Skip to content

Commit

Permalink
Merge pull request #92 from leorochael/leorochael-no-import-of-appdir…
Browse files Browse the repository at this point in the history
…s-during-setup

Don't import appdirs from setup.py
  • Loading branch information
zoofood committed Apr 29, 2017
2 parents 859eac4 + b0262da commit 494089c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions appdirs.py
Expand Up @@ -13,8 +13,8 @@
# - Mac OS X: http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/index.html
# - XDG spec for Un*x: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

__version_info__ = (1, 4, 3)
__version__ = '.'.join(map(str, __version_info__))
__version__ = "1.4.3"
__version_info__ = tuple(int(segment) for segment in __version__.split("."))


import sys
Expand Down
11 changes: 9 additions & 2 deletions setup.py
Expand Up @@ -7,7 +7,7 @@
from setuptools import setup
except ImportError:
from distutils.core import setup
import appdirs
import ast

tests_require = []
if sys.version_info < (2, 7):
Expand All @@ -21,9 +21,16 @@ def read(fname):
return out


# Do not import `appdirs` yet, lest we import some random version on sys.path.
for line in read("appdirs.py").splitlines():
if line.startswith("__version__"):
version = ast.literal_eval(line.split("=", 1)[1].strip())
break


setup(
name='appdirs',
version=appdirs.__version__,
version=version,
description='A small Python module for determining appropriate ' + \
'platform-specific dirs, e.g. a "user data dir".',
long_description=read('README.rst') + '\n' + read('CHANGES.rst'),
Expand Down

0 comments on commit 494089c

Please sign in to comment.