Skip to content

Commit dbc4ec4

Browse files
committed
Modernize a bit project packaging metadata.
1 parent a63402f commit dbc4ec4

File tree

9 files changed

+116
-144
lines changed

9 files changed

+116
-144
lines changed

.bumpversion.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ current_version = 3.8.0
33
commit = True
44
tag = True
55

6-
[bumpversion:file:setup.py]
7-
search = 'fallback_version': '{current_version}'
8-
replace = 'fallback_version': '{new_version}'
6+
[bumpversion:file:pyproject.toml]
7+
search = fallback_version = "{current_version}"
8+
replace = fallback_version = "{new_version}"
99

1010
[bumpversion:file (badge):README.rst]
1111
search = /v{current_version}.svg

.cookiecutterrc

Lines changed: 44 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,47 @@
1-
# This file exists so you can easily regenerate your project.
2-
#
3-
# `cookiepatcher` is a convenient shim around `cookiecutter`
4-
# for regenerating projects (it will generate a .cookiecutterrc
5-
# automatically for any template). To use it:
6-
#
7-
# pip install cookiepatcher
8-
# cookiepatcher gh:ionelmc/cookiecutter-pylibrary python-hunter
9-
#
10-
# See:
11-
# https://pypi.org/project/cookiepatcher
12-
#
13-
# Alternatively, you can run:
14-
#
15-
# cookiecutter --overwrite-if-exists --config-file=python-hunter/.cookiecutterrc gh:ionelmc/cookiecutter-pylibrary
1+
# Generated by cookiepatcher, a small shim around cookiecutter (pip install cookiepatcher)
162

173
default_context:
18-
c_extension_optional: "yes"
19-
c_extension_support: "cython"
20-
codacy: "no"
21-
codacy_projectid: "-"
22-
codeclimate: "no"
23-
codecov: "yes"
24-
command_line_interface: "argparse"
25-
command_line_interface_bin_name: "hunter-trace"
26-
coveralls: "no"
27-
distribution_name: "hunter"
28-
29-
formatter_quote_style: "single"
30-
full_name: "Ionel Cristian Mărieș"
31-
function_name: "compute"
32-
github_actions: "yes"
33-
github_actions_osx: "yes"
34-
github_actions_windows: "yes"
35-
license: "BSD 2-Clause License"
36-
module_name: "core"
37-
package_name: "hunter"
38-
pre_commit: "yes"
39-
project_name: "Hunter"
40-
project_short_description: "Hunter is a flexible code tracing toolkit, not for measuring coverage, but for debugging, logging, inspection and other nefarious purposes. It has a simple Python API and a convenient terminal API (see `Environment variable activation <env-var-activation_>`_)."
41-
pypi_badge: "yes"
42-
pypi_disable_upload: "no"
43-
release_date: "2024-05-02"
44-
repo_hosting: "github.com"
45-
repo_hosting_domain: "github.com"
46-
repo_main_branch: "master"
47-
repo_name: "python-hunter"
48-
repo_username: "ionelmc"
49-
scrutinizer: "no"
50-
setup_py_uses_setuptools_scm: "yes"
51-
sphinx_docs: "yes"
52-
sphinx_docs_hosting: "https://python-hunter.readthedocs.io/"
53-
sphinx_doctest: "no"
54-
sphinx_theme: "furo"
55-
test_matrix_separate_coverage: "yes"
56-
tests_inside_package: "no"
4+
c_extension_optional: 'yes'
5+
c_extension_support: cython
6+
codacy: 'no'
7+
codacy_projectid: '-'
8+
codeclimate: 'no'
9+
codecov: 'yes'
10+
command_line_interface: argparse
11+
command_line_interface_bin_name: hunter-trace
12+
coveralls: 'no'
13+
distribution_name: hunter
14+
15+
formatter_quote_style: single
16+
full_name: Ionel Cristian Mărieș
17+
function_name: compute
18+
github_actions: 'yes'
19+
github_actions_osx: 'yes'
20+
github_actions_windows: 'yes'
21+
license: BSD 2-Clause License
22+
module_name: core
23+
package_name: hunter
24+
pre_commit: 'yes'
25+
project_name: Hunter
26+
project_short_description: Hunter is a flexible code tracing toolkit, not for measuring coverage, but for debugging, logging, inspection and other nefarious purposes. It has a simple Python API and a convenient terminal API (see `Environment variable activation <env-var-activation_>`_).
27+
pypi_badge: 'yes'
28+
pypi_disable_upload: 'no'
29+
release_date: '2024-05-02'
30+
repo_hosting: github.com
31+
repo_hosting_domain: github.com
32+
repo_main_branch: master
33+
repo_name: python-hunter
34+
repo_username: ionelmc
35+
scrutinizer: 'no'
36+
setup_py_uses_setuptools_scm: 'yes'
37+
sphinx_docs: 'yes'
38+
sphinx_docs_hosting: https://python-hunter.readthedocs.io/
39+
sphinx_doctest: 'no'
40+
sphinx_theme: furo
41+
test_matrix_separate_coverage: 'yes'
42+
tests_inside_package: 'no'
5743
version: 3.8.0
58-
version_manager: "bump2version"
59-
website: "https://blog.ionelmc.ro"
60-
year_from: "2015"
61-
year_to: "2025"
44+
version_manager: bump2version
45+
website: https://blog.ionelmc.ro
46+
year_from: '2015'
47+
year_to: '2025'

