Skip to content

Commit

Permalink
move build.py, ffi and include out of package
Browse files Browse the repository at this point in the history
  • Loading branch information
Tester authored and Tester committed Dec 27, 2023
1 parent af5bbc2 commit 7a48b33
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 22 deletions.
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ curl_cffi/include/curl/curl.h: curl-impersonate-$(VERSION)/chrome/patches
for p in $</curl-*.patch; do patch -p1 < ../$$p; done
# Re-generate the configure script
autoreconf -fi
mkdir -p ../curl_cffi/include/curl
cp -R include/curl/* ../curl_cffi/include/curl/

.so_downloaded:
python preprocess/download_so.py
Expand Down Expand Up @@ -53,6 +51,6 @@ clean:
rm -rf build/ dist/ curl_cffi.egg-info/ $(CURL_VERSION)/ curl-impersonate-$(VERSION)/
rm -rf curl_cffi/*.o curl_cffi/*.so curl_cffi/_wrapper.c
rm -rf .preprocessed .so_downloaded $(CURL_VERSION).tar.xz curl-impersonate-$(VERSION).tar.gz
rm -rf curl_cffi/include/
rm -rf include/

.PHONY: clean build test install-local upload preprocess
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ test = [
[tool.setuptools]
packages = ["curl_cffi", "curl_cffi.requests"]
# package-data = { curl_cffi = ["libcurl/*/*"] }
exclude-package-data = { curl_cffi = ["include/*", "ffi/*"] }


[build-system]
Expand Down
20 changes: 2 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import fnmatch

from setuptools import setup
from setuptools.command.build_py import build_py
from wheel.bdist_wheel import bdist_wheel


Expand All @@ -16,21 +13,8 @@ def get_tag(self):
return python, abi, plat


excluded = ['curl_cffi/build.py', 'curl_cffi\\build.py']


class excluded_build_py(build_py):
def find_package_modules(self, package, package_dir):
modules = super().find_package_modules(package, package_dir)
return [
(pkg, mod, file)
for (pkg, mod, file) in modules
if not any(fnmatch.fnmatchcase(file, pat=pattern) for pattern in excluded)
]


setup(
# this option is only valid in setup.py
cffi_modules=["curl_cffi/build.py:ffibuilder"],
cmdclass={"bdist_wheel": bdist_wheel_abi3, 'build_py': excluded_build_py}, # type: ignore
cffi_modules=["./build.py:ffibuilder"],
cmdclass={"bdist_wheel": bdist_wheel_abi3}, # type: ignore
)

0 comments on commit 7a48b33

Please sign in to comment.