From 2444dc755c93786852595f0afc9be17ba654878c Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sun, 9 Mar 2025 20:11:11 +0100 Subject: [PATCH 1/2] python312Packages.hydra-core: fix on python 3.13, cleanup --- .../python-modules/hydra-core/default.nix | 64 ++++++++++++------- 1 file changed, 42 insertions(+), 22 deletions(-) diff --git a/pkgs/development/python-modules/hydra-core/default.nix b/pkgs/development/python-modules/hydra-core/default.nix index 6264ff89d6c7..1484503de7aa 100644 --- a/pkgs/development/python-modules/hydra-core/default.nix +++ b/pkgs/development/python-modules/hydra-core/default.nix @@ -1,25 +1,33 @@ { lib, - antlr4, - antlr4-python3-runtime, buildPythonPackage, fetchFromGitHub, + + # build-system + setuptools, + + # patches + replaceVars, + antlr4, fetchpatch, - importlib-resources, + + # nativeBuildInputs jre_headless, + + # dependencies + antlr4-python3-runtime, omegaconf, packaging, + + # tests pytestCheckHook, - pythonOlder, - replaceVars, + pythonAtLeast, }: buildPythonPackage rec { pname = "hydra-core"; version = "1.3.2"; - format = "setuptools"; - - disabled = pythonOlder "3.6"; + pyproject = true; src = fetchFromGitHub { owner = "facebookresearch"; @@ -44,17 +52,23 @@ buildPythonPackage rec { # We substitute the path to the jar with the one from our antlr4 # package, so this file becomes unused rm -v build_helpers/bin/antlr*-complete.jar - - sed -i 's/antlr4-python3-runtime==.*/antlr4-python3-runtime/' requirements/requirements.txt ''; + build-system = [ + setuptools + ]; + nativeBuildInputs = [ jre_headless ]; - propagatedBuildInputs = [ + pythonRelaxDeps = [ + "antlr4-python3-runtime" + ]; + + dependencies = [ antlr4-python3-runtime omegaconf packaging - ] ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ]; + ]; nativeCheckInputs = [ pytestCheckHook ]; @@ -64,13 +78,18 @@ buildPythonPackage rec { ]; # Test environment setup broken under Nix for a few tests: - disabledTests = [ - "test_bash_completion_with_dot_in_path" - "test_install_uninstall" - "test_config_search_path" - # does not raise UserWarning - "test_initialize_compat_version_base" - ]; + disabledTests = + [ + "test_bash_completion_with_dot_in_path" + "test_install_uninstall" + "test_config_search_path" + # does not raise UserWarning + "test_initialize_compat_version_base" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # AssertionError: Regex pattern did not match + "test_failure" + ]; disabledTestPaths = [ "tests/test_hydra.py" ]; @@ -80,10 +99,11 @@ buildPythonPackage rec { "hydra.version" ]; - meta = with lib; { + meta = { description = "Framework for configuring complex applications"; homepage = "https://hydra.cc"; - license = licenses.mit; - maintainers = with maintainers; [ bcdarwin ]; + changelog = "https://github.com/facebookresearch/hydra/blob/v${version}/NEWS.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ bcdarwin ]; }; } From 6227dcc011c81c679a6ddcd78fe4d62e314453ec Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sun, 9 Mar 2025 19:52:38 +0100 Subject: [PATCH 2/2] python312Packages.nocturne: unstable-2022-10-15 -> 0-unstable-2024-06-19 --- .../python-modules/nocturne/default.nix | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/pkgs/development/python-modules/nocturne/default.nix b/pkgs/development/python-modules/nocturne/default.nix index 2d105972419e..3c4ac1f6e830 100644 --- a/pkgs/development/python-modules/nocturne/default.nix +++ b/pkgs/development/python-modules/nocturne/default.nix @@ -1,27 +1,28 @@ { - buildPythonPackage, - cmake, - fetchFromGitHub, - gtest, - hydra-core, lib, + buildPythonPackage, + fetchFromGitHub, nlohmann_json, pybind11, - pyvirtualdisplay, - sfml, replaceVars, + gtest, + setuptools, + cmake, + sfml, + hydra-core, + pyvirtualdisplay, }: -buildPythonPackage rec { +buildPythonPackage { pname = "nocturne"; - version = "unstable-2022-10-15"; - format = "setuptools"; + version = "0-unstable-2024-06-19"; + pyproject = true; src = fetchFromGitHub { owner = "facebookresearch"; - repo = pname; - rev = "ae0a4e361457caf6b7e397675cc86f46161405ed"; - hash = "sha256-pFVbl4m7qX1mJgleNabRboS9klDDsbzUa4PYL5+Jupc="; + repo = "nocturne"; + rev = "6d1e0f329f7acbed01c934842b269333540af6d2"; + hash = "sha256-Ufhvc+IZUrn8i6Fmu6o81LPjY1Jo0vzsso+eLbI1F2s="; }; # Simulate the git submodules but with nixpkgs dependencies @@ -37,13 +38,17 @@ buildPythonPackage rec { }) ]; + build-system = [ + setuptools + ]; + nativeBuildInputs = [ cmake ]; dontUseCmakeConfigure = true; buildInputs = [ sfml ]; # hydra-core and pyvirtualdisplay are not declared as dependences but they are requirements - propagatedBuildInputs = [ + dependencies = [ hydra-core pyvirtualdisplay ]; @@ -53,10 +58,10 @@ buildPythonPackage rec { pythonImportsCheck = [ "nocturne" ]; - meta = with lib; { + meta = { description = "Data-driven, fast driving simulator for multi-agent coordination under partial observability"; homepage = "https://github.com/facebookresearch/nocturne"; - license = licenses.mit; - maintainers = with maintainers; [ samuela ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ samuela ]; }; }