Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/reusable_prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
- name: Build
run: |
pip install --upgrade hatch "click<8.3" "virtualenv<21"
# Keep hatchling 1.32.1 out of the isolated build env (pypa/hatch#2427).
# See reusable_python_build.yml for why the pin must be a constraint.
echo 'hatchling!=1.32.1' > "$RUNNER_TEMP/build-constraints.txt"
export UV_CONSTRAINT="$RUNNER_TEMP/build-constraints.txt"
export PIP_CONSTRAINT="$RUNNER_TEMP/build-constraints.txt"
hatch -v build

- name: UploadArtifacts
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/reusable_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ jobs:
- name: Build
run: |
pip install --upgrade hatch "click<8.3" "virtualenv<21"
# Keep hatchling 1.32.1 out of the isolated build env (pypa/hatch#2427).
# See reusable_python_build.yml for why the pin must be a constraint.
echo 'hatchling!=1.32.1' > "$RUNNER_TEMP/build-constraints.txt"
export UV_CONSTRAINT="$RUNNER_TEMP/build-constraints.txt"
export PIP_CONSTRAINT="$RUNNER_TEMP/build-constraints.txt"
hatch -v build

- name: Configure AWS credentials
Expand Down Expand Up @@ -168,6 +173,13 @@ jobs:
run: |
pip install --upgrade hatch "click<8.3" "virtualenv<21"
pip install --upgrade twine
# Keep hatchling 1.32.1 out of the isolated build env (pypa/hatch#2427).
# See reusable_python_build.yml for why the pin must be a constraint.
echo 'hatchling!=1.32.1' > "$RUNNER_TEMP/build-constraints.txt"
{
echo "UV_CONSTRAINT=$RUNNER_TEMP/build-constraints.txt"
echo "PIP_CONSTRAINT=$RUNNER_TEMP/build-constraints.txt"
} >> "$GITHUB_ENV"

- name: Build
run: hatch -v build
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/reusable_python_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
python-version: ${{ inputs.python-version }}

- name: Install Hatch
# bash on every OS: the constraint snippet below uses POSIX redirection,
# and this job also runs on windows-latest where the default is pwsh.
shell: bash
run: |
# pyproject-hooks 1.3.0 renamed the env var carrying an in-tree
# backend's backend-path to _PYPROJECT_HOOKS_BACKEND_PATH_JSON
Expand All @@ -62,6 +65,18 @@ jobs:
# once hatch sets the new name.
pip install --upgrade hatch "click<8.3" "virtualenv<21" "pyproject-hooks<1.3"

# hatchling 1.32.1 imports `hatch`, which is absent from the isolated
# build env that `hatch build` creates, so every build fails with
# ModuleNotFoundError (pypa/hatch#2427; the release is yanked). A pin
# on the line above only reaches the CLI env. The build env is
# installed by uv and honours UV_CONSTRAINT; PIP_CONSTRAINT covers a
# pip-installed one.
echo 'hatchling!=1.32.1' > "$RUNNER_TEMP/build-constraints.txt"
{
echo "UV_CONSTRAINT=$RUNNER_TEMP/build-constraints.txt"
echo "PIP_CONSTRAINT=$RUNNER_TEMP/build-constraints.txt"
} >> "$GITHUB_ENV"

- name: Run Linting
run: hatch -v run lint

Expand Down