Skip to content

Commit 3fc5779

Browse files
committed
Project metadata: Migrate from setup.py to pyproject.toml
1 parent 9c25704 commit 3fc5779

File tree

6 files changed

+126
-117
lines changed

6 files changed

+126
-117
lines changed

Diff for: .github/workflows/tests.yml

+6-9
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,16 @@ jobs:
5151
python-version: ${{ matrix.python-version }}
5252
architecture: x64
5353
cache: 'pip'
54-
cache-dependency-path: |
55-
requirements-utils.txt
56-
setup.py
54+
cache-dependency-path: pyproject.toml
55+
56+
- name: Install project
57+
run: pip install --editable=.[develop,fake,test]
5758

5859
- name: Run linter
59-
run: |
60-
pip install --requirement=requirements-utils.txt
61-
poe lint
60+
run: poe lint
6261

6362
- name: Run tests, with coverage
64-
run: |
65-
pip install --editable=.[test,fake]
66-
pytest
63+
run: poe test
6764

6865
- name: Upload coverage results to Codecov
6966
uses: codecov/codecov-action@v3

Diff for: CHANGES.rst

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ in progress
1414
- NMEA0183 telemetry: Emit compass/heading data using ``$MLHDT`` sentence
1515
- NMEA0183 telemetry: Emit compass/pitch+roll data using ``$MLXDR`` sentence
1616
- NMEA0183 telemetry: Emit air temperature and battery level data using ``$MLXDR`` sentences
17+
- Project metadata: Migrate from ``setup.py`` to ``pyproject.toml``
1718

1819

1920
2022-08-03 0.5.1

Diff for: doc/sandbox.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ It is recommended to use a Python virtualenv. In order to do so, invoke::
1919
Then, in order to install the project in development mode, and to invoke the
2020
test suite, run::
2121

22-
pip install --editable=.[test,fake] --requirement=requirements-utils.txt
22+
pip install --editable=.[develop,fake,test]
2323
poe test
2424

2525

Diff for: pyproject.toml

+118-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,118 @@
1+
# ==================
2+
# Project definition
3+
# ==================
4+
5+
# Derived from https://peps.python.org/pep-0621/
6+
7+
[project]
8+
name = "calypso-anemometer"
9+
version = "0.5.1"
10+
description = "Python driver for the Calypso UP10 anemometer"
11+
readme = "README.rst"
12+
keywords = [
13+
"anemometer",
14+
"ble",
15+
"bluetooth",
16+
"bluetooth-le",
17+
"bluetooth-low-energy",
18+
"calypso",
19+
"environmental-monitoring",
20+
"nmea",
21+
"nmea-0183",
22+
"opencpn",
23+
"openplotter",
24+
"signalk",
25+
"signalk-plugin",
26+
"solar",
27+
"ultrasonic",
28+
"ultrasonic-anemometry",
29+
"ultrasonic-sensor",
30+
"up10",
31+
"wind-meter",
32+
]
33+
license = {text = "AGPL-3.0, EUPL-1.2"}
34+
authors = [
35+
{name = "Andreas Motl", email = "[email protected]"},
36+
{name = "Holger Marseille"},
37+
]
38+
requires-python = ">=3.7"
39+
classifiers = [
40+
"Development Status :: 4 - Beta",
41+
"Environment :: Console",
42+
"Intended Audience :: Customer Service",
43+
"Intended Audience :: Developers",
44+
"Intended Audience :: Education",
45+
"Intended Audience :: Information Technology",
46+
"Intended Audience :: Manufacturing",
47+
"Intended Audience :: Science/Research",
48+
"Intended Audience :: System Administrators",
49+
"Intended Audience :: Telecommunications Industry",
50+
"License :: OSI Approved :: GNU Affero General Public License v3",
51+
"License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)",
52+
"Operating System :: MacOS :: MacOS X",
53+
"Operating System :: POSIX :: Linux",
54+
"Operating System :: Unix",
55+
"Programming Language :: Python",
56+
"Programming Language :: Python :: 3.7",
57+
"Programming Language :: Python :: 3.8",
58+
"Programming Language :: Python :: 3.9",
59+
"Programming Language :: Python :: 3.10",
60+
"Programming Language :: Python :: 3.11",
61+
"Topic :: Communications",
62+
"Topic :: Education",
63+
"Topic :: Home Automation",
64+
"Topic :: Scientific/Engineering",
65+
"Topic :: Software Development :: Libraries",
66+
"Topic :: Software Development :: Quality Assurance",
67+
"Topic :: Software Development :: Object Brokering",
68+
"Topic :: System :: Emulators",
69+
"Topic :: System :: Hardware",
70+
"Topic :: System :: Logging",
71+
"Topic :: System :: Monitoring",
72+
"Topic :: System :: Networking",
73+
"Topic :: System :: Networking :: Monitoring",
74+
"Topic :: System :: Systems Administration",
75+
"Topic :: Utilities",
76+
]
77+
dependencies = [
78+
"bleak<1",
79+
"click<9",
80+
]
81+
[project.optional-dependencies]
82+
develop = [
83+
"black<24",
84+
"isort<6",
85+
"poethepoet<0.19",
86+
"proselint==0.13",
87+
"pyproject-fmt<0.10",
88+
"ruff==0.0.252",
89+
"validate-pyproject<0.13",
90+
]
91+
fake = [
92+
'aiorate<2,>1; python_version >= "3.7"',
93+
]
94+
release = [
95+
"build<1",
96+
'minibump<1; python_version >= "3.10"',
97+
"twine<5",
98+
]
99+
test = [
100+
"pytest<8",
101+
"pytest-asyncio<1",
102+
"pytest-cov<4",
103+
"pytest-mock<4",
104+
]
105+
[project.urls]
106+
changelog = "https://github.com/maritime-labs/calypso-anemometer/blob/main/CHANGES.rst"
107+
documentation = "https://github.com/maritime-labs/calypso-anemometer"
108+
homepage = "https://github.com/maritime-labs/calypso-anemometer"
109+
repository = "https://github.com/maritime-labs/calypso-anemometer"
110+
[project.entry-points.console_scripts]
111+
calypso-anemometer = "calypso_anemometer.cli:cli"
112+
113+
[tool.setuptools.packages]
114+
find = {}
115+
1116
[tool.black]
2117
line-length = 120
3118

@@ -65,15 +180,14 @@ select = [
65180

66181
[tool.poe.tasks]
67182

68-
test = { cmd = "pytest" }
69-
70183
format = [
71184
{ cmd = "black ." },
72185
{ cmd = "isort ." },
73186
# Configure Ruff not to auto-fix (remove!) unused variables (F841) and `print` statements (T201).
74187
{ cmd = "ruff --fix --ignore=ERA --ignore=F401 --ignore=F841 --ignore=T20 ." },
75188
{ cmd = "pyproject-fmt pyproject.toml" },
76189
]
190+
77191
lint = [
78192
{ cmd = "ruff check ." },
79193
{ cmd = "black --check ." },
@@ -88,3 +202,5 @@ release = [
88202
{ cmd = "python -m build" },
89203
{ cmd = "twine upload --skip-existing --verbose dist/*{.tar.gz,.whl}" },
90204
]
205+
206+
test = { cmd = "pytest" }

Diff for: requirements-utils.txt

-10
This file was deleted.

Diff for: setup.py

-95
This file was deleted.

0 commit comments

Comments
 (0)