Skip to content

Commit 9c8f9fb

Browse files
authored
Merge pull request #115 from roberthdevries/add-pyproject-toml
Convert python project configuration to pyproject.toml.
2 parents 23e9a7c + ddf707b commit 9c8f9fb

4 files changed

Lines changed: 139 additions & 30 deletions

File tree

ChangeLog.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
wolfCrypt-py Release NEXT (TBD, 2026)
2-
==========================================
1+
wolfCrypt-py Release next (TBD, 2026)
32

3+
* Drop support for end-of-life Python versions (<= 3.9)
44
* Add extra nonce parameter to Random generator
55

66

pyproject.toml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
[project]
2+
name = "wolfcrypt"
3+
description = "Python module that encapsulates wolfSSL's crypto engine API."
4+
readme = "README.rst"
5+
requires-python = ">=3.10"
6+
authors = [
7+
{name = "wolfSSL Inc.", email="info@wolfssl.com"},
8+
]
9+
license = "GPL-2.0-only OR LicenseRef-WolfSSL"
10+
license-files = ["LICENSING.rst"]
11+
keywords = ["wolfssl", "wolfcrypt", "security", "cryptography"]
12+
classifiers = [
13+
"Operating System :: OS Independent",
14+
"Programming Language :: Python :: 3",
15+
"Programming Language :: Python :: 3.10",
16+
"Programming Language :: Python :: 3.11",
17+
"Programming Language :: Python :: 3.12",
18+
"Programming Language :: Python :: 3.13",
19+
"Programming Language :: Python :: 3.14",
20+
"Topic :: Security",
21+
"Topic :: Security :: Cryptography",
22+
"Topic :: Software Development"
23+
]
24+
dynamic = ["version"]
25+
dependencies = [
26+
"cffi>=1.0.0",
27+
]
28+
29+
[project.urls]
30+
Homepage = "https://github.com/wolfssl/wolfcrypt-py"
31+
32+
[build-system]
33+
requires = ["setuptools"]
34+
build-backend = "setuptools.build_meta:__legacy__"
35+
36+
[dependency-groups]
37+
dev = [
38+
"mypy",
39+
"pytest",
40+
"ruff",
41+
"sphinx",
42+
"sphinx-rtd-theme",
43+
"tox >= 4",
44+
"ty",
45+
"types-cffi",
46+
]
47+
48+
[tool.tox]
49+
requires = ["tox>=4"]
50+
env_list = ["py3"]
51+
52+
[tool.tox.env_run_base]
53+
package = "wheel"
54+
deps = ["-rrequirements/test.txt"]
55+
commands = [["py.test", "tests/"]]
56+
57+
58+
[tool.ruff]
59+
# Exclude a variety of commonly ignored directories.
60+
exclude = [
61+
".bzr",
62+
".direnv",
63+
".eggs",
64+
".git",
65+
".git-rewrite",
66+
".hg",
67+
".idea",
68+
".ipynb_checkpoints",
69+
".mypy_cache",
70+
".nox",
71+
".pants.d",
72+
".pyenv",
73+
".pytest_cache",
74+
".pytype",
75+
".ruff_cache",
76+
".svn",
77+
".tox",
78+
".venv",
79+
".vscode",
80+
"__pypackages__",
81+
"_build",
82+
"buck-out",
83+
"build",
84+
"dist",
85+
"lib",
86+
"node_modules",
87+
"site-packages",
88+
"venv",
89+
]
90+
91+
# The GitHub editor is 127 characters wide.
92+
line-length = 127
93+
indent-width = 4
94+
95+
# Assume Python 3.10
96+
target-version = "py310"
97+
98+
[tool.ruff.lint]
99+
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
100+
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
101+
# McCabe complexity (`C901`) by default.
102+
select = ["E4", "E7", "E9", "F", "B", "UP"]
103+
ignore = ["UP031", "UP025", "UP032"]
104+
105+
# Allow fix for all enabled rules (when `--fix`) is provided.
106+
fixable = ["ALL"]
107+
unfixable = []
108+
109+
# Allow unused variables when underscore-prefixed.
110+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
111+
112+
[tool.ruff.format]
113+
# Like Black, use double quotes for strings.
114+
quote-style = "double"
115+
116+
# Like Black, indent with spaces, rather than tabs.
117+
indent-style = "space"
118+
119+
# Like Black, respect magic trailing commas.
120+
skip-magic-trailing-comma = false
121+
122+
# Like Black, automatically detect the appropriate line ending.
123+
line-ending = "auto"
124+
125+
# Enable auto-formatting of code examples in docstrings. Markdown,
126+
# reStructuredText code/literal blocks and doctests are all supported.
127+
#
128+
# This is currently disabled by default, but it is planned for this
129+
# to be opt-out in the future.
130+
docstring-code-format = false
131+
132+
# Set the line length limit used when formatting code snippets in
133+
# docstrings.
134+
#
135+
# This only has an effect when the `docstring-code-format` setting is
136+
# enabled.
137+
docstring-code-line-length = "dynamic"

setup.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,30 +55,10 @@
5555
setup(
5656
name="wolfcrypt",
5757
version=verstr,
58-
description="Python module that encapsulates wolfSSL's crypto engine API.",
5958
long_description=long_description,
6059
long_description_content_type='text/x-rst',
61-
author="wolfSSL Inc.",
62-
author_email="info@wolfssl.com",
63-
url="https://github.com/wolfssl/wolfcrypt-py",
64-
license="GPLv2 or Commercial License",
6560

6661
packages=find_packages(),
67-
keywords="wolfssl, wolfcrypt, security, cryptography",
68-
classifiers=[
69-
u"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
70-
u"License :: Other/Proprietary License",
71-
u"Operating System :: OS Independent",
72-
u"Programming Language :: Python :: 3",
73-
u"Programming Language :: Python :: 3.6",
74-
u"Programming Language :: Python :: 3.7",
75-
u"Programming Language :: Python :: 3.8",
76-
u"Programming Language :: Python :: 3.9",
77-
u"Programming Language :: Python :: 3.10",
78-
u"Topic :: Security",
79-
u"Topic :: Security :: Cryptography",
80-
u"Topic :: Software Development"
81-
],
8262

8363
setup_requires=["cffi>=1.0.0"],
8464
install_requires=["cffi>=1.0.0"],

tox.ini

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)