diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2016-07-23 13:51:20 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2016-07-23 13:51:20 -0400 |
commit | 5a63f386217cae916c60cc8a89ae1115df9ea7f4 (patch) | |
tree | 9d797296982530aa18668552d80fc04b046a2447 /setup.py | |
parent | bf866865418c7c58970b9f8da9151f7df3cba6af (diff) | |
download | external_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-x | setup.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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) |