Skip to content

Commit 74853e8

Browse files
authored
Replace versioneer with setuptools_scm. (#83)
1 parent bad590a commit 74853e8

File tree

14 files changed

+89
-2556
lines changed

14 files changed

+89
-2556
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ _generated
1818

1919
build
2020
dist
21+
src/_pytask/_version.py

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ repos:
4040
rev: v2.4.0
4141
hooks:
4242
- id: reorder-python-imports
43+
- repo: https://github.com/asottile/setup-cfg-fmt
44+
rev: v1.17.0
45+
hooks:
46+
- id: setup-cfg-fmt
4347
- repo: https://github.com/psf/black
4448
rev: 20.8b1
4549
hooks:

MANIFEST.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
include CITATION
22
include LICENSE
3-
include versioneer.py
4-
include src/_pytask/_version.py
53

64
exclude *.yaml
75
exclude *.yml

README.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
.. raw:: html
2-
3-
<img src="docs/_static/images/pytask_w_text.png" alt="pytask" width="50%">
1+
.. image:: https://raw.githubusercontent.com/pytask-dev/pytask/main/docs/_static/images/pytask_w_text.png
2+
:target: https://pytask-dev.readthedocs.io/en/latest
3+
:align: center
4+
:width: 50%
5+
:alt: pytask
46

57
------
68

codecov.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,3 @@ coverage:
2525
ignore:
2626
- ".tox/**/*"
2727
- "setup.py"
28-
- "versioneer.py"
29-
- "src/_pytask/_version.py"

docs/changes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ all releases are available on `PyPI <https://pypi.org/project/pytask>`_ and
1414
- :gh:`81` adds a warning if a path is not correctly cased on a case-insensitive file
1515
system. This facilitates cross-platform builds of projects. Deactivate the check by
1616
setting ``check_casing_of_paths = false`` in the configuration file.
17+
- :gh:`83` replaces ``versioneer`` with ``setuptools_scm``.
1718
- :gh:`84` fixes an error in the path normalization introduced by :gh:`81`.
1819
- :gh:`85` sorts collected tasks, dependencies, and products by name.
1920

environment.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ channels:
77
dependencies:
88
- python >=3.7
99
- pip
10+
- setuptools_scm
11+
- toml
1012

1113
# Conda
1214
- anaconda-client

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[build-system]
2+
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.0"]
3+
4+
5+
[tool.setuptools_scm]
6+
write_to = "src/_pytask/_version.py"

setup.cfg

Lines changed: 59 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,59 @@
1-
# See the docstring in versioneer.py for instructions. Note that you must re-run
2-
# 'versioneer.py setup' after changing this section, and commit the resulting files.
3-
4-
[versioneer]
5-
VCS = git
6-
style = pep440
7-
versionfile_source = src/_pytask/_version.py
8-
versionfile_build = _pytask/_version.py
9-
tag_prefix = v
10-
parentdir_prefix = pytask-
1+
[metadata]
2+
name = pytask
3+
description = In its highest aspirations, pytask tries to be pytest as a build system.
4+
long_description = file: README.rst
5+
long_description_content_type = text/x-rst
6+
url = https://pytask-dev.readthedocs.io/en/latest
7+
author = Tobias Raabe
8+
author_email = raabe@posteo.de
9+
license = MIT
10+
license_file = LICENSE
11+
platforms = unix, linux, osx, cygwin, win32
12+
classifiers =
13+
Development Status :: 3 - Alpha
14+
Environment :: Console
15+
Intended Audience :: Science/Research
16+
License :: OSI Approved :: MIT License
17+
Operating System :: MacOS :: MacOS X
18+
Operating System :: Microsoft :: Windows
19+
Operating System :: POSIX
20+
Programming Language :: Python :: 3
21+
Programming Language :: Python :: 3 :: Only
22+
Programming Language :: Python :: 3.6
23+
Programming Language :: Python :: 3.7
24+
Programming Language :: Python :: 3.8
25+
Programming Language :: Python :: 3.9
26+
Topic :: Scientific/Engineering
27+
Topic :: Software Development :: Build Tools
28+
project_urls =
29+
Changelog = https://pytask-dev.readthedocs.io/en/latest/changes.html
30+
Documentation = https://pytask-dev.readthedocs.io/en/latest
31+
Github = https://github.com/pytask-dev/pytask
32+
Tracker = https://github.com/pytask-dev/pytask/issues
33+
34+
[options]
35+
packages = find:
36+
install_requires =
37+
attrs>=17.4.0
38+
click
39+
click-default-group
40+
networkx
41+
pluggy
42+
pony>=0.7.13
43+
rich
44+
python_requires = >=3.6.1
45+
include_package_data = True
46+
package_dir =
47+
=src
48+
zip_safe = False
49+
50+
[options.packages.find]
51+
where = src
52+
53+
[options.entry_points]
54+
console_scripts =
55+
pytask=_pytask.cli:cli
56+
57+
[check-manifest]
58+
ignore =
59+
src/_pytask/_version.py

setup.py

Lines changed: 2 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,4 @@
1-
"""The setup.py for pytask."""
2-
from pathlib import Path
3-
4-
from setuptools import find_packages
51
from setuptools import setup
62

7-
import versioneer
8-
9-
10-
DESCRIPTION = "In its highest aspirations, pytask tries to be pytest as a build system."
11-
12-
# Remove the image from the README.rst since the raw directive is not allowed.
13-
README = "\n".join(Path("README.rst").read_text().split("\n")[5:])
14-
15-
PROJECT_URLS = {
16-
"Documentation": "https://pytask-dev.readthedocs.io/en/latest",
17-
"Github": "https://github.com/pytask-dev/pytask",
18-
"Tracker": "https://github.com/pytask-dev/pytask/issues",
19-
"Changelog": "https://pytask-dev.readthedocs.io/en/latest/changes.html",
20-
}
21-
22-
23-
setup(
24-
name="pytask",
25-
version=versioneer.get_version(),
26-
cmdclass=versioneer.get_cmdclass(),
27-
description=DESCRIPTION,
28-
long_description=README,
29-
long_description_content_type="text/x-rst",
30-
author="Tobias Raabe",
31-
author_email="raabe@posteo.de",
32-
url=PROJECT_URLS["Github"],
33-
project_urls=PROJECT_URLS,
34-
license="MIT",
35-
classifiers=[
36-
"Development Status :: 3 - Alpha",
37-
"Environment :: Console",
38-
"Intended Audience :: Science/Research",
39-
"License :: OSI Approved :: MIT License",
40-
"Operating System :: MacOS :: MacOS X",
41-
"Operating System :: Microsoft :: Windows",
42-
"Operating System :: POSIX",
43-
"Programming Language :: Python :: 3.6",
44-
"Programming Language :: Python :: 3.7",
45-
"Programming Language :: Python :: 3.8",
46-
"Programming Language :: Python :: 3.9",
47-
"Topic :: Scientific/Engineering",
48-
"Topic :: Software Development :: Build Tools",
49-
],
50-
install_requires=[
51-
"attrs >= 17.4.0",
52-
"click",
53-
"click-default-group",
54-
"networkx",
55-
"pluggy",
56-
"pony >= 0.7.13",
57-
"rich",
58-
],
59-
python_requires=">=3.6.1",
60-
entry_points={"console_scripts": ["pytask=_pytask.cli:cli"]},
61-
packages=find_packages(where="src"),
62-
package_dir={"": "src"},
63-
platforms="any",
64-
include_package_data=True,
65-
zip_safe=False,
66-
)
3+
if __name__ == "__main__":
4+
setup()

0 commit comments

Comments
 (0)