Skip to content

Commit

Permalink
refactor: combine all python modules into a single package using pdm (#…
Browse files Browse the repository at this point in the history
…3366)

* refactor: combine all python modules into a single package using pdm

* .

* .

* .

* .

* .

* .
  • Loading branch information
kantord authored May 6, 2024
1 parent 1fbae2c commit e6cb70c
Show file tree
Hide file tree
Showing 142 changed files with 1,936 additions and 4,981 deletions.
23 changes: 8 additions & 15 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,22 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Poetry
uses: snok/install-poetry@v1
- name: Install Python Dependencies
shell: bash
run: poetry install
- name: Setup PDM
uses: pdm-project/setup-pdm@v4
- name: Install dependencies
run: pdm install
- name: Test Python packages
shell: bash
run: poetry run pytest --doctest-modules
run: pdm run pytest --doctest-modules
- name: Test Python types (mypy)
shell: bash
run: poetry run mypy apps
run: pdm run mypy apps
- name: Python code style (black)
shell: bash
run: poetry run black apps --check
run: pdm run black src --check
- name: Python code style (pylint)
shell: bash
run: poetry run pylint $(git ls-files '*.py')
run: pdm run pylint $(git ls-files '*.py')
- name: validate that Test Course Json files are up to date
run: |
poetry install --no-interaction
cd apps/librelingo_yaml_loader
poetry install --no-interaction
cd ../librelingo_json_export
poetry install --no-interaction
cd ../..
./scripts/verifyTestCourseJsonFiles.sh
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,11 @@ localData/
/apps/web/src/courses/*-*
/courses/*-*



# PDM
.pdm.toml
.pdm-python
.pdm-build/

neovide_backtraces.log
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
PYTHON_FILEPATHS = `(find . -iname "*.py" -not -path "./.venv/*" -not -path "./node_modules/*")`
lint: ## Lint codebase
poetry run pylint --rcfile=pylintrc $(PYTHON_FILEPATHS)
pdm run pylint --rcfile=pylintrc $(PYTHON_FILEPATHS)

format: ## Run black formatter
poetry run black --check $(PYTHON_FILEPATHS)
pdm run black --check $(PYTHON_FILEPATHS)

format-fix: ## Run black formatter with automated fix
poetry run black $(PYTHON_FILEPATHS)
pdm run black $(PYTHON_FILEPATHS)

type-check: ## Run mypy
poetry run mypy $(PYTHON_FILEPATHS)
pdm run mypy $(PYTHON_FILEPATHS)

pycache-delete: ## Delete the __pycache__ folders
find . -type d -name __pycache__ -exec rm -r {} \+
Expand Down
58 changes: 0 additions & 58 deletions apps/docker/Dockerfile

This file was deleted.

43 changes: 0 additions & 43 deletions apps/docker/README.md

This file was deleted.

21 changes: 0 additions & 21 deletions apps/docker/docker-entrypoint.sh

This file was deleted.

46 changes: 0 additions & 46 deletions apps/librelingo-standalone-server/build.sh

This file was deleted.

5 changes: 0 additions & 5 deletions apps/librelingo-standalone-server/go.mod

This file was deleted.

20 changes: 0 additions & 20 deletions apps/librelingo-standalone-server/go.sum

This file was deleted.

20 changes: 0 additions & 20 deletions apps/librelingo-standalone-server/main.go

This file was deleted.

20 changes: 0 additions & 20 deletions apps/librelingo_audios/pyproject.toml

This file was deleted.

2 changes: 0 additions & 2 deletions apps/librelingo_fakes/Makefile

This file was deleted.

43 changes: 0 additions & 43 deletions apps/librelingo_fakes/README.md

This file was deleted.

8 changes: 0 additions & 8 deletions apps/librelingo_fakes/pydoc-markdown.yml

This file was deleted.

18 changes: 0 additions & 18 deletions apps/librelingo_fakes/pyproject.toml

This file was deleted.

2 changes: 0 additions & 2 deletions apps/librelingo_json_export/Makefile

This file was deleted.

Loading

0 comments on commit e6cb70c

Please sign in to comment.