Skip to content

Commit 2a9489e

Browse files
committed
build: modernize a bit the build system
1 parent 4262cf1 commit 2a9489e

4 files changed

Lines changed: 53 additions & 51 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
python-version:
20-
- "3.8"
2120
- "3.9"
2221
- "3.10"
2322
- "3.11"
2423
- "3.12"
2524
- "3.13"
25+
- "3.14"
2626
steps:
2727
- uses: actions/checkout@v4
2828
with:

pyproject.toml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,48 @@
22
requires = ["setuptools >= 42.0.0", "setuptools_scm", "cffi >= 1.0.0"]
33
build-backend = "setuptools.build_meta"
44

5+
[project]
6+
name = "snimpy"
7+
description = "interactive SNMP tool"
8+
requires-python = ">= 3.9"
9+
dynamic = ["version"]
10+
readme = "README.rst"
11+
license = "ISC"
12+
authors = [
13+
{ name = "Vincent Bernat", email = "bernat@luffy.cx" },
14+
]
15+
classifiers = [
16+
"Development Status :: 4 - Beta",
17+
"Environment :: Console",
18+
"Intended Audience :: System Administrators",
19+
"Operating System :: POSIX",
20+
"Programming Language :: Python :: 3",
21+
"Programming Language :: Python :: 3.9",
22+
"Programming Language :: Python :: 3.10",
23+
"Programming Language :: Python :: 3.11",
24+
"Programming Language :: Python :: 3.12",
25+
"Programming Language :: Python :: 3.13",
26+
"Programming Language :: Python :: 3.14",
27+
"Topic :: System :: Networking",
28+
"Topic :: Utilities",
29+
"Topic :: System :: Monitoring",
30+
]
31+
dependencies = [
32+
"cffi >= 1.0.0",
33+
"pysnmp >= 7",
34+
"pysnmpcrypto",
35+
"setuptools",
36+
]
37+
38+
[project.scripts]
39+
snimpy = "snimpy.main:interact"
40+
41+
[project.urls]
42+
Homepage = "https://github.com/vincentbernat/snimpy"
43+
44+
[tool.setuptools]
45+
packages = ["snimpy"]
46+
zip-safe = false
47+
548
[tool.setuptools_scm]
649
write_to = "snimpy/_version.py"

setup.py

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,8 @@
11
import os
2-
from setuptools import setup, find_packages
2+
from setuptools import setup
33

44
rtd = os.environ.get("READTHEDOCS", None) == "True"
55

6-
7-
if __name__ == "__main__":
8-
readme = open("README.rst").read()
9-
history = open("HISTORY.rst").read().replace(".. :changelog:", "")
10-
11-
setup(
12-
name="snimpy",
13-
classifiers=[
14-
"Development Status :: 4 - Beta",
15-
"Environment :: Console",
16-
"Intended Audience :: System Administrators",
17-
"License :: OSI Approved :: ISC License (ISCL)",
18-
"Operating System :: POSIX",
19-
"Programming Language :: Python :: 3",
20-
"Topic :: System :: Networking",
21-
"Topic :: Utilities",
22-
"Topic :: System :: Monitoring",
23-
],
24-
url="https://github.com/vincentbernat/snimpy",
25-
description="interactive SNMP tool",
26-
long_description=readme + "\n\n" + history,
27-
long_description_content_type="text/x-rst",
28-
author="Vincent Bernat",
29-
author_email="bernat@luffy.cx",
30-
packages=["snimpy"],
31-
entry_points={
32-
"console_scripts": [
33-
"snimpy = snimpy.main:interact",
34-
],
35-
},
36-
data_files=[("share/man/man1", ["man/snimpy.1"])],
37-
zip_safe=False,
38-
cffi_modules=(not rtd and ["snimpy/smi_build.py:ffi"] or []),
39-
install_requires=[
40-
"cffi >= 1.0.0",
41-
"pysnmp >= 7",
42-
"pysnmpcrypto",
43-
"setuptools",
44-
],
45-
setup_requires=["cffi >= 1.0.0", "setuptools_scm"],
46-
use_scm_version=True,
47-
)
6+
setup(
7+
cffi_modules=(not rtd and ["snimpy/smi_build.py:ffi"] or []),
8+
)

tox.ini

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
[tox]
2-
envlist = py{36,37,38,39,310,311,312,313}{,-ipython},lint,doc
2+
envlist = py{39,310,311,312,313,314}{,-ipython},lint,doc
33
skip_missing_interpreters = True
44

55
[gh-actions]
66
python =
7-
3.6: py36
8-
3.7: py37
9-
3.8: py38, lint, doc
10-
3.9: py39
7+
3.9: py39, lint, doc
118
3.10: py310
129
3.11: py311
1310
3.12: py312
1411
3.13: py313
12+
3.14: py314
1513

1614
[testenv]
1715
allowlist_externals = make
@@ -28,7 +26,7 @@ deps =
2826
twine
2927
interrogate
3028
build
31-
whitelist_externals = make
29+
allowlist_externals = make
3230
commands =
3331
make lint
3432
python -m build
@@ -40,7 +38,7 @@ changedir = docs
4038
deps =
4139
sphinx
4240
sphinx-rtd-theme
43-
whitelist_externals = make
41+
allowlist_externals = make
4442
commands =
4543
make html READTHEDOCS=True
4644

0 commit comments

Comments
 (0)