Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move from poetry back to setuptools #87

Merged
merged 7 commits into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ jobs:
name: publish package to PyPI
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v2
- name: install Poetry
uses: abatilo/[email protected]
- name: install Dunamai
run: pip install dunamai
- name: extract version from VCS
run: poetry version $(dunamai from any)
- name: build wheel and source
run: poetry build
- name: upload wheel and source
run: poetry publish --username __token__ --password ${{ secrets.PYPI_TOKEN }}
- uses: actions/checkout@main
- uses: actions/cache@main
with:
path: ${{ env.pythonLocation }}
key: build-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'setup.*') }}
- run: pip wheel . --no-deps -w dist
- uses: pypa/gh-action-pypi-publish@main
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
46 changes: 24 additions & 22 deletions .github/workflows/quick_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,22 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- name: clone repository
uses: actions/checkout@v2
- name: install Python
uses: actions/setup-python@v2
- name: load cached Python installation
- uses: actions/checkout@main
- uses: actions/setup-python@main
with:
python-version: '3.x'
- uses: actions/cache@main
id: cache
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: lint-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- name: install linters
run: pip install flake8 oitnb
- name: lint with flake8
run: |
- run: pip install flake8 oitnb
- run: |
# stop the build if there are Python syntax errors or undefined names
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
- name: lint with oitnb
run: oitnb . --check
- run: oitnb . --check
test:
needs: lint
name: quick test
Expand All @@ -48,19 +44,17 @@ jobs:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: clone repository
uses: actions/checkout@v2
- name: install Python
uses: actions/setup-python@v2
- name: load cached Python installation
- uses: actions/checkout@main
- uses: actions/setup-python@main
with:
python-version: '3.x'
- uses: actions/cache@main
id: cache
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: test-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- name: install dependencies
run: pip install ".[testing]"
- name: run tests
- run: pip install ".[testing]"
- run: pytest -m "serial"
env:
APRS_FI_API_KEY: ${{ secrets.APRS_FI_API_KEY }}
APRS_IS_PASSWORD: ${{ secrets.APRS_IS_PASSWORD }}
Expand All @@ -69,4 +63,12 @@ jobs:
POSTGRES_DATABASE: test_database
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: test_password
run: pytest
- run: pytest -m "not serial" -n auto
env:
APRS_FI_API_KEY: ${{ secrets.APRS_FI_API_KEY }}
APRS_IS_PASSWORD: ${{ secrets.APRS_IS_PASSWORD }}
POSTGRES_HOSTNAME: localhost
POSTGRES_PORT: 5432
POSTGRES_DATABASE: test_database
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: test_password
110 changes: 50 additions & 60 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,71 +17,64 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- name: clone repository
uses: actions/checkout@v2
- name: install Python
uses: actions/setup-python@v2
- name: load cached Python installation
- uses: actions/checkout@main
- uses: actions/setup-python@main
with:
python-version: '3.x'
- uses: actions/cache@main
id: cache
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: lint-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- name: install linters
run: pip install flake8 oitnb
- name: lint with flake8
run: |
- run: pip install flake8 oitnb
- run: |
# stop the build if there are Python syntax errors or undefined names
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
- name: lint with oitnb
run: oitnb . --check
- run: oitnb . --check
test_without_postgres:
needs: lint
needs: [ lint ]
name: test without PostGreSQL database
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest, windows-latest ]
python-version: [ '3.8', '3.9', '3.x' ]
python: [ '3.8', '3.9', '3.10' ]
exclude:
- os: macos-latest
python-version: '3.x'
python: '3.10'
- os: windows-latest
python-version: '3.9'
python: '3.9'
- os: windows-latest
python-version: '3.x'
python: '3.10'
steps:
- name: clone repository
uses: actions/checkout@v2
- name: install Python
uses: actions/setup-python@v2
- uses: actions/checkout@main
- uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}
- name: load cached Python installation
python-version: ${{ matrix.python }}
- uses: actions/cache@main
id: cache
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: test-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- name: install dependencies
run: pip install ".[testing]"
- name: run tests
- run: pip install ".[testing]"
- run: pytest -m "serial"
env:
APRS_FI_API_KEY: ${{ secrets.APRS_FI_API_KEY }}
APRS_IS_PASSWORD: ${{ secrets.APRS_IS_PASSWORD }}
- run: pytest -m "not serial" -n auto
env:
APRS_FI_API_KEY: ${{ secrets.APRS_FI_API_KEY }}
APRS_IS_PASSWORD: ${{ secrets.APRS_IS_PASSWORD }}
run: |
pytest -m "serial"
pytest -m "not serial" --numprocesses auto
test_with_postgres:
needs: lint
needs: [ lint ]
name: test with PostGreSQL database
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.8', '3.9', '3.x' ]
python: [ '3.8', '3.9', '3.10' ]
services:
postgres:
image: postgis/postgis:13-3.1
Expand All @@ -92,21 +85,26 @@ jobs:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: clone repository
uses: actions/checkout@v2
- name: install Python
uses: actions/setup-python@v2
- uses: actions/checkout@main
- uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}
- name: load cached Python installation
python-version: ${{ matrix.python }}
- uses: actions/cache@main
id: cache
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: test-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- name: install dependencies
run: pip install ".[testing]"
- name: run tests
- run: pip install ".[testing]"
- run: pytest -m "serial"
env:
APRS_FI_API_KEY: ${{ secrets.APRS_FI_API_KEY }}
APRS_IS_PASSWORD: ${{ secrets.APRS_IS_PASSWORD }}
POSTGRES_HOSTNAME: localhost
POSTGRES_PORT: 5432
POSTGRES_DATABASE: test_database
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: test_password
- run: pytest -m "not serial" -n auto
env:
APRS_FI_API_KEY: ${{ secrets.APRS_FI_API_KEY }}
APRS_IS_PASSWORD: ${{ secrets.APRS_IS_PASSWORD }}
Expand All @@ -115,11 +113,8 @@ jobs:
POSTGRES_DATABASE: test_database
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: test_password
run: |
pytest -m "serial"
pytest -m "not serial" --numprocesses auto
test_with_coverage:
needs: [ lint, test_without_postgres, test_with_postgres ]
needs: [ test_without_postgres, test_with_postgres ]
name: test with coverage
runs-on: ubuntu-latest
services:
Expand All @@ -132,19 +127,17 @@ jobs:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: clone repository
uses: actions/checkout@v2
- name: install Python
uses: actions/setup-python@v2
- name: load cached Python installation
- uses: actions/checkout@main
- uses: actions/setup-python@main
with:
python-version: '3.x'
- uses: actions/cache@main
id: cache
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: test-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- name: install dependencies
run: pip install ".[testing]"
- name: run tests with coverage
- run: pip install ".[testing]"
- run: pytest --cov . --cov-report xml:coverage.xml
env:
APRS_FI_API_KEY: ${{ secrets.APRS_FI_API_KEY }}
APRS_IS_PASSWORD: ${{ secrets.APRS_IS_PASSWORD }}
Expand All @@ -153,11 +146,8 @@ jobs:
POSTGRES_DATABASE: test_database
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: test_password
run: pytest --cov . --cov-report xml:coverage.xml
- name: show coverage report
run: coverage report
- name: upload coverage to Codecov
uses: codecov/[email protected]
- run: coverage report
- uses: codecov/codecov-action@master
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
Expand Down
87 changes: 39 additions & 48 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,61 +1,52 @@
[tool.poetry]
[project]
name = 'packetraven'
version = '0.0.0'
description = 'Telemetry dashboard for APRS packets from TNC, https://aprs.fi, and PostGIS'
authors = ['Zach Burnett <[email protected]>']
license = 'GPL-3.0-or-later'
authors = [{ name = 'Zach Burnett', email = '[email protected]' }]
readme = 'README.md'
repository = 'https:/UMDBPP/packetraven.git'
requires-python = '>=3.8'
license = { file = 'LICENSE' }
dependencies = [
'aprslib',
'backoff',
'humanize',
'numpy',
'pandas',
'pyserial',
'geojson',
'fastkml',
'matplotlib',
'pyproj',
'pyyaml',
'requests',
'shapely',
'sshtunnel',
'tablecrow >=1.4.3',
'teek',
'typepigeon >=1.0.13',
'typer',
]
dynamic = ['version']

