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't unselect default extras #2

Open
konstin opened this issue Jan 21, 2025 · 4 comments
Open

Can't unselect default extras #2

konstin opened this issue Jan 21, 2025 · 4 comments
Assignees

Comments

@konstin
Copy link

konstin commented Jan 21, 2025

Companion repo: https://github.com/konstin/ndeiabc

I have this pyproject.toml:

[project]
name = "ndeiabc"
version = "0.1.1"
description = "new default extra is a breaking change"
requires-python = ">=3.12"
dependencies = []
default-optional-dependencies = [
    "recommended",
]

[project.optional-dependencies]
recommended = ["numpy>=2,<3", "tqdm>4,<=5"]
minimal = []

[build-system]
requires = ["setuptools @ git+https://github.com/wheel-next/setuptools.git@pep_771"]
build-backend = "setuptools.build_meta"

And this test script:

#!/bin/bash

set -e

rm -rf .venv
virtualenv .venv
.venv/bin/pip config set --site global.extra-index-url https://wheel-next.github.io/mockhouse/pep-771/
.venv/bin/pip install pep-771
echo "=========================="
.venv/bin/pip --version
echo "=========================="
pip install "ndeiabc[minimal]==0.1.1" --no-cache --find-links dist

If i run the script i get

==========================
pip 25.0.dev0+pep-771 from /home/konsti/projects/ndeiabc/.venv/lib/python3.13/site-packages/pip (python 3.13)
==========================
Looking in indexes: https://pypi.org/simple, https://wheel-next.github.io/mockhouse/pep-771/
Looking in links: dist
Processing ./dist/ndeiabc-0.1.1-py3-none-any.whl (from ndeiabc[minimal]==0.1.1)
Collecting numpy<3,>=2 (from ndeiabc==0.1.1->ndeiabc[minimal]==0.1.1)
  Downloading numpy-2.2.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (62 kB)
Collecting tqdm<=5,>4 (from ndeiabc==0.1.1->ndeiabc[minimal]==0.1.1)
  Downloading tqdm-4.67.1-py3-none-any.whl.metadata (57 kB)
Downloading numpy-2.2.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.1/16.1 MB 12.3 MB/s eta 0:00:00
Downloading tqdm-4.67.1-py3-none-any.whl (78 kB)
Installing collected packages: tqdm, numpy, ndeiabc
Successfully installed ndeiabc-0.1.1 numpy-2.2.2 tqdm-4.67.1

It seems that the patched pip always installs the default requirements?

For context, the METADATA of the wheel:

Metadata-Version: 2.5
Name: ndeiabc
Version: 0.1.1
Summary: new default extra is a breaking change
Requires-Python: >=3.12
Default-Extra: recommended
Provides-Extra: recommended
Requires-Dist: numpy<3,>=2; extra == "recommended"
Requires-Dist: tqdm<=5,>4; extra == "recommended"
Provides-Extra: minimal
@DEKHTIARJonathan
Copy link
Member

Hi @konstin,

Yes indeed I noticed the bug indeed last week - sorry about this.
I'm a bit "tight on schedule" - give me a week or so and I'll track down why it's that way. I didn't mention it on DPO to avoid creating unnecessary noise (it's just demo-related not truly proposal-related).

However, thanks a lot for trying the demo ;) If you're interested in having a chat about your perspective about how the demo is implemented, feel free to hit me up. Having some feedback would be nice

@DEKHTIARJonathan
Copy link
Member

@konstin I finally found the issue and fixed it. If you reapply all the instructions you should be able to confirm it now works just right

@DEKHTIARJonathan DEKHTIARJonathan self-assigned this Jan 23, 2025
@konstin
Copy link
Author

konstin commented Jan 27, 2025

I'm seeing this bug still:

$ pip install "ndeiabc[minimal]==0.1.1" --no-cache --find-links dist
Looking in indexes: https://pypi.org/simple, https://wheel-next.github.io/mockhouse/pep-771/
Looking in links: dist
Processing ./dist/ndeiabc-0.1.1-py3-none-any.whl (from ndeiabc[minimal]==0.1.1)
Collecting numpy<3,>=2 (from ndeiabc==0.1.1->ndeiabc[minimal]==0.1.1)
  Downloading numpy-2.2.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (62 kB)
Collecting tqdm<=5,>4 (from ndeiabc==0.1.1->ndeiabc[minimal]==0.1.1)
  Downloading tqdm-4.67.1-py3-none-any.whl.metadata (57 kB)
Downloading numpy-2.2.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.1/16.1 MB 12.7 MB/s eta 0:00:00
Downloading tqdm-4.67.1-py3-none-any.whl (78 kB)
Installing collected packages: tqdm, numpy, ndeiabc
Successfully installed ndeiabc-0.1.1 numpy-2.2.2 tqdm-4.67.1

Only on the second run, they seem to be skipped:

$ pip install "ndeiabc[minimal]==0.1.1" --no-cache --find-links dist
Looking in indexes: https://pypi.org/simple, https://wheel-next.github.io/mockhouse/pep-771/
Looking in links: dist
Requirement already satisfied: ndeiabc==0.1.1 in ./.venv/lib/python3.13/site-packages (from ndeiabc[minimal]==0.1.1) (0.1.1)
Ignoring numpy: markers 'extra == "recommended"' don't match your environment
Ignoring tqdm: markers 'extra == "recommended"' don't match your environment

pip's direct_url.json:

{
  "url": "https://github.com/wheel-next/pip.git",
  "vcs_info": {
    "commit_id": "3b74d678d558ec43d53fd4c609871853a2d0865e",
    "requested_revision": "pep_771",
    "vcs": "git"
  }
}

@DEKHTIARJonathan
Copy link
Member

Oh interesting I must have screwed up something pretty basic. If you remove ==A.B.C it will work just fine.

I'll check in the debugger next week, I'm a bit busy until Monday. Thanks a lot again for your testing, very very much appreciated

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

No branches or pull requests

2 participants