Skip to content

Commit 36d1e2d

Browse files
committed
build: convert to PEP517
Fix #114
1 parent 7e5b2c7 commit 36d1e2d

File tree

3 files changed

+12
-27
lines changed

3 files changed

+12
-27
lines changed

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[build-system]
2+
requires = ["setuptools >= 42.0.0", "setuptools_scm", "cffi >= 1.0.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools_scm]
6+
write_to = "snimpy/_version.py"

setup.py

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
11
import os
2-
from setuptools import setup
3-
from setuptools.command.test import test
4-
import snimpy
2+
from setuptools import setup, find_packages
53

64
rtd = os.environ.get("READTHEDOCS", None) == "True"
75

86

9-
class SnimpyTestCommand(test):
10-
def run_tests(self, *args, **kwds):
11-
# Ensure we keep a reference to multiprocessing and pysnmp to
12-
# avoid errors at the end of the test
13-
import multiprocessing
14-
import pysnmp
15-
16-
SnimpyTestCommand.multiprocessing = multiprocessing
17-
SnimpyTestCommand.pysnmp = pysnmp
18-
return test.run_tests(self, *args, **kwds)
19-
20-
217
if __name__ == "__main__":
228
readme = open("README.rst").read()
239
history = open("HISTORY.rst").read().replace(".. :changelog:", "")
@@ -36,11 +22,11 @@ def run_tests(self, *args, **kwds):
3622
"Topic :: System :: Monitoring",
3723
],
3824
url="https://github.com/vincentbernat/snimpy",
39-
description=snimpy.__doc__,
25+
description="interactive SNMP tool",
4026
long_description=readme + "\n\n" + history,
4127
long_description_content_type="text/x-rst",
42-
author=snimpy.__author__,
43-
author_email=snimpy.__email__,
28+
author="Vincent Bernat",
29+
author_email="bernat@luffy.cx",
4430
packages=["snimpy"],
4531
entry_points={
4632
"console_scripts": [
@@ -57,10 +43,6 @@ def run_tests(self, *args, **kwds):
5743
'pyasyncore; python_version >= "3.12"',
5844
"setuptools",
5945
],
60-
setup_requires=["cffi >= 1.0.0", "vcversioner"],
61-
cmdclass={"test": SnimpyTestCommand},
62-
pbr=False,
63-
vcversioner={
64-
"version_module_paths": ["snimpy/_version.py"],
65-
},
46+
setup_requires=["cffi >= 1.0.0", "setuptools_scm"],
47+
use_scm_version=True,
6648
)

snimpy/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
"""interactive SNMP tool"""
22

3-
__author__ = 'Vincent Bernat'
4-
__email__ = 'bernat@luffy.cx'
5-
63
try:
74
from snimpy._version import __version__ # nopep8
85
except ImportError:

0 commit comments

Comments
 (0)