Skip to content

Commit

Permalink
refactor: switch to uv, update GitHub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
junzis committed Nov 26, 2024
1 parent 2c40302 commit 5f2dcec
Show file tree
Hide file tree
Showing 57 changed files with 814 additions and 1,040 deletions.
31 changes: 24 additions & 7 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,32 @@ name: build and publish

on:
release:
types: [created]
types:
- published
workflow_dispatch:

jobs:
build:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and publish to pypi
uses: JRubics/[email protected]
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Build packages
run: |
uvx --with hatch-vcs hatchling build
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
poetry_version: "==1.8.2"
pypi_token: ${{ secrets.PYPI_API_TOKEN_PYMODES }}
user: __token__
password: ${{ secrets.PYPI_API_TOKEN_PYMODES }}
70 changes: 0 additions & 70 deletions .github/workflows/run-tests.yml

This file was deleted.

26 changes: 0 additions & 26 deletions Makefile

This file was deleted.

17 changes: 3 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -359,19 +359,8 @@ Here is an example:
Unit test
---------
To perform unit tests, ``pytest`` must be install first.

Build Cython extensions
::
.. code:: bash
$ make ext

Run unit tests
::

$ make test

Clean build files
::

$ make clean
uv sync --dev --all-extras
uv run pytest
881 changes: 0 additions & 881 deletions poetry.lock

This file was deleted.

83 changes: 41 additions & 42 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[tool.poetry]
[project]
name = "pyModeS"
version = "2.19"
description = "Python Mode-S and ADS-B Decoder"
authors = ["Junzi Sun <[email protected]>"]
license = "GNU GPL v3"
authors = [{ name = "Junzi Sun", email = "[email protected]" }]
license = { text = "GNU GPL v3" }
readme = "README.rst"
classifiers = [
"Development Status :: 4 - Beta",
Expand All @@ -13,48 +13,47 @@ classifiers = [
"Programming Language :: Python :: 3",
"Typing :: Typed",
]
packages = [{ include = "pyModeS", from = "." }]
include = [
"LICENSE",
"*.pyx",
"*.pxd",
"*.pyi",
"py.typed",
{ path = "pyModeS/**/*.so", format = "wheel" },
{ path = "pyModeS/**/*.pyd", format = "wheel" },
requires-python = ">=3.9"
dependencies = ["numpy>=1.26", "pyzmq>=24.0"]

[project.optional-dependencies]
rtlsdr = ["pyrtlsdr>=0.2.93"]


[tool.uv]
dev-dependencies = [
"mypy>=0.991",
"flake8>=5.0.0",
"black>=22.12.0",
"isort>=5.11.4",
"pytest>=7.2.0",
"pytest-cov>=4.0.0",
"codecov>=2.1.12",
]
build = "build.py"

[tool.poetry.scripts]
[project.scripts]
modeslive = "pyModeS.streamer.modeslive:main"

[tool.poetry.dependencies]
python = ">=3.9"
numpy = ">=1.26"
pyzmq = ">=24.0"
pyrtlsdr = { version = ">=0.2.93", optional = true }

[tool.poetry.group.dev.dependencies]
mypy = ">=0.991"
flake8 = ">=5.0.0"
black = ">=22.12.0"
isort = ">=5.11.4"
pytest = ">=7.2.0"
pytest-cov = ">=4.0.0"
codecov = ">=2.1.12"

[tool.poetry.extras]
rtlsdr = ["pyrtlsdr"]

[tool.black]
line-length = 80
target_version = ['py39', 'py310', 'py311', 'py312']
include = '\.pyi?$'

[tool.isort]
line_length = 80
profile = "black"
[tool.ruff]
target-version = "py310"

[tool.ruff.lint]
select = [
"E",
"W", # pycodestyle
"F", # pyflakes
"I", # isort
"NPY", # numpy
"NPY201", # numpy
# "PD", # pandas
"DTZ", # flake8-datetimez
"RUF",
]

[tool.ruff.lint.isort]
known-first-party = ["numpy", "pandas", "pyproj", "shapely"]


[build-system]
requires = ["poetry-core>=1.0.0", "Cython>=0.29.32", "setuptools>=69.1.1"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling", "Cython>=0.29.32", "setuptools>=69.1.1"]
build-backend = "hatchling.build"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 5f2dcec

Please sign in to comment.