-
Notifications
You must be signed in to change notification settings - Fork 47
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 addons-7c.txt #55
Comments
That's weird. Have you tried clearing your pre-commit cache ? |
it's a brand new setup from scratch but I'll try! |
@sbidoul tried again: no luck. I had to copy files there to make it work. I'm in a virtualenv and I thought this was the issue but I've tried inside and outside it, no luck. I've tried uninstalling venv installation of setuptools-odoo and pre-commit, no luck. I've tried cleaning the cache in both cases, no luck.
|
Can you share the relevant pre-commit config? I'll give it a try. |
Note that |
Perhaps the fact that you installed both pre-commit and setuptools-odoo with |
I have the same issue, also on a fresh install/pre-commit cache, it says: Generate default setup.py for an addons directory........................Failed
- hook id: setuptools-odoo-make-default
- exit code: 1
Traceback (most recent call last):
File "/home/salix/.cache/pre-commit/reporh098zcx/py_env-python3/bin/setuptools-odoo-make-default", line 5, in <module>
from setuptools_odoo.make_default_setup import main
File "/home/salix/.cache/pre-commit/reporh098zcx/py_env-python3/lib/python3.8/site-packages/setuptools_odoo/__init__.py", line 6, in <module>
from .core import get_addon_metadata
File "/home/salix/.cache/pre-commit/reporh098zcx/py_env-python3/lib/python3.8/site-packages/setuptools_odoo/core.py", line 14, in <module>
from . import base_addons, external_dependencies
File "/home/salix/.cache/pre-commit/reporh098zcx/py_env-python3/lib/python3.8/site-packages/setuptools_odoo/base_addons.py", line 16, in <module>
openerp7 = _addons("7c")
File "/home/salix/.cache/pre-commit/reporh098zcx/py_env-python3/lib/python3.8/site-packages/setuptools_odoo/base_addons.py", line 12, in _addons
b = resource_string("setuptools_odoo", "addons-%s.txt" % suffix)
File "/home/salix/.cache/pre-commit/reporh098zcx/py_env-python3/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1142, in resource_string
return get_provider(package_or_requirement).get_resource_string(
File "/home/salix/.cache/pre-commit/reporh098zcx/py_env-python3/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1388, in get_resource_string
return self._get(self._fn(self.module_path, resource_name))
File "/home/salix/.cache/pre-commit/reporh098zcx/py_env-python3/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1611, in _get
with open(path, 'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/home/salix/.cache/pre-commit/reporh098zcx/py_env-python3/lib/python3.8/site-packages/setuptools_odoo/addons-7c.txt' pre-commit config: https://github.com/OCA/wms/blob/3d7446f47af2ec134ae14c6bc3d264b406d242cc/.pre-commit-config.yaml |
Can you try to create a reproducer in a container or something ? |
Is this still an issue ? |
Not AFAIK |
For the record, I' running into this. After clearing the cache and reinitializing pre-commit, I have the following versions:
I can activate pre-commit's virtualenv and upgrade setuptools-odoo which fixes the problem, but it's not ideal. |
@StefanRijnhart this looks like setuptools-odoo was installed from git or a git checkout ? That's weird. I can't really do much without a reproducer. |
@sbidoul I'm hitting this again on a setup from scratch.
pre-commit 2.20.0
|
I confirm that upgrading setuptools-odoo fixes the problem
So for some reasons, pre-commit installs pre-commit config https://github.com/OCA/edi/blob/14.0/.pre-commit-config.yaml |
This setuptools-odoo |
I know but I have no clue 😅 |
Commit |
Could you try manually reinstalling |
The fact that it shows version |
If a repro situation, can you also list the content of |
Same problem here. |
Installing pre-commit with pipx and emptying the pre-commit cache fixed the issue. It is likely due to some incompatibility with the system setuptools. |
Getting the same problem, after running |
The best explanation we have is an incompatibility somewhere between pre-commit, setuptools_scm and the system python packages. The recommendation is to install pre-commit using pipx. |
I actually already had pre-commit with pipx.
Still get same error. Not sure if this helps:
|
Addition info - from trial and error, it stops working for me at setuptools-odoo 3.1.5. |
That is weird. The diff between these two version has really nothing that could explain that. |
Some imports changed. Maybe that activated code that triggers the issue? |
I dug into the virtualenv being used: activated it, ran
Can this be a packaging issue? |
In case it helps, venv package list:
|
Again, I'd be happy to investigate but I can't reproduce. If someone can reproduce in a Dockerfile or something I'll be happy to dig into it. |
Found a solution that worked for me - turn off your computer and turn it on again ... or almost that 😸 : |
I just did this:
|
The issue seems to be that somehow the file gets located in the wrong place... |
@sbidoul BTW I'm on v14, what's the point of loading all the versions? (I'm checking) |
This looks insane. |
As you see, inside the pkg_resource lookup, the module path is the latter, which is missing those files. |
@simahawk Sharing my result:
I have four caches, all created recently (because I recently ran I have no idea if this is helpful... |
@sbidoul once again getting back to this... Here's a brand new setup cleaned w/ After my last |
@simahawk could you do a Dockerfile with a reproducer? |
I'll try, not sure when 😅 |
I am facing this issue and trying to debug. There is no data file in the cache So I try to check why data files are not copied when setuptools try to setup the package. I checked the code and it looks good with Then I research on the internet and found this https://stackoverflow.com/questions/7522250/how-to-include-package-data-with-setuptools-distutils/14159430#14159430 |
@cuongnmtm since setuptools-odoo uses the git file finder via setuptools_scm, updating MANIFEST.in should not be necessary. By chance do you have a procedure to reproduce the issue? |
@sbidoul I just tried to reproduce the issue but cannot... I tried to run This only happens with very few of my projects (actually just one of two projects). Let's see if I faced this issue again in the future. Thank you. |
I faced this exact issue about file "addons-7c.txt" and another one about the readme generation, that complained about a missing "gen_addon_readme.rst.jinja" somewhere. Re-installing
Now Hope this helps 😄 |
Versions
Python: 3.8
setuptools-odoo: 2.7.1 (installed w/
pip3 install --user setuptools-odoo
)pre-commit: 2.13.0 (installed w/
pip3 install --user pre-commit
)Odoo version: 14.0
I get this when running pre-commit:
I find the file in
/home/sorsi/.cache/pre-commit/repo1mxdepkf/setuptools_odoo/addons-7c.txt
so it seems that the lookup for these txt files is broken heresetuptools-odoo/setuptools_odoo/base_addons.py
Line 11 in f481c16
Maybe it happens only w/ pre-commit + 3.8?
The text was updated successfully, but these errors were encountered: