Skip to content
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

Upgrade to V3 of CI base image. #9

Merged
merged 1 commit into from
Jun 5, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- id: details
uses: kpfleming/composite-actions/image-details@v2
with:
base_image: python:bookworm-main
base_image: python:v3-bookworm-main
- id: preflight
uses: kpfleming/composite-actions/ci-preflight@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: hatch build -t wheel
shell: bash
- name: install project
run: hatch run ci.py${{ inputs.python }}:pip install dist/*.whl
run: hatch run ci.py${{ inputs.python }}:uv pip install dist/*.whl
shell: bash
- name: run tests
run: hatch run ci.py${{ inputs.python }}:ci
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ packages = [

[tool.hatch.envs.default]
python = "3.12"
installer = "uv"
python-sources = [
"external",
]

[tool.hatch.envs.lint]
dependencies = [
Expand Down Expand Up @@ -122,7 +126,6 @@ python = [
"3.10",
"3.11",
"3.12",
"3.13",
]

[tool.hatch.envs.ci.scripts]
Expand Down
28 changes: 10 additions & 18 deletions workflow-support/make_ci_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ image_name=${1}; shift
dist_name=${1}; shift

lint_deps=(shellcheck)
proj_deps=(libsqlite3-0)
proj_build_deps=(build-essential libc6-dev pkg-config)
proj_deps=()
proj_build_deps=()

hatchenvs=(lint ci)
cimatrix=(3.8 3.9 3.10 3.11 3.12 3.13)

c=$(buildah from "${base_image}")

Expand All @@ -41,27 +40,20 @@ build_cmd apt install --yes --quiet=2 "${lint_deps[@]}" "${proj_deps[@]}" "${pro
for env in "${hatchenvs[@]}"; do
# this looks weird... but it causes Hatch to create the env,
# install all of the project's dependencies and the project,
# then runs pip to uninstall the project, leaving the env
# then runs 'uv pip' to uninstall the project, leaving the env
# in place with the dependencies
case "${env}" in
ci*)
for py in "${cimatrix[@]}"; do
build_cmd_with_source hatch env create "${env}.py${py}"
build_cmd_with_source hatch -e "${env}.py${py}" run pip uninstall --yes "${dist_name}"
done
;;
*)
build_cmd_with_source hatch env create "${env}"
build_cmd_with_source hatch -e "${env}" run pip uninstall --yes "${dist_name}"
;;
esac
build_cmd_with_source hatch env create "${env}"
build_cmd_with_source hatch -e "${env}" run uv pip uninstall "${dist_name}"
done

build_cmd apt remove --yes --purge "${proj_build_deps[@]}"
if [ -n "${proj_build_deps[*]}" ]
then
build_cmd apt remove --yes --purge "${proj_build_deps[@]}"
fi
build_cmd apt autoremove --yes --purge
build_cmd apt clean autoclean
build_cmd sh -c "rm -rf /var/lib/apt/lists/*"
build_cmd rm -rf /root/.cache
build_cmd uv cache clean

if buildah images --quiet "${image_name}"; then
buildah rmi "${image_name}"
Expand Down
2 changes: 1 addition & 1 deletion workflow-support/versions.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
versions={"python": ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]}
versions={"python": ["3.8", "3.9", "3.10", "3.11", "3.12"]}
Loading