Skip to content

Replace versioneer with setuptools_scm. #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ _generated

build
dist
src/_pytask/_version.py
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ repos:
rev: v2.4.0
hooks:
- id: reorder-python-imports
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.17.0
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
include CITATION
include LICENSE
include versioneer.py
include src/_pytask/_version.py

exclude *.yaml
exclude *.yml
Expand Down
8 changes: 5 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.. raw:: html

<img src="docs/_static/images/pytask_w_text.png" alt="pytask" width="50%">
.. image:: https://raw.githubusercontent.com/pytask-dev/pytask/main/docs/_static/images/pytask_w_text.png
:target: https://pytask-dev.readthedocs.io/en/latest
:align: center
:width: 50%
:alt: pytask

------

Expand Down
2 changes: 0 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,3 @@ coverage:
ignore:
- ".tox/**/*"
- "setup.py"
- "versioneer.py"
- "src/_pytask/_version.py"
1 change: 1 addition & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ all releases are available on `PyPI <https://pypi.org/project/pytask>`_ and
- :gh:`81` adds a warning if a path is not correctly cased on a case-insensitive file
system. This facilitates cross-platform builds of projects. Deactivate the check by
setting ``check_casing_of_paths = false`` in the configuration file.
- :gh:`83` replaces ``versioneer`` with ``setuptools_scm``.
- :gh:`84` fixes an error in the path normalization introduced by :gh:`81`.
- :gh:`85` sorts collected tasks, dependencies, and products by name.

Expand Down
2 changes: 2 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ channels:
dependencies:
- python >=3.7
- pip
- setuptools_scm
- toml

# Conda
- anaconda-client
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.0"]


[tool.setuptools_scm]
write_to = "src/_pytask/_version.py"
69 changes: 59 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,59 @@
# See the docstring in versioneer.py for instructions. Note that you must re-run
# 'versioneer.py setup' after changing this section, and commit the resulting files.

[versioneer]
VCS = git
style = pep440
versionfile_source = src/_pytask/_version.py
versionfile_build = _pytask/_version.py
tag_prefix = v
parentdir_prefix = pytask-
[metadata]
name = pytask
description = In its highest aspirations, pytask tries to be pytest as a build system.
long_description = file: README.rst
long_description_content_type = text/x-rst
url = https://pytask-dev.readthedocs.io/en/latest
author = Tobias Raabe
author_email = [email protected]
license = MIT
license_file = LICENSE
platforms = unix, linux, osx, cygwin, win32
classifiers =
Development Status :: 3 - Alpha
Environment :: Console
Intended Audience :: Science/Research
License :: OSI Approved :: MIT License
Operating System :: MacOS :: MacOS X
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Topic :: Scientific/Engineering
Topic :: Software Development :: Build Tools
project_urls =
Changelog = https://pytask-dev.readthedocs.io/en/latest/changes.html
Documentation = https://pytask-dev.readthedocs.io/en/latest
Github = https://github.com/pytask-dev/pytask
Tracker = https://github.com/pytask-dev/pytask/issues

[options]
packages = find:
install_requires =
attrs>=17.4.0
click
click-default-group
networkx
pluggy
pony>=0.7.13
rich
python_requires = >=3.6.1
include_package_data = True
package_dir =
=src
zip_safe = False

[options.packages.find]
where = src

[options.entry_points]
console_scripts =
pytask=_pytask.cli:cli

[check-manifest]
ignore =
src/_pytask/_version.py
66 changes: 2 additions & 64 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,66 +1,4 @@
"""The setup.py for pytask."""
from pathlib import Path

from setuptools import find_packages
from setuptools import setup

import versioneer


DESCRIPTION = "In its highest aspirations, pytask tries to be pytest as a build system."

# Remove the image from the README.rst since the raw directive is not allowed.
README = "\n".join(Path("README.rst").read_text().split("\n")[5:])

PROJECT_URLS = {
"Documentation": "https://pytask-dev.readthedocs.io/en/latest",
"Github": "https://github.com/pytask-dev/pytask",
"Tracker": "https://github.com/pytask-dev/pytask/issues",
"Changelog": "https://pytask-dev.readthedocs.io/en/latest/changes.html",
}


setup(
name="pytask",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description=DESCRIPTION,
long_description=README,
long_description_content_type="text/x-rst",
author="Tobias Raabe",
author_email="[email protected]",
url=PROJECT_URLS["Github"],
project_urls=PROJECT_URLS,
license="MIT",
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Build Tools",
],
install_requires=[
"attrs >= 17.4.0",
"click",
"click-default-group",
"networkx",
"pluggy",
"pony >= 0.7.13",
"rich",
],
python_requires=">=3.6.1",
entry_points={"console_scripts": ["pytask=_pytask.cli:cli"]},
packages=find_packages(where="src"),
package_dir={"": "src"},
platforms="any",
include_package_data=True,
zip_safe=False,
)
if __name__ == "__main__":
setup()
11 changes: 7 additions & 4 deletions src/_pytask/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from ._version import get_versions
__all__ = ["__version__"]

__version__ = get_versions()["version"]
__git_version__ = get_versions()["full-revisionid"]
del get_versions
try:
from ._version import version as __version__
except ImportError:
# broken installation, we don't even try unknown only works because we do poor mans
# version compare
__version__ = "unknown"
Loading