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

FileNotFoundError with v2.21.0 #2009

Closed
cbrnr opened this issue Sep 16, 2024 · 8 comments
Closed

FileNotFoundError with v2.21.0 #2009

cbrnr opened this issue Sep 16, 2024 · 8 comments

Comments

@cbrnr
Copy link

cbrnr commented Sep 16, 2024

Description

When running one of my tests with cibuildwheel v2.21.0, I get a FileNotFoundError for one of my package files (I'm using setuptools-scm, and this file is a data file):

https://github.com/cbrnr/sleepecg/actions/runs/10880385421/job/30187081612#step:3:498

The previous v2.20.0 worked with the same configuration:

https://github.com/cbrnr/sleepecg/actions/runs/10880143449/job/30186309191

Build log

https://github.com/cbrnr/sleepecg/actions/runs/10880385421/job/30187081612#step:3:498

CI config

https://github.com/cbrnr/sleepecg/blob/fd4b079a0e45474e358f21ecb0f9eea227f6601b/.github/workflows/test.yml

@Czaki
Copy link
Contributor

Czaki commented Sep 16, 2024

It may be related to an updated method of coping files to the container.
#2004
So maybe #2007 will also solve this.

@cbrnr
Copy link
Author

cbrnr commented Sep 16, 2024

Yeah, I saw this issue, but I didn't have any file permission messages in the log. However, it might still be related and I'm happy to test whenever that fix lands.

@Czaki
Copy link
Contributor

Czaki commented Sep 16, 2024

Yeah, I saw this issue, but I didn't have any file permission messages in the log. However, it might still be related and I'm happy to test whenever that fix lands.

I remember File not found error when I do not have permissions to access the file. But I may be wrong.

@joerick
Copy link
Contributor

joerick commented Sep 16, 2024

I had a look and I'm doubtful that it's a permission problem, because the file that's not found in the backtrace is in the test venv, which should have been installed by pip running in the container.

      + sh -c 'pytest /project'
  ============================= test session starts ==============================
  platform linux -- Python 3.9.20, pytest-8.3.3, pluggy-1.5.0
  rootdir: /project
  configfile: pyproject.toml
  collected 19 items / 1 error
  
  ==================================== ERRORS ====================================
  ______________ ERROR collecting tests/test_heartbeat_detection.py ______________
  /project/tests/test_heartbeat_detection.py:16: in <module>
      ecg, fs = get_toy_ecg()
  ../venv/lib/python3.9/site-packages/sleepecg/utils.py:187: in get_toy_ecg
      ecg = np.load(Path(__file__).parent / "data" / "ecg.npz")["ecg"]
  ../venv/lib/python3.9/site-packages/numpy/lib/npyio.py:427: in load
      fid = stack.enter_context(open(os_fspath(file), "rb"))
  E   FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp.pTAVUyVJFb/venv/lib/python3.9/site-packages/sleepecg/data/ecg.npz'
  =========================== short test summary info ============================
  ERROR ../../../project/tests/test_heartbeat_detection.py - FileNotFoundError:...
  !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
  =============================== 1 error in 0.95s ===============================

It might simply be that your test dependencies have updated since you last tried a build. Did you check that it still works on cibuildwheel==2.20.0 ?

@cbrnr
Copy link
Author

cbrnr commented Sep 16, 2024

Yes, I've tried the exact same configuration with v2.20.0, it's linked in the first post.

@joerick
Copy link
Contributor

joerick commented Sep 16, 2024

Thanks. I don't understand the issue! but I've confirmed that #2007 fixes it by doing

uvx --from https://github.com/mayeut/cibuildwheel/archive/refs/heads/use-tar.zip cibuildwheel --platform linux .

So I guess it is a permissions issue. Maybe @Czaki knows more!

@Czaki
Copy link
Contributor

Czaki commented Sep 17, 2024

@cbrnr could you check the latest release?

@cbrnr
Copy link
Author

cbrnr commented Sep 17, 2024

Yes, v2.21.1 fixes the issue (cbrnr/sleepecg#236)! Thanks for the quick fix everyone! 🎉

@Czaki Czaki closed this as completed Sep 17, 2024
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

No branches or pull requests

3 participants