Commit 233b6b76 authored by Jorn Baayen's avatar Jorn Baayen

Use versioneer to generate version string from repository state.

parent 7b01bb84
rtctools/_version.py export-subst
.vscode
build
*.pyc
*.so
......
include versioneer.py
include rtctools/_version.py
......@@ -64,11 +64,13 @@ author = 'Jorn Baayen, Matthijs den Toom, et al.'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
from rtctools._version import get_versions
release = get_versions()['version']
del get_versions
# The short X.Y version.
version = '2.0'
# The full version, including alpha/beta/rc tags.
release = '2.0.0-beta7'
version = '.'.join(release.split('.')[:2])
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......
__version__ = '2.1.0'
# Get version
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
# Print header
print(
"""
******************************************************************************
......@@ -10,6 +14,7 @@ print(
******************************************************************************
""".format(__version__))
# Import dependencies
try:
import casadi
except ImportError:
......@@ -21,4 +26,4 @@ except ImportError:
warnings.warn("CasADi not found. Please ensure that casadi can be imported before running RTC-Tools.")
MOCK_MODULES = ['casadi', 'pymola', 'pylab', 'scipy', 'scipy.interpolate']
sys.modules.update((mod_name, MagicMock()) for mod_name in MOCK_MODULES)
\ No newline at end of file
sys.modules.update((mod_name, MagicMock()) for mod_name in MOCK_MODULES)
This diff is collapsed.
# 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 = rtctools/_version.py
versionfile_build = rtctools/_version.py
tag_prefix =
parentdir_prefix = rtctools-
from setuptools import setup
import rtctools
"""Toolbox for control and optimization of water systems.
RTC-Tools is the Deltares toolbox for control and optimization of water systems.
"""
from setuptools import setup, find_packages
import versioneer
import sys
if sys.version_info[0] == 3 and sys.version_info[1] < 6:
sys.exit("Sorry, Python 3.6 or newer is required.")
DOCLINES = __doc__.split("\n")
CLASSIFIERS = """\
Development Status :: 4 - Beta
Intended Audience :: Science/Research
Intended Audience :: Information Technology
License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Programming Language :: Python
Programming Language :: Python :: 3
Topic :: Scientific/Engineering :: GIS
Topic :: Scientific/Engineering :: Mathematics
Topic :: Scientific/Engineering :: Physics
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Operating System :: Unix
Operating System :: MacOS
"""
# Install requirements
with open('requirements.txt', 'r') as req_file:
install_reqs = req_file.read().split('\n')
setup(
name = 'rtctools',
packages = ['rtctools', 'rtctools.data', 'rtctools.data.interpolation', 'rtctools.optimization', 'rtctools.simulation'],
version = rtctools.__version__,
description = 'Toolbox for control and optimization of environmental systems',
version = versioneer.get_version(),
maintainer = 'Jorn Baayen',
author = 'Jorn Baayen',
description = DOCLINES[0],
long_description = '\n'.join(DOCLINES[2:]),
url = 'http://www.deltares.nl/en/software/rtc-tools/',
download_url='http://gitlab.com/deltares/rtc-tools/',
license = 'GPL',
classifiers = [_f for _f in CLASSIFIERS.split('\n') if _f],
platforms = ['Windows', 'Linux', 'Mac OS-X', 'Unix'],
packages = find_packages(),
install_requires = install_reqs,
tests_require = ['nose'],
test_suite = 'nose.collector',
cmdclass = {
'versioneer': versioneer.get_cmdclass(),
},
)
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment