Skip to content

Commit

Permalink
switch to versioneer
Browse files Browse the repository at this point in the history
  • Loading branch information
jGaboardi committed Sep 11, 2021
1 parent a7bdc85 commit d020b69
Show file tree
Hide file tree
Showing 7 changed files with 2,797 additions and 10 deletions.
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

0 comments on commit d020b69

Please sign in to comment.