chore: add a new Makefile target simple-index which builds all distribution artifacts and then creates a PEP-503 compatible Simple Index in the dist/ folder#1358
Conversation
…ribution artifacts and then creates a PEP-503 compatible Simple Index in the dist/ folder Signed-off-by: Jens Troeger <jens.troeger@light-speed.de>
|
@behnazh-w following up on our conversation, here’s how to use the Simple Index to install Macaron in one go1: ~ > mkdir macaron-index
~ > cd macaron-index/
macaron-index > python3.11 -m venv .venv
macaron-index > . .venv/bin/activate
macaron-index > pip install --no-deps --extra-index-url file:///path/to/macaron/dist/simple-index/ -r /path/to/macaron/dist/macaron-0.23.0-py3-none-macosx_x86_64-requirements.txt
...
Processing /path/to/macaron/dist/simple-index/macaron/macaron-0.23.0.tar.gz (from -r /path/to/macaron/dist/macaron-0.23.0-py3-none-macosx_x86_64-requirements.txt (line 2027))
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: macaron
Building wheel for macaron (pyproject.toml) ... done
Created wheel for macaron: filename=macaron-0.23.0-py3-none-any.whl size=585953 sha256=84a454bea1b7ce1268c0dec87c438661d8676151769723fd04e0b84336877236
Stored in directory: /path/to/caches/pip/wheels/fa/e2/95/83a10db4b99104f7fd70877686c083ca53aaf06b5633a6acd5
Successfully built macaron
Installing collected packages: ...
Successfully installed ... macaron-0.23.0 ...For example, the one line above can replace these two: macaron/scripts/release_scripts/install_macaron_python.sh Lines 116 to 119 in 3a4e8dd Also, I noticed that building the Docker image does not use the pinned & hashed requirements but instead installs Macaron and then whatever deps macaron/docker/Dockerfile.final Lines 41 to 42 in 3a4e8dd Footnotes |
@jenstroeger Looks like I missed this comment. Yes, I am aware of the behavior you have observed, and in fact it's been something that I've been wanting to improve, but didn't find time. Now that we have this new target, it's a good time to improve how we install Macaron in the Dockerfile and elsewhere. |
Summary
Add a new Makefile target
simple-indexwhich builds all distribution artifacts and then creates a PEP-503 compatible Simple Index in the dist/ folder.Description of changes
The Simple Index structure is defined in PEP 503 and this change works as follows:
We can ignore the warnings because the Simple Index contains only the Macaron package; all other packages fall back to the global PyPI default index.
Related issues
No related issue, but the changes are cherry-picked from PR #1355.
Checklist
verifiedlabel should appear next to all of your commits on GitHub.