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: push good images to pypi #642

Merged
merged 32 commits into from
Feb 20, 2025
Merged

fix: push good images to pypi #642

merged 32 commits into from
Feb 20, 2025

Conversation

thomasrockhu-codecov
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Feb 19, 2025

❌ 5 Tests Failed:

Tests completed Failed Passed Skipped
3570 5 3565 0
View the top 3 failed test(s) by shortest run time
api.temp.calculator.test_calculator::test_divide
Stack Traces | 0.001s run time
def
                test_divide():
                > assert Calculator.divide(1, 2) == 0.5
                E assert 1.0 == 0.5
                E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
                E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
                .../temp/calculator/test_calculator.py:30: AssertionError
api.temp.calculator.test_calculator::test_divide
Stack Traces | 0.001s run time
def
                test_divide():
                > assert Calculator.divide(1, 2) == 0.5
                E assert 1.0 == 0.5
                E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
                E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
                .../temp/calculator/test_calculator.py:30: AssertionError
api.temp.calculator.test_calculator::test_divide
Stack Traces | 0.001s run time
def
                test_divide():
                > assert Calculator.divide(1, 2) == 0.5
                E assert 1.0 == 0.5
                E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
                E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
                .../temp/calculator/test_calculator.py:30: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Copy link

✅ All tests successful. No failed tests were found.

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

@thomasrockhu-codecov
Copy link
Contributor Author

thomasrockhu-codecov commented Feb 20, 2025

@webknjaz I am making some fixes here, but I'm running into an issue where requirements.txt which is available in the sdist is not being copied into the wheel distributions. This makes it so when I run pip install codecov....whl (output of the build) , I get a requirements.txt file not found error.

@webknjaz
Copy link
Contributor

@thomasrockhu-codecov you're not really supposed to copy requirements.txt into site-packages. The content within wheels (which are just zip archives) is just unpacked into site-packages and that's about it. setuptools will auto-discover Python modules for installation. Any other files can be forced into the wheel if they need to be used in runtime as data files. But I don't think you need it. It looks quite unorthodox to me that you moved the requirements file into the importable package dir. Why? Could you explain why you feel this is necessary?

@webknjaz
Copy link
Contributor

Oh, you moved it back already. I was thinking of several commits back, then.

@webknjaz
Copy link
Contributor

This makes it so when I run pip install codecov....whl (output of the build) , I get a requirements.txt file not found error.

There's no relation between the two. Installers don't interact with project-specific files in wheels at all. You must be misinterpreting something..

@thomasrockhu-codecov
Copy link
Contributor Author

@webknjaz yeah perhaps I am, let me rephrase

I'm trying to pull down one of the built wheels locally, pip install that wheel and then run the codecov-cli commands to test if it works out of the box.

When do I do that from one of the artifacts here, I get this

--> pip install codecov_cli-10.1.0-cp311-cp311-macosx_11_0_arm64.whl
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'

So I'm confused, since I believe that the wheel should be self-contained, but perhaps I have the wrong mental model.

@webknjaz
Copy link
Contributor

@thomasrockhu-codecov yes, wheels should contain ready-to-use end result. I don't know what outputs that line but I find it hard to believe that pip would do that. Do you have a more complete log? Is something else invoking pip install?

@webknjaz
Copy link
Contributor

Also, have you tried cranking up the verbosity? -vvvvv

@thomasrockhu-codecov
Copy link
Contributor Author

@webknjaz, now with verbosity

