Skip to content

Commit 24263bd

Browse files
committed
Use poetry
1 parent 7982840 commit 24263bd

8 files changed

Lines changed: 55 additions & 75 deletions

File tree

.builds/debian.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ packages:
77
- python3-bluetooth
88
- python3-sphinx
99
- python3-sphinx-rtd-theme
10-
- python3-pytest
11-
- python3-setuptools
1210
- python3-sphinx-autodoc-typehints
11+
- python3-pytest
12+
- python3-poetry
1313
sources:
1414
- https://git.sr.ht/~ni/nxt-python
1515
tasks:
@@ -23,7 +23,7 @@ tasks:
2323
tar czf ../../nxt-python.tar.gz latest
2424
- install: |
2525
cd nxt-python
26-
python3 setup.py install --user
26+
poetry install
2727
- upload: |
2828
cd nxt-python
2929
# Only on master branch.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ docs/_build/
33
htmlcov/
44
__pycache__/
55
.coverage
6+
poetry.lock

.pre-commit-config.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ repos:
33
rev: v4.4.0
44
hooks:
55
- id: check-merge-conflict
6+
- id: check-toml
67
- id: check-yaml
78
- id: end-of-file-fixer
89
- id: fix-byte-order-marker
@@ -24,11 +25,6 @@ repos:
2425
- id: pytest
2526
name: pytest
2627
language: system
27-
entry: python3 -m pytest
28+
entry: poetry run pytest
2829
types: [python]
2930
pass_filenames: false
30-
- repo: https://github.com/mgedmin/check-manifest
31-
rev: "0.49"
32-
hooks:
33-
- id: check-manifest
34-
stages: [push, manual]

MANIFEST.in

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

pyproject.toml

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,48 @@
1+
[tool.poetry]
2+
name = "nxt-python"
3+
version = "3.2.0"
4+
description = "LEGO Mindstorms NXT Control Package"
5+
authors = ["Nicolas Schodet <nico@ni.fr.eu.org>"]
6+
license = "GPL-3.0-or-later"
7+
readme = "README.md"
8+
homepage = "https://ni.srht.site/nxt-python/latest/"
9+
packages = [{ include = "nxt" }]
10+
include = [
11+
{ path = "logo.svg", format = "sdist" },
12+
{ path = "tox.ini", format = "sdist" },
13+
{ path = "scripts/python-nxt-filer.desktop", format = "sdist" },
14+
{ path = "scripts/nxt_*", format = "sdist" },
15+
{ path = "contrib", format = "sdist" },
16+
{ path = "docs/Makefile", format = "sdist" },
17+
{ path = "docs/conf.py", format = "sdist" },
18+
{ path = "docs/favicon.ico", format = "sdist" },
19+
{ path = ".pre-commit-config.yaml", format = "sdist" },
20+
{ path = "docs/**/*.rst", format = "sdist" },
21+
{ path = "examples", format = "sdist" },
22+
{ path = "setup.cfg", format = "sdist" },
23+
{ path = "tests", format = "sdist" },
24+
]
25+
26+
[tool.poetry.dependencies]
27+
python = "^3.8"
28+
pyusb = "^1.2.1"
29+
pybluez = { version = "^0.23", optional = true }
30+
31+
[tool.poetry.extras]
32+
bluetooth = ["pybluez"]
33+
34+
[tool.poetry.group.dev.dependencies]
35+
pytest = "^7.2.1"
36+
coverage = "^6.5.0"
37+
pre-commit = "^3.0.4"
38+
isort = "^5.12.0"
39+
black = "^23.1.0"
40+
flake8 = "^5.0.4"
41+
sphinx = "^5.3.0"
42+
sphinx-rtd-theme = "^1.2.0"
43+
sphinx-autodoc-typehints = "^1.12.0"
44+
tox = "^3.28.0"
45+
146
[build-system]
2-
requires = ["setuptools", "wheel"]
3-
build-backend = "setuptools.build_meta"
47+
requires = ["poetry-core"]
48+
build-backend = "poetry.core.masonry.api"

setup.cfg

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,3 @@
1-
[metadata]
2-
name = nxt-python
3-
version = 3.2.0
4-
author = Nicolas Schodet
5-
author_email = nico@ni.fr.eu.org
6-
description = LEGO Mindstorms NXT Control Package
7-
long_description = file: README.md
8-
long_description_content_type = text/markdown
9-
url = https://github.com/schodet/nxt-python/
10-
classifiers =
11-
Programming Language :: Python :: 3
12-
Programming Language :: Python :: 3 :: Only
13-
Programming Language :: Python :: 3.8
14-
Programming Language :: Python :: 3.9
15-
Programming Language :: Python :: 3.10
16-
Programming Language :: Python :: 3.11
17-
License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
18-
Operating System :: OS Independent
19-
20-
[options]
21-
zip_safe = True
22-
packages =
23-
nxt
24-
nxt.backend
25-
nxt.sensor
26-
scripts =
27-
scripts/nxt_filer
28-
scripts/nxt_push
29-
scripts/nxt_server
30-
scripts/nxt_test
31-
python_requires = >=3.8
32-
install_requires =
33-
pyusb >= 1.2.1
34-
35-
[options.extras_require]
36-
bluetooth =
37-
pybluez >= 0.23; platform_system == 'Linux'
38-
pybluez >= 0.23; platform_system == 'Windows'
39-
pybluez >= 0.23; platform_system == 'Darwin'
40-
dev =
41-
pytest >= 6.0.2
42-
coverage >= 5.1
43-
pre-commit >= 2.10.1
44-
check-manifest >= 0.48
45-
sphinx >= 3.4.3
46-
sphinx-rtd-theme >= 0.5.1
47-
sphinx-autodoc-typehints >= 1.12.0
48-
tox >= 3.21.4
49-
501
[flake8]
512
max-line-length = 88
523

setup.py

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

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55

66
[tox]
77
envlist = py38, py39, py310, py311
8+
isolated_build = True
89

910
[testenv]
1011
deps =
1112
pytest
1213
pyusb
1314
commands =
14-
pytest tests
15+
pytest

0 commit comments

Comments
 (0)