pypa / virtualenv

Virtual Python Environment builder
https://virtualenv.pypa.io
MIT License
4.78k stars 1.02k forks source link

virtualenv creation broken by filelock 3.15.0 release #2735

Open tamird opened 2 months ago

tamird commented 2 months ago
Creating virtualenv root in /codebuild/output/src4294789612/src/actions-runner/_work/python_monorepo/python_monorepo/.venv

object.__init__() takes exactly one argument (the instance to initialize)
Exception ignored in: <function BaseFileLock.__del__ at 0x7f8ac1d91760>
Traceback (most recent call last):
  File "/root/.local/share/pipx/venvs/poetry/lib/python3.11/site-packages/filelock/_api.py", line 365, in __del__
    self.release(force=True)
  File "/root/.local/share/pipx/venvs/poetry/lib/python3.11/site-packages/virtualenv/util/lock.py", line 34, in release
    with self.thread_safe:
         ^^^^^^^^^^^^^^^^
AttributeError: '_CountedFileLock' object has no attribute 'thread_safe'

https://github.com/tox-dev/filelock/pull/334 looks the likeliest culprit.

rlizzo commented 2 months ago

+1 this issue is occuring for us as well

EarningsCall commented 2 months ago

Wow, searching far and wide and just now found this issue. Looks like it's happening to everyone!

For me, I'll just pin filelock for the time being:

pip install --upgrade hatch filelock==3.14.0
schmod commented 2 months ago

The offending version of filelock has been yanked from PyPi, so this should basically be resolved. You might need to force a reinstallation of virtualenv (or whatever depended on it).

susodapop commented 2 months ago

Note to others: if you're GH Actions checks are failing you may need to purge your env caches that are created by actions/cache@v2

[edit] I removed my edit because I accidentally posted on the wrong repository! Apologies for the noise 🙏

edgarrmondragon commented 2 months ago

I think this has resurfaced with filelock 3.15.2?

benjamin-awd commented 2 months ago

Looks like 3.15.2 just got yanked from PyPI

image

jkanche commented 2 months ago

Just noticed 3.15.2 is also yanked from PyPI

sdmitriev1 commented 2 months ago

3.15.3 was released, fixed the problem for me