-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
288 lines (263 loc) · 9.04 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
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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
[build-system]
requires = ["hatchling>=1.5.0"]
build-backend = "hatchling.build"
[project]
name = "gitlab_activity"
description = "Grab recent issue/PR activity from a GitLab repository and render it as markdown."
license = { file = "LICENSE" }
authors = [
{ name = "Mahendra Paipuri", email = "[email protected]" },
]
readme = "README.md"
requires-python = ">=3.8"
classifiers = [
"License :: OSI Approved :: BSD License",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Software Development :: Version Control :: Git",
"Topic :: Software Development :: Build Tools",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
dependencies = [
"click",
"toml",
"markdown",
"importlib_resources",
"numpy",
"pandas",
"python-dateutil ; python_version < '3.12'",
# NOTE: https://github.com/dateutil/dateutil/issues/1314
# Until they make a new release for Python 3.12 we dont support 3.12
# "python-dateutil @ git+https://github.com/dateutil/dateutil ; python_version == '3.12'",
"requests",
"tqdm",
"jsonschema"
]
dynamic = ["version"]
[project.urls]
Homepage = "https://mahendrapaipuri.gitlab.io/gitlab-activity/"
"Source Code" = "https://gitlab.com/mahendrapaipuri/gitlab-activity"
[project.optional-dependencies]
# Test related dependencies
test = [
"pytest",
"pytest-regressions"
]
# Coverage requirements
test-cov = [
"gitlab_activity[test]",
"pytest-cov>=2.6.1",
]
dev = [
"gitlab_activity[test-cov]",
"pre-commit",
]
[project.scripts]
"gitlab-activity" = "gitlab_activity.cli:main"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.version]
# Read version string from _version.py and use it for the package
path = "gitlab_activity/_version.py"
# Hatch environment that will be used to test different versions of Python
[tool.hatch.envs.test]
type = "virtual"
matrix-name-format = "Testing with Python {value}"
# Use Python distributions shipped from hatch
python-sources = ["internal"]
# Install optional dependencies group dev which will install all
# development related dependencies
features = [
"dev",
]
[tool.hatch.envs.test.scripts]
test = "pytest"
check = "python --version"
[[tool.hatch.envs.test.matrix]]
python = [
"3.8",
"3.9",
"3.10",
"3.11",
]
[tool.hatch.envs.docs]
type = "virtual"
dependencies = [
"importlib",
"sphinx",
]
[tool.hatch.envs.docs.scripts]
build = "cd docs/website && npm install && npm run build"
serve = "cd docs/website && npm run serve"
start = "cd docs/website && npm install && npm run start"
[tool.hatch.envs.publish]
type = "virtual"
skip-install = true
dependencies = [
"pypiserver",
"setuptools",
"twine",
"build",
]
[tool.hatch.envs.publish.scripts]
build-package = "python -m build --outdir dist ."
check-package = "twine check dist/*"
start-localpypi = [
"mkdir -p test_registry",
"pypi-server run -p 8081 -P . -a . -o -v test_registry",
]
upload-to-localpypi = "twine upload --repository-url=http://localhost:8081 --user=foo --password=bar dist/*"
upload-to-testpypi = "twine upload --repository=testpypi --user={env:TWINE_USERNAME} --password={env:TWINE_PASSWORD} dist/*"
upload-to-pypi = "twine upload --user={env:TWINE_USERNAME} --password={env:TWINE_PASSWORD} dist/*"
[tool.check-wheel-contents]
ignore = ["W002"] # Triggers on __init__.py's
# ruff config
[tool.ruff]
line-length = 88
select = [
"E", "F", "W", # flake8
"B", # flake8-bugbear
"ARG", # flake8-unused-arguments
"C4", # flake8-comprehensions
"EM", # flake8-errmsg
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RUF", # Ruff-specific
"SIM", # flake8-simplify
"TID251", # flake8-tidy-imports.banned-api
"T20", # flake8-print
"UP", # pyupgrade
"YTT", # flake8-2020
"ANN204", # Add -> None to __init__
"S307", # eval -> literal_eval
"TCH", # flake8-type-checking
"PERF", # perflint
"FLY", # flynt
"TRY", # tryceratops
]
exclude = [
"tests/*",
]
# Seems like W503 is not implemented in ruff
# ref: https://github.com/astral-sh/ruff/issues/4125
ignore = [
"E203", "E231",
"TRY003", # Avoid specifying long messages outside the exception class
"PLR0912", # Too-many-arguments
"PLR0913", # Too many branches
"PLR0915", # Too many statements
]
[tool.isort]
profile = "black"
[tool.black]
line-length = 88
skip-string-normalization = true
target-version = [
'py38',
'py39',
'py310',
'py311',
]
[tool.pytest.ini_options]
addopts = [
"--verbose",
"--color=yes",
"--cov-report=xml",
"--cov-report=term",
"--cov-report=html",
"--cov=gitlab_activity",
"--cov-branch",
]
python_files = "test_*.py"
markers = [
"group: mark as a test for groups",
"services: mark as a services test",
"user: mark as a test for a user",
"slow: mark a test as slow",
]
filterwarnings = [
"error",
"ignore:Config variable '.*' is unset, Python ABI tag may be incorrect:RuntimeWarning",
"default:pkg_resources is deprecated as an API:DeprecationWarning:wheel", # Caused by wheel<0.41 in tests
"default:onerror argument is deprecated, use onexc instead:DeprecationWarning:wheel", # Caused by wheel<0.41 & Python 3.12
"default:The distutils package is deprecated and slated for removal:DeprecationWarning", # Caused by setuptools sometimes
"default:The distutils.sysconfig module is deprecated, use sysconfig instead:DeprecationWarning", # Caused by setuptools sometimes
"default:check_home argument is deprecated and ignored.:DeprecationWarning", # Caused by setuptools sometimes
]
[tool.coverage.run]
omit = [
"tests/*",
]
parallel = true
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = [
"if self.debug:",
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain if tests don't hit defensive assertion code:
"raise NotImplementedError",
"except ImportError",
]
ignore_errors = true
omit = [
"tests/*",
"gitlab_activity/_version.py",
]
[tool.coverage.xml]
output = "coverage.xml"
[tool.gitlab-activity.options]
# Changelog file path
output = "CHANGELOG.md"
# Only query for merge requests
activity = ["merge_requests"]
# Append to existing file
append = true
# Add list of contributors to each entry
include_contributors_list = true
# Use heading level of 2 to account for top level heading
heading_level = 2
[tool.gitlab-activity.activity]
# List of bot_users
bot_users = [
"(.*)codecov(.*)",
"gitlab-bot",
"ghost1",
]
[tool.gitlab-activity.activity.categories]
# Labels used in issues
# Dicts must be inline for linters not to complain
issues = [
{ labels = [ "feature", "feat", "new" ], pre = [ "NEW", "FEAT", "FEATURE" ], description = "New features added" },
{ labels = [ "enhancement", "enhancements" ], pre = [ "ENH", "ENHANCEMENT", "IMPROVE", "IMP" ], description = "Enhancements made" },
{ labels = [ "bug", "bugfix", "bugs" ], pre = [ "FIX", "BUG" ], description = "Bugs fixed" },
{ labels = [ "packaging", "build" ], pre = [ "BUILD", ], description = "Build changes" },
{ labels = [ "ci" ], pre = [ "CI", ], description = "CI changes" },
{ labels = [ "maintenance", "maint" ], pre = [ "MAINT", "MNT" ], description = "Maintenance and upkeep improvements" },
{ labels = [ "documentation", "docs", "doc" ], pre = [ "DOC", "DOCS" ], description = "Documentation improvements" },
{ labels = [ "deprecation", "deprecate" ], pre = [ "DEPRECATE", "DEPRECATION", "DEP" ], description = "Deprecated features" },
]
# Labels used in MRs
# Dicts must be inline for linters not to complain
merge_requests = [
{ labels = [ "feature", "feat", "new" ], pre = [ "NEW", "FEAT", "FEATURE" ], description = "New features added" },
{ labels = [ "enhancement", "enhancements" ], pre = [ "ENH", "ENHANCEMENT", "IMPROVE", "IMP" ], description = "Enhancements made" },
{ labels = [ "bug", "bugfix", "bugs" ], pre = [ "FIX", "BUG" ], description = "Bugs fixed" },
{ labels = [ "packaging", "build" ], pre = [ "BUILD", ], description = "Build changes" },
{ labels = [ "ci" ], pre = [ "CI", ], description = "CI changes" },
{ labels = [ "maintenance", "maint" ], pre = [ "MAINT", "MNT" ], description = "Maintenance and upkeep improvements" },
{ labels = [ "documentation", "docs", "doc" ], pre = [ "DOC", "DOCS" ], description = "Documentation improvements" },
{ labels = [ "deprecation", "deprecate" ], pre = [ "DEPRECATE", "DEPRECATION", "DEP" ], description = "Deprecated features" },
]