-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #175 from freemansw1/add-version-number
Adding version numbers
- Loading branch information
Showing
3 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,34 @@ | ||
from setuptools import setup | ||
|
||
|
||
""" | ||
This code is from the python documentation and is | ||
designed to read in the version number. | ||
See: https://packaging.python.org/en/latest/guides/single-sourcing-package-version/ | ||
""" | ||
from pathlib import Path | ||
|
||
|
||
def read(pkg_name): | ||
init_fname = Path(__file__).parent / pkg_name / "__init__.py" | ||
with open(init_fname, "r") as fp: | ||
return fp.read() | ||
|
||
|
||
def get_version(pkg_name): | ||
for line in read(pkg_name).splitlines(): | ||
if line.startswith("__version__"): | ||
delim = '"' if '"' in line else "'" | ||
return line.split(delim)[1] | ||
else: | ||
raise RuntimeError("Unable to find version string.") | ||
|
||
|
||
PACKAGE_NAME = "tobac" | ||
|
||
setup( | ||
name="tobac", | ||
version="1.3.3", | ||
name=PACKAGE_NAME, | ||
version=get_version(PACKAGE_NAME), | ||
description="Tracking and object-based analysis of clouds", | ||
url="http://github.com/tobac-project/tobac", | ||
author=[ | ||
|
@@ -22,7 +48,7 @@ | |
"[email protected]", | ||
], | ||
license="BSD-3-Clause License", | ||
packages=["tobac"], | ||
packages=[PACKAGE_NAME], | ||
install_requires=[], | ||
zip_safe=False, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters