Packaging with buildPythonPackage dependencies error

Hello, I’m trying to package my own code, but encounter very unexpected problems

{
  lib,
  python311Packages,
}:

python311Packages.buildPythonPackage {
  name = "mytest";
  pyproject = true;
  src = ./.;
  build-system = with python311Packages; [ setuptools ];

  propagatedBuildInputs = with python311Packages; [
    ...
    aiorwlock
    ...
  ];
}

for some reason building this causes aiorwlock package to fail to build, it fails tests

error: builder for '/nix/store/68xhyr00a6nl5f3ccz7fvjxlb4kmgw00-python3.11-aiorwlock-1.5.0.drv' failed with exit code 1;
       last 25 log lines:
       > ERROR tests/test_rwlock.py::test_write_context_manager[fast]
       > ERROR tests/test_rwlock.py::test_await_read_lock[fast]
       > ERROR tests/test_rwlock.py::test_await_write_lock[fast]
       > ERROR tests/test_rwlock.py::test_created_outside_of_coroutine[fast]
       > ERROR tests/test_rwlock.py::test_many_readers[slow]
       > ERROR tests/test_rwlock.py::test_reader_recursion[slow]
       > ERROR tests/test_rwlock.py::test_writer_recursion[slow]
       > ERROR tests/test_rwlock.py::test_writer_then_reader_recursion[slow]
       > ERROR tests/test_rwlock.py::test_readers_writers[slow]
       > ERROR tests/test_rwlock.py::test_raise_error_on_with_for_reader_lock[slow]
       > ERROR tests/test_rwlock.py::test_raise_error_on_with_for_writer_lock[slow]
       > ERROR tests/test_rwlock.py::test_read_locked[slow]
       > ERROR tests/test_rwlock.py::test_write_locked[slow]
       > ERROR tests/test_rwlock.py::test_write_read_lock_multiple_tasks[slow]
       > ERROR tests/test_rwlock.py::test_read_context_manager[slow]
       > ERROR tests/test_rwlock.py::test_write_context_manager[slow]
       > ERROR tests/test_rwlock.py::test_await_read_lock[slow]
       > ERROR tests/test_rwlock.py::test_await_write_lock[slow]
       > ERROR tests/test_rwlock.py::test_created_outside_of_coroutine[slow]
       > ERROR tests/test_rwlock.py::test_read_upgrade_write_release
       > ERROR tests/test_rwlock.py::test_writer_recursion_fail
       > ERROR tests/test_rwlock.py::test_writer_success
       > ERROR tests/test_rwlock.py::test_writer_success_fast
       > ERROR tests/test_rwlock.py::test_writer_success_with_statement
       > ========================= 5 passed, 47 errors in 0.09s =========================
       For full logs, run:
         nix log /nix/store/68xhyr00a6nl5f3ccz7fvjxlb4kmgw00-python3.11-aiorwlock-1.5.0.drv

building aiorwlock by itself works fine nix build nixpkgs#python311Packages.aiorwlock
so I guess I’m doing something wrong and somehow overriding something in aiorwlock package so it fails to build.

another question i have here is how to specify a certain version of python package dependency in case my setup.cfg has version constraints on some requirements?

I’m ashamed to admit, that the issue with the test failure is due to the most obvious reason - my package flake was pointing to nixos-unstable, where this particular package is broken, while nix build command was using nixos stable branch…

sorry for inconveniences.

1 Like