diff --git a/pkgs/by-name/li/litestar/package.nix b/pkgs/by-name/li/litestar/package.nix index 14d597236c96a..3aed08801b3a8 100644 --- a/pkgs/by-name/li/litestar/package.nix +++ b/pkgs/by-name/li/litestar/package.nix @@ -45,6 +45,21 @@ python3Packages.buildPythonApplication rec { picologging ]; + nativeCheckInputs = with python3Packages; [ + pytestCheckHook + pytest-lazy-fixtures + pytest-xdist + pytest-mock + pytest-asyncio + pytest-timeout + pytest-rerunfailures + ]; + + pytestFlagsArray = [ + # Follow github CI + "docs/examples/" + ]; + meta = { homepage = "https://litestar.dev/"; platforms = lib.platforms.unix; diff --git a/pkgs/by-name/se/selenium-manager/package.nix b/pkgs/by-name/se/selenium-manager/package.nix index 3f28c4d6ee8a2..213f97a9dd828 100644 --- a/pkgs/by-name/se/selenium-manager/package.nix +++ b/pkgs/by-name/se/selenium-manager/package.nix @@ -7,18 +7,18 @@ rustPlatform.buildRustPackage rec { pname = "selenium-manager"; - version = "4.27.0"; + version = "4.28.0"; src = fetchFromGitHub { owner = "SeleniumHQ"; repo = "selenium"; - rev = "selenium-${version}"; - hash = "sha256-1i+kPOWTpLYzwhPgUoQXLQ4k+Q1w9KL2VNxvs38SqPc="; + tag = "selenium-${version}"; + hash = "sha256-b5xwuZ4lcwLbGhJuEmHYrFXoaTW/M0ABdK3dvbpj8oM="; }; sourceRoot = "${src.name}/rust"; - cargoHash = "sha256-lD9SFqBO9hhyTD4e7LSBktJzbj7uXk6naHEp9uZPhPc="; + cargoHash = "sha256-hEfAfds0LSuTmEEydjS2Q96GWlmZKZstt3+tFUOHNBA="; buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.SystemConfiguration diff --git a/pkgs/development/python-modules/picologging/default.nix b/pkgs/development/python-modules/picologging/default.nix index c5a3ac1782738..6d6d278097975 100644 --- a/pkgs/development/python-modules/picologging/default.nix +++ b/pkgs/development/python-modules/picologging/default.nix @@ -25,6 +25,12 @@ buildPythonPackage rec { hash = "sha256-t75D7aNKAifzeCPwtyKp8LoiXtbbXspRFYnsI0gx+V4="; }; + patches = [ + # For python 313 + # https://github.com/microsoft/picologging/pull/212 + ./pr-212.patch + ]; + build-system = [ setuptools cmake diff --git a/pkgs/development/python-modules/picologging/pr-212.patch b/pkgs/development/python-modules/picologging/pr-212.patch new file mode 100644 index 0000000000000..01498fcd74091 --- /dev/null +++ b/pkgs/development/python-modules/picologging/pr-212.patch @@ -0,0 +1,94 @@ +diff --git a/src/picologging/compat.hxx b/src/picologging/compat.hxx +index d3356da..be7a1fc 100644 +--- a/src/picologging/compat.hxx ++++ b/src/picologging/compat.hxx +@@ -88,4 +88,12 @@ static inline PyObject* _Py_XNewRef(PyObject *obj) + } + #endif + ++// For Python 3.13 and above, PyTime_t is now part of the public API ++#if PY_VERSION_HEX >= 0x030d0000 ++#define _PyTime_t PyTime_t ++#define _PyTime_AsSecondsDouble PyTime_AsSecondsDouble ++#define _PyTime_AsMilliseconds PyTime_AsMilliseconds ++#define _PyTime_ROUND_CEILING PyTime_ROUND_CEILING ++#endif ++ + #endif // COMPAT_H +\ No newline at end of file + +From fe313d8b3dcf0115e1be781e03b20673d3f51c3f Mon Sep 17 00:00:00 2001 +From: Anthony Shaw +Date: Sat, 14 Sep 2024 17:33:25 +1000 +Subject: [PATCH 2/2] Patch other changed APIs for pytime + +--- + pyproject.toml | 2 +- + src/picologging/compat.hxx | 2 -- + src/picologging/logrecord.cxx | 13 +++++++++++++ + 3 files changed, 14 insertions(+), 3 deletions(-) + +diff --git a/pyproject.toml b/pyproject.toml +index 33abe66..27628c9 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -1,7 +1,7 @@ + [build-system] + requires = [ + "setuptools>=65.4.1", +- "scikit-build>=0.17.0", ++ "scikit-build>=0.18.0", + "cmake>=3.18", + "ninja", + ] +diff --git a/src/picologging/compat.hxx b/src/picologging/compat.hxx +index be7a1fc..7c6970d 100644 +--- a/src/picologging/compat.hxx ++++ b/src/picologging/compat.hxx +@@ -92,8 +92,6 @@ static inline PyObject* _Py_XNewRef(PyObject *obj) + #if PY_VERSION_HEX >= 0x030d0000 + #define _PyTime_t PyTime_t + #define _PyTime_AsSecondsDouble PyTime_AsSecondsDouble +-#define _PyTime_AsMilliseconds PyTime_AsMilliseconds +-#define _PyTime_ROUND_CEILING PyTime_ROUND_CEILING + #endif + + #endif // COMPAT_H +\ No newline at end of file +diff --git a/src/picologging/logrecord.cxx b/src/picologging/logrecord.cxx +index cec68c9..9f5cf86 100644 +--- a/src/picologging/logrecord.cxx ++++ b/src/picologging/logrecord.cxx +@@ -16,11 +16,19 @@ _PyFloat_FromPyTime(_PyTime_t t) + + _PyTime_t current_time() + { ++#if PY_VERSION_HEX >= 0x030d0000 ++ _PyTime_t t; ++ if (PyTime_Time(&t) < 0) { ++ return -1; ++ } ++ return t; ++#else + _PyTime_t t; + if (_PyTime_GetSystemClockWithInfo(&t, NULL) < 0) { + return -1; + } + return t; ++#endif + } + + PyObject* LogRecord_new(PyTypeObject* type, PyObject *initargs, PyObject *kwds) +@@ -162,7 +170,12 @@ LogRecord* LogRecord_create(LogRecord* self, PyObject* name, PyObject* msg, PyOb + } + + self->created = _PyTime_AsSecondsDouble(ctime); ++// msecs conversion isn't in 3.13 API ++#if PY_VERSION_HEX < 0x030d0000 + self->msecs = _PyTime_AsMilliseconds(ctime, _PyTime_ROUND_CEILING); ++#else ++ self->msecs = 0; ++#endif + self->relativeCreated = _PyFloat_FromPyTime((ctime - startTime) * 1000); + self->thread = PyThread_get_thread_ident(); // Only supported in Python 3.7+, if big demand for 3.6 patch this out for the old API. + // TODO #2 : See if there is a performant way to get the thread name. diff --git a/pkgs/development/python-modules/psycopg/default.nix b/pkgs/development/python-modules/psycopg/default.nix index fcfa87b1a9b20..527ab08cb9002 100644 --- a/pkgs/development/python-modules/psycopg/default.nix +++ b/pkgs/development/python-modules/psycopg/default.nix @@ -34,13 +34,13 @@ let pname = "psycopg"; - version = "3.2.3"; + version = "3.2.4"; src = fetchFromGitHub { owner = "psycopg"; - repo = pname; + repo = "psycopg"; tag = version; - hash = "sha256-vcUZvQeD5MnEM02phk73I9dpf0Eug95V7Rspi0s6S2M="; + hash = "sha256-gicntSAEK5VO67M2gAGR6wSwKQwgnbHxVUoPpaAbaDk="; }; patches = [ diff --git a/pkgs/development/python-modules/selenium/default.nix b/pkgs/development/python-modules/selenium/default.nix index c596ec3b40c61..356d8f5598daf 100644 --- a/pkgs/development/python-modules/selenium/default.nix +++ b/pkgs/development/python-modules/selenium/default.nix @@ -20,17 +20,16 @@ buildPythonPackage rec { pname = "selenium"; - version = "4.27.1"; + version = "4.28.0"; pyproject = true; - disabled = pythonOlder "3.7"; + disabled = pythonOlder "3.9"; src = fetchFromGitHub { owner = "SeleniumHQ"; repo = "selenium"; - # check if there is a newer tag with or without -python suffix - tag = "selenium-${version}-python"; - hash = "sha256-XpTfZCERA2SmLOj6dcERVJ47K0gFhdXMTl9VCeE6eD8="; + tag = "selenium-${version}" + lib.optionalString (lib.versions.patch version != "0") "-python"; + hash = "sha256-b5xwuZ4lcwLbGhJuEmHYrFXoaTW/M0ABdK3dvbpj8oM="; }; patches = [ ./dont-build-the-selenium-manager.patch ]; diff --git a/pkgs/development/python-modules/selenium/dont-build-the-selenium-manager.patch b/pkgs/development/python-modules/selenium/dont-build-the-selenium-manager.patch index 4654e00b49194..42ec9ce797744 100644 --- a/pkgs/development/python-modules/selenium/dont-build-the-selenium-manager.patch +++ b/pkgs/development/python-modules/selenium/dont-build-the-selenium-manager.patch @@ -1,5 +1,5 @@ diff --git a/py/pyproject.toml b/py/pyproject.toml -index e99a03cd5d..1061adbdf5 100644 +index 9afa6a63c7..c28f9a4cbc 100644 --- a/py/pyproject.toml +++ b/py/pyproject.toml @@ -1,5 +1,5 @@ @@ -9,47 +9,13 @@ index e99a03cd5d..1061adbdf5 100644 build-backend = "setuptools.build_meta" [project] -diff --git a/py/setup.py b/py/setup.py -deleted file mode 100755 -index 0f93e33f0e..0000000000 ---- a/py/setup.py -+++ /dev/null -@@ -1,38 +0,0 @@ --# Licensed to the Software Freedom Conservancy (SFC) under one --# or more contributor license agreements. See the NOTICE file --# distributed with this work for additional information --# regarding copyright ownership. The SFC licenses this file --# to you under the Apache License, Version 2.0 (the --# "License"); you may not use this file except in compliance --# with the License. You may obtain a copy of the License at --# --# http://www.apache.org/licenses/LICENSE-2.0 --# --# Unless required by applicable law or agreed to in writing, --# software distributed under the License is distributed on an --# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --# KIND, either express or implied. See the License for the --# specific language governing permissions and limitations --# under the License. -- --from distutils.command.install import INSTALL_SCHEMES --from os.path import dirname, join, abspath --from setuptools import setup --from setuptools.command.install import install --from setuptools_rust import Binding, RustExtension -- -- --for scheme in INSTALL_SCHEMES.values(): -- scheme['data'] = scheme['purelib'] -- --setup_args = { -- 'cmdclass': {'install': install}, -- 'rust_extensions': [ -- RustExtension( -- {"selenium-manager": "selenium.webdriver.common.selenium-manager"}, -- binding=Binding.Exec -- ) -- ], --} +@@ -43,9 +43,6 @@ exclude = ["test*"] + namespaces = false + # include-package-data is `true` by default in pyproject.toml + +-[[tool.setuptools-rust.bins]] +-target = "selenium.webdriver.common.selenium-manager" - --setup(**setup_args) + [project.urls] + Repository = "https://github.com/SeleniumHQ/selenium/" + BugTracker = "https://github.com/SeleniumHQ/selenium/issues" diff --git a/pkgs/development/python-modules/shapely/default.nix b/pkgs/development/python-modules/shapely/default.nix index 914b6deccb6ca..9e078d92610c4 100644 --- a/pkgs/development/python-modules/shapely/default.nix +++ b/pkgs/development/python-modules/shapely/default.nix @@ -7,7 +7,7 @@ pytestCheckHook, pythonOlder, - cython_0, + cython, geos, numpy, oldest-supported-numpy, @@ -36,7 +36,7 @@ buildPythonPackage rec { ]; nativeBuildInputs = [ - cython_0 + cython geos # for geos-config oldest-supported-numpy setuptools @@ -45,7 +45,7 @@ buildPythonPackage rec { buildInputs = [ geos ]; - propagatedBuildInputs = [ numpy ]; + dependencies = [ numpy ]; nativeCheckInputs = [ pytestCheckHook ]; @@ -68,11 +68,11 @@ buildPythonPackage rec { pythonImportsCheck = [ "shapely" ]; - meta = with lib; { + meta = { changelog = "https://github.com/shapely/shapely/blob/${version}/CHANGES.txt"; description = "Manipulation and analysis of geometric objects"; homepage = "https://github.com/shapely/shapely"; - license = licenses.bsd3; - maintainers = teams.geospatial.members; + license = lib.licenses.bsd3; + maintainers = lib.teams.geospatial.members; }; } diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index fb355d48bcc55..deeb109dbbc69 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7550,6 +7550,10 @@ self: super: with self; { litestar-htmx = callPackage ../development/python-modules/litestar-htmx { }; + litestar = toPythonModule (pkgs.litestar.override { + python3Packages = pythonPackages; + }); + littleutils = callPackage ../development/python-modules/littleutils { }; livelossplot = callPackage ../development/python-modules/livelossplot { };