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

Diverging versions without markers #5344

Closed
konstin opened this issue Jul 23, 2024 · 3 comments
Closed

Diverging versions without markers #5344

konstin opened this issue Jul 23, 2024 · 3 comments
Assignees
Labels
bug Something isn't working preview Experimental behavior

Comments

@konstin
Copy link
Member

konstin commented Jul 23, 2024

Take the following pyproject.toml, which forks:

[project]
name = "transformers"
version = "4.39.0.dev0"
description = "State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow"
requires-python = ">=3.9.0"

dependencies = [
  "datasets",
  "dill<0.3.5",
  "tensorboard",
  "tensorflow-text<2.16",
  "tensorflow>=2.6,<2.16",
  "torch",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

Delete any existing uv.lock, run uv lock. In the lockfile, we find entries with diverging versions but missing markers:

[[distribution]]
name = "datasets"
version = "2.20.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
    { name = "aiohttp" },
    { name = "dill" },
    { name = "filelock" },
    { name = "fsspec", extra = ["http"] },
    { name = "huggingface-hub" },
    { name = "multiprocess" },
    { name = "numpy", version = "1.26.4", source = { registry = "https://pypi.org/simple" } },
    { name = "numpy", version = "2.0.1", source = { registry = "https://pypi.org/simple" } },
    { name = "packaging" },
    { name = "pandas" },
    { name = "pyarrow" },
    { name = "pyarrow-hotfix" },
    { name = "pyyaml" },
    { name = "requests" },
    { name = "tqdm" },
    { name = "xxhash" },
]
sdist = { url = "https://files.pythonhosted.org/packages/d5/59/b94bfb5f6225c4c931cd516390b3f006e232a036a48337f72889c6c9ab27/datasets-2.20.0.tar.gz", hash = "sha256:3c4dbcd27e0f642b9d41d20ff2efa721a5e04b32b2ca4009e0fc9139e324553f", size = 2225757 }
wheels = [
    { url = "https://files.pythonhosted.org/packages/60/2d/963b266bb8f88492d5ab4232d74292af8beb5b6fdae97902df9e284d4c32/datasets-2.20.0-py3-none-any.whl", hash = "sha256:76ac02e3bdfff824492e20678f0b6b1b6d080515957fe834b00c2ba8d6b18e5e", size = 547777 },
]

This must not be, we can't when to install which version this way. We need to know for which markers we should pick which numpy version.

#5163 does not fix this case.

@konstin konstin added bug Something isn't working preview Experimental behavior labels Jul 23, 2024
@BurntSushi BurntSushi self-assigned this Jul 23, 2024
@BurntSushi
Copy link
Member

I'll look into this. It could be a dupe of #4640 since #5163 only targets the "incomplete" marker case, where as #4640 is a problem with markers overlapping with each other.

@BurntSushi
Copy link
Member

It looks like #5597 might have fixed this! With that PR:

[[distribution]]
name = "datasets"
version = "2.20.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
    { name = "aiohttp", marker = "python_version <= '3.11' or python_version >= '3.12' or (python_version < '3.12' and python_version > '3.11')" },
    { name = "dill", marker = "python_version <= '3.11' or python_version >= '3.12' or (python_version < '3.12' and python_version > '3.11')" },
    { name = "filelock", marker = "python_version <= '3.11' or python_version >= '3.12' or (python_version < '3.12' and python_version > '3.11')" },
    { name = "fsspec", marker = "python_version <= '3.11' or python_version >= '3.12' or (python_version < '3.12' and python_version > '3.11')" },
    { name = "fsspec", extra = ["http"] },
    { name = "huggingface-hub", marker = "python_version <= '3.11' or python_version >= '3.12' or (python_version < '3.12' and python_version > '3.11')" },
    { name = "multiprocess", marker = "python_version <= '3.11' or python_version >= '3.12' or (python_version < '3.12' and python_version > '3.11')" },
    { name = "numpy", version = "1.26.4", source = { registry = "https://pypi.org/simple" }, marker = "python_version >= '3.12'" },
    { name = "numpy", version = "2.0.1", source = { registry = "https://pypi.org/simple" }, marker = "python_version <= '3.11' or (python_version < '3.12' and python_version > '3.11')" },
    { name = "packaging", marker = "python_version <= '3.11' or python_version >= '3.12' or (python_version < '3.12' and python_version > '3.11')" },
    { name = "pandas", marker = "python_version <= '3.11' or python_version >= '3.12' or (python_version < '3.12' and python_version > '3.11')" },
    { name = "pyarrow", marker = "python_version <= '3.11' or python_version >= '3.12' or (python_version < '3.12' and python_version > '3.11')" },
    { name = "pyarrow-hotfix", marker = "python_version <= '3.11' or python_version >= '3.12' or (python_version < '3.12' and python_version > '3.11')" },
    { name = "pyyaml", marker = "python_version <= '3.11' or python_version >= '3.12' or (python_version < '3.12' and python_version > '3.11')" },
    { name = "requests", marker = "python_version <= '3.11' or python_version >= '3.12' or (python_version < '3.12' and python_version > '3.11')" },
    { name = "tqdm", marker = "python_version <= '3.11' or python_version >= '3.12' or (python_version < '3.12' and python_version > '3.11')" },
    { name = "xxhash", marker = "python_version <= '3.11' or python_version >= '3.12' or (python_version < '3.12' and python_version > '3.11')" },
]
sdist = { url = "https://files.pythonhosted.org/packages/d5/59/b94bfb5f6225c4c931cd516390b3f006e232a036a48337f72889c6c9ab27/datasets-2.20.0.tar.gz", hash = "sha256:3c4dbcd27e0f642b9d41d20ff2efa721a5e04b32b2ca4009e0fc9139e324553f", size = 2225757 }
wheels = [
    { url = "https://files.pythonhosted.org/packages/60/2d/963b266bb8f88492d5ab4232d74292af8beb5b6fdae97902df9e284d4c32/datasets-2.20.0-py3-none-any.whl", hash = "sha256:76ac02e3bdfff824492e20678f0b6b1b6d080515957fe834b00c2ba8d6b18e5e", size = 547777 },
]

@konstin
Copy link
Member Author

konstin commented Jul 30, 2024

Looks good! Feel free to close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working preview Experimental behavior
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants