-
Notifications
You must be signed in to change notification settings - Fork 4
Remove py-show and use pyproject-external project
#5
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e9c5eb4
Clear root-level a bit
jaimergp 663cfb1
Centralize workflow requirements
jaimergp 520df06
Remove py-show in favor of external-metadata cli
jaimergp a16df75
Adjust GHA workflow accordingly
jaimergp 0207f11
install git in container
jaimergp 6c6d42e
fix package name
jaimergp cef1a93
retrigger
jaimergp 3c3753e
fix mambarc location
jaimergp 0008610
retrigger
jaimergp 7d8f908
retrigger
jaimergp 92b155d
quote echo
jaimergp 109800a
move libyaml to host-requires
jaimergp b9e4078
quote here too
jaimergp 66ebdc3
call eval directly
jaimergp 552d0e3
use shlex branch temporarily
jaimergp e98e691
move build time patches to correct section
jaimergp 89313b5
revert to install from main
jaimergp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,17 +41,17 @@ jobs: | |
| steps: | ||
| - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | ||
|
|
||
| - name: Install system Python | ||
| - name: Install system Python and git | ||
| run: | | ||
| if [[ ${{ matrix.platform[1] }} == "Fedora" ]]; then | ||
| sudo dnf install -y python # will install 3.12 | ||
| sudo dnf install -y python git # will install 3.12 | ||
| elif [[ ${{ matrix.platform[1] }} == "Arch" ]]; then | ||
| pacman -Syu python sudo --noconfirm # will install 3.11 | ||
| pacman -Syu python git sudo --noconfirm # will install 3.11 | ||
| elif [[ ${{ matrix.platform[1] }} == "conda-forge" ]]; then | ||
| "${SHELL}" <(curl -L micro.mamba.pm/install.sh) | ||
| source ~/.bashrc | ||
| cp .mambarc ~/.mambarc | ||
| micromamba create -n cfenv python pip # will install 3.12 | ||
| cp .github/.mambarc ~/.mambarc | ||
| micromamba create -n cfenv python pip git # will install 3.12 | ||
| fi | ||
|
|
||
| - name: Download and patch sdist | ||
|
|
@@ -63,8 +63,8 @@ jobs: | |
| source venv/bin/activate | ||
| fi | ||
|
|
||
| python -m pip install pypi_json distro typer rich ./py-show | ||
| python download_and_patch_sdist.py ${{ matrix.pkgdata[0]}} | ||
| python -m pip install -r requirements.txt | ||
| python scripts/download_and_patch_sdist.py ${{ matrix.pkgdata[0]}} | ||
| ls -alh sdist/ | ||
| ls -alh sdist/_amended | ||
|
|
||
|
|
@@ -77,14 +77,19 @@ jobs: | |
| fi | ||
| name=${{ matrix.pkgdata[0]}} | ||
|
|
||
| pyshow_args="--sdist-dir=./sdist/_amended" | ||
| cli_args="" | ||
| if [[ ${{ matrix.platform[1] }} == "conda-forge" ]]; then | ||
| pyshow_args+=" --package-manager=micromamba" | ||
| cli_args+=" --package-manager=micromamba" | ||
| fi | ||
| cli_args+=" ./sdist/_amended/$name-*.tar.gz" | ||
|
|
||
| py-show --external $name $pyshow_args | ||
| py-show --external --system-install-cmd $name $pyshow_args | ||
| eval "$(py-show --external --system-install-cmd $name $pyshow_args)" | ||
| echo "Raw external metadata:" | ||
| python -m pyproject_external --output=raw $cli_args | ||
| echo "Mapped external metadata:" | ||
| python -m pyproject_external --output=mapped $cli_args | ||
| echo "Install command:" | ||
| set +x | ||
| eval "$(python -m pyproject_external --output=command $cli_args)" | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is nice. |
||
|
|
||
| - name: Build from sdist | ||
| run: | | ||
|
|
@@ -93,12 +98,6 @@ jobs: | |
| else | ||
| source venv/bin/activate | ||
| fi | ||
| # Build time patches | ||
| case ${{ matrix.pkgdata[0] }} in | ||
| matplotlib) | ||
| export AR="${GCC_AR:gcc-ar}" | ||
| ;; | ||
| esac | ||
| # Dependencies may be installed from wheels, the target package from sdist | ||
| python -m pip install sdist/_amended/${{ matrix.pkgdata[0] }}-*.tar.gz -v | ||
|
|
||
|
|
@@ -174,20 +173,19 @@ jobs: | |
| - name: Install system Python | ||
| run: | | ||
| if [[ ${{ matrix.platform[1] }} == "Fedora" ]]; then | ||
| sudo dnf install -y python # will install 3.12 | ||
| sudo dnf install -y python git # will install 3.12 | ||
| elif [[ ${{ matrix.platform[1] }} == "Arch" ]]; then | ||
| pacman -Syu python sudo --noconfirm # will install 3.11 | ||
| pacman -Syu python git sudo --noconfirm # will install 3.11 | ||
| elif [[ ${{ matrix.platform[1] }} == "conda-forge" ]]; then | ||
| "${SHELL}" <(curl -L micro.mamba.pm/install.sh) | ||
| source ~/.bashrc | ||
| cp .mambarc ~/.mambarc | ||
| micromamba create -n cfenv python pip # will install 3.12 | ||
| cp .github/.mambarc ~/.mambarc | ||
| micromamba create -n cfenv python pip git # will install 3.12 | ||
| else | ||
| echo 'Unsupported distro!' | ||
| fi | ||
|
|
||
| - name: Download and patch sdist | ||
| if: ${{ matrix.platform[2] }} | ||
| run: | | ||
| if [[ ${{ matrix.platform[1] }} == "conda-forge" ]]; then | ||
| source ~/.bashrc && micromamba activate cfenv | ||
|
|
@@ -196,13 +194,12 @@ jobs: | |
| source venv/bin/activate | ||
| fi | ||
|
|
||
| python -m pip install pypi_json distro typer rich ./py-show | ||
| python download_and_patch_sdist.py ${{ matrix.pkgdata[0]}} | ||
| python -m pip install -r requirements.txt | ||
| python scripts/download_and_patch_sdist.py ${{ matrix.pkgdata[0]}} | ||
| ls -alh sdist/ | ||
| ls -alh sdist/_amended | ||
|
|
||
| - name: Install external dependencies | ||
| if: ${{ matrix.platform[2] }} | ||
| run: | | ||
| if [[ ${{ matrix.platform[1] }} == "conda-forge" ]]; then | ||
| source ~/.bashrc && micromamba activate cfenv | ||
|
|
@@ -211,14 +208,19 @@ jobs: | |
| fi | ||
| name=${{ matrix.pkgdata[0]}} | ||
|
|
||
| pyshow_args="--sdist-dir=./sdist/_amended" | ||
| cli_args="" | ||
| if [[ ${{ matrix.platform[1] }} == "conda-forge" ]]; then | ||
| pyshow_args+=" --package-manager=micromamba" | ||
| cli_args+=" --package-manager=micromamba" | ||
| fi | ||
| cli_args+=" ./sdist/_amended/$name-*.tar.gz" | ||
|
|
||
| py-show --external $name $pyshow_args | ||
| py-show --external --system-install-cmd $name $pyshow_args | ||
| $(py-show --external --system-install-cmd $name $pyshow_args) | ||
| echo "Raw external metadata:" | ||
| python -m pyproject_external --output=raw $cli_args | ||
| echo "Mapped external metadata:" | ||
| python -m pyproject_external --output=mapped $cli_args | ||
| echo "Install command:" | ||
| set +x | ||
| eval "$(python -m pyproject_external --output=command $cli_args)" | ||
|
|
||
| - name: Build from sdist | ||
| if: ${{ matrix.platform[2] }} | ||
|
|
@@ -228,6 +230,12 @@ jobs: | |
| else | ||
| source venv/bin/activate | ||
| fi | ||
| # Build time patches | ||
| case ${{ matrix.pkgdata[0] }} in | ||
| matplotlib) | ||
| export AR="${GCC_AR:gcc-ar}" | ||
| ;; | ||
| esac | ||
| # Dependencies may be installed from wheels, the target package from sdist | ||
| python -m pip install sdist/_amended/${{ matrix.pkgdata[0] }}-*.tar.gz -v | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,8 @@ | ||
| [external] | ||
| build-requires = [ | ||
| "dep:virtual/compiler/c", | ||
| ] | ||
|
|
||
| host-requires = [ | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good catch, this was a bug before |
||
| "dep:generic/libyaml", | ||
| ] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: why is
gitneeded?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Docker images don't have it, and some of our dependencies are installing Python packages from github repositories because they are not released on PyPI yet, more specifically:
pkgas a PackageURL class attribute package-url/packageurl-python#184I tried using a github archive for that but it failed due to setuptools-scm shenanigans.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that explains it - makes sense. It's not an issue at all to have it here, just good to know it can be dropped again in principle ones tooling issues are resolved. I kept it out on purpose because
gitcan also be a runtime dependency.