.github/workflows/github-actions.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ jobs:
1111
include:
1212
- name: 'check'
1313
python: '3.13'
14-
toxpython: 'python3.13'
1514
tox_env: 'check'
1615
os: 'ubuntu-latest'
1716
- name: 'docs'
1817
python: '3.13'
19-
toxpython: 'python3.13'
2018
tox_env: 'docs'
2119
os: 'ubuntu-latest'
2220
- name: 'py39-pure-cover (ubuntu/x86_64)'

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ exclude: '^(.tox/|ci/templates/|src/hunter.(pth|embed)$|src/hunter/vendor/|.bump
66
# Note the order is intentional to avoid multiple passes of the hooks
77
repos:
88
- repo: https://github.com/astral-sh/ruff-pre-commit
9-
rev: v0.12.2
9+
rev: v0.12.3
1010
hooks:
1111
- id: ruff
1212
args: [--fix, --exit-non-zero-on-fix, --show-fixes]

ci/requirements.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
virtualenv>=20.4.7
2-
pip>=19.1.1
3-
setuptools>=18.0.1
4-
tox
1+
pip>=24.2
2+
setuptools>=69
3+
tox>=4

ci/templates/.github/workflows/github-actions.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ jobs:
1111
include:
1212
- name: 'check'
1313
python: '3.13'
14-
toxpython: 'python3.13'
1514
tox_env: 'check'
1615
os: 'ubuntu-latest'
1716
- name: 'docs'
1817
python: '3.13'
19-
toxpython: 'python3.13'
2018
tox_env: 'docs'
2119
os: 'ubuntu-latest'
2220
{% for env in tox_environments %}

pyproject.toml

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,72 @@
11
[build-system]
22
requires = [
3-
"setuptools>=64.0.0",
4-
"wheel",
5-
"setuptools_scm>=3.3.1,!=4.0.0",
3+
"setuptools>=69",
4+
"setuptools_scm>=8",
65
]
76
build-backend = "setuptools.build_meta"
87

8+
[project]
9+
dynamic = [
10+
"readme",
11+
"version",
12+
]
13+
name = "hunter"
14+
license = "BSD-2-Clause"
15+
license-files = ["LICENSE"]
16+
description = "Hunter is a flexible code tracing toolkit."
17+
authors = [
18+
{ name = "Ionel Cristian Mărieș", email = "[email protected]" },
19+
]
20+
classifiers = [
21+
# complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers
22+
"Development Status :: 5 - Production/Stable",
23+
"Intended Audience :: Developers",
24+
"Operating System :: Unix",
25+
"Operating System :: POSIX",
26+
"Operating System :: Microsoft :: Windows",
27+
"Programming Language :: Python",
28+
"Programming Language :: Python :: 3",
29+
"Programming Language :: Python :: 3 :: Only",
30+
"Programming Language :: Python :: 3.9",
31+
"Programming Language :: Python :: 3.10",
32+
"Programming Language :: Python :: 3.11",
33+
"Programming Language :: Python :: 3.12",
34+
"Programming Language :: Python :: 3.13",
35+
"Programming Language :: Python :: Implementation :: CPython",
36+
"Programming Language :: Python :: Implementation :: PyPy",
37+
"Topic :: Utilities",
38+
"Topic :: Software Development :: Debuggers"
39+
]
40+
keywords = [
41+
"trace",
42+
"tracer",
43+
"settrace",
44+
"debugger",
45+
"debugging",
46+
"code",
47+
"source",
48+
]
49+
requires-python = ">=3.9"
50+
dependencies = [
51+
"manhole>=1.5; platform_system!='Windows'",
52+
]
53+
54+
[project.optional-dependencies]
55+
# rst = ["docutils>=0.11"]
56+
57+
[project.scripts]
58+
hunter-trace = "hunter.remote:main"
59+
60+
[project.urls]
61+
"Sources" = "https://github.com/ionelmc/python-hunter"
62+
"Documentation" = "https://python-hunter.readthedocs.io/"
63+
"Changelog" = "https://python-hunter.readthedocs.io/en/latest/changelog.html"
64+
"Issue Tracker" = "https://github.com/ionelmc/python-hunter/issues"
65+
966
[tool.setuptools_scm]
67+
local_scheme = "dirty-tag"
68+
write_to = "src/hunter/_version.py"
69+
fallback_version = "3.8.0"
1070

1171
[tool.ruff]
1272
extend-exclude = ["static", "ci/templates"]

setup.py

Lines changed: 1 addition & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
CFLAGS = os.environ['CFLAGS'] = '-DCYTHON_TRACE=1 -DCYTHON_USE_SYS_MONITORING=0'
3131
LFLAGS = os.environ['LFLAGS'] = ''
3232
else:
33-
CFLAGS = '-DCYTHON_USE_SYS_MONITORING=0'
33+
CFLAGS = ''
3434
LFLAGS = ''
3535

