Move version into __init__.py
This commit is contained in:
parent
706fb49baa
commit
285170eddc
@ -1,6 +1,8 @@
|
||||
"""Module config for resync."""
|
||||
"""Module config for resync.
|
||||
|
||||
from ._version import __version__
|
||||
This is the one place the version number for resync is stored.
|
||||
"""
|
||||
__version__ = '2.0.0'
|
||||
|
||||
# Enable easy import for core classes, e.g.
|
||||
# from resync import Resource
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
"""This is the one place the version number for resync is stored."""
|
||||
#
|
||||
# Format: x.y.z where
|
||||
# x.y is spec version, see http://www.openarchives.org/rs/x.y/
|
||||
# z is incremented for revisions within that version, 1...
|
||||
__version__ = '1.0.10'
|
||||
21
setup.py
21
setup.py
@ -2,12 +2,12 @@
|
||||
from setuptools import setup, Command
|
||||
import os
|
||||
|
||||
# Extract version number from resync/_version.py. Here we
|
||||
# are very strict about the format of the version string
|
||||
# as an extra sanity check. (Thanks for comments in
|
||||
# Extract version number from resync/__init__.py. Here we
|
||||
# are very strict about the format of the version string
|
||||
# as an extra sanity check. (Thanks for comments in
|
||||
# http://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package )
|
||||
import re
|
||||
VERSIONFILE="resync/_version.py"
|
||||
VERSIONFILE = "resync/__init__.py"
|
||||
verfilestr = open(VERSIONFILE, "rt").read()
|
||||
match = re.search(r"^__version__ = '(\d\.\d.\d+(\.\d+)?)'", verfilestr, re.MULTILINE)
|
||||
if match:
|
||||
@ -15,6 +15,7 @@ if match:
|
||||
else:
|
||||
raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE))
|
||||
|
||||
|
||||
class Coverage(Command):
|
||||
"""Class to allow coverage run from setup."""
|
||||
|
||||
@ -36,28 +37,29 @@ class Coverage(Command):
|
||||
os.system("coverage html")
|
||||
print("See htmlcov/index.html for details.")
|
||||
|
||||
|
||||
setup(
|
||||
name='resync',
|
||||
version=version,
|
||||
packages=['resync'],
|
||||
scripts=['resync.py','resync-explorer.py'],
|
||||
scripts=['bin/resync', 'bin/resync-explorer.py'],
|
||||
classifiers=["Development Status :: 4 - Beta",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: Apache Software License",
|
||||
"Operating System :: OS Independent", #is this true? know Linux & OS X ok
|
||||
"Operating System :: OS Independent", # is this true? know Linux & OS X ok
|
||||
"Programming Language :: Python",
|
||||
"Programming Language :: Python :: 2.7",
|
||||
"Programming Language :: Python :: 3.5",
|
||||
"Programming Language :: Python :: 3.6",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Topic :: Internet :: WWW/HTTP",
|
||||
"Topic :: Software Development :: Libraries :: Python Modules",
|
||||
"Environment :: Web Environment"],
|
||||
author='Simeon Warner',
|
||||
author_email='simeon.warner@cornell.edu',
|
||||
description='ResourceSync library and client',
|
||||
long_description=open('README').read(),
|
||||
url='http://github.com/resync/resync',
|
||||
long_description=open('README.md').read(),
|
||||
long_description_content_type='text/markdown',
|
||||
install_requires=[
|
||||
"requests",
|
||||
"python-dateutil>=1.5",
|
||||
@ -67,6 +69,7 @@ setup(
|
||||
tests_require=[
|
||||
"testfixtures"
|
||||
],
|
||||
python_requires='>=3.5',
|
||||
cmdclass={
|
||||
'coverage': Coverage
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user