From 0c3b2bda2c8bca7b7e86cb0a9c35254dc6995adc Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Fri, 5 Oct 2018 19:42:52 -0700 Subject: [PATCH] setup: use relative paths for distutils (#51) I hope this fixes things... --- NEWS.rst | 1 + setup_zstd.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 88499421..b007bda5 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -41,6 +41,7 @@ Other Actions Not Blocking Release 0.10.0 (not yet released) ========================= +* Use relative paths in setup.py to appease Python 3.7 (#51). * Added CI for Python 3.7. 0.9.1 (released 2018-06-04) diff --git a/setup_zstd.py b/setup_zstd.py index 6e7e9e05..b283cd00 100644 --- a/setup_zstd.py +++ b/setup_zstd.py @@ -151,6 +151,11 @@ def get_c_extension(support_legacy=False, system_zstd=False, name='zstd', libraries = ['zstd'] if system_zstd else [] + # Python 3.7 doesn't like absolute paths. So normalize to relative. + sources = [os.path.relpath(p, root) for p in sources] + include_dirs = [os.path.relpath(p, root) for p in include_dirs] + depends = [os.path.relpath(p, root) for p in depends] + # TODO compile with optimizations. return Extension(name, sources, include_dirs=include_dirs,