3636
allow_extensions = True
@@ -117,81 +117,16 @@ def read(*names, **kwargs):
117117

118118

119119
setup(
120-
name='hunter',
121-
use_scm_version={
122-
'local_scheme': 'dirty-tag',
123-
'write_to': 'src/hunter/_version.py',
124-
'fallback_version': '3.8.0',
125-
},
126-
license='BSD-2-Clause',
127-
description='Hunter is a flexible code tracing toolkit.',
128120
long_description='{}\n{}'.format(
129121
re.compile('^.. start-badges.*^.. end-badges', re.M | re.S).sub('', read('README.rst')),
130122
re.sub(':[a-z]+:`~?(.*?)`', r'``\1``', read('CHANGELOG.rst')),
131123
),
132124
long_description_content_type='text/x-rst',
133-
author='Ionel Cristian Mărieș',
134-
author_email='[email protected]',
135-
url='https://github.com/ionelmc/python-hunter',
136125
packages=find_namespace_packages('src'),
137126
package_dir={'': 'src'},
138127
py_modules=[path.stem for path in Path('src').glob('*.py')],
139128
include_package_data=True,
140129
zip_safe=False,
141-
classifiers=[
142-
# complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers
143-
'Development Status :: 5 - Production/Stable',
144-
'Intended Audience :: Developers',
145-
'Operating System :: Unix',
146-
'Operating System :: POSIX',
147-
'Operating System :: Microsoft :: Windows',
148-
'Programming Language :: Python',
149-
'Programming Language :: Python :: 3',
150-
'Programming Language :: Python :: 3 :: Only',
151-
'Programming Language :: Python :: 3.9',
152-
'Programming Language :: Python :: 3.10',
153-
'Programming Language :: Python :: 3.11',
154-
'Programming Language :: Python :: 3.12',
155-
'Programming Language :: Python :: 3.13',
156-
'Programming Language :: Python :: Implementation :: CPython',
157-
'Programming Language :: Python :: Implementation :: PyPy',
158-
'Topic :: Utilities',
159-
'Topic :: Software Development :: Debuggers',
160-
],
161-
project_urls={
162-
'Documentation': 'https://python-hunter.readthedocs.io/',
163-
'Changelog': 'https://python-hunter.readthedocs.io/en/latest/changelog.html',
164-
'Issue Tracker': 'https://github.com/ionelmc/python-hunter/issues',
165-
},
166-
keywords=[
167-
'trace',
168-
'tracer',
169-
'settrace',
170-
'debugger',
171-
'debugging',
172-
'code',
173-
'source',
174-
],
175-
python_requires='>=3.9',
176-
install_requires=[],
177-
extras_require={
178-
':platform_system != "Windows"': ['manhole >= 1.5'],
179-
},
180-
setup_requires=(
181-
[
182-
'setuptools_scm>=3.3.1,!=4.0.0',
183-
'cython',
184-
]
185-
if Cython
186-
else [
187-
'setuptools_scm>=3.3.1,!=4.0.0',
188-
]
189-
),
190-
entry_points={
191-
'console_scripts': [
192-
'hunter-trace = hunter.remote:main',
193-
]
194-
},
195130
cmdclass={
196131
'build': BuildWithPTH,
197132
'easy_install': EasyInstallWithPTH,

tox.ini

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ commands =
5252
{py38,py39,py310,py311,py312,py313,py313t}: python tests/setup.py build_ext --force --inplace
5353
cover: python setup.py clean --all build_ext --force --inplace
5454
nocov: {posargs:pytest -vv --ignore=src}
55-
cover: {posargs:pytest --cov --cov-report=term-missing -vv}
55+
cover: {posargs:pytest --cov --cov-report=term-missing --cov-report=xml -vv}
5656

5757
[testenv:check]
5858
deps =
@@ -68,7 +68,6 @@ commands =
6868
pre-commit run --all-files --show-diff-on-failure
6969

7070
[testenv:cythonize]
71-
basepython = {env:TOXPYTHON:python3.13}
7271
pip_pre = true
7372
deps =
7473
cython
@@ -78,7 +77,6 @@ commands =
7877
{posargs:python setup.py clean --all build_ext --force}
7978

8079
[testenv:docs]
81-
basepython = {env:TOXPYTHON:python3.13}
8280
usedevelop = true
8381
deps =
8482
-r{toxinidir}/docs/requirements.txt
@@ -87,7 +85,6 @@ commands =
8785
sphinx-build -b linkcheck docs dist/docs
8886

8987
[testenv:report]
90-
basepython = {env:TOXPYTHON:python3.13}
9188
deps =
9289
coverage
9390
cython
@@ -99,7 +96,6 @@ commands =
9996
coverage html
10097

10198
[testenv:clean]
102-
basepython = {env:TOXPYTHON:python3.13}
10399
commands =
104100
python setup.py clean
105101
coverage erase

0 commit comments

Comments
 (0)