Skip to content

Commit

Permalink
Merge pull request #16 from mbsantiago/feature/soundevent_update
Browse files Browse the repository at this point in the history
Updated soundevent to 2.0
  • Loading branch information
mbsantiago authored May 17, 2024
2 parents 22ee77b + 9f97e85 commit f159925
Show file tree
Hide file tree
Showing 20 changed files with 772 additions and 2,232 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: "3.11"
- name: Install the latest version of rye
uses: eifinger/setup-rye@v3
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- name: Install dependencies
run: |
cd back
pdm install --dev --group docs
rye sync
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
Expand All @@ -27,4 +25,4 @@ jobs:
mkdocs-material-
- run: |
cd back
pdm run mkdocs gh-deploy --force
rye run mkdocs gh-deploy --force
21 changes: 5 additions & 16 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: "3.11"
- name: Install the latest version of rye
uses: eifinger/setup-rye@v3
- name: Install dependencies
run: |
cd back
pdm install --dev
- name: Check formatting
rye sync
- name: Check formatting and typing
run: |
cd back
pdm run black --check src
pdm run black --check tests
- name: Check typing
run: |
cd back
pdm run pyright src
- name: Check for overall code issues
run: |
cd back
pdm run ruff src
make lint
10 changes: 4 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: "3.11"
- name: Install the latest version of rye
uses: eifinger/setup-rye@v3
- name: Install dependencies
run: |
cd back
pdm install --dev
rye sync
- name: Run tests
run: |
cd back
pdm run pytest --cov=src/whombat --cov-report=xml -n auto
rye run pytest --cov=src/whombat --cov-report=xml -n auto
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
Expand Down
12 changes: 6 additions & 6 deletions back/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ Ready to contribute? Here's how to set up `whombat` for local development.
git clone git@github.com:your_name_here/whombat.git
```

3. We recommend the use of [pdm](https://pdm-project.org/latest/) to manage the
dev environment. Once pdm is installed
3. We recommend the use of [rye](https://rye-up.com/) to manage the
dev environment. Once rye is installed

```{bash}
pdm install
rye sync
```

4. Create a branch for local development
Expand All @@ -75,8 +75,8 @@ Ready to contribute? Here's how to set up `whombat` for local development.
tests.

```{bash}
pdm run make test
pdm run make lint
make test
make lint
```

6. Commit your changes and push your branch to GitHub
Expand Down Expand Up @@ -104,5 +104,5 @@ Before you submit a pull request, check that it meets these guidelines:
To run a subset of tests

```{bash}
pdm run pytest tests.test_api
rye run pytest tests.test_api
```
45 changes: 17 additions & 28 deletions back/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SHELL := /bin/bash

.DEFAULT_GOAL := help

ENV_PREFIX=.venv/bin/
WHOMBAT_BACKEND_DEV_PORT ?= 5000

define BROWSER_PYSCRIPT
Expand Down Expand Up @@ -53,55 +54,43 @@ clean-test:
clean-docs:
rm -fr site/

lint/flake8:
flake8 src tests

lint/black:
black --check src tests

lint/pylint:
pylint src tests

lint/pycodestyle:
pycodestyle src

lint/pydocstyle:
pydocstyle src
lint/ruff:
$(ENV_PREFIX)ruff check src tests

lint/pyright:
pyright src
$(ENV_PREFIX)pyright src

lint: lint/flake8 lint/black lint/pycodestyle lint/pydocstyle lint/pylint lint/pyright ## check style
lint: lint/ruff lint/pyright

format: ## format code
isort src tests
black src tests
$(ENV_PREFIX)ruff format src tests

test: ## Run all tests
pytest -n auto
$(ENV_PREFIX)pytest -n auto

install: clean ## install the package to the active Python's site-packages
pip install .
python -m venv .venv
$(ENV_PREFIX)pip install .

coverage: ## check code coverage
coverage run --source whombat -m pytest
coverage report -m
coverage html
$(ENV_PREFIX)coverage run --source whombat -m pytest
$(ENV_PREFIX)coverage report -m
$(ENV_PREFIX)coverage html
$(BROWSER) htmlcov/index.html

build-docs: ## build documentation
mkdocs build
$(ENV_PREFIX)mkdocs build

build-guide: ## build user guide
mkdocs build -f mkdocs-guide.yml -d src/whombat/user_guide
$(ENV_PREFIX)mkdocs build -f mkdocs-guide.yml -d src/whombat/user_guide

serve-docs: ## serve documentation
URL="http://localhost:8000/whombat/"; xdg-open $$URL || sensible-browser $$URL || x-www-browser $$URL || gnome-open $$URL
@$(ENV_PREFIX)mkdocs serve
$(ENV_PREFIX)mkdocs serve

serve-guide: ## serve user guide
URL="http://localhost:8000/whombat/"; xdg-open $$URL || sensible-browser $$URL || x-www-browser $$URL || gnome-open $$URL
@$(ENV_PREFIX)mkdocs serve -f mkdocs-guide.yml
$(ENV_PREFIX)mkdocs serve -f mkdocs-guide.yml

serve-dev: ## serve development backend
WHOMBAT_DEV=true python -m whombat
WHOMBAT_DEV=true $(ENV_PREFIX)python -m whombat
10 changes: 5 additions & 5 deletions back/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ docker run -p 5000:5000 whombat

### Development Environment

We manage Whombat's development with `pdm`.
We manage Whombat's development with `rye`.

1. Follow the official [installation instructions](https://pdm-project.org/latest/#installation) to get `pdm` on your machine.
1. Follow the official [installation instructions](https://rye-up.com/guide/installation/) to get `rye` on your machine.

2. Clone the repository:

Expand All @@ -68,17 +68,17 @@ git clone https://github.com/mbsantiago/whombat.git

```bash
cd whombat/back
pdm install --dev
rye sync
```

4. Start the development server:

```bash
pdm run make serve-dev
make serve-dev
```

or

```bash
WHOMBAT_DEV=true pdm run python -m whombat
WHOMBAT_DEV=true rye run python -m whombat
```
10 changes: 5 additions & 5 deletions back/docs/developer_guide/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ following tools installed:
version should be compatible. Download Python 3.11
[here](https://www.python.org/downloads/release/python-3117/).

2. **PDM**: PDM is a Python package dependency manager that we use to manage
dependencies for the Python part of Whombat. Download PDM
[here](https://pdm-project.org/latest/#installation).
2. **rye**: Rye is a Python package dependency manager that we use to manage
dependencies for the Python part of Whombat. Download rye
[here](https://rye-up.com/).

3. **Node.js**: We use Node.js to develop and bundle the final JavaScript code
for the Whombat frontend. Download the latest version
Expand All @@ -32,7 +32,7 @@ git clone https://github.com/mbsantiago/whombat.git

```bash
cd whombat/back
pdm install --dev
rye sync
```

3. Move to the frontend directory and install all dependencies:
Expand All @@ -51,7 +51,7 @@ Once installed, you can start the backend server by navigating to the `back`
directory and running:

```bash
pdm run make serve-dev
make serve-dev
```

You can also start the frontend development server by navigating to the `front`
Expand Down
Loading

0 comments on commit f159925

Please sign in to comment.