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

Fix micromamba test dependency conda-package-handling #2945

Merged
merged 1 commit into from
Oct 29, 2023

Conversation

rominf
Copy link
Contributor

@rominf rominf commented Oct 28, 2023

Previously it was not possible to run micromamba tests locally just by
following the instructions given here:
https://mamba.readthedocs.io/en/latest/developer_zone/build_locally.html#id1

$ pytest micromamba/tests/
============================= test session starts =============================
platform linux -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0
rootdir: /home/rominf/dev/mamba
configfile: pyproject.toml
plugins: lazy-fixture-0.6.3, asyncio-0.21.1, xprocess-0.23.0
asyncio: mode=Mode.STRICT
collected 2156 items / 1 error / 1 skipped

=================================== ERRORS ====================================
______________ ERROR collecting micromamba/tests/test_package.py ______________
ImportError while importing test module '/home/rominf/dev/mamba/micromamba/tests/test_package.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../micromamba/envs/mamba/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
micromamba/tests/test_package.py:11: in <module>
    from conda_package_handling import api as cph
E   ModuleNotFoundError: No module named 'conda_package_handling'
=========================== short test summary info ===========================
ERROR micromamba/tests/test_package.py
!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
========================= 1 skipped, 1 error in 0.63s =========================

The reason is that first
micromamba/tests/envlockfile-check-step-1-lock.yaml with
conda-package-handling dependency was introduced, then during the CI
run it was installed, cached, then the import was introduced (it worked
because of the caching). It looks like nobody ran tests locally since
then and this error was unnoticed.

This change adds the required dependency.

Previously it was not possible to run micromamba tests locally just by
following the instructions given here:
https://mamba.readthedocs.io/en/latest/developer_zone/build_locally.html#id1

```
$ pytest micromamba/tests/
============================= test session starts =============================
platform linux -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0
rootdir: /home/rominf/dev/mamba
configfile: pyproject.toml
plugins: lazy-fixture-0.6.3, asyncio-0.21.1, xprocess-0.23.0
asyncio: mode=Mode.STRICT
collected 2156 items / 1 error / 1 skipped

=================================== ERRORS ====================================
______________ ERROR collecting micromamba/tests/test_package.py ______________
ImportError while importing test module '/home/rominf/dev/mamba/micromamba/tests/test_package.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../micromamba/envs/mamba/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
micromamba/tests/test_package.py:11: in <module>
    from conda_package_handling import api as cph
E   ModuleNotFoundError: No module named 'conda_package_handling'
=========================== short test summary info ===========================
ERROR micromamba/tests/test_package.py
!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
========================= 1 skipped, 1 error in 0.63s =========================
```

The reason is that first
`micromamba/tests/envlockfile-check-step-1-lock.yaml` with
`conda-package-handling` dependency was introduced, then during the CI
run it was installed, cached, then the import was introduced (it worked
because of the caching). It looks like nobody ran tests locally since
then and this error was unnoticed.

This change adds the required dependency.
@rominf rominf force-pushed the rominf/micromamba-fix-tests-deps branch from 73ed962 to a51966a Compare October 29, 2023 05:45
@rominf rominf marked this pull request as ready for review October 29, 2023 05:46
@rominf
Copy link
Contributor Author

rominf commented Oct 29, 2023

I have rebased on main and undrafted the PR.

@jonashaag jonashaag merged commit eb56046 into mamba-org:main Oct 29, 2023
22 of 23 checks passed
@rominf rominf deleted the rominf/micromamba-fix-tests-deps branch October 30, 2023 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants