Skip to content

Issues setting up development environment and running tests #2188

@etiennebresciani

Description

@etiennebresciani

I've had a hard time installing my development environment and running tests. I am reporting errors and practical solutions here, hoping that (1) it may help someone else and (2) this can be improved because it is a frustrating experience.

  1. Note that on Windows, the install command should be:

pip install -e ".[test]"

(i.e., ".[test]" must replace '.[test]' indicated in the documentation about contributing). Note that the [test] bit is important, otherwise several stuff are missing when running the tests with pytest.

  1. The above command produces errors such as:

ERROR setuptools_scm._get_version_impl command git not found while parsing the scm

if git is not installed in the Python environment. It would be better to have git as an explicit requirement.

  1. Then, I got the following error when running pip install -r requirements_docs.txt:

ERROR: Failed building wheel for cffi

I figured out this is a bug related to cffi version 1.15.0 with Python 3.13. The problem is that this specific version of cffi is forced by mpi. Therefore, we cannot use Python 3.13. I was able to successfully install the requirements in an environment under Python 3.12.

  1. Then, when running pytest, I had errors such as:

RuntimeError: Attempting to use an asynchronous Client in a synchronous context of dask.compute

I figured out this is a bug since using dask version 2025.3.0. I solved it with:

pip install dask==2025.1.0
pip install distributed==2025.1.0

Hence, I guess dask version should be imposed to be inferior to 2025.3.0 in the requirements (until it gets resolved in dask).

  1. Then pytest gave me another errors such as:

_____________________________________________________ test_array_quantity_creation_by_multiplication[sparse-Unit-array-first] _____________________________________________________
[XPASS(strict)] upstream issue numpy/numpy#15200

I figured out it is a Numpy's bug and it has been identified in pint, but without saying what to do with it. I then figured out you can smoothly run tests ignoring this issue by setting

xfail_strict = true

instead of false in pyproject.toml before doing the install (i.e. before pip install -e ".[test]").

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions