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

Missing METADATA for UV-installed pkg_resources #261

Open
NiklasRosenstein opened this issue Jul 18, 2024 · 0 comments
Open

Missing METADATA for UV-installed pkg_resources #261

NiklasRosenstein opened this issue Jul 18, 2024 · 0 comments

Comments

@NiklasRosenstein
Copy link
Contributor

When using krakenw --use UV --upgrade lock on a project, I get the below error.

FileNotFoundError: [Errno 2] No such file or directory: '/home/coder/git/myproject/build/.kraken/venv/lib/python3.10/site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/METADATA'
Full error
Traceback (most recent call last):
  File "<string>", line 5, in <module>
  File "/home/coder/git/myproject/build/.kraken/venv/lib/python3.10/site-packages/kraken/core/cli/main.py", line 496, in main
    main_internal(prog, argv)
  File "/home/coder/git/myproject/build/.kraken/venv/lib/python3.10/site-packages/kraken/core/cli/main.py", line 454, in main_internal
    env()
  File "/home/coder/git/myproject/build/.kraken/venv/lib/python3.10/site-packages/kraken/core/cli/main.py", line 425, in env
    dists = sorted(get_distributions().values(), key=lambda dist: dist.name)
  File "/home/coder/git/myproject/build/.kraken/venv/lib/python3.10/site-packages/kraken/common/pyenv/_distributions.py", line 113, in get_distributions
    collector.collect_all()
  File "/home/coder/git/myproject/build/.kraken/venv/lib/python3.10/site-packages/kraken/common/pyenv/_distributions.py", line 106, in collect_all
    self.distributions[dist.project_name] = Distribution.from_pkg_resources(dist)
  File "/home/coder/git/myproject/build/.kraken/venv/lib/python3.10/site-packages/kraken/common/pyenv/_distributions.py", line 32, in from_pkg_resources
    data = Parser().parsestr(dist.get_metadata(dist.PKG_INFO))
  File "/home/coder/git/myproject/build/.kraken/venv/lib/python3.10/site-packages/pkg_resources/__init__.py", line 1674, in get_metadata
    value = self._get(path)
  File "/home/coder/git/myproject/build/.kraken/venv/lib/python3.10/site-packages/pkg_resources/__init__.py", line 1888, in _get
    with open(path, 'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/home/coder/git/myproject/build/.kraken/venv/lib/python3.10/site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/METADATA'
Traceback (most recent call last):
  File "/home/coder/.local/bin/krakenw", line 8, in <module>
    sys.exit(main())
  File "/home/coder/.local/share/pipx/venvs/kraken-wrapper/lib/python3.10/site-packages/kraken/common/exceptions.py", line 22, in wrapper
    return func(*args, **kwargs)
  File "/home/coder/.local/share/pipx/venvs/kraken-wrapper/lib/python3.10/site-packages/kraken/wrapper/main.py", line 486, in main
    lock(f"{parser.prog} lock", argv, manager, project)
  File "/home/coder/.local/share/pipx/venvs/kraken-wrapper/lib/python3.10/site-packages/kraken/wrapper/main.py", line 102, in lock
    distributions = environment.get_installed_distributions()
  File "/home/coder/.local/share/pipx/venvs/kraken-wrapper/lib/python3.10/site-packages/kraken/wrapper/_buildenv_venv.py", line 145, in get_installed_distributions
    return general_get_installed_distributions([str(python), "-c", f"{KRAKEN_MAIN_IMPORT_SNIPPET}\nmain()"])
  File "/home/coder/.local/share/pipx/venvs/kraken-wrapper/lib/python3.10/site-packages/kraken/wrapper/_buildenv.py", line 107, in general_get_installed_distributions
    output = subprocess.check_output(command).decode()
  File "/home/coder/.pyenv/versions/3.10.14/lib/python3.10/subprocess.py", line 421, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/home/coder/.pyenv/versions/3.10.14/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/coder/git/myproject/build/.kraken/venv/bin/python', '-c', 'try:\n    from kraken.core.cli.main import main  # >= 0.9.0\nexcept ImportError:\n    from kraken.cli.main import main  # < 0.9.0\nmain()', 'query', 'env']' returned non-zero exit status 1.

It seems UV does something a bit different than Pip, and it's breaking how we collect dependency information for the Kraken lock file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant