aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-07-23 13:51:20 -0400
committerJason R. Coombs <jaraco@jaraco.com>2016-07-23 13:51:20 -0400
commit5a63f386217cae916c60cc8a89ae1115df9ea7f4 (patch)
tree9d797296982530aa18668552d80fc04b046a2447 /setup.py
parentbf866865418c7c58970b9f8da9151f7df3cba6af (diff)
downloadexternal_python_setuptools-5a63f386217cae916c60cc8a89ae1115df9ea7f4.tar.gz
external_python_setuptools-5a63f386217cae916c60cc8a89ae1115df9ea7f4.tar.bz2
external_python_setuptools-5a63f386217cae916c60cc8a89ae1115df9ea7f4.zip
Only chdir when executed, which may be unnecessary, but keeping it for compatibility.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index 4eb3f78e..355b0aaa 100755
--- a/setup.py
+++ b/setup.py
@@ -10,10 +10,9 @@ import textwrap
import setuptools
+
here = os.path.dirname(__file__)
-# Allow to run setup.py from another directory.
-here and os.chdir(here)
def require_metadata():
"Prevent improper installs without necessary metadata. See #659"
@@ -47,7 +46,8 @@ def _gen_console_scripts():
.format(shortver=sys.version[:3]))
-with io.open('README.rst', encoding='utf-8') as readme_file:
+readme_path = os.path.join(here, 'README.rst')
+with io.open(readme_path, encoding='utf-8') as readme_file:
long_description = readme_file.read()
package_data = dict(
@@ -188,5 +188,7 @@ setup_params = dict(
)
if __name__ == '__main__':
+ # allow setup.py to run from another directory
+ here and os.path.chdir(here)
require_metadata()
dist = setuptools.setup(**setup_params)