Skip to content

Commit 387d76a

Browse files
authored
Replace versioneer with setuptools-scm. (#16)
1 parent 3f28d72 commit 387d76a

File tree

11 files changed

+75
-2530
lines changed

11 files changed

+75
-2530
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ __pycache__
1313
*.egg-info
1414

1515
.pytask.sqlite3
16+
17+
build
18+
dist
19+
src/pytask_r/_version.py

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ repos:
3030
rev: v2.5.0
3131
hooks:
3232
- id: reorder-python-imports
33+
- repo: https://github.com/asottile/setup-cfg-fmt
34+
rev: v1.17.0
35+
hooks:
36+
- id: setup-cfg-fmt
3337
- repo: https://github.com/psf/black
3438
rev: 21.6b0
3539
hooks:

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ all releases are available on `PyPI <https://pypi.org/project/pytask-r>`_ and
1111
-------------------
1212

1313
- :gh:`15` fixes the tests related to changes in pytask.
14+
- :gh:`16` replaces versioneer with setuptools-scm.
1415

1516

1617
0.0.9 - 2021-03-05

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
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_r/_version.py"

setup.cfg

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,47 @@
1-
[versioneer]
2-
VCS = git
3-
style = pep440
4-
versionfile_source = src/pytask_r/_version.py
5-
versionfile_build = pytask_r/_version.py
6-
tag_prefix = v
7-
parentdir_prefix = pytask-r-
1+
[metadata]
2+
name = pytask_r
3+
description = Run R scripts with pytask.
4+
long_description = file: README.rst
5+
long_description_content_type = text/x-rst
6+
author = Tobias Raabe
7+
author_email = raabe@posteo.de
8+
license = MIT
9+
license_file = LICENSE
10+
platforms = any
11+
classifiers =
12+
Development Status :: 3 - Alpha
13+
License :: OSI Approved :: MIT License
14+
Operating System :: OS Independent
15+
Programming Language :: Python :: 3
16+
Programming Language :: Python :: 3 :: Only
17+
Programming Language :: Python :: 3.6
18+
Programming Language :: Python :: 3.7
19+
Programming Language :: Python :: 3.8
20+
Programming Language :: Python :: 3.9
21+
Programming Language :: R
22+
project_urls =
23+
Changelog = https://github.com/pytask-dev/pytask-r/blob/main/CHANGES.rst
24+
Documentation = https://github.com/pytask-dev/pytask-r
25+
Github = https://github.com/pytask-dev/pytask-r
26+
Tracker = https://github.com/pytask-dev/pytask-r/issues
27+
28+
[options]
29+
packages = find:
30+
install_requires =
31+
click
32+
pytask>=0.0.9
33+
python_requires = >=3.6
34+
include_package_data = True
35+
package_dir = =src
36+
zip_safe = False
37+
38+
[options.packages.find]
39+
where = src
40+
41+
[options.entry_points]
42+
pytask =
43+
pytask_r = pytask_r.plugin
44+
45+
[check-manifest]
46+
ignore =
47+
src/pytask_r/_version.py

setup.py

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,5 @@
1-
from pathlib import Path
2-
3-
from setuptools import find_packages
41
from setuptools import setup
52

6-
import versioneer
7-
8-
9-
README = Path("README.rst").read_text()
10-
11-
PROJECT_URLS = {
12-
"Documentation": "https://github.com/pytask-dev/pytask-r",
13-
"Github": "https://github.com/pytask-dev/pytask-r",
14-
"Tracker": "https://github.com/pytask-dev/pytask-r/issues",
15-
"Changelog": "https://github.com/pytask-dev/pytask-r/blob/main/CHANGES.rst",
16-
}
17-
183

19-
setup(
20-
name="pytask-r",
21-
version=versioneer.get_version(),
22-
cmdclass=versioneer.get_cmdclass(),
23-
description="Run R scripts with pytask.",
24-
long_description=README,
25-
long_description_content_type="text/x-rst",
26-
author="Tobias Raabe",
27-
author_email="raabe@posteo.de",
28-
url=PROJECT_URLS["Github"],
29-
project_urls=PROJECT_URLS,
30-
python_requires=">=3.6",
31-
license="MIT",
32-
classifiers=[
33-
"Development Status :: 3 - Alpha",
34-
"Operating System :: OS Independent",
35-
"Programming Language :: Python :: 3",
36-
"Programming Language :: Python :: 3 :: Only",
37-
"Programming Language :: Python :: 3.6",
38-
"Programming Language :: Python :: 3.7",
39-
"Programming Language :: Python :: 3.8",
40-
"Programming Language :: Python :: 3.9",
41-
"Programming Language :: R",
42-
],
43-
install_requires=["click", "pytask >= 0.0.9"],
44-
platforms="any",
45-
packages=find_packages(where="src"),
46-
package_dir={"": "src"},
47-
entry_points={"pytask": ["pytask_r = pytask_r.plugin"]},
48-
include_package_data=True,
49-
zip_safe=False,
50-
)
4+
if __name__ == "__main__":
5+
setup()

src/pytask_r/__init__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
from ._version import get_versions
1+
try:
2+
from ._version import version as __version__
3+
except ImportError:
4+
# broken installation, we don't even try unknown only works because we do poor mans
5+
# version compare
6+
__version__ = "unknown"
27

3-
__version__ = get_versions()["version"]
4-
del get_versions
8+
9+
__all__ = ["__version__"]

0 commit comments

Comments
 (0)