[project.optional-dependencies]
testing = ['pytest', 'pytest-cov', 'pytest-mock', 'pytest-xdist']
development = ['isort', 'oitnb']
documentation = ['m2r2', 'sphinx', 'sphinx-rtd-theme', 'sphinxcontrib-programoutput']

[project.urls]
repository = 'https:/UMDBPP/packetraven'
documentation = 'https://packetraven.readthedocs.io'

[build-system]
requires = [
'cython',
'poetry-core>=1.0.0',
'poetry-dynamic-versioning',
'setuptools >=61',
'setuptools_scm[toml] >=3.4',
'wheel',
]
build-backend = 'poetry.core.masonry.api'
build-backend = 'setuptools.build_meta'

[tool.poetry-dynamic-versioning]
enable = true

[tool.poetry.dependencies]
python = '^3.8'
aprslib = '*'
backoff = '*'
humanize = '*'
numpy = '*'
pandas = '*'
pyserial = '*'
geojson = '*'
fastkml = '*'
matplotlib = '*'
pyproj = '*'
pyyaml = '*'
requests = '*'
shapely = '*'
sshtunnel = '*'
tablecrow = '>=1.4.3'
teek = '*'
typepigeon = '>=1.0.13'
typer = '*'
isort = { version = '*', optional = true }
oitnb = { version = '*', optional = true }
pytest = { version = '*', optional = true }
pytest-cov = { version = '*', optional = true }
pytest-mock = { version = '*', optional = true }
pytest-xdist = { version = '*', optional = true }
m2r2 = { version = '*', optional = true }
sphinx = { version = '*', optional = true }
sphinx-rtd-theme = { version = '*', optional = true }
sphinxcontrib-programoutput = { version = '*', optional = true }

[tool.poetry.extras]
testing = ['pytest', 'pytest-cov', 'pytest-mock', 'pytest-xdist']
development = ['isort', 'oitnb']
documentation = ['m2r2', 'sphinx', 'sphinx-rtd-theme', 'sphinxcontrib-programoutput']
[tool.setuptools_scm]

[tool.poetry.scripts]
[project.scripts]
packetraven = 'packetraven.__main__:main'

[tool.pytest.ini_options]
Expand Down