Skip to content

Commit

Permalink
Fix setup.py (#67)
Browse files Browse the repository at this point in the history
* find __version__ without importing the module

If we import the module, the dependencies are not yet installed and
setup fails

* use a single `__version__.py` file instead
  • Loading branch information
davidcaron authored and cehbrecht committed Nov 30, 2018
1 parent 6f42c6a commit d8abda6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 0 additions & 2 deletions emu/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
from .wsgi import application

__version__ = '0.9.0'
1 change: 1 addition & 0 deletions emu/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '0.9.0'
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tag = True
[metadata]
description-file = README.rst

[bumpversion:file:emu/__init__.py]
[bumpversion:file:emu/__version__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'

Expand Down
9 changes: 7 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import re
import os

from setuptools import setup, find_packages

version = __import__('emu').__version__
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGES.rst')).read()

reqs = [line.strip() for line in open('requirements.txt')]
extra_reqs = [line.strip() for line in open('requirements_dev.txt')]

# copied from `requests`
about = {}
with open(os.path.join(here, 'emu', '__version__.py'), 'r') as f:
exec(f.read(), about)

classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
Expand All @@ -20,7 +25,7 @@
]

setup(name='emu',
version=version,
version=about['__version__'],
description='WPS processes for testing and demo',
long_description=README + '\n\n' + CHANGES,
classifiers=classifiers,
Expand Down

0 comments on commit d8abda6

Please sign in to comment.