Skip to content

Commit 8723a88

Browse files
committed
Change to pyproject.toml.
1 parent 7e3e9d9 commit 8723a88

File tree

6 files changed

+265
-390
lines changed

6 files changed

+265
-390
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
with:
4040
python-version: ${{ matrix.python.version }}
4141
cache: 'pip'
42-
- run: pip install -e . -r requirements.txt
42+
- run: pip install -e ".[all]"
4343
- run: codespell
4444
- run: pylint --recursive=y examples pymodbus test
4545
- run: pre-commit run --all-files
@@ -68,7 +68,7 @@ jobs:
6868
with:
6969
python-version: ${{ matrix.python.version }}
7070
cache: 'pip'
71-
- run: pip install -e . -r requirements.txt
71+
- run: pip install -e ".[all]"
7272

7373
- run: pytest -n0 -v --full-trace --timeout=1200
7474

README.rst

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -142,39 +142,39 @@ permissions or a virtualenv currently running):
142142

143143
pip install -U pymodbus
144144

145-
This will install a base version of pymodbus.
145+
If you want to use the serial interface:
146+
147+
pip install -U pymodbus[serial]
148+
149+
This will install pymodbus, r
146150

147151
To install pymodbus with options run:
148152

149153
pip install -U pymodbus[<option>,...]
150154

151155
Available options are:
152156

153-
- **repl**, installs pymodbus REPL.
157+
- **repl**, install dependencies needed by pymodbus.repl
154158

155159
- **serial**, installs serial drivers.
156160

161+
- **simulator**, install dependencies needed by pymodbus.simulator
162+
157163
- **documentation**, installs tools to generate documentation.
158164

159165
- **development**, installs development tools needed to enable test/check of pymodbus changes.
160166

161-
162-
Or to install a specific release:
163-
164-
pip install -U pymodbus==X.Y.Z
165-
167+
- **all**, installs all of the above
166168

167169

168170
Installing with github
169171
----------------------
170172

171173
Before cloning the repo, you need to install python3 (preferable 3.11)
172-
and make a virtual environment::
174+
and make and activate a virtual environment::
173175

174176
python3 -m venv /path/to/new/virtual/environment
175177

176-
To activate the virtual environment please do::
177-
178178
source .venv/bin/activate
179179

180180
Clone the source and install from there::
@@ -194,9 +194,7 @@ To get bleeding edge::
194194

195195
Install required development tools::
196196

197-
pip install -r requirements.txt
198-
199-
pip install -e .
197+
pip install -e ".[development]"
200198

201199
pre-commit install
202200

@@ -209,7 +207,6 @@ The repository contains a number of important branches and tags.
209207
* **dev** is where all development happens, this branch is not always stable.
210208
* **master** is where are releases are kept.
211209
* All releases are tagged with **vX.Y.Z** (e.g. v2.5.3)
212-
* All prereleases are tagged with **vX.Y.ZrcQ** (e.g. v3.0.0.0rc1)
213210

214211
If a maintenance release of an old version is needed (e.g. v2.5.4),
215212
the release tag is used to create a branch with the same name,
@@ -233,22 +230,29 @@ solving issues:
233230
* Functional testing against any reference we can find
234231
* The remaining edges of the protocol (that we think no one uses)
235232

233+
There are 2 bigger projects ongoing:
234+
235+
* rewriting the internal part of all clients (both sync and async)
236+
* Make the simulator datastore THE datastore
237+
236238

237239
Development Instructions
238240
------------------------
239241
The current code base is compatible python >= 3.8.
240242
Here are some of the common commands to perform a range of activities
241243

242-
pip install -r requirements.txt install all requirements
243-
244-
pip install -e . source directory is "release", useful for testing
245-
246244
./check_ci.sh run the same checks as CI runs on a pull request.
247245

248246

249247
Generate documentation
250248
----------------------
251249

250+
**Remark** Assumes that you have installed documentation tools:
251+
252+
pip install -e ".[documentation]"
253+
254+
to build do:
255+
252256
cd doc
253257
./build_html
254258

