Skip to content
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

Replace versioneer for setuptools-scm #307

Merged
merged 7 commits into from Mar 16, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 0 additions & 7 deletions setup.cfg → .flake8
@@ -1,10 +1,3 @@
[versioneer]
VCS = git
style = pep440
versionfile_source = verde/_version.py
versionfile_build = verde/_version.py
tag_prefix = ''

[flake8]
ignore = E203, E266, E501, W503, F401, E741
max-line-length = 88
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Expand Up @@ -4,7 +4,6 @@ include CODE_OF_CONDUCT.md
include CONTRIBUTING.md
include AUTHORS.md
include requirements.txt
include versioneer.py
include verde/datasets/registry.txt
recursive-include verde/tests/data *
recursive-include verde/tests/baseline *
1 change: 1 addition & 0 deletions environment.yml
Expand Up @@ -5,6 +5,7 @@ channels:
dependencies:
- python=3.7
- pip
- setuptools_scm
- numpy
- scipy
- pandas
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
@@ -1,3 +1,4 @@
setuptools_scm
numpy
scipy
pandas
Expand Down
16 changes: 9 additions & 7 deletions setup.py
@@ -1,12 +1,10 @@
"""
Build and install the project.

Uses versioneer to manage version numbers using git tags.
Uses setuptools-scm to manage version numbers using git tags.
"""
from setuptools import setup, find_packages

import versioneer


NAME = "verde"
FULLNAME = "Verde"
Expand All @@ -20,8 +18,6 @@
KEYWORDS = ""
with open("README.rst") as f:
LONG_DESCRIPTION = "".join(f.readlines())
VERSION = versioneer.get_version()
CMDCLASS = versioneer.get_cmdclass()
CLASSIFIERS = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
Expand All @@ -46,14 +42,20 @@
with open("requirements.txt") as f:
INSTALL_REQUIRES = f.readlines()
PYTHON_REQUIRES = ">=3.6"
# Configuration for setuptools-scm
SETUP_REQUIRES = ["setuptools_scm"]
USE_SCM_VERSION = {
"relative_to": __file__,
"local_scheme": "node-and-date",
}

if __name__ == "__main__":
setup(
name=NAME,
fullname=FULLNAME,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
version=VERSION,
use_scm_version=USE_SCM_VERSION,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
maintainer=MAINTAINER,
Expand All @@ -68,5 +70,5 @@
keywords=KEYWORDS,
install_requires=INSTALL_REQUIRES,
python_requires=PYTHON_REQUIRES,
cmdclass=CMDCLASS,
setup_requires=SETUP_REQUIRES,
)
4 changes: 4 additions & 0 deletions verde/__init__.py
Expand Up @@ -33,6 +33,10 @@
from .projections import project_region, project_grid


# Get the version number through setuptools-scm
__version__ = version.version


def test(doctest=True, verbose=True, coverage=False, figures=True):
"""
Run the test suite.
Expand Down