Skip to content

Commit

Permalink
use poetry for build and deps
Browse files Browse the repository at this point in the history
This changes the build system from setuptools to poetry. This allows
us to avoid duplicating the package dependencies 3 times and also
include a lock file so that devs are working from the same package
versions.
  • Loading branch information
dlech committed Sep 4, 2022
1 parent 995899a commit d19cca9
Show file tree
Hide file tree
Showing 13 changed files with 942 additions and 227 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,11 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip. setuptools and wheel
run: python -m pip install --upgrade pip setuptools wheel
- name: Install dependencies
run: pip install -r requirements.txt
- name: Install development dependencies
run: pip install -r requirements_dev.txt
run: pipx run poetry install --only main,test
- name: Test with pytest
run: |
pytest tests --junitxml=junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml --cov=com --cov-report=xml --cov-report=html
pipx run poetry run pytest tests --junitxml=junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml --cov=com --cov-report=xml --cov-report=html
- name: Upload pytest test results
uses: actions/upload-artifact@v1
with:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Upgrade pip. setuptools and wheel
run: python -m pip install --upgrade pip setuptools wheel
- name: Install dependencies
run: pip install buildozer cython
- name: Cache buildozer files
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/format_and_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,15 @@ jobs:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Upgrade pip. setuptools and wheel
run: python -m pip install --upgrade pip setuptools wheel
- name: Install development dependencies
run: pip install -r requirements_dev.txt
run: pipx run poetry install --only docs,lint
- name: Check code formatting with black
run: black . --check --diff
run: pipx run poetry run black . --check --diff
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
pipx run poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. Default line length of black is 88
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
pipx run poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
- name: Build docs
run: READTHEDOCS=True make -C docs html
run: READTHEDOCS=True pipx run poetry run make -C docs html
16 changes: 4 additions & 12 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
- name: Build
run: pipx run poetry build
- name: Publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
run: pipx run twine upload dist/*
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0
`Unreleased`_
=============

Changed
-------
* Use Poetry for build system and dependencies.


`0.16.0`_ (2022-08-31)
======================

Expand Down
12 changes: 0 additions & 12 deletions MANIFEST.in

This file was deleted.

31 changes: 0 additions & 31 deletions Pipfile

This file was deleted.

Loading

0 comments on commit d19cca9

Please sign in to comment.