summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2021-12-13 14:27:54 +0100
committerStefan Behnel <stefan_ml@behnel.de>2021-12-13 14:27:54 +0100
commit745ac2685ca05c67afbf2a1dde24e4d48bd86dcd (patch)
treeeb4f3737985f2051dc4d302619ada68604e35541
parentf0a575a5b5d9860be5b481950194f443ba7b9eac (diff)
downloadpython-lxml-lxml-4.7.1.tar.gz
Move zlib.h and friends into a subdirectory "extlibs" in lxml/includes/ to separate them from lxml-version.h etc.lxml-4.7.1
These files are copied by setuptools as package data from an external install directory and thus need to be in a separate package to prevent conflicting with the content of the normal lxml.includes package.
-rw-r--r--.gitignore1
-rw-r--r--setup.py12
2 files changed, 11 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 25349ce6..66a48a6e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,6 +20,7 @@ MANIFEST
doc/api/lxml*.rst
doc/api/_build/
doc/s5/lxml-ep2008.html
+src/lxml/includes/*/
src/lxml/includes/lxml-version.h
src/lxml/*.html
src/lxml/html/*.c
diff --git a/setup.py b/setup.py
index 553d5c61..97dd973f 100644
--- a/setup.py
+++ b/setup.py
@@ -180,12 +180,20 @@ def setup_extra_options():
header_packages = build_packages(extract_files(include_dirs))
+ package_filename = "__init__.py"
for package_path, (root_path, filenames) in header_packages.items():
if not package_path:
- # No need to add anything to 'lxml.includes' since it has a wildcard include.
- continue
+ # lxml.includes -> lxml.includes.extlibs
+ package_path = "extlibs"
package = 'lxml.includes.' + package_path
packages.append(package)
+
+ # create '__init__.py' to make sure it's considered a package
+ if package_filename not in filenames:
+ with open(os.path.join(root_path, package_filename), 'wb') as f:
+ pass
+ filenames.append(package_filename)
+
assert package not in package_data
package_data[package] = filenames
assert package not in package_dir