Skip to content

Commit a216c58

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

File tree

6 files changed

+291
-390
lines changed

6 files changed

+291
-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: 267 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,267 @@
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+
"pyserial>=3.5",
86+
# "pymodbus[repl]",
87+
"aiohttp>=3.8.6",
88+
"typer[all]>=0.7.0",
89+
"prompt-toolkit>=3.0.36",
90+
"pygments>=2.15.0",
91+
"click>=8.0.0",
92+
# "pymodbus[simulator]",
93+
"aiohttp>=3.8.6",
94+
# "pymodbus[documentation]",
95+
"recommonmark>=0.7.1",
96+
"Sphinx>=5.3.0",
97+
"sphinx-rtd-theme>=1.1.1",
98+
# "pymodbus[dev]",
99+
"codespell>=2.2.2",
100+
"coverage>=7.1.0",
101+
"pre-commit>=3.1.1",
102+
"pyflakes>=3.0.1",
103+
"pydocstyle>=6.3.0",
104+
"pycodestyle>=2.10.0",
105+
"pylint>=2.17.2",
106+
"pytest>=7.3.1",
107+
"pytest-asyncio>=0.20.3",
108+
"pytest-cov>=4.1.0",
109+
"pytest-timeout>=2.1.0",
110+
"pytest-xdist>=3.3.1",
111+
"ruff>=0.0.287",
112+
"twine>=4.0.2",
113+
"types-Pygments",
114+
"types-pyserial"
115+
]
116+
117+
[tool.setuptools]
118+
include-package-data = true
119+
zip-safe = true
120+
platforms = ["'Linux'", "'Mac OS X'", "'Win'"]
121+
122+
[tool.setuptools.exclude-package-data]
123+
pymodbus = [
124+
"examples",
125+
"test",
126+
"doc",
127+
]
128+
129+
[tool.setuptools.package-data]
130+
pymodbus = [
131+
"py.typed",
132+
"server/simulator/setup.json",
133+
"server/simulator/web/**/*"
134+
]
135+
136+
[tool.setuptools.packages.find]
137+
include = ["pymodbus*"]
138+
namespaces = false
139+
140+
[tool.setuptools.dynamic]
141+
version = {attr = "pymodbus.__version__"}
142+
143+
[tool.pylint.main]
144+
ignore-paths = [
145+
"pymodbus/transport/serial_asyncio",
146+
"doc"
147+
]
148+
ignore-patterns = '^\.#'
149+
persistent = "no"
150+
load-plugins = [
151+
"pylint.extensions.bad_builtin",
152+
"pylint.extensions.check_elif",
153+
"pylint.extensions.code_style",
154+
"pylint.extensions.comparison_placement",
155+
"pylint.extensions.confusing_elif",
156+
"pylint.extensions.docparams",
157+
"pylint.extensions.docstyle",
158+
"pylint.extensions.eq_without_hash",
159+
"pylint.extensions.for_any_all",
160+
"pylint.extensions.overlapping_exceptions",
161+
"pylint.extensions.private_import",
162+
"pylint.extensions.set_membership",
163+
"pylint.extensions.typing"
164+
]
165+
jobs = "0"
166+
py-version = "3.8"
167+
168+
[tool.pylint.messages_control]
169+
enable = "all"
170+
disable = [
171+
"duplicate-code", # TBD
172+
"file-ignored", # ONLY to be used with extreme care.
173+
"format", # NOT wanted, handled by black
174+
"locally-disabled", # NOT wanted
175+
"suppressed-message" # NOT wanted"""
176+
]
177+
178+
[tool.pylint.reports]
179+
output-format = "text"
180+
181+
[tool.pylint.logging]
182+
logging-format-style = "new"
183+
184+
[tool.pylint.similarities]
185+
ignore-imports = "no"
186+
ignore-signatures = "no"
187+
188+
[tool.pylint.variables]
189+
dummy-variables-rgx = ""
190+
191+
[tool.pylint.format]
192+
max-module-lines = "2000"
193+
194+
[tool.pylint.basic]
195+
good-names = "i,j,k,rr,fc,rq,fd,x,_"
196+
attr-rgx = "([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$"
197+
method-rgx = "[a-z_][a-zA-Z0-9_]{2,}$"
198+
199+
[tool.pylint.design]
200+
max-args = "10"
201+
max-locals = "25"
202+
max-returns = "11"
203+
max-branches = "27"
204+
max-statements = "100"
205+
max-attributes = "20"
206+
max-public-methods = "25"
207+
208+
[tool.pylint.classes]
209+
valid-metaclass-classmethod-first-arg = "mcs"
210+
211+
[tool.pylint.imports]
212+
deprecated-modules = "regsub,TERMIOS,Bastion,rexec"
213+
214+
[tool.pylint.exceptions]
215+
overgeneral-exceptions = "builtins.Exception"
216+
217+
[tool.pylint.deprecated_builtins]
218+
bad-functions = "map,input"
219+
220+
[tool.mypy]
221+
strict_optional = false
222+
exclude = "pymodbus/client/base.py"
223+
show_error_codes = true
224+
local_partial_types = true
225+
strict_equality = true
226+
warn_incomplete_stub = true
227+
warn_redundant_casts = true
228+
warn_unused_configs = true
229+
warn_unused_ignores = true
230+
enable_error_code = "ignore-without-code, redundant-self, truthy-iterable"
231+
disable_error_code = ["annotation-unchecked"]
232+
strict_concatenate = false
233+
disallow_subclassing_any = true
234+
disallow_untyped_decorators = true
235+
warn_unreachable = true
236+
237+
[tool.distutils]
238+
bdist_wheel = {}
239+
240+
[tool.distutils.egg_info]
241+
tag-svn-revision = false
242+
243+
[tool.distutils.upload_docs]
244+
upload-dir = "build/sphinx/html"
245+
246+
[tool.build-sphinx]
247+
source-dir = "doc/sphinx/"
248+
build-dir = "doc/sphinx/build"
249+
all_files = "1"
250+
251+
[tool.pytest.ini_options]
252+
testpaths = ["test"]
253+
addopts = "-p no:warnings --dist loadscope --numprocesses auto"
254+
asyncio_mode = "auto"
255+
timeout = 40
256+
257+
[tool.coverage.run]
258+
include = [
259+
"examples/",
260+
"pymodbus/",
261+
"test/",
262+
]
263+
omit = ["examples/contrib/"]
264+
265+
[tool.codespell]
266+
skip = "./doc/_build,./doc/source/_static,venv,.venv,.git,htmlcov,CHANGELOG.rst,.mypy_cache"
267+
ignore-words-list = "asend"

0 commit comments

Comments
 (0)