Skip to content

Commit 5f2dcec

Browse files
committed
refactor: switch to uv, update GitHub workflows
1 parent 2c40302 commit 5f2dcec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+814
-1040
lines changed

.github/workflows/build-publish.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,32 @@ name: build and publish
22

33
on:
44
release:
5-
types: [created]
5+
types:
6+
- published
7+
workflow_dispatch:
68

79
jobs:
8-
build:
10+
deploy:
911
runs-on: ubuntu-latest
1012
steps:
11-
- uses: actions/checkout@v3
12-
- name: Build and publish to pypi
13-
uses: JRubics/[email protected]
13+
- uses: actions/checkout@v4
14+
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v3
17+
with:
18+
enable-cache: true
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.11"
24+
25+
- name: Build packages
26+
run: |
27+
uvx --with hatch-vcs hatchling build
28+
29+
- name: Publish a Python distribution to PyPI
30+
uses: pypa/gh-action-pypi-publish@release/v1
1431
with:
15-
poetry_version: "==1.8.2"
16-
pypi_token: ${{ secrets.PYPI_API_TOKEN_PYMODES }}
32+
user: __token__
33+
password: ${{ secrets.PYPI_API_TOKEN_PYMODES }}

.github/workflows/run-tests.yml

Lines changed: 0 additions & 70 deletions
This file was deleted.

Makefile

Lines changed: 0 additions & 26 deletions
This file was deleted.

README.rst

Lines changed: 3 additions & 14 deletions

poetry.lock

Lines changed: 0 additions & 881 deletions
This file was deleted.

pyproject.toml

Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
[tool.poetry]
1+
[project]
22
name = "pyModeS"
33
version = "2.19"
44
description = "Python Mode-S and ADS-B Decoder"
5-
authors = ["Junzi Sun <[email protected]>"]
6-
license = "GNU GPL v3"
5+
authors = [{ name = "Junzi Sun", email = "[email protected]" }]
6+
license = { text = "GNU GPL v3" }
77
readme = "README.rst"
88
classifiers = [
99
"Development Status :: 4 - Beta",
@@ -13,48 +13,47 @@ classifiers = [
1313
"Programming Language :: Python :: 3",
1414
"Typing :: Typed",
1515
]
16-
packages = [{ include = "pyModeS", from = "." }]
17-
include = [
18-
"LICENSE",
19-
"*.pyx",
20-
"*.pxd",
21-
"*.pyi",
22-
"py.typed",
23-
{ path = "pyModeS/**/*.so", format = "wheel" },
24-
{ path = "pyModeS/**/*.pyd", format = "wheel" },
16+
requires-python = ">=3.9"
17+
dependencies = ["numpy>=1.26", "pyzmq>=24.0"]
18+
19+
[project.optional-dependencies]
20+
rtlsdr = ["pyrtlsdr>=0.2.93"]
21+
22+
23+
[tool.uv]
24+
dev-dependencies = [
25+
"mypy>=0.991",
26+
"flake8>=5.0.0",
27+
"black>=22.12.0",
28+
"isort>=5.11.4",
29+
"pytest>=7.2.0",
30+
"pytest-cov>=4.0.0",
31+
"codecov>=2.1.12",
2532
]
26-
build = "build.py"
2733

28-
[tool.poetry.scripts]
34+
[project.scripts]
2935
modeslive = "pyModeS.streamer.modeslive:main"
3036

31-
[tool.poetry.dependencies]
32-
python = ">=3.9"
33-
numpy = ">=1.26"
34-
pyzmq = ">=24.0"
35-
pyrtlsdr = { version = ">=0.2.93", optional = true }
36-
37-
[tool.poetry.group.dev.dependencies]
38-
mypy = ">=0.991"
39-
flake8 = ">=5.0.0"
40-
black = ">=22.12.0"
41-
isort = ">=5.11.4"
42-
pytest = ">=7.2.0"
43-
pytest-cov = ">=4.0.0"
44-
codecov = ">=2.1.12"
45-
46-
[tool.poetry.extras]
47-
rtlsdr = ["pyrtlsdr"]
48-
49-
[tool.black]
50-
line-length = 80
51-
target_version = ['py39', 'py310', 'py311', 'py312']
52-
include = '\.pyi?$'
53-
54-
[tool.isort]
55-
line_length = 80
56-
profile = "black"
37+
[tool.ruff]
38+
target-version = "py310"
39+
40+
[tool.ruff.lint]
41+
select = [
42+
"E",
43+
"W", # pycodestyle
44+
"F", # pyflakes
45+
"I", # isort
46+
"NPY", # numpy
47+
"NPY201", # numpy
48+
# "PD", # pandas
49+
"DTZ", # flake8-datetimez
50+
"RUF",
51+
]
52+
53+
[tool.ruff.lint.isort]
54+
known-first-party = ["numpy", "pandas", "pyproj", "shapely"]
55+
5756

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

0 commit comments

Comments
 (0)