-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
165 lines (140 loc) · 3.74 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
156
157
158
159
160
161
162
163
164
165
# Packaging
# ---------
[build-system]
requires = ["maturin>=1.7,<2.0"]
build-backend = "maturin"
# Project
# -------
[project]
name = "rustfluent"
requires-python = ">=3.11"
classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Rust",
]
# Do not manually edit the version, use `make version_{type}` instead.
# This should match the version in the [tool.bumpversion] section.
version = "0.1.0a7"
dependencies = []
[project.urls]
# See https://daniel.feldroy.com/posts/2023-08-pypi-project-urls-cheatsheet for
# additional URLs that can be included here.
repository = "https://github.com/kraken-tech/python-rustfluent/"
changelog = "https://github.com/kraken-tech/python-rustfluent/blob/main/CHANGELOG.md"
[project.optional-dependencies]
dev = [
# Testing
"pytest",
"nox", # Install in virtualenv so Mypy has access to the package types.
# Linting
"ruff",
"mypy",
# Versioning
"bump-my-version",
# Workflow
"pip", # Without this, `maturin develop` won't work.
"pre-commit",
"maturin",
]
[tool.maturin]
features = ["pyo3/extension-module"]
# Ruff
# ----
[tool.ruff]
line-length = 99
[tool.ruff.lint]
select = [
# pycodestyle
"E",
# pyflakes
"F",
# isort
"I",
]
ignore = [
# Ruff's formatter will try to respect the `line-length` setting
# but doesn't guarantee it - so we ignore the possible line length
# errors that the checker might raise.
"E501",
]
[tool.ruff.lint.per-file-ignores]
# Allow unused imports in `__init__.py` files as these are convenience imports.
"**/__init__.py" = [ "F401" ]
[tool.ruff.lint.isort]
lines-after-imports = 2
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"project",
"local-folder",
]
[tool.ruff.lint.isort.sections]
"project" = [
"rustfluent",
"tests",
]
# Mypy
# ----
[tool.mypy]
files = "."
exclude = "build/"
# The "$MYPY_CONFIG_FILE_DIR" path allows Mypy to find the
# "tests" package and noxfile.py.
explicit_package_bases = true
mypy_path = [
"$MYPY_CONFIG_FILE_DIR/src",
"$MYPY_CONFIG_FILE_DIR",
]
# Use strict defaults
strict = true
warn_unreachable = true
warn_no_return = true
[[tool.mypy.overrides]]
# Don't require test functions to include types
module = "tests.*"
allow_untyped_defs = true
disable_error_code = "attr-defined"
# Pytest
# ------
[tool.pytest.ini_options]
# Ensure error warnings are converted into test errors.
filterwarnings = "error"
# Bump My Version
# ---------------
[tool.bumpversion]
# Do not manually edit the version, use `make version_{type}` instead.
# This should match the version in the [project] section.
current_version = "0.1.0a7"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
replace = "{new_version}"
regex = false
ignore_missing_version = false
tag = false
sign_tags = false
tag_name = "v{new_version}"
tag_message = "Bump version: {current_version} → {new_version}"
allow_dirty = false
commit = true
message = "Bump version: {current_version} → {new_version}"
commit_args = ""
# Relabel the Unreleased section of the changelog and add a new unreleased section
# as a reminder to add to it.
[[tool.bumpversion.files]]
filename = "CHANGELOG.md"
search = "## [Unreleased]"
replace = "## [Unreleased]\n\n## [{new_version}] - {now:%Y-%m-%d}"
# Update the project version.
[[tool.bumpversion.files]]
filename = "pyproject.toml"
regex = true
search = "^version = \"{current_version}\""
replace = "version = \"{new_version}\""