Author: Armin Rigo <[email protected]>
Branch:
Changeset: r3158:603d417606ae
Date: 2018-09-09 12:11 +0200
http://bitbucket.org/cffi/cffi/changeset/603d417606ae/
Log: "python setup.py sdist" should not list the generated ABI module.
See ``"python3 setup.py sdist" wrongly packages auto-generated file
(out-of-line ABI-mode)`` on the mailing list.
diff --git a/cffi/setuptools_ext.py b/cffi/setuptools_ext.py
--- a/cffi/setuptools_ext.py
+++ b/cffi/setuptools_ext.py
@@ -162,6 +162,17 @@
module_path = module_name.split('.')
module_path[-1] += '.py'
generate_mod(os.path.join(self.build_lib, *module_path))
+ def get_source_files(self):
+ # This is called from 'setup.py sdist' only. Exclude
+ # the generate .py module in this case.
+ saved_py_modules = self.py_modules
+ try:
+ if saved_py_modules:
+ self.py_modules = [m for m in saved_py_modules
+ if m != module_name]
+ return base_class.get_source_files(self)
+ finally:
+ self.py_modules = saved_py_modules
dist.cmdclass['build_py'] = build_py_make_mod
# distutils and setuptools have no notion I could find of a
@@ -171,6 +182,7 @@
# the module. So we add it here, which gives a few apparently
# harmless warnings about not finding the file outside the
# build directory.
+ # Then we need to hack more in get_source_files(); see above.
if dist.py_modules is None:
dist.py_modules = []
dist.py_modules.append(module_name)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit