Skip to content

Commit

Permalink
Use poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
schodet committed Jan 4, 2024
1 parent 7982840 commit 24263bd
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 75 deletions.
6 changes: 3 additions & 3 deletions .builds/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ packages:
- python3-bluetooth
- python3-sphinx
- python3-sphinx-rtd-theme
- python3-pytest
- python3-setuptools
- python3-sphinx-autodoc-typehints
- python3-pytest
- python3-poetry
sources:
- https://git.sr.ht/~ni/nxt-python
tasks:
Expand All @@ -23,7 +23,7 @@ tasks:
tar czf ../../nxt-python.tar.gz latest
- install: |
cd nxt-python
python3 setup.py install --user
poetry install
- upload: |
cd nxt-python
# Only on master branch.
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ docs/_build/
htmlcov/
__pycache__/
.coverage
poetry.lock
8 changes: 2 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ repos:
rev: v4.4.0
hooks:
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: fix-byte-order-marker
Expand All @@ -24,11 +25,6 @@ repos:
- id: pytest
name: pytest
language: system
entry: python3 -m pytest
entry: poetry run pytest
types: [python]
pass_filenames: false
- repo: https://github.com/mgedmin/check-manifest
rev: "0.49"
hooks:
- id: check-manifest
stages: [push, manual]
11 changes: 0 additions & 11 deletions MANIFEST.in

This file was deleted.

49 changes: 47 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
[tool.poetry]
name = "nxt-python"
version = "3.2.0"
description = "LEGO Mindstorms NXT Control Package"
authors = ["Nicolas Schodet <[email protected]>"]
license = "GPL-3.0-or-later"
readme = "README.md"
homepage = "https://ni.srht.site/nxt-python/latest/"
packages = [{ include = "nxt" }]
include = [
{ path = "logo.svg", format = "sdist" },
{ path = "tox.ini", format = "sdist" },
{ path = "scripts/python-nxt-filer.desktop", format = "sdist" },
{ path = "scripts/nxt_*", format = "sdist" },
{ path = "contrib", format = "sdist" },
{ path = "docs/Makefile", format = "sdist" },
{ path = "docs/conf.py", format = "sdist" },
{ path = "docs/favicon.ico", format = "sdist" },
{ path = ".pre-commit-config.yaml", format = "sdist" },
{ path = "docs/**/*.rst", format = "sdist" },
{ path = "examples", format = "sdist" },
{ path = "setup.cfg", format = "sdist" },
{ path = "tests", format = "sdist" },
]

[tool.poetry.dependencies]
python = "^3.8"
pyusb = "^1.2.1"
pybluez = { version = "^0.23", optional = true }

[tool.poetry.extras]
bluetooth = ["pybluez"]

[tool.poetry.group.dev.dependencies]
pytest = "^7.2.1"
coverage = "^6.5.0"
pre-commit = "^3.0.4"
isort = "^5.12.0"
black = "^23.1.0"
flake8 = "^5.0.4"
sphinx = "^5.3.0"
sphinx-rtd-theme = "^1.2.0"
sphinx-autodoc-typehints = "^1.12.0"
tox = "^3.28.0"

[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
49 changes: 0 additions & 49 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,52 +1,3 @@
[metadata]
name = nxt-python
version = 3.2.0
author = Nicolas Schodet
author_email = [email protected]
description = LEGO Mindstorms NXT Control Package
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/schodet/nxt-python/
classifiers =
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Operating System :: OS Independent

[options]
zip_safe = True
packages =
nxt
nxt.backend
nxt.sensor
scripts =
scripts/nxt_filer
scripts/nxt_push
scripts/nxt_server
scripts/nxt_test
python_requires = >=3.8
install_requires =
pyusb >= 1.2.1

[options.extras_require]
bluetooth =
pybluez >= 0.23; platform_system == 'Linux'
pybluez >= 0.23; platform_system == 'Windows'
pybluez >= 0.23; platform_system == 'Darwin'
dev =
pytest >= 6.0.2
coverage >= 5.1
pre-commit >= 2.10.1
check-manifest >= 0.48
sphinx >= 3.4.3
sphinx-rtd-theme >= 0.5.1
sphinx-autodoc-typehints >= 1.12.0
tox >= 3.21.4

[flake8]
max-line-length = 88

Expand Down
3 changes: 0 additions & 3 deletions setup.py

This file was deleted.

3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@

[tox]
envlist = py38, py39, py310, py311
isolated_build = True

[testenv]
deps =
pytest
pyusb
commands =
pytest tests
pytest

0 comments on commit 24263bd

Please sign in to comment.