-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpyproject.toml
155 lines (133 loc) · 4.13 KB
/
pyproject.toml
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
[build-system]
requires = ["maturin>=1,<2"]
build-backend = "maturin"
[project]
name = "python-template-rust"
authors = [{name = "Python Project Template Authors", email = "3105306+timkpaine@users.noreply.github.com"}]
description = "A Rust-Python project template"
readme = "README.md"
license = { text = "Apache-2.0" }
version = "0.1.0"
requires-python = ">=3.9"
keywords = []
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Rust",
"Programming Language :: Python",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = []
[project.optional-dependencies]
develop = [
"build",
"bump-my-version",
"check-manifest",
"cibuildwheel",
"maturin>=1,<2",
"pytest",
"pytest-cov",
"ruff",
"twine",
"wheel",
]
[project.scripts]
[project.urls]
Repository = "https://github.com/python-project-templates/python-template-rust"
Homepage = "https://github.com/python-project-templates/python-template-rust"
[tool.bumpversion]
current_version = "0.1.0"
commit = true
tag = true
[[tool.bumpversion.files]]
filename = "python_template_rust/__init__.py"
search = '__version__ = "{current_version}"'
replace = '__version__ = "{new_version}"'
[[tool.bumpversion.files]]
filename = "pyproject.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'
[[tool.bumpversion.files]]
filename = "Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'
[[tool.bumpversion.files]]
filename = "rust/Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'
[tool.check-manifest]
ignore = [
".copier-answers.yml",
"Makefile",
"docs/**/*",
"rust/.config/*",
"rust/Cargo.lock",
"rust/README.md",
]
[tool.cibuildwheel]
before-build = "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=minimal -y"
build = "cp39-*"
skip = "*musllinux*"
test-command = "pytest -vvv {project}/python_template_rust/tests"
test-requires = ["pytest", "pytest-cov", "pytest-sugar", "pytest-xdist"]
[tool.cibuildwheel.linux]
before-build = """
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=minimal -y
rustup target add aarch64-unknown-linux-gnu
rustup target add x86_64-unknown-linux-gnu
rustup show
"""
environment = {PATH="$HOME/.cargo/bin:$PATH", CARGO_TERM_COLOR="always"}
archs = "x86_64 aarch64"
[tool.cibuildwheel.macos]
before-build = """
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=minimal -y
rustup target add aarch64-apple-darwin
rustup target add x86_64-apple-darwin
rustup show
"""
environment = {PATH="$HOME/.cargo/bin:$PATH", CARGO_TERM_COLOR="always", MACOS_DEPLOYMENT_TARGET=11.0}
archs = "x86_64 arm64"
[tool.cibuildwheel.windows]
before-build = """
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=minimal -y
rustup target add x86_64-pc-windows-msvc
rustup target add aarch64-pc-windows-msvc
rustup show
"""
environment = {PATH="$UserProfile\\.cargo\bin;$PATH", CARGO_TERM_COLOR="always"}
archs = "AMD64 ARM64"
[tool.coverage.run]
branch = true
omit = [
"python_template_rust/tests/integration/",
]
[tool.coverage.report]
exclude_also = [
"raise NotImplementedError",
"if __name__ == .__main__.:",
"@(abc\\.)?abstractmethod",
]
ignore_errors = true
fail_under = 50
[tool.pytest.ini_options]
addopts = ["-vvv", "--junitxml=junit.xml"]
asyncio_mode = "strict"
testpaths = "python_template_rust/tests"
[tool.ruff]
line-length = 150
[tool.ruff.lint]
extend-select = ["I"]
[tool.ruff.lint.isort]
combine-as-imports = true
default-section = "third-party"
known-first-party = ["python_template_rust"]
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]