commit:     0d48cfdce689b091e1e9baa2d125256a4a77aacc
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 15 17:18:26 2026 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Feb 15 17:39:25 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0d48cfdc

dev-python/cryptography: Fix installing stray files

Closes: https://bugs.gentoo.org/970090
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/cryptography/cryptography-46.0.5.ebuild |  5 +++
 .../files/cryptography-46.0.5-stray-files.patch    | 48 ++++++++++++++++++++++
 2 files changed, 53 insertions(+)

diff --git a/dev-python/cryptography/cryptography-46.0.5.ebuild 
b/dev-python/cryptography/cryptography-46.0.5.ebuild
index ea8c2998c391..b6bb5899e185 100644
--- a/dev-python/cryptography/cryptography-46.0.5.ebuild
+++ b/dev-python/cryptography/cryptography-46.0.5.ebuild
@@ -104,6 +104,11 @@ EPYTEST_PLUGINS=( hypothesis pytest-subtests )
 EPYTEST_XDIST=1
 distutils_enable_tests pytest
 
+PATCHES=(
+       # https://github.com/pyca/cryptography/pull/14319
+       "${FILESDIR}/${PN}-46.0.5-stray-files.patch"
+)
+
 src_unpack() {
        if use verify-provenance; then
                pypi_verify_provenance "${DISTDIR}/${P}.tar.gz"{,.provenance}

diff --git 
a/dev-python/cryptography/files/cryptography-46.0.5-stray-files.patch 
b/dev-python/cryptography/files/cryptography-46.0.5-stray-files.patch
new file mode 100644
index 000000000000..e13bb4f560c4
--- /dev/null
+++ b/dev-python/cryptography/files/cryptography-46.0.5-stray-files.patch
@@ -0,0 +1,48 @@
+From b89a7737e3f135333125b0984e75ea553a485203 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <[email protected]>
+Date: Sun, 15 Feb 2026 17:47:48 +0100
+Subject: [PATCH] Fix installing stray files into site-packages
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fix the `include` pattern in `pyproject.toml` not to install stray files
+such as `CHANGELOG.rst`, `CONTRIBUTING.rst`, `docs` and `tests` straight
+into site-packages.  Apparently Maturin did not install them before due
+to a bug, but it was fixed in maturin 1.12.0, leading to the files being
+suddenly installed.
+
+Originally reported as https://bugs.gentoo.org/970090.
+
+Signed-off-by: Michał Górny <[email protected]>
+---
+ pyproject.toml | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/pyproject.toml b/pyproject.toml
+index e26b38628..8640cb6e5 100644
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -106,10 +106,10 @@ module-name = "cryptography.hazmat.bindings._rust"
+ locked = true
+ sdist-generator = "git"
+ include = [
+-    "CHANGELOG.rst",
+-    "CONTRIBUTING.rst",
++    { path = "CHANGELOG.rst", format = "sdist" },
++    { path = "CONTRIBUTING.rst", format = "sdist" },
+ 
+-    "docs/**/*",
++    { path = "docs/**/*", format = "sdist" },
+ 
+     { path = "src/_cffi_src/**/*.py", format = "sdist" },
+     { path = "src/_cffi_src/**/*.c", format = "sdist" },
+@@ -121,7 +121,7 @@ include = [
+     { path = "src/rust/**/Cargo.lock", format = "sdist" },
+     { path = "src/rust/**/*.rs", format = "sdist" },
+ 
+-    "tests/**/*.py",
++    { path = "tests/**/*.py", format = "sdist" },
+ ]
+ exclude = [
+     "vectors/**/*",

Reply via email to