-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
251 lines (226 loc) · 8.12 KB
/
pyproject.toml
File metadata and controls
251 lines (226 loc) · 8.12 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# SPDX-FileCopyrightText: 2023 Gabriele Pongelli
#
# SPDX-License-Identifier: MIT
[tool.poetry]
name = "pycode128"
version = "3.0.0"
homepage = "https://github.com/gpongelli/pycode128"
description = "Python extension for Code128 barcode generator library."
authors = ["Gabriele Pongelli <gabriele.pongelli@gmail.com>"]
readme = "README.md"
license = "MIT"
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
]
packages = [
{ include = "pycode128" },
]
include = [
{ path = "tests", format = "sdist" },
{ path = "libs", format = "sdist" },
{ path = "LICENSES" },
{ path = "setup.cfg", format = "sdist" },
]
[tool.poetry.urls]
"Issue Tracker" = "https://github.com/gpongelli/pycode128/issues"
"Documentation" = "https://gpongelli.github.io/pycode128/"
"Changelog" = "https://gpongelli.github.io/pycode128/history.html"
"Source" = "https://github.com/gpongelli/pycode128"
[tool.poetry.build]
script = "build_extension.py"
generate-setup-file = true
[tool.poetry.dependencies]
python = ">=3.8.0,<4.0"
click = "8.1.3"
cloup = "^2.0.0"
pillow = "^9.4.0"
[tool.poetry.group.devel]
optional = true
[tool.poetry.group.devel.dependencies]
pip = "^23.0.1"
black = "^22.0"
isort = "^5.8.0"
flake8 = [
{ version = "^6.0.0", python = ">=3.8.1"},
{ version = "^3.9.2", python = "<3.8.1"}
]
flake8-docstrings = "^1.7.0"
mypy = "^0.961"
pytest = "^7.2.0"
pytest-cov = "^4.0.0"
tox = "^4.4.6"
virtualenv = "^20.2.2"
twine = "^3.3.0"
Sphinx = "4.2.0"
sphinx-rtd-theme = "1.0.0"
sphinxcontrib-napoleon = "0.7"
m2r2 = "0.3.2"
pre-commit = "^2.12.0"
pytomlpp = "^1.0.11"
commitizen = "^2.32.2"
darglint = "^1.8.1"
bandit = "^1.7.4"
codespell = "^2.1.0"
pylint = "^2.14.3"
types-setuptools = "^65.3.0"
reuse = "^1.1.0"
setuptools = "^67.5.0"
wheel = "^0.38.4"
cibuildwheel = "^2.12.0"
[tool.poetry.group.pyvers]
optional = true
[tool.poetry.group.pyvers.dependencies]
check-python-versions = "^0.21.2"
python-active-versions = "^1.8.0"
[tool.poetry.scripts]
pycode128 = 'pycode128.cli_tools.cli:pycode128'
[tool.black]
line-length = 120
skip-string-normalization = true
target-version = ['py39', 'py310']
include = '\.pyi?$'
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''
[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
line_length = 120
skip_gitignore = true
# you can skip files as below
#skip_glob = ["docs/conf.py", "path/*"]
[tool.commitizen]
name = "cz_conventional_commits"
version = "3.0.0"
version_files = [
"pycode128/__init__.py:__version__",
"pyproject.toml:version"
]
gpg_sign = true
bump_message = 'Bump version: $current_version -> $new_version'
update_changelog_on_bump = false
style = [
["qmark", "fg:#ff9d00 bold"],
["question", "bold"],
["answer", "fg:#ff9d00 bold"],
["pointer", "fg:#ff9d00 bold"],
["highlighted", "fg:#ff9d00 bold"],
["selected", "fg:#cc5454"],
["separator", "fg:#cc5454"],
["instruction", ""],
["text", ""],
["disabled", "fg:#858585 italic"]
]
[tool.bandit]
tests = [
# list from https://github.com/outscale/osc-sdk-python/blob/master/bandit.conf
"B101", # assert_used
"B103", # set_bad_file_permissions
"B105", # hardcoded_password_string
"B106", # hardcoded_password_funcarg
"B107", # hardcoded_password_default
"B108", # hardcoded_tmp_directory
"B110", # try_except_pass
"B112", # try_except_continue
"B108", # hardcoded_tmp_directory
"B301", # pickle library
"B303", # MD5 insecure hash function
"B304", # insecure ciphers
"B305", # insecure cipher modes
"B306", # deprecated mktemp
"B307", # eval - Use of possibly insecure function - consider using safer ast.literal_eval
"B313", # xml_bad_cElementTree
"B314", # xml_bad_ElementTree
"B315", # xml_bad_expatreader
"B316", # xml_bad_expatbuilder
"B317", # xml_bad_sax
"B318", # xml_bad_minidom
"B319", # xml_bad_pulldom
"B320", # xml_bad_etree
"B323", # unverified_context
"B324", # hashlib_new_insecure_functions
"B325", # tempnam
"B501", # request_with_no_cert_validation
"B502", # ssl_with_bad_version
"B503", # ssl_with_bad_defaults
"B504", # ssl_with_no_version
"B505", # weak_cryptographic_key
"B506", # yaml_load
"B507", # ssh_no_host_key_verification
"B601", # paramiko_calls
"B602", # subprocess_popen_with_shell_equals_true
"B604", # any_other_function_with_shell_equals_true
"B605", # start_process_with_a_shell
"B606", # start_process_with_no_shell
"B607", # start_process_with_partial_path
"B608", # hardcoded_sql_expressions
"B609" # linux_commands_wildcard_injection
]
[tool.pylint]
#ignore-paths = [
# "folder/*"
#]
max-line-length=120
[build-system]
requires = ["setuptools", "poetry-core>=1.4.0"]
build-backend = "poetry.core.masonry.api"
# locally can be run with 'poetry run cibuildwheel --platform ...'
[tool.cibuildwheel]
build-frontend = "pip"
build-verbosity = 3
before-test = "python -m pip install --upgrade pip"
test-requires = ["poetry"]
test-command = [
# takes tox & pytest configs from setup.cfg
# change to project dir where pyproject.toml exists
"cd {project}",
'poetry run tox --skip-pkg-install -e py3.11'
]
# Skip CPython 3.6 and CPython 3.7 , Disable building PyPy wheels on all platforms
skip = ["cp36-*", "cp37-*", "pp*", "*musllinux*", "*aarch*", "*ppc*", "*s390*"]
build = ["cp38-*", "cp39-*", "cp310-*", "cp311-*"]
# configure cibuildwheel to build native archs ('auto'), and some emulated ones
# https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation
# https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip
# https://github.com/pypa/cibuildwheel/blob/main/examples/github-with-qemu.yml
[tool.cibuildwheel.windows]
archs = ["AMD64"]
[tool.cibuildwheel.macos]
archs = ["x86_64"]
[tool.cibuildwheel.linux]
# i686 arch needs cryptography to be manually built
# https://github.com/pyca/cryptography/blob/main/docs/installation.rst
archs = ["x86_64"]
# Build using the manylinux2014 image -> AlmaLinux 8 based
manylinux-x86_64-image = "manylinux_2_28"
manylinux-i686-image = "manylinux_2_28"
manylinux-aarch64-image = "manylinux_2_28"
repair-wheel-command = ""
# https://stackoverflow.com/questions/47968578/python3-utf-8-decode-issue
environment = { CRYPTOGRAPHY_DONT_BUILD_RUST="1", PYTHONIOENCODING="utf8" }
# skip musslinux build https://cibuildwheel.readthedocs.io/en/stable/options/#overrides
[[tool.cibuildwheel.overrides]]
select = "*-musllinux*"
skip = ["cp*", "pp*"]