From 88ee42a4bdd2f39d440faeb20009a13223c59695 Mon Sep 17 00:00:00 2001 From: Samuel Ainsworth Date: Tue, 3 Jan 2023 05:35:56 +0000 Subject: python3Packages.hydra-core: fix #208843 --- pkgs/development/python-modules/hydra-core/default.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkgs/development/python-modules') diff --git a/pkgs/development/python-modules/hydra-core/default.nix b/pkgs/development/python-modules/hydra-core/default.nix index 17dda8404b4ad..d16b1137312c5 100644 --- a/pkgs/development/python-modules/hydra-core/default.nix +++ b/pkgs/development/python-modules/hydra-core/default.nix @@ -7,6 +7,7 @@ , importlib-resources , jre_headless , omegaconf +, packaging , pytestCheckHook , pythonOlder , substituteAll @@ -48,6 +49,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ antlr4-python3-runtime omegaconf + packaging ] ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ]; @@ -69,6 +71,8 @@ buildPythonPackage rec { pythonImportsCheck = [ "hydra" + # See https://github.com/NixOS/nixpkgs/issues/208843 + "hydra.version" ]; meta = with lib; { -- cgit 1.4.1 From 6de86d47d39137e320b55bb90de19b96248fec39 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Wed, 4 Jan 2023 13:34:54 -0700 Subject: pythonPackages.thefuzz: init at 0.19.0 Co-authored-by: Erik Arvstedt Signed-off-by: Sumner Evans --- .../development/python-modules/thefuzz/default.nix | 50 ++++++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 52 insertions(+) create mode 100644 pkgs/development/python-modules/thefuzz/default.nix (limited to 'pkgs/development/python-modules') diff --git a/pkgs/development/python-modules/thefuzz/default.nix b/pkgs/development/python-modules/thefuzz/default.nix new file mode 100644 index 0000000000000..e521182a395a4 --- /dev/null +++ b/pkgs/development/python-modules/thefuzz/default.nix @@ -0,0 +1,50 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder +, pytestCheckHook +, hypothesis +, python-Levenshtein +}: + +buildPythonPackage rec { + pname = "thefuzz"; + version = "0.19.0"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-b3Em2y8silQhKwXjp0DkX0KRxJfXXSB1Fyj2Nbt0qj0="; + }; + + propagatedBuildInputs = [ python-Levenshtein ]; + + # Skip linting + postPatch = '' + substituteInPlace test_thefuzz.py --replace "import pycodestyle" "" + ''; + + pythonImportsCheck = [ + "thefuzz" + ]; + + checkInputs = [ + hypothesis + pytestCheckHook + ]; + + disabledTests = [ + # Skip linting + "test_pep8_conformance" + ]; + + meta = with lib; { + description = "Fuzzy string matching for Python"; + homepage = "https://github.com/seatgeek/thefuzz"; + changelog = "https://github.com/seatgeek/thefuzz/blob/${version}/CHANGES.rst"; + license = licenses.gpl2Only; + maintainers = with maintainers; [ sumnerevans ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b6aaa8a203bd9..d64b76ac0044a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11199,6 +11199,8 @@ self: super: with self; { cudnnSupport = false; }; + thefuzz = callPackage ../development/python-modules/thefuzz { }; + thermobeacon-ble = callPackage ../development/python-modules/thermobeacon-ble { }; thermopro-ble = callPackage ../development/python-modules/thermopro-ble { }; -- cgit 1.4.1 From ecf05f1c15eb348bf3f72cb2bc2729f6f10974ec Mon Sep 17 00:00:00 2001 From: Samuel Ainsworth Date: Sun, 8 Jan 2023 04:17:59 +0000 Subject: python3Packages: virtual-display -> PyVirtualDisplay virtual-display is a quite old package, and it's not clear why it was named "virtual-display" as the PyPI name is (and was) "PyVirtualDisplay". In any case, this commit rectifies that inconsistency. --- .../python-modules/PyVirtualDisplay/default.nix | 23 ++++++++++++++++++++++ .../python-modules/pytest-xvfb/default.nix | 4 ++-- .../python-modules/virtual-display/default.nix | 23 ---------------------- pkgs/top-level/python-aliases.nix | 1 + pkgs/top-level/python-packages.nix | 6 ++++-- 5 files changed, 30 insertions(+), 27 deletions(-) create mode 100644 pkgs/development/python-modules/PyVirtualDisplay/default.nix delete mode 100644 pkgs/development/python-modules/virtual-display/default.nix (limited to 'pkgs/development/python-modules') diff --git a/pkgs/development/python-modules/PyVirtualDisplay/default.nix b/pkgs/development/python-modules/PyVirtualDisplay/default.nix new file mode 100644 index 0000000000000..bc7469e1d61a0 --- /dev/null +++ b/pkgs/development/python-modules/PyVirtualDisplay/default.nix @@ -0,0 +1,23 @@ +{ lib, buildPythonPackage, fetchPypi, EasyProcess }: + +buildPythonPackage rec { + pname = "PyVirtualDisplay"; + version = "3.0"; + + propagatedBuildInputs = [ EasyProcess ]; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-CXVbw86263JfsH7KVCX0PyNY078I4A0qm3kqGu3RYVk="; + }; + + # requires X server + doCheck = false; + + meta = with lib; { + description = "Python wrapper for Xvfb, Xephyr and Xvnc"; + homepage = "https://github.com/ponty/pyvirtualdisplay"; + license = licenses.bsdOriginal; + maintainers = with maintainers; [ layus ]; + }; +} diff --git a/pkgs/development/python-modules/pytest-xvfb/default.nix b/pkgs/development/python-modules/pytest-xvfb/default.nix index c3dabe7f6e30a..f4038c557797b 100644 --- a/pkgs/development/python-modules/pytest-xvfb/default.nix +++ b/pkgs/development/python-modules/pytest-xvfb/default.nix @@ -2,7 +2,7 @@ , buildPythonPackage , fetchPypi , pytest -, virtual-display +, PyVirtualDisplay , isPy27 }: @@ -19,7 +19,7 @@ buildPythonPackage rec { buildInputs = [ pytest ]; propagatedBuildInputs = [ - virtual-display + PyVirtualDisplay ]; meta = with lib; { diff --git a/pkgs/development/python-modules/virtual-display/default.nix b/pkgs/development/python-modules/virtual-display/default.nix deleted file mode 100644 index bc7469e1d61a0..0000000000000 --- a/pkgs/development/python-modules/virtual-display/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ lib, buildPythonPackage, fetchPypi, EasyProcess }: - -buildPythonPackage rec { - pname = "PyVirtualDisplay"; - version = "3.0"; - - propagatedBuildInputs = [ EasyProcess ]; - - src = fetchPypi { - inherit pname version; - sha256 = "sha256-CXVbw86263JfsH7KVCX0PyNY078I4A0qm3kqGu3RYVk="; - }; - - # requires X server - doCheck = false; - - meta = with lib; { - description = "Python wrapper for Xvfb, Xephyr and Xvnc"; - homepage = "https://github.com/ponty/pyvirtualdisplay"; - license = licenses.bsdOriginal; - maintainers = with maintainers; [ layus ]; - }; -} diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index 75f5cf537a20f..e7bfd9fa0161d 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -223,6 +223,7 @@ mapAliases ({ unittest2 = throw "unittest2 has been removed as it's a backport of unittest that's unmaintained and not needed beyond Python 3.4."; # added 2022-12-01 uproot3 = throw "uproot3 has been removed, use uproot instead"; # added 2022-12-13 uproot3-methods = throw "uproot3-methods has been removed"; # added 2022-12-13 + virtual-display = throw "virtual-display has been renamed to PyVirtualDisplay"; # added 2023-01-07 Wand = wand; # added 2022-11-13 WazeRouteCalculator = wazeroutecalculator; # added 2021-09-29 weakrefmethod = throw "weakrefmethod was removed since it's not needed in Python >= 3.4"; # added 2022-12-01 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7e1a758e4d4ce..ed6f6319c9f37 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6285,6 +6285,8 @@ self: super: with self; { nocaselist = callPackage ../development/python-modules/nocaselist { }; + nocturne = callPackage ../development/python-modules/nocturne { }; + nodeenv = callPackage ../development/python-modules/nodeenv { }; nodepy-runtime = callPackage ../development/python-modules/nodepy-runtime { }; @@ -9454,6 +9456,8 @@ self: super: with self; { pyvicare = callPackage ../development/python-modules/pyvicare { }; + PyVirtualDisplay = callPackage ../development/python-modules/PyVirtualDisplay { }; + pyvis = callPackage ../development/python-modules/pyvis { }; pyvisa = callPackage ../development/python-modules/pyvisa { }; @@ -11848,8 +11852,6 @@ self: super: with self; { virtkey = callPackage ../development/python-modules/virtkey { }; - virtual-display = callPackage ../development/python-modules/virtual-display { }; - virtualenv = callPackage ../development/python-modules/virtualenv { }; virtualenv-clone = callPackage ../development/python-modules/virtualenv-clone { }; -- cgit 1.4.1 From 0fb94ef0d86e6947d44831e3c67060f6bc4f3694 Mon Sep 17 00:00:00 2001 From: Samuel Ainsworth Date: Sun, 8 Jan 2023 04:18:18 +0000 Subject: python3Packages.nocturne: init at unstable-2022-10-15 --- .../python-modules/nocturne/default.nix | 61 ++++++++++++++++++++++ .../python-modules/nocturne/dependencies.patch | 27 ++++++++++ 2 files changed, 88 insertions(+) create mode 100644 pkgs/development/python-modules/nocturne/default.nix create mode 100644 pkgs/development/python-modules/nocturne/dependencies.patch (limited to 'pkgs/development/python-modules') diff --git a/pkgs/development/python-modules/nocturne/default.nix b/pkgs/development/python-modules/nocturne/default.nix new file mode 100644 index 0000000000000..42424f1dacc97 --- /dev/null +++ b/pkgs/development/python-modules/nocturne/default.nix @@ -0,0 +1,61 @@ +{ buildPythonPackage +, cmake +, fetchFromGitHub +, gtest +, hydra-core +, lib +, nlohmann_json +, pybind11 +, PyVirtualDisplay +, sfml +, substituteAll +}: + +buildPythonPackage rec { + pname = "nocturne"; + version = "unstable-2022-10-15"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "facebookresearch"; + repo = pname; + rev = "ae0a4e361457caf6b7e397675cc86f46161405ed"; + hash = "sha256-pFVbl4m7qX1mJgleNabRboS9klDDsbzUa4PYL5+Jupc="; + }; + + # Simulate the git submodules but with nixpkgs dependencies + postUnpack = '' + rm -rf $sourceRoot/third_party/* + ln -s ${nlohmann_json.src} $sourceRoot/third_party/json + ln -s ${pybind11.src} $sourceRoot/third_party/pybind11 + ''; + + patches = [ + (substituteAll { + src = ./dependencies.patch; + gtest_src = gtest.src; + }) + ]; + + nativeBuildInputs = [ cmake ]; + dontUseCmakeConfigure = true; + + buildInputs = [ sfml ]; + + # hydra-core and PyVirtualDisplay are not declared as dependences but they are requirements + propagatedBuildInputs = [ hydra-core PyVirtualDisplay ]; + + # Test suite requires hydra-submitit-launcher which is not packaged as of 2022-01-02 + doCheck = false; + + pythonImportsCheck = [ + "nocturne" + ]; + + meta = with lib; { + description = "A 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 ]; + }; +} diff --git a/pkgs/development/python-modules/nocturne/dependencies.patch b/pkgs/development/python-modules/nocturne/dependencies.patch new file mode 100644 index 0000000000000..18843ff6309f3 --- /dev/null +++ b/pkgs/development/python-modules/nocturne/dependencies.patch @@ -0,0 +1,27 @@ +diff --git a/nocturne/cpp/CMakeLists.txt b/nocturne/cpp/CMakeLists.txt +index c67815f..e1f825b 100644 +--- a/nocturne/cpp/CMakeLists.txt ++++ b/nocturne/cpp/CMakeLists.txt +@@ -62,8 +62,7 @@ include(FetchContent) + + FetchContent_Declare( + googletest +- GIT_REPOSITORY https://github.com/google/googletest.git +- GIT_TAG main ++ SOURCE_DIR @gtest_src@ + ) + + set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +diff --git a/setup.py b/setup.py +index 4863ae6..b5d3545 100644 +--- a/setup.py ++++ b/setup.py +@@ -92,6 +92,8 @@ def main(): + # with open("./requirements.txt", "r") as f: + # requires = f.read().splitlines() + setup( ++ # Adding `packages=` is necessary to get `python setup.py install` to work ++ packages=["nocturne", "cfgs"], + ext_modules=[CMakeExtension("nocturne", "./nocturne")], + cmdclass=dict(build_ext=CMakeBuild), + ) -- cgit 1.4.1