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

switch to versioneer #194

Merged
merged 1 commit into from
Sep 12, 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 .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.ipynb linguist-language=Python
spopt/_version.py export-subst
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
include LICENSE.txt MANIFEST.in requirements.txt requirements_docs.txt requirements_dev.txt requirements_tests.txt
include versioneer.py
include spopt/_version.py
7 changes: 7 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[versioneer]
VCS = git
style = pep440
versionfile_source = spopt/_version.py
versionfile_build = spopt/_version.py
tag_prefix = v
parentdir_prefix = spopt-
11 changes: 3 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
from setuptools import setup, find_packages
from distutils.command.build_py import build_py
import versioneer

package = "spopt" # name of package

# Get __version__ from spopt/__init__.py without importing the package
# __version__ has to be defined in the first line
with open("%s/__init__.py" % package, "r") as f:
exec(f.readline())


# Fetch README.md for the `long_description`
with open("README.md", "r", encoding="utf-8") as file:
long_description = file.read()
Expand Down Expand Up @@ -39,7 +34,8 @@ def setup_package():

setup(
name=package,
version=__version__,
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass({"build_py": build_py}),
description="Spatial Optimization in PySAL",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down Expand Up @@ -67,7 +63,6 @@ def setup_package():
install_requires=install_reqs,
extras_require=extras_reqs,
zip_safe=False,
cmdclass={"build.py": build_py},
python_requires=">=3.7",
)

Expand Down
6 changes: 4 additions & 2 deletions spopt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
__version__ = "0.1.2"

from . import region

from . import _version

__version__ = _version.get_versions()["version"]
Loading