diff --git a/cellxgene_gateway/__init__.py b/cellxgene_gateway/__init__.py index 447b57c..c903020 100755 --- a/cellxgene_gateway/__init__.py +++ b/cellxgene_gateway/__init__.py @@ -6,3 +6,5 @@ # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES # OR CONDITIONS OF ANY KIND, either express or implied. See the License for # the specific language governing permissions and limitations under the License. + +__version__ = "0.2.0" diff --git a/setup.py b/setup.py index f37d18f..9a8dfb8 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,23 @@ import os -from setuptools import setup +import codecs +from setuptools import find_packages, setup +import sys + +if sys.version_info < (3,6): + sys.exit('Sorry, Python < 3.6 is not supported') + +def read(rel_path): + here = os.path.abspath(os.path.dirname(__file__)) + with codecs.open(os.path.join(here, rel_path), 'r') as fp: + return fp.read() + +def get_version(rel_path): + for line in read(rel_path).splitlines(): + if line.startswith('__version__'): + delim = '"' if '"' in line else "'" + return line.split(delim)[1] + else: + raise RuntimeError("Unable to find version string.") def parse_requirements(): reqs = [] @@ -17,7 +35,7 @@ setup( # mandatory name="cellxgene-gateway", # mandatory - version="0.2.0", + version=get_version("cellxgene_gateway/__init__.py"), # mandatory author="Niket Patel, Yohann Potier, Alok Saldanha", author_email="alok.saldanha@novartis.com",