From 06b2f7730a0a744099ddccabee2b568a57c3b063 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 20 May 2024 10:58:30 +0300 Subject: [PATCH 1/2] python311Packages.rowan: init at 1.3.0 --- .../python-modules/rowan/default.nix | 43 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 45 insertions(+) create mode 100644 pkgs/development/python-modules/rowan/default.nix diff --git a/pkgs/development/python-modules/rowan/default.nix b/pkgs/development/python-modules/rowan/default.nix new file mode 100644 index 000000000000..b6217b8b5f46 --- /dev/null +++ b/pkgs/development/python-modules/rowan/default.nix @@ -0,0 +1,43 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, setuptools +, pytestCheckHook +, scipy +, numpy +}: + +buildPythonPackage rec { + pname = "rowan"; + version = "1.3.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "glotzerlab"; + repo = "rowan"; + rev = "v${version}"; + hash = "sha256-klIqyX04w1xYmYtAbLF5jwpcJ83oKOaENboxyCL70EY="; + }; + + nativeBuildInputs = [ + setuptools + ]; + nativeCheckInputs = [ + pytestCheckHook + scipy + ]; + + propagatedBuildInputs = [ + numpy + ]; + + pythonImportsCheck = [ "rowan" ]; + + meta = with lib; { + description = "A Python package for working with quaternions"; + homepage = "https://github.com/glotzerlab/rowan"; + changelog = "https://github.com/glotzerlab/rowan/blob/${src.rev}/ChangeLog.rst"; + license = licenses.bsd3; + maintainers = with maintainers; [ doronbehar ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 455b2ddbff3b..8f2ff46e5f79 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13412,6 +13412,8 @@ self: super: with self; { rova = callPackage ../development/python-modules/rova { }; + rowan = callPackage ../development/python-modules/rowan { }; + rpcq = callPackage ../development/python-modules/rpcq { }; rpdb = callPackage ../development/python-modules/rpdb { }; From d5f26ad1c93038133a2c3db311925b72c69f7307 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 20 May 2024 10:58:51 +0300 Subject: [PATCH 2/2] python311Packages.freud: init at 3.0.0 --- .../python-modules/freud/default.nix | 90 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 92 insertions(+) create mode 100644 pkgs/development/python-modules/freud/default.nix diff --git a/pkgs/development/python-modules/freud/default.nix b/pkgs/development/python-modules/freud/default.nix new file mode 100644 index 000000000000..e5b776734367 --- /dev/null +++ b/pkgs/development/python-modules/freud/default.nix @@ -0,0 +1,90 @@ +{ lib +, stdenv +, buildPythonPackage +, fetchFromGitHub +, cmake +, cython +, oldest-supported-numpy +, scikit-build +, setuptools +, tbb +, numpy +, rowan +, scipy +, pytest +, gsd +, matplotlib +, sympy +}: + +buildPythonPackage rec { + pname = "freud"; + version = "3.0.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "glotzerlab"; + repo = "freud"; + rev = "v${version}"; + hash = "sha256-aKh2Gub1vU/wzvWkCl8yzlIswp8CtR975USiCr6ijUI="; + fetchSubmodules = true; + }; + # Because we prefer to not `leaveDotGit`, we need to fool upstream into + # thinking we left the .git files in the submodules, so cmake won't think we + # didn't initialize them. Upstream doesn't support using the system wide + # installed version of these libraries, and it's probably aint's worth the + # hassle, because upstream also doesn't distribute all of these dependencies' + # libraries, and probably it uses only what it needs. + preConfigure = '' + touch extern/{voro++,fsph,Eigen}/.git + ''; + + nativeBuildInputs = [ + cmake + cython + oldest-supported-numpy + scikit-build + setuptools + ]; + dontUseCmakeConfigure = true; + buildInputs = [ + tbb + ]; + + propagatedBuildInputs = [ + numpy + rowan + scipy + ]; + + nativeCheckInputs = [ + # Encountering circular ImportError issues with pytestCheckHook, see also: + # https://github.com/NixOS/nixpkgs/issues/255262 + pytest + gsd + matplotlib + sympy + ]; + checkPhase = '' + runHook preCheck + + pytest + + runHook postCheck + ''; + # Some tests fail on aarch64. If we could have used pytestCheckHook, we would + # have disabled only the tests that fail with the disabledTests attribute. + # But that is not possible unfortunately. See upstream report for the + # failure: https://github.com/glotzerlab/freud/issues/961 + doCheck = !stdenv.isAarch64; + + pythonImportsCheck = [ "freud" ]; + + meta = with lib; { + description = "Powerful, efficient particle trajectory analysis in scientific Python"; + homepage = "https://github.com/glotzerlab/freud"; + changelog = "https://github.com/glotzerlab/freud/blob/${src.rev}/ChangeLog.md"; + license = licenses.bsd3; + maintainers = with maintainers; [ doronbehar ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8f2ff46e5f79..edd1c3fbdc7e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4530,6 +4530,8 @@ self: super: with self; { frelatage = callPackage ../development/python-modules/frelatage { }; + freud = callPackage ../development/python-modules/freud { }; + frida-python = callPackage ../development/python-modules/frida-python { }; frigidaire = callPackage ../development/python-modules/frigidaire { };