Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python311Packages.pot: pypi missing files, switch to github; fixbuild #270851

Merged
merged 1 commit into from Nov 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 17 additions & 21 deletions pkgs/development/python-modules/pot/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{ lib
, autograd
, buildPythonPackage
, fetchFromGitHub
, cupy
, cvxopt
, cython
, fetchPypi
, oldest-supported-numpy
, matplotlib
, numpy
, tensorflow
Expand All @@ -20,19 +21,20 @@
buildPythonPackage rec {
pname = "pot";
version = "0.9.1";
format = "setuptools";
pyproject = true;

disabled = pythonOlder "3.6";

src = fetchPypi {
pname = "POT";
inherit version;
hash = "sha256-gcJTJ6ABl/8Rwf5SIc8YGtHf/mFWRBUuLhFd3d9eWRs=";
src = fetchFromGitHub {
owner = "PythonOT";
repo = "POT";
rev = version;
hash = "sha256-D61/dqO16VvcQx4FG1beKR4y1OQHndwCizaugNaUe4g=";
};

nativeBuildInputs = [
numpy
cython
oldest-supported-numpy
];

propagatedBuildInputs = [
Expand All @@ -59,17 +61,19 @@ buildPythonPackage rec {
--replace " --cov-report= --cov=ot" "" \
--replace " --durations=20" "" \
--replace " --junit-xml=junit-results.xml" ""
substituteInPlace setup.py \
--replace '"oldest-supported-numpy", ' ""

# we don't need setup.py to find the macos sdk for us
sed -i '/sdk_path/d' setup.py
'';

# To prevent importing of an incomplete package from the build directory
# instead of nix store (`ot` is the top-level package name).
# need to run the tests with the built package next to the test directory
preCheck = ''
rm -r ot
pushd build/lib.*
ln -s -t . "$OLDPWD/test"
'';

postCheck = ''
popd
'';

disabledTests = [
Expand Down Expand Up @@ -100,15 +104,7 @@ buildPythonPackage rec {
"test_emd1d_device_tf"
];

disabledTestPaths = [
# AttributeError: module pytest has no attribute skip_backend
"test/test_bregman.py"
"test/test_da.py"
"test/test_utils.py"
"test/test_gromov.py"
"test/test_helpers.py"
"test/test_unbalanced.py"
] ++ lib.optionals (!enableDimensionalityReduction) [
disabledTestPaths = lib.optionals (!enableDimensionalityReduction) [
"test/test_dr.py"
];

Expand Down