Skip to content

Commit

Permalink
[python-updates] Recurse into python313Packages (#354627)
Browse files Browse the repository at this point in the history
  • Loading branch information
mweinelt authored Nov 18, 2024
2 parents 2b09ab2 + 87ba457 commit 7b0b389
Show file tree
Hide file tree
Showing 151 changed files with 2,483 additions and 1,484 deletions.
2 changes: 2 additions & 0 deletions pkgs/applications/version-management/sourcehut/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ let
flask
sqlalchemy
];
disabledTests = [ "test_persist_selectable" ];
});

# flask-sqlalchemy 2.x requires flask 2.x
Expand Down Expand Up @@ -72,6 +73,7 @@ let
hash = "sha256-83doVvfdpymlAB0EbfrHmuoKE5B2LJbFq+AY2xGpnl4=";
})
];
nativeCheckInputs = oldAttrs.nativeCheckInputs or [] ++ [ self.pytest-xprocess ];
});

# sourcehut is not (yet) compatible with factory-boy 3.x
Expand Down
1 change: 1 addition & 0 deletions pkgs/by-name/oc/octoprint/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ let
flask = super.flask.overridePythonAttrs (oldAttrs: rec {
version = "2.2.5";
format = "setuptools";
pyproject = null;
src = fetchPypi {
pname = "Flask";
inherit version;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_metadata(wheel: str) -> Metadata:
"""
text = get_manifest_text_from_wheel(wheel)
raw, _ = parse_email(text)
metadata = Metadata.from_raw(raw)
metadata = Metadata.from_raw(raw, validate=False)

return metadata

Expand All @@ -78,6 +78,9 @@ def test_requirement(requirement: Requirement) -> bool:
error(f"{package_name} not installed")
return False

# Allow prereleases, to give to give us some wiggle-room
requirement.specifier.prereleases = True

if requirement.specifier and package.version not in requirement.specifier:
error(
f"{package_name}{requirement.specifier} not satisfied by version {package.version}"
Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/libraries/gpgme/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ stdenv.mkDerivation rec {
patches = [
# Support Python 3.10-3.12, remove distutils, https://dev.gnupg.org/D545
./python-310-312-remove-distutils.patch
# Support Python 3.13
./python313-support.patch
# Fix a test after disallowing compressed signatures in gpg (PR #180336)
./test_t-verify_double-plaintext.patch
# Don't use deprecated LFS64 APIs (removed in musl 1.2.4)
Expand Down
13 changes: 13 additions & 0 deletions pkgs/development/libraries/gpgme/python313-support.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/configure.ac b/configure.ac
index ae4c7da0..9a0401aa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -591,7 +591,7 @@ if test "$found_py" = "1"; then
# Reset everything, so that we can look for another Python.
m4_foreach([mym4pythonver],
[[2.7],[3.4],[3.5],[3.6],[3.7],[3.8],[3.9],[3.10],
- [3.11],[3.12],[all]],
+ [3.11],[3.12],[3.13],[all]],
[unset PYTHON
unset PYTHON_VERSION
unset PYTHON_CPPFLAGS
16 changes: 8 additions & 8 deletions pkgs/development/python-modules/a2wsgi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
lib,
buildPythonPackage,
fetchPypi,
asgiref,
baize,
httpx,
pdm-backend,
pytest-asyncio,
pytestCheckHook,
starlette,
baize,
}:

buildPythonPackage rec {
Expand All @@ -21,18 +20,19 @@ buildPythonPackage rec {
hash = "sha256-zkYv9+HarAvFcYPG+ADwmnHCp6mN3VzeyhSePqvzM44=";
};

nativeBuildInputs = [ pdm-backend ];
build-system = [ pdm-backend ];

dependencies = [
starlette
baize
];

nativeCheckInputs = [
asgiref
baize
httpx
pytest-asyncio
pytestCheckHook
];

dependencies = [
starlette
baize
];

meta = {
Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/python-modules/aiogram/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ buildPythonPackage rec {

build-system = [ hatchling ];

pythonRelaxDeps = [ "aiohttp" ];

dependencies = [
aiofiles
aiohttp
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/aiohappyeyeballs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

buildPythonPackage rec {
pname = "aiohappyeyeballs";
version = "2.4.2";
version = "2.4.3";
pyproject = true;

disabled = pythonOlder "3.10";
Expand All @@ -30,7 +30,7 @@ buildPythonPackage rec {
owner = "bdraco";
repo = "aiohappyeyeballs";
rev = "refs/tags/v${version}";
hash = "sha256-ZHxAup3Qf+ejW5Lz9ucuiWAQAwSG0Rf5giPSwk9A0ww=";
hash = "sha256-mN1vJ/ktkabEkON3BqomnUoahrM0uEB/KJStqAYUS5s=";
};

outputs = [
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/aiohttp-fast-zlib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@

buildPythonPackage rec {
pname = "aiohttp-fast-zlib";
version = "0.1.1";
version = "0.2.0";
pyproject = true;

src = fetchFromGitHub {
owner = "bdraco";
repo = "aiohttp-fast-zlib";
rev = "v${version}";
hash = "sha256-uPmttfEiWmEtQrBZYwiSjLTMmXhZ0MmaAQJMXTSQj+U=";
hash = "sha256-fvZVviKN/CL42Zmmm6k/JNdeAljRoqN63rlduNJVr98=";
};

postPatch = ''
Expand Down
49 changes: 0 additions & 49 deletions pkgs/development/python-modules/aiohttp-zlib-ng/default.nix

This file was deleted.

38 changes: 22 additions & 16 deletions pkgs/development/python-modules/aiohttp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
pythonOlder,
fetchFromGitHub,
substituteAll,
python,
isPy310,
isPyPy,

# build-system
cython,
Expand All @@ -17,21 +17,27 @@

# dependencies
aiohappyeyeballs,
aiosignal,
async-timeout,
attrs,
frozenlist,
multidict,
async-timeout,
propcache,
yarl,
frozenlist,
aiosignal,

# optional dependencies
aiodns,
brotli,
brotlicffi,

# tests
freezegun,
gunicorn,
proxy-py,
pytest-codspeed,
pytest-cov-stub,
pytest-mock,
pytest-xdist,
pytestCheckHook,
python-on-whales,
re-assert,
Expand All @@ -40,7 +46,7 @@

buildPythonPackage rec {
pname = "aiohttp";
version = "3.10.10";
version = "3.11.2";
pyproject = true;

disabled = pythonOlder "3.8";
Expand All @@ -49,7 +55,7 @@ buildPythonPackage rec {
owner = "aio-libs";
repo = "aiohttp";
rev = "refs/tags/v${version}";
hash = "sha256-c2mnt2ZQ7d7WO7Z8eDaUo9y+v0V0JwXUa1WJI9bwGTM=";
hash = "sha256-+a5ok4jg6+eL8uQBqZ6AaaZ1wNqJyh6Fxe08VOoJxNM=";
};

patches = [
Expand Down Expand Up @@ -77,28 +83,28 @@ buildPythonPackage rec {

dependencies = [
aiohappyeyeballs
aiosignal
async-timeout
attrs
frozenlist
multidict
async-timeout
propcache
yarl
frozenlist
aiosignal
] ++ optional-dependencies.speedups;

optional-dependencies.speedups = [
aiodns
brotli
(if isPyPy then brotlicffi else brotli)
];

postInstall = ''
# remove source code file with reference to dev dependencies
rm $out/${python.sitePackages}/aiohttp/_cparser.pxd{,.orig}
'';

# NOTE: pytest-xdist cannot be added because it is flaky. See https://github.com/NixOS/nixpkgs/issues/230597 for more info.
nativeCheckInputs = [
freezegun
gunicorn
proxy-py
pytest-codspeed
pytest-cov-stub
pytest-mock
pytest-xdist
pytestCheckHook
python-on-whales
re-assert
Expand Down
22 changes: 11 additions & 11 deletions pkgs/development/python-modules/aiohttp/unvendor-llhttp.patch
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
diff --git a/Makefile b/Makefile
index 5769d2a1..f505dd81 100644
index b0a3ef32..f36132c6 100644
--- a/Makefile
+++ b/Makefile
@@ -71,7 +71,7 @@ vendor/llhttp/node_modules: vendor/llhttp/package.json
@@ -79,7 +79,7 @@ vendor/llhttp/node_modules: vendor/llhttp/package.json
generate-llhttp: .llhttp-gen

.PHONY: cythonize
-cythonize: .install-cython $(PYXS:.pyx=.c)
+cythonize: $(PYXS:.pyx=.c)
-cythonize: .install-cython $(PYXS:.pyx=.c) aiohttp/_websocket/reader_c.c
+cythonize: $(PYXS:.pyx=.c) aiohttp/_websocket/reader_c.c

.install-deps: .install-cython $(PYXS:.pyx=.c) $(call to-hash,$(CYS) $(REQS))
@python -m pip install -r requirements/dev.txt -c requirements/constraints.txt
.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
diff --git a/aiohttp/_cparser.pxd b/aiohttp/_cparser.pxd
index 165dd61d..bc6bf86d 100644
index c2cd5a92..9184ac60 100644
--- a/aiohttp/_cparser.pxd
+++ b/aiohttp/_cparser.pxd
@@ -10,7 +10,7 @@ from libc.stdint cimport (
)
@@ -1,7 +1,7 @@
from libc.stdint cimport int32_t, uint8_t, uint16_t, uint64_t


-cdef extern from "../vendor/llhttp/build/llhttp.h":
Expand All @@ -25,7 +25,7 @@ index 165dd61d..bc6bf86d 100644
struct llhttp__internal_s:
int32_t _index
diff --git a/setup.py b/setup.py
index 4d59a022..d87d5b69 100644
index 2f024e87..feebc638 100644
--- a/setup.py
+++ b/setup.py
@@ -17,13 +17,6 @@ if sys.implementation.name != "cpython":
Expand Down Expand Up @@ -56,5 +56,5 @@ index 4d59a022..d87d5b69 100644
+ library_dirs=["@llhttpLib@/lib"],
+ libraries=["llhttp"],
),
Extension("aiohttp._helpers", ["aiohttp/_helpers.c"]),
Extension("aiohttp._http_writer", ["aiohttp/_http_writer.c"]),
Extension("aiohttp._websocket.reader_c", ["aiohttp/_websocket/reader_c.c"]),
10 changes: 10 additions & 0 deletions pkgs/development/python-modules/aioresponses/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
buildPythonPackage,
fetchPypi,
fetchpatch2,
pythonOlder,

# build-system
Expand All @@ -28,6 +29,15 @@ buildPythonPackage rec {
hash = "sha256-95XZ29otYXdIQOfjL1Nm9FdS0a3Bt0yTYq/QFylsfuE=";
};

patches = [
(fetchpatch2 {
# https://github.com/pnuckowski/aioresponses/pull/262
name = "aiohttp-3.11.0-compat.patch";
url = "https://github.com/pnuckowski/aioresponses/commit/e909123c5a70180a54443899d26b44ada511cd39.patch";
hash = "sha256-i/2rPtX64buVrVDSdB06NMOJCTdgENsxZDyphXWRwJI=";
})
];

nativeBuildInputs = [
pbr
setuptools
Expand Down
11 changes: 11 additions & 0 deletions pkgs/development/python-modules/ase/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
stdenv,
fetchPypi,
fetchpatch2,
buildPythonPackage,
isPy27,
pythonAtLeast,
Expand Down Expand Up @@ -30,6 +31,16 @@ buildPythonPackage rec {
hash = "sha256-kaKqMdib2QsO/f5KfoQmTzKCiyq/yfOOZeBBrXb+yK4=";
};

patches = [
# https://gitlab.com/ase/ase/-/merge_requests/3400
(fetchpatch2 {
name = "numpy_2-compatibility.patch";
url = "https://gitlab.com/ase/ase/-/commit/5434193ad9dd2cb20a76b3d503fa2b50d7a8ed34.patch";
excludes = [ "pyproject.toml" ];
hash = "sha256-3hsyzYnFCrlZDT/jqJKKvj2UXjnjLU0U6PJqgOpA7CU=";
})
];

build-system = [ setuptools ];

dependencies = [
Expand Down
Loading

0 comments on commit 7b0b389

Please sign in to comment.