Repository navigation
Expand file tree
/
Copy pathsetup.py
More file actions
69 lines (63 loc) · 2.22 KB
/
Copy pathsetup.py
File metadata and controls
69 lines (63 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
"""Setup script for DNP3 driver package."""
import re
from pathlib import Path
from setuptools import find_packages, setup
# Repo root is the dnp3py package (not a dnp3py/ subdir), so map it explicitly.
_root = Path(__file__).resolve().parent
_subpackages = find_packages(
where=str(_root),
exclude=["tests", "tests.*"],
)
# Ensure we don't install the tests package; keep core, layers, objects, utils, examples.
packages = ["dnp3py"] + [f"dnp3py.{p}" for p in _subpackages]
# Single source of version: read from package __init__.py
_version_file = _root / "__init__.py"
_version_match = re.search(
r'__version__\s*=\s*["\']([^"\']+)["\']',
_version_file.read_text(encoding="utf-8"),
)
if not _version_match:
raise RuntimeError("__version__ not found in __init__.py")
version = _version_match.group(1)
# Long description for PyPI / pip show
_long_description = (_root / "README.md").read_text(encoding="utf-8")
setup(
name="nfm-dnp3",
version=version,
description="A pure Python DNP3 protocol driver for SCADA communication",
long_description=_long_description,
long_description_content_type="text/markdown",
author="DNP3 Driver Development",
url="https://github.com/fxodell/dnp3py",
project_urls={
"Documentation": "https://github.com/fxodell/dnp3py#readme",
"Source": "https://github.com/fxodell/dnp3py",
"Changelog": "https://github.com/fxodell/dnp3py/releases",
},
license="MIT",
package_dir={"dnp3py": "."},
packages=packages,
python_requires=">=3.9",
install_requires=[],
extras_require={
"dev": [
"pytest>=7.0",
"pytest-cov>=4.0",
"bandit[toml]>=1.7.0",
"ruff>=0.8.0",
"pyright>=1.1.0",
],
},
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: System :: Networking",
"Topic :: System :: Hardware",
],
)