From ad5cd0ff95d25ebdab6737747b70a4aa3c838bf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Wed, 29 Jan 2025 15:20:11 +0100 Subject: [PATCH 1/4] Include `tools` directory in source distribution to fix Makefile Include the `tools` directory in source distribution, as at least `tools/gen.py` and `tools/check_sum.py` are expected by the `Makefile` targets. --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index d7c5cef6aad..64cee139a1f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -7,6 +7,7 @@ graft aiohttp graft docs graft examples graft tests +graft tools graft requirements recursive-include vendor * global-include aiohttp *.pyi From 1e758800eeecf66fe26127902874bc9ee2fb349e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Wed, 29 Jan 2025 15:23:57 +0100 Subject: [PATCH 2/4] Fix `tools/gen.py` to work from a source distribution Modify `tools/gen.py` to determine the top project directory by the presence of `pyproject.toml` rather than `.git`, in order to make it work correctly outside a git checkout. This is needed to make the `Makefile` targets work. --- tools/gen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gen.py b/tools/gen.py index d00780aa676..cc015043985 100755 --- a/tools/gen.py +++ b/tools/gen.py @@ -7,7 +7,7 @@ import multidict ROOT = pathlib.Path.cwd() -while ROOT.parent != ROOT and not (ROOT / ".git").exists(): +while ROOT.parent != ROOT and not (ROOT / "pyproject.toml").exists(): ROOT = ROOT.parent From ee61a6488451c738b2d07231b54c9f3702a1526c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Wed, 29 Jan 2025 15:35:37 +0100 Subject: [PATCH 3/4] Add a `cythonize-nodeps` target for downstreams Add a `cythonize-nodeps` target that can be used by downstreams who wish to re-Cythonize files and have provided the necessary dependencies externally. Calling `pip` is undesirable, as it causes sandbox violations. --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 0163b771b8a..dc49c1592ff 100644 --- a/Makefile +++ b/Makefile @@ -81,6 +81,9 @@ generate-llhttp: .llhttp-gen .PHONY: cythonize cythonize: .install-cython $(PYXS:.pyx=.c) aiohttp/_websocket/reader_c.c +.PHONY: cythonize-nodeps +cythonize-nodeps: $(PYXS:.pyx=.c) aiohttp/_websocket/reader_c.c + .install-deps: .install-cython $(PYXS:.pyx=.c) aiohttp/_websocket/reader_c.c $(call to-hash,$(CYS) $(REQS)) @python -m pip install -r requirements/dev.in -c requirements/dev.txt @touch .install-deps From f1afe62b337fd02217f629e054fe5b9a79f20be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Wed, 29 Jan 2025 15:43:27 +0100 Subject: [PATCH 4/4] Add a news fragment --- CHANGES/10366.packaging | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 CHANGES/10366.packaging diff --git a/CHANGES/10366.packaging b/CHANGES/10366.packaging new file mode 100644 index 00000000000..f0e9f62095a --- /dev/null +++ b/CHANGES/10366.packaging @@ -0,0 +1,2 @@ +Added missing files to the source distribution to fix ``Makefile`` targets. +Added a ``cythonize-nodeps`` target to run Cython without invoking pip to install dependencies.