pyproject.toml

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
[build-system]
2+
requires = ["setuptools>=61.2"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "pymodbus"
7+
dynamic = ["version"]
8+
license = {text = "BSD-3-Clause"}
9+
authors = [{name = '"Galen Collins'}, {name = 'Jan Iversen"'}]
10+
maintainers = [{name = '"dhoomakethu'}, {name = 'janiversen"'}]
11+
description = "A fully featured modbus protocol stack in python"
12+
keywords = ["modbus", "asyncio", "scada", "client", "server", "simulator"]
13+
readme = "README.rst"
14+
classifiers = [
15+
"Development Status :: 5 - Production/Stable",
16+
"Environment :: Console",
17+
"Framework :: AsyncIO",
18+
"Intended Audience :: Developers",
19+
"License :: OSI Approved :: BSD License",
20+
"Operating System :: POSIX :: Linux",
21+
"Operating System :: Unix",
22+
"Operating System :: MacOS :: MacOS X",
23+
"Operating System :: OS Independent",
24+
"Operating System :: Microsoft",
25+
"Programming Language :: Python :: 3.8",
26+
"Programming Language :: Python :: 3.9",
27+
"Programming Language :: Python :: 3.10",
28+
"Programming Language :: Python :: 3.11",
29+
"Topic :: System :: Networking",
30+
"Topic :: Utilities",
31+
]
32+
requires-python = ">=3.8.0"
33+
34+
[project.urls]
35+
Homepage = "https://github.com/pymodbus-dev/pymodbus/"
36+
"Source Code" = "https://github.com/pymodbus-dev/pymodbus"
37+
"Bug Reports" = "https://github.com/pymodbus-dev/pymodbus/issues"
38+
"Docs: Dev" = "https://pymodbus.readthedocs.io/en/latest/?badge=latest"
39+
Discord = "https://discord.gg/vcP8qAz2"
40+
41+
[project.scripts]
42+
"pymodbus.console" = "pymodbus.repl.client.main:main"
43+
"pymodbus.server" = "pymodbus.repl.server.main:app"
44+
"pymodbus.simulator" = "pymodbus.server.simulator.main:main"
45+
46+
[project.optional-dependencies]
47+
serial = [
48+
"pyserial>=3.5"
49+
]
50+
repl = [
51+
"aiohttp>=3.8.6",
52+
"typer[all]>=0.7.0",
53+
"prompt-toolkit>=3.0.36",
54+
"pygments>=2.15.0",
55+
"click>=8.0.0"
56+
]
57+
simulator = [
58+
"aiohttp>=3.8.6"
59+
]
60+
documentation = [
61+
"recommonmark>=0.7.1",
62+
"Sphinx>=5.3.0",
63+
"sphinx-rtd-theme>=1.1.1"
64+
]
65+
development = [
66+
"codespell>=2.2.2",
67+
"coverage>=7.1.0",
68+
"pre-commit>=3.1.1",
69+
"pyflakes>=3.0.1",
70+
"pydocstyle>=6.3.0",
71+
"pycodestyle>=2.10.0",
72+
"pylint>=2.17.2",
73+
"pytest>=7.3.1",
74+
"pytest-asyncio>=0.20.3",
75+
"pytest-cov>=4.1.0",
76+
"pytest-timeout>=2.1.0",
77+
"pytest-xdist>=3.3.1",
78+
"ruff>=0.0.287",
79+
"twine>=4.0.2",
80+
"types-Pygments",
81+
"types-pyserial"
82+
]
83+
all = [
84+
"pymodbus[serial]",
85+
"pymodbus[repl]",
86+
"pymodbus[simulator]",
87+
"pymodbus[documentation]",
88+
"pymodbus[dev]"
89+
]
90+
91+
[tool.setuptools]
92+
include-package-data = true
93+
zip-safe = true
94+
platforms = ["'Linux'", "'Mac OS X'", "'Win'"]
95+
96+
[tool.setuptools.exclude-package-data]
97+
pymodbus = [
98+
"examples",
99+
"test",
100+
"doc",
101+
]
102+
103+
[tool.setuptools.package-data]
104+
pymodbus = [
105+
"py.typed",
106+
"server/simulator/setup.json",
107+
"server/simulator/web/**/*"
108+
]
109+
110+
[tool.setuptools.packages.find]
111+
include = ["pymodbus*"]
112+
namespaces = false
113+
114+
[tool.setuptools.dynamic]
115+
version = {attr = "pymodbus.__version__"}
116+
117+
[tool.pylint.main]
118+
ignore-paths = [
119+
"pymodbus/transport/serial_asyncio",
120+
"doc"
121+
]
122+
ignore-patterns = '^\.#'
123+
persistent = "no"
124+
load-plugins = [
125+
"pylint.extensions.bad_builtin",
126+
"pylint.extensions.check_elif",
127+
"pylint.extensions.code_style",
128+
"pylint.extensions.comparison_placement",
129+
"pylint.extensions.confusing_elif",
130+
"pylint.extensions.docparams",
131+
"pylint.extensions.docstyle",
132+
"pylint.extensions.eq_without_hash",
133+
"pylint.extensions.for_any_all",
134+
"pylint.extensions.overlapping_exceptions",
135+
"pylint.extensions.private_import",
136+
"pylint.extensions.set_membership",
137+
"pylint.extensions.typing"
138+
]
139+
jobs = "0"
140+
py-version = "3.8"
141+
142+
[tool.pylint.messages_control]
143+
enable = "all"
144+
disable = [
145+
"duplicate-code", # TBD
146+
"file-ignored", # ONLY to be used with extreme care.
147+
"format", # NOT wanted, handled by black
148+
"locally-disabled", # NOT wanted
149+
"suppressed-message" # NOT wanted"""
150+
]
151+
152+
[tool.pylint.reports]
153+
output-format = "text"
154+
155+
[tool.pylint.logging]
156+
logging-format-style = "new"
157+
158+
[tool.pylint.similarities]
159+
ignore-imports = "no"
160+
ignore-signatures = "no"
161+
162+
[tool.pylint.variables]
163+
dummy-variables-rgx = ""
164+
165+
[tool.pylint.format]
166+
max-module-lines = "2000"
167+
168+
[tool.pylint.basic]
169+
good-names = "i,j,k,rr,fc,rq,fd,x,_"
170+
attr-rgx = "([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$"
171+
method-rgx = "[a-z_][a-zA-Z0-9_]{2,}$"
172+
173+
[tool.pylint.design]
174+
max-args = "10"
175+
max-locals = "25"
176+
max-returns = "11"
177+
max-branches = "27"
178+
max-statements = "100"
179+
max-attributes = "20"
180+
max-public-methods = "25"
181+
182+
[tool.pylint.classes]
183+
valid-metaclass-classmethod-first-arg = "mcs"
184+
185+
[tool.pylint.imports]
186+
deprecated-modules = "regsub,TERMIOS,Bastion,rexec"
187+
188+
[tool.pylint.exceptions]
189+
overgeneral-exceptions = "builtins.Exception"
190+
191+
[tool.pylint.deprecated_builtins]
192+
bad-functions = "map,input"
193+
194+
[tool.mypy]
195+
strict_optional = false
196+
exclude = "pymodbus/client/base.py"
197+
show_error_codes = true
198+
local_partial_types = true
199+
strict_equality = true
200+
warn_incomplete_stub = true
201+
warn_redundant_casts = true
202+
warn_unused_configs = true
203+
warn_unused_ignores = true
204+
enable_error_code = "ignore-without-code, redundant-self, truthy-iterable"
205+
disable_error_code = ["annotation-unchecked"]
206+
strict_concatenate = false
207+
disallow_subclassing_any = true
208+
disallow_untyped_decorators = true
209+
warn_unreachable = true
210+
211+
[tool.distutils]
212+
bdist_wheel = {}
213+
214+
[tool.distutils.egg_info]
215+
tag-svn-revision = false
216+
217+
[tool.distutils.upload_docs]
218+
upload-dir = "build/sphinx/html"
219+
220+
[tool.build-sphinx]
221+
source-dir = "doc/sphinx/"
222+
build-dir = "doc/sphinx/build"
223+
all_files = "1"
224+
225+
[tool.pytest.ini_options]
226+
testpaths = ["test"]
227+
addopts = "-p no:warnings --dist loadscope --numprocesses auto"
228+
asyncio_mode = "auto"
229+
timeout = 40
230+
231+
[tool.coverage.run]
232+
include = [
233+
"examples/",
234+
"pymodbus/",
235+
"test/",
236+
]
237+
omit = ["examples/contrib/"]
238+
239+
[tool.codespell]
240+
skip = "./doc/_build,./doc/source/_static,venv,.venv,.git,htmlcov,CHANGELOG.rst,.mypy_cache"
241+
ignore-words-list = "asend"

0 commit comments

Comments
 (0)