Skip to content

Commit 9dd6f90

Browse files
committed
Migrate from setup.py to setup.cfg and pyproject.toml
1 parent 20b130c commit 9dd6f90

File tree

4 files changed

+71
-67
lines changed

4 files changed

+71
-67
lines changed

pyproject.toml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[build-system]
2+
requires = ["setuptools>=34.4.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
15
[tool.isort]
26
multi_line_output = 3
37
length_sort = true
@@ -28,3 +32,29 @@ max-line-length = 88
2832
# E203: Whitespace before ':'
2933
# D202 No blank lines allowed after function docstring
3034
ignore = "W503,E203,D202"
35+
36+
[tool.tox]
37+
legacy_tox_ini = """
38+
[tox]
39+
envlist = py37, py38, py39, lint, black
40+
skip_missing_interpreters = True
41+
42+
[testenv]
43+
setenv = PYTHONPATH = {toxinidir}
44+
extras = testing
45+
commands = py.test --cov --cov-report=html
46+
47+
[testenv:lint]
48+
basepython = python3
49+
deps = flake8
50+
commands = flake8
51+
52+
[testenv:black]
53+
deps =
54+
black==20.8.b1
55+
setenv =
56+
LC_ALL=C.UTF-8
57+
LANG=C.UTF-8
58+
commands=
59+
black --check --fast {toxinidir}/zigpy_znp {toxinidir}/tests {toxinidir}/setup.py
60+
"""

setup.cfg

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[metadata]
2+
name = zigpy-znp
3+
description = A library for zigpy which communicates with TI ZNP radios
4+
version = attr: zigpy_znp.__version__
5+
long_description = file: README.md
6+
long_description_content_type = text/markdown; charset=UTF-8
7+
url = https://github.com/zigpy/zigpy-znp
8+
author = Alexei Chetroi
9+
author_email = [email protected]
10+
license = GPL-3.0
11+
12+
[options]
13+
packages = find:
14+
python_requires = >=3.7
15+
install_requires =
16+
pyserial-asyncio>=0.6
17+
zigpy>=0.40.0
18+
async_timeout
19+
voluptuous
20+
coloredlogs
21+
jsonschema
22+
23+
[options.packages.find]
24+
exclude =
25+
tests
26+
tests.*
27+
28+
[options.extras_require]
29+
# XXX: The order of these deps seems to matter
30+
testing =
31+
pytest>=5.4.5
32+
pytest-asyncio>=0.12.0
33+
pytest-timeout
34+
pytest-mock
35+
pytest-cov
36+
coveralls
37+
asynctest; python_version < "3.8.0"
38+

setup.py

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,4 @@
1-
"""Setup module for zigpy-znp"""
1+
import setuptools
22

3-
import pathlib
4-
5-
from setuptools import setup, find_packages
6-
7-
import zigpy_znp
8-
9-
setup(
10-
name="zigpy-znp",
11-
version=zigpy_znp.__version__,
12-
description="A library for zigpy which communicates with TI ZNP radios",
13-
long_description=(pathlib.Path(__file__).parent / "README.md").read_text(),
14-
long_description_content_type="text/markdown",
15-
url="https://github.com/zigpy/zigpy-znp",
16-
author="Alexei Chetroi",
17-
author_email="[email protected]",
18-
license="GPL-3.0",
19-
packages=find_packages(exclude=["tests", "tests.*"]),
20-
python_requires=">=3.7",
21-
install_requires=[
22-
"pyserial-asyncio>=0.6", # 0.5 is broken on Windows
23-
"zigpy>=0.40.0",
24-
"async_timeout",
25-
"voluptuous",
26-
"coloredlogs",
27-
"jsonschema",
28-
],
29-
extras_require={
30-
"testing": [
31-
# XXX: The order of these deps seems to matter
32-
"pytest>=5.4.5",
33-
"pytest-asyncio>=0.12.0",
34-
"pytest-timeout",
35-
"pytest-mock",
36-
"pytest-cov",
37-
"coveralls",
38-
'asynctest; python_version < "3.8.0"',
39-
]
40-
},
41-
)
3+
if __name__ == "__main__":
4+
setuptools.setup()

tox.ini

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

0 commit comments

Comments
 (0)