Skip to content

Commit 2a6bfbf

Browse files
authored
Replace versioneer with setuptools-scm. (#13)
1 parent 6b809f8 commit 2a6bfbf

File tree

12 files changed

+81
-2534
lines changed

12 files changed

+81
-2534
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.

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

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ repos:
3838
rev: v2.5.0
3939
hooks:
4040
- id: reorder-python-imports
41+
- repo: https://github.com/asottile/setup-cfg-fmt
42+
rev: v1.17.0
43+
hooks:
44+
- id: setup-cfg-fmt
4145
- repo: https://github.com/psf/black
4246
rev: 21.7b0
4347
hooks:
@@ -62,6 +66,7 @@ repos:
6266
flake8-print,
6367
flake8-pytest-style,
6468
flake8-todo,
69+
flake8-typing-imports,
6570
flake8-unused-arguments,
6671
pep8-naming,
6772
pydocstyle,

CHANGES.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ all releases are available on `PyPI <https://pypi.org/project/pytask-stata>`_ an
77
`Anaconda.org <https://anaconda.org/conda-forge/pytask-stata>`_.
88

99

10-
0.0.7 - 2021-xx-xx
10+
0.1.0 - 2021-07-21
1111
------------------
1212

1313
- :gh:`11` fixes the ``README.rst``.
14-
- :gh:`14` fixes tests and aligns pytask-stata with pytask 0.1.0.
14+
- :gh:`13` replaces versioneer with setuptools-scm.
15+
- :gh:`14` fixes tests and aligns pytask-stata with pytask v0.1.0.
1516

1617

1718
0.0.6 - 2021-03-05

environment.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ name: pytask-stata
22

33
channels:
44
- conda-forge
5+
- nodefaults
56

67
dependencies:
7-
- python
8+
- python >=3.6
89
- pip
10+
- setuptools_scm
11+
- toml
912

1013
# Conda
1114
- 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_stata/_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_stata/_version.py
5-
versionfile_build = pytask_stata/_version.py
6-
tag_prefix = v
7-
parentdir_prefix = pytask-stata-
1+
[metadata]
2+
name = pytask_stata
3+
description = Execute do-files with Stata and pytask.
4+
long_description = file: README.rst
5+
long_description_content_type = text/x-rst
6+
url = https://github.com/pytask-dev/pytask-stata
7+
author = Tobias Raabe
8+
author_email = [email protected]
9+
license = MIT
10+
license_file = LICENSE
11+
platforms = any
12+
classifiers =
13+
Development Status :: 3 - Alpha
14+
License :: OSI Approved :: MIT License
15+
Operating System :: OS Independent
16+
Programming Language :: Python :: 3
17+
Programming Language :: Python :: 3 :: Only
18+
Programming Language :: Python :: 3.6
19+
Programming Language :: Python :: 3.7
20+
Programming Language :: Python :: 3.8
21+
Programming Language :: Python :: 3.9
22+
project_urls =
23+
Documentation = https://github.com/pytask-dev/pytask-stata
24+
Github = https://github.com/pytask-dev/pytask-stata
25+
Tracker = https://github.com/pytask-dev/pytask-stata/issues
26+
Changelog = https://github.com/pytask-dev/pytask-stata/blob/main/CHANGES.rst
27+
28+
[options]
29+
packages = find:
30+
install_requires =
31+
click
32+
pytask>=0.1.0
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_stata = pytask_stata.plugin
44+
45+
[check-manifest]
46+
ignore =
47+
src/pytask_stata/_version.py

setup.py

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +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-stata",
13-
"Github": "https://github.com/pytask-dev/pytask-stata",
14-
"Tracker": "https://github.com/pytask-dev/pytask-stata/issues",
15-
"Changelog": "https://github.com/pytask-dev/pytask-stata/blob/main/CHANGES.rst",
16-
}
17-
183

19-
setup(
20-
name="pytask-stata",
21-
version=versioneer.get_version(),
22-
cmdclass=versioneer.get_cmdclass(),
23-
description="Execute do-files with Stata and pytask.",
24-
long_description=README,
25-
long_description_content_type="text/x-rst",
26-
author="Tobias Raabe",
27-
author_email="[email protected]",
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-
],
42-
install_requires=["click", "pytask >= 0.0.9"],
43-
platforms="any",
44-
packages=find_packages(where="src"),
45-
package_dir={"": "src"},
46-
entry_points={"pytask": ["pytask_stata = pytask_stata.plugin"]},
47-
include_package_data=True,
48-
zip_safe=False,
49-
)
4+
if __name__ == "__main__":
5+
setup()

src/pytask_stata/__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)