Skip to content

Commit

Permalink
ci: fix some build and test issues (#2767)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelotduarte committed Jan 7, 2025
1 parent 0c942e8 commit d632c30
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
{"os": "ubuntu-latest", "arch": "arm64", "tag": "cp3{8,9,10,11,12}-manylinux_aarch64"},
{"os": "ubuntu-latest", "arch": "arm64", "tag": "cp3{8,9,10,11,12}-musllinux_aarch64"},
{"os": "ubuntu-latest", "arch": "ppc64le", "tag": "cp3{8,9,10,11,12}-manylinux_ppc64le"},
{"os": "windows-latest", "arch": "x86_64", "tag": "cp3{8,9,10,11,12}-win32"},
]
with open(os.environ["GITHUB_OUTPUT"], "a+") as f:
print("data="+json.dumps({"include": include}), file=f)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt-get install -qy alien fakeroot rpm
sudo apt-get install -qy --allow-downgrades cpio=2.13+dfsg-7
sudo apt-get install -qy --allow-downgrades cpio=2.13+dfsg-7 || true
- name: Install dependencies to test
run: |
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ recursive-include cx_Freeze/importshed *.pyi
recursive-include cx_Freeze/initscripts *.txt
recursive-include doc Makefile *.py *.rst *.txt
recursive-include samples *.*
recursive-include source *.c *.rc python.manifest
recursive-include source *.c *.h *.rc python.manifest
recursive-include tests *.md *.py *.txt
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ ifeq ($(PY_PLATFORM),win-amd64)
python -m pip install --upgrade uv --disable-pip-version-check;\
fi
else
curl -LsSf https://astral.sh/uv/install.sh | env UV_UNMANAGED_INSTALL="$(HOME)/bin" sh
curl -LsSf https://astral.sh/uv/install.sh | \
env UV_INSTALL_DIR=="$(HOME)/bin" INSTALLER_NO_MODIFY_PATH=1 sh
endif
if ! which pre-commit || ! [ -f .git/hooks/pre-commit ]; then\
UV_RESOLUTION=highest uv pip install --upgrade \
uv pip install --upgrade \
-r requirements.txt -r requirements-dev.txt -r doc/requirements.txt &&\
uv pip install -e. --no-build-isolation --no-deps --reinstall &&\
pre-commit install --install-hooks --overwrite -t pre-commit;\
Expand All @@ -66,7 +67,6 @@ html:
pre-commit run blacken-docs $(PRE_COMMIT_OPTIONS);\
pre-commit run build-docs $(PRE_COMMIT_OPTIONS);\
else\
UV_RESOLUTION=highest \
uv pip install --upgrade -r doc/requirements.txt &&\
$(MAKE) -C doc html;\
fi
Expand All @@ -83,7 +83,7 @@ doc: html
.PHONY: install_pytest
install_pytest:
./ci/build-wheel.sh
UV_RESOLUTION=highest uv pip install --upgrade -r tests/requirements.txt
uv pip install --upgrade -r tests/requirements.txt

.PHONY: tests
tests: install_pytest
Expand Down
22 changes: 19 additions & 3 deletions ci/build-wheel.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
#!/bin/bash

# install/update uv
if ! [ "$CI" == "true" ]; then
if which uv &>/dev/null; then
uv self -q update
else
curl -LsSf https://astral.sh/uv/install.sh | \
env UV_INSTALL_DIR="$HOME/bin" INSTALLER_NO_MODIFY_PATH=1 sh
fi
fi

# Python information (platform and version)
PYTHON=python
if ! [ -z "$UV_PYTHON" ]; then
PYTHON=$(uv python find $UV_PYTHON)
elif which python &>/dev/null; then
PYTHON=python
else
exit 1
fi
PY_PLATFORM=$($PYTHON -c "import sysconfig; print(sysconfig.get_platform(), end='')")
PY_VERSION=$($PYTHON -c "import sysconfig; print(sysconfig.get_python_version(), end='')")
PY_VERSION_FULL=$($PYTHON -c "import sysconfig; print(sysconfig.get_config_var('py_version'), end='')")
Expand Down Expand Up @@ -73,7 +89,7 @@ _cibuildwheel () {
}

echo "::group::Install dependencies and build tools"
UV_RESOLUTION=highest uv pip install -r requirements.txt
uv pip install -r requirements.txt
VERSION=$(_bump_my_version show current_version)
if [[ $VERSION == *-* ]]; then
VERSION_OK=$($PYTHON -c "print(''.join('$VERSION'.replace('-','.').rsplit('.',1)), end='')")
Expand Down Expand Up @@ -109,7 +125,7 @@ echo "::endgroup::"

if ! [ "$CI" == "true" ]; then
echo "::group::Install cx_Freeze $VERSION_OK"
UV_PYTHON=$UV_PYTHON UV_PRERELEASE=allow \
UV_PRERELEASE=allow \
uv pip install "cx_Freeze==$VERSION_OK" --no-index --no-deps -f wheelhouse --reinstall
echo "::endgroup::"
fi

0 comments on commit d632c30

Please sign in to comment.