--> pip install codecov_cli-10.1.0-cp311-cp311-macosx_11_0_arm64.whl -vvvvv
Using pip 25.0.1 from /Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip (python 3.11)
Non-user install because site-packages writeable
Created temporary directory: /private/var/folders/pw/6615_04s7z96dksq70xtcs6m0000gp/T/pip-build-tracker-yuicz8bc
Initialized build tracking at /private/var/folders/pw/6615_04s7z96dksq70xtcs6m0000gp/T/pip-build-tracker-yuicz8bc
Created build tracker: /private/var/folders/pw/6615_04s7z96dksq70xtcs6m0000gp/T/pip-build-tracker-yuicz8bc
Entered build tracker: /private/var/folders/pw/6615_04s7z96dksq70xtcs6m0000gp/T/pip-build-tracker-yuicz8bc
Created temporary directory: /private/var/folders/pw/6615_04s7z96dksq70xtcs6m0000gp/T/pip-install-w1na8ufg
Remote version of pip: 25.0.1
Local version of pip:  25.0.1
Was pip installed by pip? True
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
Exception information:
Traceback (most recent call last):
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/req/req_file.py", line 587, in get_file_content
    with open(url, "rb") as f:
         ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/cli/base_command.py", line 106, in _run_wrapper
    status = _inner_run()
             ^^^^^^^^^^^^
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/cli/base_command.py", line 97, in _inner_run
    return self.run(options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/cli/req_command.py", line 67, in wrapper
    return func(self, options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/commands/install.py", line 350, in run
    reqs = self.get_requirements(args, options, finder, session)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/cli/req_command.py", line 218, in get_requirements
    for parsed_req in parse_requirements(
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/req/req_file.py", line 168, in parse_requirements
    for parsed_line in parser.parse(filename, constraint):
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/req/req_file.py", line 349, in parse
    yield from self._parse_and_recurse(
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/req/req_file.py", line 359, in _parse_and_recurse
    for line in self._parse_file(filename, constraint):
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/req/req_file.py", line 408, in _parse_file
    _, content = get_file_content(filename, self._session)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/req/req_file.py", line 590, in get_file_content
    raise InstallationError(f"Could not open requirements file: {exc}")
pip._internal.exceptions.InstallationError: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
Removed build tracker: '/private/var/folders/pw/6615_04s7z96dksq70xtcs6m0000gp/T/pip-build-tracker-yuicz8bc'

@webknjaz
Copy link
Contributor

@thomasrockhu-codecov I assume it doesn't fail with --no-deps?

@thomasrockhu-codecov
Copy link
Contributor Author

@webknjaz same error I believe

--> pip install codecov_cli-10.1.0-cp311-cp311-macosx_11_0_arm64.whl --no-deps -vvvvv
Using pip 25.0.1 from /Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip (python 3.11)
Non-user install because site-packages writeable
Created temporary directory: /private/var/folders/pw/6615_04s7z96dksq70xtcs6m0000gp/T/pip-build-tracker-1vwnhzqw
Initialized build tracking at /private/var/folders/pw/6615_04s7z96dksq70xtcs6m0000gp/T/pip-build-tracker-1vwnhzqw
Created build tracker: /private/var/folders/pw/6615_04s7z96dksq70xtcs6m0000gp/T/pip-build-tracker-1vwnhzqw
Entered build tracker: /private/var/folders/pw/6615_04s7z96dksq70xtcs6m0000gp/T/pip-build-tracker-1vwnhzqw
Created temporary directory: /private/var/folders/pw/6615_04s7z96dksq70xtcs6m0000gp/T/pip-install-wq9jvn7q
Remote version of pip: 25.0.1
Local version of pip:  25.0.1
Was pip installed by pip? True
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
Exception information:
Traceback (most recent call last):
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/req/req_file.py", line 587, in get_file_content
    with open(url, "rb") as f:
         ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/cli/base_command.py", line 106, in _run_wrapper
    status = _inner_run()
             ^^^^^^^^^^^^
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/cli/base_command.py", line 97, in _inner_run
    return self.run(options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/cli/req_command.py", line 67, in wrapper
    return func(self, options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/commands/install.py", line 350, in run
    reqs = self.get_requirements(args, options, finder, session)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/cli/req_command.py", line 218, in get_requirements
    for parsed_req in parse_requirements(
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/req/req_file.py", line 168, in parse_requirements
    for parsed_line in parser.parse(filename, constraint):
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/req/req_file.py", line 349, in parse
    yield from self._parse_and_recurse(
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/req/req_file.py", line 359, in _parse_and_recurse
    for line in self._parse_file(filename, constraint):
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/req/req_file.py", line 408, in _parse_file
    _, content = get_file_content(filename, self._session)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tomhu/.pyenv/versions/3.11.5/lib/python3.11/site-packages/pip/_internal/req/req_file.py", line 590, in get_file_content
    raise InstallationError(f"Could not open requirements file: {exc}")
pip._internal.exceptions.InstallationError: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
Removed build tracker: '/private/var/folders/pw/6615_04s7z96dksq70xtcs6m0000gp/T/pip-build-tracker-1vwnhzqw'

@webknjaz
Copy link
Contributor

Can you try a handmade venv + older pip? This seems like an upstream bug to me. But I'll also try getting one of the wheels and see what's happening. Too bad you excluded cp313, as that's my default now :)

@thomasrockhu-codecov
Copy link
Contributor Author

@webknjaz had to exclude 3.13 for now as there is an dep that doesn't allow for it

@thomasrockhu-codecov
Copy link
Contributor Author

@webknjaz yeah, fresh venv and pip==23.2.1

--> pip install codecov_cli-10.1.0-cp311-cp311-macosx_11_0_arm64.whl --no-deps -vvv
Using pip 23.2.1 from /Users/tomhu/Downloads/cibw-wheels-macos-latest/meow/lib/python3.11/site-packages/pip (python 3.11)
Non-user install because user site-packages disabled
Created temporary directory: /private/var/folders/pw/6615_04s7z96dksq70xtcs6m0000gp/T/pip-build-tracker-q5r162e6
Initialized build tracking at /private/var/folders/pw/6615_04s7z96dksq70xtcs6m0000gp/T/pip-build-tracker-q5r162e6
Created build tracker: /private/var/folders/pw/6615_04s7z96dksq70xtcs6m0000gp/T/pip-build-tracker-q5r162e6
Entered build tracker: /private/var/folders/pw/6615_04s7z96dksq70xtcs6m0000gp/T/pip-build-tracker-q5r162e6
Created temporary directory: /private/var/folders/pw/6615_04s7z96dksq70xtcs6m0000gp/T/pip-install-cgm4hrmv
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
Exception information:
Traceback (most recent call last):
  File "/Users/tomhu/Downloads/cibw-wheels-macos-latest/meow/lib/python3.11/site-packages/pip/_internal/req/req_file.py", line 548, in get_file_content
    with open(url, "rb") as f:
         ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/tomhu/Downloads/cibw-wheels-macos-latest/meow/lib/python3.11/site-packages/pip/_internal/cli/base_command.py", line 180, in exc_logging_wrapper
    status = run_func(*args)
             ^^^^^^^^^^^^^^^
  File "/Users/tomhu/Downloads/cibw-wheels-macos-latest/meow/lib/python3.11/site-packages/pip/_internal/cli/req_command.py", line 248, in wrapper
    return func(self, options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tomhu/Downloads/cibw-wheels-macos-latest/meow/lib/python3.11/site-packages/pip/_internal/commands/install.py", line 342, in run
    reqs = self.get_requirements(args, options, finder, session)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tomhu/Downloads/cibw-wheels-macos-latest/meow/lib/python3.11/site-packages/pip/_internal/cli/req_command.py", line 399, in get_requirements
    for parsed_req in parse_requirements(
  File "/Users/tomhu/Downloads/cibw-wheels-macos-latest/meow/lib/python3.11/site-packages/pip/_internal/req/req_file.py", line 148, in parse_requirements
    for parsed_line in parser.parse(filename, constraint):
  File "/Users/tomhu/Downloads/cibw-wheels-macos-latest/meow/lib/python3.11/site-packages/pip/_internal/req/req_file.py", line 335, in parse
    yield from self._parse_and_recurse(filename, constraint)
  File "/Users/tomhu/Downloads/cibw-wheels-macos-latest/meow/lib/python3.11/site-packages/pip/_internal/req/req_file.py", line 340, in _parse_and_recurse
    for line in self._parse_file(filename, constraint):
  File "/Users/tomhu/Downloads/cibw-wheels-macos-latest/meow/lib/python3.11/site-packages/pip/_internal/req/req_file.py", line 371, in _parse_file
    _, content = get_file_content(filename, self._session)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tomhu/Downloads/cibw-wheels-macos-latest/meow/lib/python3.11/site-packages/pip/_internal/req/req_file.py", line 551, in get_file_content
    raise InstallationError(f"Could not open requirements file: {exc}")
pip._internal.exceptions.InstallationError: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
Remote version of pip: 25.0.1
Local version of pip:  23.2.1
Was pip installed by pip? True

[notice] A new release of pip is available: 23.2.1 -> 25.0.1
[notice] To update, run: pip install --upgrade pip
Removed build tracker: '/private/var/folders/pw/6615_04s7z96dksq70xtcs6m0000gp/T/pip-build-tracker-q5r162e6'

@webknjaz
Copy link
Contributor

Which dep? Also, it doesn't fail for me locally. But it's an x86_64 Gentoo Linux, and you're obviously on Mac (arm64?)

You can also tell pip to choose the proper wheel instead of guessing which file matches your platform: pip install codecov-cli --no-index -f ./download-dir.

So far, it looks like you may have broken Python install or are hitting a corner case in pip. I'd maybe pyenv install 3.11.5 to reset it. But also, try a different Python version.

@webknjaz
Copy link
Contributor

You could also try downloading a known working wheel from another project, like https://pypi.org/project/aiohttp/3.11.12/#files and see if pip behaves the same on your machine.

@thomasrockhu-codecov
Copy link
Contributor Author

@webknjaz fascinating!

--> pip install aiohttp-3.11.12-cp312-cp312-macosx_11_0_arm64.whl
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'

[notice] A new release of pip is available: 23.2.1 -> 25.0.1
[notice] To update, run: pip install --upgrade pip

@webknjaz
Copy link
Contributor

webknjaz commented Feb 20, 2025

@thomasrockhu-codecov so it's your system that is broken (or a bug in pip) 🤷‍♂️

But I inspected the wheel contents anyway and haven't found anything out of the ordinary. Posting how to do this for history:

$ wheel unpack codecov_cli-10.1.0-cp311-cp311-macosx_11_0_arm64.whl
Unpacking to: codecov_cli-10.1.0...OK

$ l codecov_cli-10.1.0
total 720K
drwxr-xr-x 7 wk wk  177 Feb 20 21:11 codecov_cli/
drwxr-xr-x 2 wk wk  109 Feb 20 21:11 codecov_cli-10.1.0.dist-info/
-rwxr-xr-x 1 wk wk 719K Feb 20 21:11 staticcodecov_languages.cpython-311-darwin.so*

$ l codecov_cli-10.1.0/codecov_cli
total 24K
drwxr-xr-x 2 wk wk 4.0K Feb 20 21:11 commands/
-rw-r--r-- 1 wk wk 1.3K Feb 20 21:11 fallbacks.py
drwxr-xr-x 4 wk wk  301 Feb 20 21:11 helpers/
-rw-r--r-- 1 wk wk   83 Feb 20 21:11 __init__.py
-rw-r--r-- 1 wk wk 3.4K Feb 20 21:11 main.py
-rw-r--r-- 1 wk wk  592 Feb 20 21:11 opentelemetry.py
drwxr-xr-x 2 wk wk  132 Feb 20 21:11 plugins/
drwxr-xr-x 2 wk wk   95 Feb 20 21:11 runners/
drwxr-xr-x 9 wk wk  157 Feb 20 21:11 services/
-rw-r--r-- 1 wk wk 2.2K Feb 20 21:11 types.py

$ l codecov_cli-10.1.0/codecov_cli-10.1.0.dist-info 
total 72K
-rw-r--r-- 1 wk wk   83 Feb 20 21:11 entry_points.txt
-rw-r--r-- 1 wk wk  12K Feb 20 21:11 LICENSE
-rw-r--r-- 1 wk wk  33K Feb 20 21:11 METADATA
-rw-rw-r-- 1 wk wk 9.0K Feb 20 21:11 RECORD
-rw-r--r-- 1 wk wk   36 Feb 20 21:11 top_level.txt
-rw-r--r-- 1 wk wk  109 Feb 20 21:11 WHEEL

$ bat codecov_cli-10.1.0/codecov_cli-10.1.0.dist-info/entry_points.txt
───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: codecov_cli-10.1.0/codecov_cli-10.1.0.dist-info/entry_points.txt
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ [console_scripts]
   2   │ codecov = codecov_cli.main:run
   3   │ codecovcli = codecov_cli.main:run
───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

$ bat codecov_cli-10.1.0/codecov_cli-10.1.0.dist-info/LICENSE

$ bat codecov_cli-10.1.0/codecov_cli-10.1.0.dist-info/WHEEL
───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: codecov_cli-10.1.0/codecov_cli-10.1.0.dist-info/WHEEL
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ Wheel-Version: 1.0
   2   │ Generator: setuptools (75.8.0)
   3   │ Root-Is-Purelib: false
   4   │ Tag: cp311-cp311-macosx_11_0_arm64
   5   │ 
───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

$ bat codecov_cli-10.1.0/codecov_cli-10.1.0.dist-info/RECORD

$ bat codecov_cli-10.1.0/codecov_cli-10.1.0.dist-info/top_level.txt
───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: codecov_cli-10.1.0/codecov_cli-10.1.0.dist-info/top_level.txt
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ codecov_cli
   2   │ staticcodecov_languages
───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

$ rg requirements\\.txt codecov_cli-10.1.0/
codecov_cli-10.1.0/codecov_cli-10.1.0.dist-info/METADATA
524:pip install -r requirements.txt

@thomasrockhu-codecov
Copy link
Contributor Author

@webknjaz thanks for all the help, I think yeah, my python is borked so re-installing.

@thomasrockhu-codecov thomasrockhu-codecov changed the title fix: test new workflow fix: push good images to pypi Feb 20, 2025
@webknjaz
Copy link
Contributor

@thomasrockhu-codecov did you do export PIP_CONSTRAINT=requirements.txt in the same terminal session in the past? Is it still set?

@webknjaz
Copy link
Contributor

@thomasrockhu-codecov so I've found a few hints on pip's tracker and I think that my hunch is right. It's easy to reproduce:

$ PIP_CONSTRAINT=blah some-venv-py312/bin/python -Im pip install codecov_cli-10.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl       
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'blah'

(would also apply to other flags like PIP_REQUIREMENTS, I imagine)

@thomasrockhu-codecov
Copy link
Contributor Author

@webknjaz
arrodillarse-dani-martinez

that was the hint I needed. I had sent PIP_CONSTRAINT when testing things earlier and never removed it

@webknjaz
Copy link
Contributor

@thomasrockhu-codecov tbf the error isn't exactly obvious. I just finished going through the issue search in pypa/pip and concluded that nobody reported the ambiguity there, so I'm going to document the confusion now. I would've guessed what's going on if this was on my machine due to the context present in my head, but with the limited info I was as confused...

@webknjaz
Copy link
Contributor

webknjaz commented Feb 20, 2025

@webknjaz had to exclude 3.13 for now as there is an dep that doesn't allow for it

@thomasrockhu-codecov so based on https://github.com/codecov/codecov-cli/actions/runs/13437036758/job/37541761198?pr=642#step:4:1083, I assume you mean test-results-parser?

This shouldn't prevent you from publishing the wheel. You can still do this and eventually that dependency will start shipping platform-compatible wheels. But it's still okay if it's build from source (unless that's broken, of course).

You have two options here:

  1. Skip the smoke-test in cibuildwheel entirely but just for Python 3.13. You can configure a test-skip/CIBW_TEST_SKIP for the environment that's problematic: https://cibuildwheel.pypa.io/en/stable/options/#test-skip.
  2. Alternatively, you can use before-test/CIBW_BEFORE_TEST https://cibuildwheel.pypa.io/en/stable/options/#before-test to install Rust there. And to make sure this command only runs where necessary, you can use selective overrides documented @ https://cibuildwheel.pypa.io/en/stable/options/#overrides.

The second variant is better because you still test things. Your job only fails because the dependency couldn't be built from sdist due to the lack of the build toolchain (Cargo/Rust). Once it's there, I imagine it'll build a wheel and install the dep without problems.

@thomasrockhu-codecov
Copy link
Contributor Author

@webknjaz going to push this first and work on the py13 thing later today to unblock some users

@thomasrockhu-codecov thomasrockhu-codecov merged commit dd7c416 into main Feb 20, 2025
13 checks passed
@thomasrockhu-codecov thomasrockhu-codecov deleted the th/test-src branch February 20, 2025 21:08
@webknjaz
Copy link
Contributor

@thomasrockhu-codecov ack. Meanwhile, I posted this issue pypa/pip#13226 — feel free to share your experience there too.

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.

3 participants