[BIG UPDATE]
The PEP PR is live: PEP 771: Default Extras for Python Software Packages by astrofrog · Pull Request #4198 · python/peps · GitHub
We have been fairly at hard work with @trobitaille.
We published and opened the PR on Github, we invite you to review it and comment it.
As part of the Wheel-Next open-source initiative, there is a “near-complete” and fully testable implementation of this PEP as a “proof of concept”:
- GitHub - wheel-next/pep_771
- MockHouse - A fast development platform for the Wheel-Next Open-Source Initiative.
We would really appreciate you for taking a few minutes to test it, and give us your feedback.
Promise, it won’t take any longer than a few pip install ...
commands
Full instructions on Github, short summary here:
# 1. Create a virtualenv
# WARNING: Installing PEP 771 overwrites a bunch of standard python library.
# Do not install this in your main python environment.
virtualenv .venv
source .venv/bin/activate
# 2. Set the extra index to the Wheel-Next Static Wheel Server: MockHouse
pip config set --site global.extra-index-url https://wheel-next.github.io/mockhouse/pep-771/
>>> Writing to /path/to/venv/pip.conf
# 2. Install the PEP 771 Metapackage that will give you the modified libraries:
# - setuptools
# - pip
# - importlib_metadata
# - validate-pyproject
pip install pep-771
# 3. Let's verify everything is good:
pip --version
>>> pip 25.0.dev0+pep-771 from ... # <=============== Check you can see `+pep-771`
pip freeze | grep setuptools
>>> setuptools @ git+https://github.com/wheel-next/setuptools.git@...
pip freeze | grep validate-pyproject
>>> validate-pyproject @ git+https://github.com/wheel-next/validate-pyproject.git@...
pip freeze | grep importlib_metadata
>>> importlib_metadata @ git+https://github.com/wheel-next/importlib_metadata.git@...
# -------------------- Then choose one of the followings -------------------- #
# ~~~~~~~~ pep-771-demo-a with the "default extra": flask ~~~~~~~~ #
# will install pep-771-demo-a AND the default `flask` extra
pip install pep-771-demo-a
# You should see `pep-771-demo-a` being installed along of `flask` and its dependencies (flask is the default "optional-dependency".
# ~~~~~~~~ pep-771-demo-a with the "user-specified extra": fastapi ~~~~~~~~ #
pip install pep-771-demo-a[fastapi]
# Will install `pep-771-demo-a` with `fastapi` and dependencies (but no flask in sight)