diff --git a/MANIFEST.in b/MANIFEST.in index 4e06459..67c834e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,9 @@ +# description +include README.rst + +# version +include wc_lang/VERSION + # license include LICENSE diff --git a/README.md b/README.md index 818ae1d..295bf02 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ - +[//]: # ( [![PyPI package](https://img.shields.io/pypi/v/wc_lang.svg)](https://pypi.python.org/pypi/wc_lang) ) [![Documentation](https://img.shields.io/badge/docs-latest-brightgreen.svg)](http://code.karrlab.org) [![Test results](https://circleci.com/gh/KarrLab/wc_lang.svg?style=shield&circle-token=f0edfe4f971e8871ebb097bdc7b10a270cd90a96)](https://circleci.com/gh/KarrLab/wc_lang) [![Test coverage](https://coveralls.io/repos/github/KarrLab/wc_lang/badge.svg?t=xViD7w)](https://coveralls.io/github/KarrLab/wc_lang) diff --git a/setup.cfg b/setup.cfg index 640feca..3df7100 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,3 @@ -[metadata] -description-file = README.rst - [bdist_wheel] universal = 1 diff --git a/setup.py b/setup.py index 1f992fa..8392186 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,18 @@ from setuptools import setup, find_packages from wc_utils.util.install import parse_requirements, install_dependencies -import wc_lang +import os + +# get long description +if os.path.isfile('README.rst'): + with open('README.rst', 'r') as file: + long_description = file.read() +else: + long_description = '' + +# get version +with open('wc_lang/VERSION', 'r') as file: + version = file.read().strip() # parse dependencies and links from requirements.txt files with open('requirements.txt', 'r') as file: @@ -18,10 +29,11 @@ # install package setup( name="wc_lang", - version=wc_lang.__version__, + version=version, description="Language for describing whole-cell models", + long_description=long_description, url="https://github.com/KarrLab/wc_lang", - download_url='https://github.com/KarrLab/wc_lang/tarball/{}'.format(wc_lang.__version__), + download_url='https://github.com/KarrLab/wc_lang', author="Jonathan Karr", author_email="jonrkarr@gmail.com", license="MIT", @@ -29,6 +41,7 @@ packages=find_packages(exclude=['tests', 'tests.*']), package_data={ 'wc_lang': [ + 'VERSION', ], }, install_requires=install_requires, diff --git a/wc_lang/VERSION b/wc_lang/VERSION new file mode 100644 index 0000000..8a9ecc2 --- /dev/null +++ b/wc_lang/VERSION @@ -0,0 +1 @@ +0.0.1 \ No newline at end of file diff --git a/wc_lang/__init__.py b/wc_lang/__init__.py index 99c4176..f2c0376 100644 --- a/wc_lang/__init__.py +++ b/wc_lang/__init__.py @@ -1 +1,5 @@ -__version__ = '0.0.1' \ No newline at end of file +import pkg_resources + +with open(pkg_resources.resource_filename('wc_lang', 'VERSION'), 'r') as file: + __version__ = file.read().strip() +# :obj:`str`: version