Skip to content

Commit

Permalink
meta: start using poetry
Browse files Browse the repository at this point in the history
Poetry seems to offer a nicer workflow for keeping packages up to date.
Start using it to make development and setup easier.

Signed-off-by: Paul Spooren <[email protected]>
  • Loading branch information
aparcar committed Feb 28, 2022
1 parent d3883b0 commit 42c69bf
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 188 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,44 @@ jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ 3.7, 3.8, 3.9 ]
name: Python ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v2

- name: Install ImageBuilder prereqs

run: sudo apt-get install -y libncurses5-dev
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Display Python version
run: python -c "import sys; print(sys.version)"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
pip install -e .
python -m pip install --upgrade poetry
poetry install
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Stylecheck with black
run: |
pip install black
black asu/ tests/
poetry run black asu/ tests/
- name: Test with pytest
run: |
pip install pytest
pip install coverage
coverage run -m pytest --runslow
coverage xml
poetry run coverage run -m pytest --runslow
poetry run coverage xml
- name: Codecov
uses: codecov/codecov-action@v1
2 changes: 1 addition & 1 deletion asu/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "dev"
__version__ = "0.0.0"
4 changes: 0 additions & 4 deletions dev-requirements.in

This file was deleted.

42 changes: 0 additions & 42 deletions dev-requirements.txt

This file was deleted.

27 changes: 27 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[tool.poetry]
name = "asu"
version = "0.6.4"
description = "An image on demand server for OpenWrt based distributions"
authors = ["Paul Spooren <[email protected]>"]
license = "GPL-2.0"
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.7"
PyNaCl = "^1.5.0"
redis = "^4.1.1"
requests = "^2.27.1"
rq = "^1.10.1"
connexion = "^2.10.0"

[tool.poetry.dev-dependencies]
pytest = "^6.2.5"
pytest-httpserver = "^1.0.3"
fakeredis = "^1.7.1"
flake8 = "^4.0.1"
black = "^22.1.0"
coverage = "^6.3.2"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
6 changes: 0 additions & 6 deletions requirements.in

This file was deleted.

86 changes: 0 additions & 86 deletions requirements.txt

This file was deleted.

7 changes: 0 additions & 7 deletions setup.cfg

This file was deleted.

30 changes: 0 additions & 30 deletions setup.py

This file was deleted.

0 comments on commit 42c69bf

Please sign in to comment.