Skip to content

Commit

Permalink
Switch to poetry... 🤞
Browse files Browse the repository at this point in the history
  • Loading branch information
joce committed Nov 17, 2023
1 parent 5326833 commit 60c4283
Show file tree
Hide file tree
Showing 6 changed files with 757 additions and 18 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,49 @@ jobs:
strategy:
matrix:
python-version: ["3.12"]
poetry-version: ["1.7.1"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies

- name: Install poetry ${{ matrix.poetry-version }}
run: |
python -m ensurepip
python -m pip install --upgrade pip
pip install -r requirements.txt isort black flake8 pylint pyright pytest-md
pip install poetry==${{ matrix.poetry-version }}
- name: View poetry --help
run: poetry --help
- name: Install dependencies
shell: bash
run: poetry install

- name:
Checking imports with isort
# change to python 3.12 when isort supports it
run: |
isort -c --profile black --python-version 3 .
poetry run isort -c --profile black --python-version 3 .
- name: Checking formatting with black
run: |
black --check --target-version py312 .
poetry run black --check --target-version py312 .
- name: Checking style with flake8
run: |
flake8 .
poetry run flake8 .
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
poetry run pylint $(git ls-files '*.py')
- name: Analysing typing with pyright
run: |
pyright --version ${{ matrix.python-version }}
poetry run pyright --version ${{ matrix.python-version }}
- name: Run pytest
uses: pavelzw/pytest-action@v2
with:
verbose: true
emoji: false
job-summary: true
custom-pytest: "poetry run pytest"
custom-arguments: "-q"
click-to-expand: true
report-title: "Test Report"
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ generated-members=
[FORMAT]

# Maximum number of characters on a single line.
max-line-length=132
max-line-length=88

# TODO(https://github.com/PyCQA/pylint/issues/3352): Direct pylint to exempt
# lines made too long by directives to pytype.
Expand Down
5 changes: 2 additions & 3 deletions .todo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
DevOps:
✔ fluke8 usage @done(23-11-15 08:45)
https://www.sefidian.com/2021/08/03/how-to-use-black-flake8-and-isort-to-format-python-codes/
Poetry (?)
Poetry (?) @done(23-11-16 21:24)
https://browniebroke.com/blog/migrating-project-to-poetry/
https://python.land/virtual-environments/python-poetry
https://python-poetry.org/docs/basic-usage/
Expand All @@ -23,7 +23,7 @@
☐ Filtering
General:
☐ Command system
use `@override`
use `@override` @done(23-11-16 21:24)
Implies dropping support for < 3.12

Tests:
Expand Down Expand Up @@ -56,7 +56,6 @@
Other:
DevOps:
☐ review .pylinrc file
☐ attempt at parallelizing some workflows.
☐ investigate using code coverage (VS Code, coverage.py (github workflow))
☐ pydoc?
https://docs.python.org/3/library/pydoc.html
Expand Down
Loading

0 comments on commit 60c4283

Please sign in to comment.