Skip to content

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

Open
jenstroeger wants to merge 1 commit intooracle:mainfrom
jenstroeger:improve-makefile-add-simple-index
Open

Conversation

@jenstroeger
Copy link
Copy Markdown
Contributor

Summary

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.

Description of changes

The Simple Index structure is defined in PEP 503 and this change works as follows:

~ > mkdir /tmp/macaron-index/
~ > cd /tmp/macaron-index/
/tmp/macaron-index > python -m venv .venv  # Create a new virtual environment and activate it.
/tmp/macaron-index > . .venv/bin/activate
/tmp/macaron-index > pip install --extra-index-url file:///path/to/macaron/dist/simple-index/ macaron  # Install the Macaron package.
Looking in indexes: https://pypi.org/simple, file:///path/to/macaron/dist/simple-index/
Processing /path/to/macaron/dist/simple-index/macaron/macaron-0.23.0.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
WARNING: Location '/path/to/macaron/dist/simple-index/requests/' is ignored: it is either a non-existing path or lacks a specific scheme.
Collecting requests<3.0.0,>=2.32.3 (from macaron)
  Using cached requests-2.33.1-py3-none-any.whl.metadata (4.8 kB)

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

  • I have reviewed the contribution guide.
  • My PR title and commits follow the Conventional Commits convention.
  • My commits include the "Signed-off-by" line.
  • I have signed my commits following the instructions provided by GitHub. Note that we run GitHub's commit verification tool to check the commit signatures. A green verified label should appear next to all of your commits on GitHub.
  • I have updated the relevant documentation, if applicable.
  • I have tested my changes and verified they work as expected.

…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>
@jenstroeger jenstroeger requested a review from behnazh-w as a code owner April 10, 2026 08:11
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Apr 10, 2026
@jenstroeger
Copy link
Copy Markdown
Contributor Author

jenstroeger commented Apr 10, 2026

@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:

# Install Macaron package and dependencies.
echo "Installing Macaron..."
pip install --no-deps "${MACARON_WHEEL}"
pip install --no-deps -r "${MACARON_REQUIREMENTS}"
if a Simple Index would be available locally.

Also, I noticed that building the Docker image does not use the pinned & hashed requirements but instead installs Macaron and then whatever deps pip decides at that particular point in time:

&& pip install --no-compile --no-cache-dir --upgrade pip setuptools \
&& find $HOME/dist -depth \( -type f \( -name "macaron-*.whl" \) \) -exec pip install --no-compile --no-cache-dir '{}' \; \
Is that intended? I had expected to see an installation using Macaron’s requirements?

Footnotes

  1. Note that the generated requirements.txt contains the macaron pin and hashes, generated by the make requirements.txt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant