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

BUG: build is not always present #1385

Closed
anissa111 opened this issue Feb 13, 2024 · 7 comments · Fixed by #1387
Closed

BUG: build is not always present #1385

anissa111 opened this issue Feb 13, 2024 · 7 comments · Fixed by #1387

Comments

@anissa111
Copy link

Hello!

Links:

Our ASV benchmarks started failing yesterday after the 0.6.2 release:

Couldn't load asv.plugins._mamba_helpers because
No module named 'libmambapy'

I've replicated this locally, where it fails with 0.6.2 but works when deprecated to 0.6.1

(asv-bench) ➜  benchmarks git:(main) ✗ asv --version
Couldn't load asv.plugins._mamba_helpers because
No module named 'libmambapy'
asv 0.6.2
(asv-bench) ➜  benchmarks git:(main) ✗ asv check    
Couldn't load asv.plugins._mamba_helpers because
No module named 'libmambapy'
· Discovering benchmarks
· Checking benchmarks
·· No problems found.
(asv-bench) ➜  benchmarks git:(main) ✗ pip install asv=="0.6.1"
Collecting asv==0.6.1
  Using cached asv-0.6.1-cp310-cp310-macosx_11_0_arm64.whl.metadata (3.5 kB)
Requirement already satisfied: asv-runner>=v0.1.0 in /Users/anissaz/miniconda3/envs/asv-bench/lib/python3.10/site-packages (from asv==0.6.1) (0.2.1)
Requirement already satisfied: json5 in /Users/anissaz/miniconda3/envs/asv-bench/lib/python3.10/site-packages (from asv==0.6.1) (0.9.14)
Requirement already satisfied: tabulate in /Users/anissaz/miniconda3/envs/asv-bench/lib/python3.10/site-packages (from asv==0.6.1) (0.9.0)
Requirement already satisfied: pyyaml in /Users/anissaz/miniconda3/envs/asv-bench/lib/python3.10/site-packages (from asv==0.6.1) (6.0.1)
Requirement already satisfied: pympler in /Users/anissaz/miniconda3/envs/asv-bench/lib/python3.10/site-packages (from asv==0.6.1) (1.0.1)
Requirement already satisfied: importlib-metadata in /Users/anissaz/miniconda3/envs/asv-bench/lib/python3.10/site-packages (from asv-runner>=v0.1.0->asv==0.6.1) (7.0.1)
Requirement already satisfied: zipp>=0.5 in /Users/anissaz/miniconda3/envs/asv-bench/lib/python3.10/site-packages (from importlib-metadata->asv-runner>=v0.1.0->asv==0.6.1) (3.17.0)
Using cached asv-0.6.1-cp310-cp310-macosx_11_0_arm64.whl (295 kB)
Installing collected packages: asv
  Attempting uninstall: asv
    Found existing installation: asv 0.6.2
    Uninstalling asv-0.6.2:
      Successfully uninstalled asv-0.6.2
Successfully installed asv-0.6.1
(asv-bench) ➜  benchmarks git:(main) ✗ asv check
· Discovering benchmarks
· Checking benchmarks
·· No problems found.

Thank you!

@trexfeathers
Copy link

Looks like the import in _mamba_helpers needs to be made 'optional' in some way:

import libmambapy

... OR libmambapy needs to be added to ASV's core dependencies:

asv/pyproject.toml

Lines 29 to 38 in a779f0c

dependencies = [
"asv-runner>=v0.2.1",
"json5",
"tabulate",
"virtualenv",
"tomli",
"colorama; platform_system == 'Windows'",
"pyyaml; platform_python_implementation != \"PyPy\"",
"pympler; platform_python_implementation != \"PyPy\"",
]

@oscarbenjamin
Copy link

... OR libmambapy needs to be added to ASV's core dependencies:

It doesn't look like libmambapy exists in PyPI (rather than conda).

@mattip
Copy link
Contributor

mattip commented Feb 18, 2024

@HaoZeke could you take a look?

@HaoZeke
Copy link
Member

HaoZeke commented Feb 18, 2024

As far as I recall this is just a logging note and not an error. Tests on CI pass completely without libmambapy. I'll take a look.

@HaoZeke
Copy link
Member

HaoZeke commented Feb 18, 2024

This is because of the change made to the default build command in the presence of pyproject.toml which is now:

        if cmd is None:
            if has_file('pyproject.toml'):
                cmd = [
                    "python -m build",
                    "python -mpip wheel -w {build_cache_dir} {build_dir}"
                ]
            else:
                cmd = [
                    "python setup.py build",
                    "python -mpip wheel -w {build_cache_dir} {build_dir}"
                ]

@HaoZeke HaoZeke changed the title 0.6.2 breaking benchmark discovery BUG: build not always added to base_requirements Feb 18, 2024
@HaoZeke
Copy link
Member

HaoZeke commented Feb 18, 2024

So the basic workaround for this case is to just depend on build.

@HaoZeke HaoZeke changed the title BUG: build not always added to base_requirements BUG: build is not always present Feb 18, 2024
@HaoZeke
Copy link
Member

HaoZeke commented Feb 18, 2024

The change is noted in the docs but not the changelog, and should be more prominently mentioned.

trexfeathers added a commit to trexfeathers/iris that referenced this issue Feb 19, 2024
ESadek-MO pushed a commit to SciTools/iris that referenced this issue Feb 19, 2024
tkknight added a commit to tkknight/iris that referenced this issue Feb 20, 2024
…umpydoc-pre-commit

* 'numpydoc-pre-commit' of github.com:tkknight/iris:
  Update CF standard names to v84. (SciTools#5761)
  Regrid docs fix (SciTools#5758)
  Improve ncdata and CF information on "iris heart xarray" page (SciTools#5752)
  Pin ASV - airspeed-velocity/asv#1385. (SciTools#5756)
  Normalise units of coordinate bounds (SciTools#5746)
  Add "Which Regridder?" Documentation (SciTools#5742)
  Document `Coord.ignore_axis` (SciTools#5744)
  Disable navidation with keys for docs HTML theme options (SciTools#5747)
  Shapefile masking (SciTools#5470)
  [pre-commit.ci] pre-commit autoupdate (SciTools#5739)
  DOCS: Add whatsnew for ruff pydocstyle compliance (SciTools#5700)
  update docstring (SciTools#5737)
  Updated environment lockfiles (SciTools#5738)
  Consider NaNs equal when comparing cubes (SciTools#5713)
yarikoptic added a commit to yarikoptic/datalad-fuse that referenced this issue Mar 20, 2024
We are hitting odd

    Run asv run --show-stderr --python 3.8 HEAD^-1
    Couldn't load asv.plugins._mamba_helpers because
    No module named 'libmambapy'

which was presumably the

   airspeed-velocity/asv#1385

which was addressed by

   airspeed-velocity/asv#1387

which was released in 0.6.3 but we are installing it

    Collecting asv!=0.6.2 (from asv[virtualenv]!=0.6.2)
      Downloading asv-0.6.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.8 kB)

and still hitting it. Trying now with explicit "build" in depends
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 a pull request may close this issue.

5 participants