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

Can no longer create an editable install of typeshed-stats on Windows after upgrading to uv==0.1.3 #1609

Closed
AlexWaygood opened this issue Feb 17, 2024 · 9 comments
Labels
bug Something isn't working cache Caching of packages and metadata duplicate This issue or pull request already exists

Comments

@AlexWaygood
Copy link
Member

I was able to create an editable install of typeshed-stats fine on Windows locally with uv==0.1.1, and I'm still able to on macOS. However, after upgrading from uv==0.1.1 to uv==0.1.3 on Windows, I now see this (using PowerShell):

PS C:\Users\alexw\coding\typeshed-stats> uv venv env
Using Python 3.12.1 interpreter at C:\Users\alexw\AppData\Local\Programs\Python\Python312\python.exe
Creating virtualenv at: env
PS C:\Users\alexw\coding\typeshed-stats> env\scripts\activate
(env) PS C:\Users\alexw\coding\typeshed-stats> uv pip install -e ".[dev]"
error: Failed to build editables
  Caused by: Failed to build editable: file:///C:/Users/alexw/coding/typeshed-stats
  Caused by: Failed to install requirements from build-system.requires (resolve)
  Caused by: No solution found when resolving: hatchling, hatch-vcs
  Caused by: Reading from cache archive failed: check bytes error: check failed for tuple struct member 0: check failed for slice index 0: check failed for struct member files: check failed for struct member wheels: check failed for slice index 0: check failed for struct member file: check failed for struct member requires_python: invalid tag for enum: 156
@AlexWaygood AlexWaygood added bug Something isn't working cache Caching of packages and metadata labels Feb 17, 2024
@AlexWaygood
Copy link
Member Author

Hmmm... probably a duplicate of #1571, I guess?

@AlexWaygood
Copy link
Member Author

The output if I run uv pip install -e ".[dev]" --verbose:

 uv::requirements::from_source source=-e .[dev]
    0.003862s DEBUG uv_interpreter::virtual_env Found a virtualenv through VIRTUAL_ENV at: C:\Users\alexw\coding\typeshed-stats\env
    0.005343s DEBUG uv_interpreter::interpreter Using cached markers for: \\?\C:\Users\alexw\coding\typeshed-stats\env\Scripts\python.exe
    0.005479s DEBUG uv::commands::pip_install Using Python 3.12.1 environment at C:\Users\alexw\coding\typeshed-stats\env\Scripts\python.exe
 uv_client::flat_index::from_entries
 uv_installer::downloader::build_editables
      0.012075s   0ms DEBUG uv_distribution::source Building (editable) file:///C:/Users/alexw/coding/typeshed-stats
   uv_dispatch::setup_build package_id="file:///C:/Users/alexw/coding/typeshed-stats", subdirectory=None
     uv_resolver::resolver::solve
          0.028772s   0ms DEBUG uv_resolver::resolver Solving with target Python version 3.12.1
       uv_resolver::resolver::choose_version package=root
       uv_resolver::resolver::get_dependencies package=root, version=0a0.dev0
            0.029515s   0ms DEBUG uv_resolver::resolver Adding direct dependency: hatch-vcs*
            0.029749s   0ms DEBUG uv_resolver::resolver Adding direct dependency: hatchling*
       uv_resolver::resolver::choose_version package=hatch-vcs
         uv_resolver::resolver::package_wait package_name=hatch-vcs
     uv_resolver::resolver::process_request request=Versions hatch-vcs
       uv_client::registry_client::simple_api package=hatch-vcs
         uv_client::cached_client::get_cacheable
           uv_client::cached_client::read_and_parse_cache file=\\?\C:\Users\alexw\AppData\Local\uv\cache\simple-v0\pypi\hatch-vcs.rkyv
     uv_resolver::resolver::process_request request=Versions hatchling
       uv_client::registry_client::simple_api package=hatchling
         uv_client::cached_client::get_cacheable
           uv_client::cached_client::read_and_parse_cache file=\\?\C:\Users\alexw\AppData\Local\uv\cache\simple-v0\pypi\hatchling.rkyv
     uv_resolver::resolver::process_request request=Prefetch hatchling *
     uv_resolver::resolver::process_request request=Prefetch hatch-vcs *
              0.033306s   2ms DEBUG uv_client::cached_client Found stale response for: https://pypi.org/simple/hatch-vcs/
              0.033573s   2ms DEBUG uv_client::cached_client Sending revalidation request for: https://pypi.org/simple/hatch-vcs/
           uv_client::cached_client::revalidation_request url="https://pypi.org/simple/hatch-vcs/"
              0.034468s   2ms DEBUG uv_client::cached_client Found stale response for: https://pypi.org/simple/hatchling/
              0.034637s   2ms DEBUG uv_client::cached_client Sending revalidation request for: https://pypi.org/simple/hatchling/
           uv_client::cached_client::revalidation_request url="https://pypi.org/simple/hatchling/"
              0.134278s 103ms DEBUG uv_client::cached_client Found not-modified response for: https://pypi.org/simple/hatch-vcs/
           uv_client::cached_client::refresh_cache file=\\?\C:\Users\alexw\AppData\Local\uv\cache\simple-v0\pypi\hatch-vcs.rkyv
error: Failed to build editables
  Caused by: Failed to build editable: file:///C:/Users/alexw/coding/typeshed-stats
  Caused by: Failed to install requirements from build-system.requires (resolve)
  Caused by: No solution found when resolving: hatchling, hatch-vcs
  Caused by: Reading from cache archive failed: check bytes error: check failed for tuple struct member 0: check failed for slice index 0: check failed for struct member files: check failed for struct member wheels: check failed for slice index 0: check failed for struct member file: check failed for struct member requires_python: invalid tag for enum: 156

@zanieb
Copy link
Member

zanieb commented Feb 17, 2024

Yeah this looks like a cache upgrade bug, if you uv clean it should be fixed

@AlexWaygood
Copy link
Member Author

Yeah this looks like a cache upgrade bug, if you uv clean it should be fixed

Yup, can confirm that fixed things!

@MichaReiser
Copy link
Member

MichaReiser commented Feb 17, 2024

Is the uv version not a part of the cache key?

@charliermarsh
Copy link
Member

No, the cache buckets have their own versions that we can bump. I need to look back at the history to see if we changed something in the cache representation between versions. It’s possible that I was supposed to bump a version.

@AlexWaygood
Copy link
Member Author

Fun fact: I only ran into this because I was trying to repro #1612 locally 😄

@charliermarsh
Copy link
Member

Ok, I believe I've confirmed locally that this was caused by #1556. I changed one of the cached structs, and that breaks the zero-copy representation. I should've bumped the cache version.

@charliermarsh
Copy link
Member

Gonna merge with #1571.

@charliermarsh charliermarsh closed this as not planned Won't fix, can't repro, duplicate, stale Feb 17, 2024
@zanieb zanieb added the duplicate This issue or pull request already exists label Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cache Caching of packages and metadata duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants