Skip to content

Commit

Permalink
use versioneer
Browse files Browse the repository at this point in the history
  • Loading branch information
ocefpaf authored and wesleybowman committed Sep 28, 2017
1 parent 87588f4 commit d1413e4
Show file tree
Hide file tree
Showing 7 changed files with 2,365 additions and 31 deletions.
1 change: 1 addition & 0 deletions .gitattributes
@@ -0,0 +1 @@
utide/_version.py export-subst
2 changes: 2 additions & 0 deletions MANIFEST.in
Expand Up @@ -4,3 +4,5 @@ include requirements.txt

recursive-include utide *.py
recursive-include utide *.npz
include versioneer.py
include utide/_version.py
11 changes: 11 additions & 0 deletions setup.cfg
@@ -0,0 +1,11 @@
# 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 = utide/_version.py
versionfile_build = utide/_version.py
tag_prefix = v
parentdir_prefix =
29 changes: 3 additions & 26 deletions setup.py
Expand Up @@ -3,30 +3,7 @@
from setuptools import setup
from setuptools.command.test import test as TestCommand


class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.verbose = True

def run_tests(self):
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)


def extract_version(module='utide'):
version = None
fdir = os.path.dirname(__file__)
fnme = os.path.join(fdir, module, '__init__.py')
with open(fnme) as fd:
for line in fd:
if (line.startswith('__version__')):
_, version = line.split('=')
# Remove quotation characters.
version = version.strip()[1:-1]
break
return version
import versioneer


rootpath = os.path.abspath(os.path.dirname(__file__))
Expand All @@ -43,7 +20,7 @@ def read(*parts):
install_requires = [r.strip() for r in require]

setup(name='UTide',
version=extract_version(),
version=versioneer.get_version(),
license='MIT',
long_description=long_description,
classifiers=['Development Status :: 5 - Production/Stable',
Expand All @@ -65,7 +42,7 @@ def read(*parts):
packages=['utide'],
package_data={'utide': ['data/*.npz']},
tests_require=['pytest'],
cmdclass=dict(test=PyTest),
cmdclass=versioneer.get_cmdclass(),
author=['Wesley Bowman'],
author_email='wesley.bowman23@gmail.com',
zip_safe=False)
11 changes: 6 additions & 5 deletions utide/__init__.py
Expand Up @@ -4,9 +4,6 @@

from utide.utilities import loadbunch, convert_unicode_arrays

__version__ = '0.1.0'


_base_dir = os.path.join(os.path.dirname(__file__), 'data')
_ut_constants_fname = os.path.join(_base_dir, 'ut_constants.npz')

Expand All @@ -20,8 +17,12 @@
constit_index_dict = dict([(name, i) for (i, name) in
enumerate(constit_names)])

from ._solve import solve # noqa
from ._reconstruct import reconstruct # noqa
from ._solve import solve
from ._reconstruct import reconstruct

__all__ = ['solve',
'reconstruct']

from ._version import get_versions
__version__ = get_versions()['version']
del get_versions

0 comments on commit d1413e4

Please sign in to comment.