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

QUERY: No warnings for change to main (asv 0.6.2 fails to install package for no discernable reason) #1389

Closed
jwodder opened this issue Feb 19, 2024 · 8 comments
Labels
documentation Triaged as a documentation issue question Triaged as a question, not requiring action after answering

Comments

@jwodder
Copy link

jwodder commented Feb 19, 2024

Attempting to benchmark our project with asv 0.6.2 fails to install the project into the virtualenv, and no message is given as to why. The output from a run of asv run --show-stderr --verbose HEAD^1..HEAD can be found at https://gist.github.com/jwodder/16c46681ed639b6c3dc7d0762d0a98c5. Note that the output ends with:

·· Running '/usr/local/bin/git name-rev --name-only --exclude=remotes/* --no-undefined 0ede8b43ddf3f5810a035dc43b1b50c938b51d91'
   OUTPUT -------->
   dummy
·· Installing 0ede8b43 <dummy> into virtualenv-py3.11
·· Failed to build the project and import the benchmark suite.

(dummy is the name of the branch I was testing on.)

If asv 0.6.1 is used instead, everything is successful.

@HaoZeke
Copy link
Member

HaoZeke commented Feb 20, 2024

This is because the default git branch is now main, so earlier in the trace it cannot find the commit to compare to. The solution is to either specify the branch in the configuration or rename the default.

@HaoZeke HaoZeke changed the title asv 0.6.2 fails to install package for no discernable reason BUG: No warnings for change to main (asv 0.6.2 fails to install package for no discernable reason) Feb 20, 2024
@HaoZeke HaoZeke changed the title BUG: No warnings for change to main (asv 0.6.2 fails to install package for no discernable reason) QUERY: No warnings for change to main (asv 0.6.2 fails to install package for no discernable reason) Feb 20, 2024
@jwodder
Copy link
Author

jwodder commented Feb 20, 2024

specify the branch in the configuration

Do you mean via the branches config option? The documentation for that says it only applies to asv run ALL and asv run NEW, neither of which I'm running. (The docs also still say that the Git default is "master".)

@jwodder
Copy link
Author

jwodder commented Mar 21, 2024

@HaoZeke I'm still having this problem with asv 0.6.3. I tried the following:

  • On a non-master branch:
    • Set branches to ["master"] and commit
    • Create another commit so that branches will be set in both HEAD and HEAD^1
    • Run asv run HEAD^1..HEAD

However, this fails with "Failed to build the project and import the benchmark suite." and no details as to what actually went wrong. Looking at the logs generated with --show-stderr --verbose, it looks like the installation was successful. The logs can be found at https://gist.github.com/jwodder/e69f53f662cc9cbc1a5fdf2d89ae5649.

@dcherian
Copy link

I'm seeing a similarly mysterious error for https://github.com/xarray-contrib/flox

Running with --verbose shows the real cause: asv run --verbose --python=same --bench cohorts

   OUTPUT -------->
   Traceback (most recent call last):
     File "/Users/deepak/miniforge3/envs/flox-tests/lib/python3.11/site-packages/asv/benchmark.py", line 28, in <module>
   from asv_runner.discovery import _discover

     File "/Users/deepak/miniforge3/envs/flox-tests/lib/python3.11/site-packages/asv_runner/discovery.py", line 8, in <module>
     from ._aux import update_sys_path
   File "/Users/deepak/miniforge3/envs/flox-tests/lib/python3.11/site-packages/asv_runner/_aux.py", line 7, in <module>
     from .benchmarks._maxrss import set_cpu_affinity

     File "/Users/deepak/miniforge3/envs/flox-tests/lib/python3.11/site-packages/asv_runner/benchmarks/__init__.py", line 51, in <module>
       asv_modules = [
                   ^
   File "/Users/deepak/miniforge3/envs/flox-tests/lib/python3.11/site-packages/asv_runner/benchmarks/__init__.py", line 54, in <listcomp>
     if dist.metadata["Name"].startswith("asv_bench")

          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   AttributeError: 'NoneType' object has no attribute 'startswith'

I don't really understand why there is a None result though.

@saraedum
Copy link
Contributor

I get an error that seems similar to the one you are seeing @jwodder. Adding --verbose does not add any information. I put some print statements into asv to understand what's going on. In my case, the problem is that the default install_command uses wheel_file but wheel_file is only set here

kwargs['wheel_file'] = os.path.join(cache_dir, wheels[0])
, the code path is not entered and then wheel_file substitution in the install_command fails.

To debug, it helps a lot to add a print(last_err) in this finally block:

finally:

@saraedum
Copy link
Contributor

In my particular case, there was an extra wheel from a dependency being collected. Setting "build_command": ["python setup.py build", "python -mpip wheel --no-deps --no-build-isolation --no-index -w {build_cache_dir} {build_dir}"], in my asv.conf.json fixed the problem.

saraedum added a commit to saraedum/sage-flatsurf that referenced this issue Apr 25, 2024
@dcherian
Copy link

@saraedum that works for me too!

dcherian added a commit to xarray-contrib/flox that referenced this issue Apr 25, 2024
dcherian added a commit to xarray-contrib/flox that referenced this issue Apr 25, 2024
@HaoZeke HaoZeke added question Triaged as a question, not requiring action after answering documentation Triaged as a documentation issue labels Aug 12, 2024
@HaoZeke
Copy link
Member

HaoZeke commented Aug 12, 2024

I'm not really sure there's much to do here, these are valid fixes, but all at the user/downstream project level related to installations which are due to a default being changed. Closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Triaged as a documentation issue question Triaged as a question, not requiring action after answering
Projects
None yet
Development

No branches or pull requests

4 participants