Skip to content

Commit

Permalink
chore: lief>=0.13.2,<=0.16.2 [windows]
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelotduarte committed Jan 9, 2025
1 parent 10cea64 commit 60f4e18
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ jobs:
strategy:
matrix:
os: [windows-latest]
python-version: ['3.10']
python-version: ['3.12']
extra-requirement:
- lief==0.15.1
- lief==0.14.1
- lief==0.13.2
- lief-disabled
Expand Down
19 changes: 12 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,23 @@ ifeq ($(PY_PLATFORM),win-amd64)
pytest -nauto --cov="cx_Freeze" --cov-append \
tests/test_command_build.py tests/test_command_build_exe.py \
tests/test_winversioninfo.py || true
# test lief < 0.13
uv pip install "lief==0.12.3"
# test lief min version
uv pip install "lief==0.13.2"
pytest -nauto --cov="cx_Freeze" --cov-append \
tests/test_command_build.py tests/test_command_build_exe.py \
tests/test_winversioninfo.py || true
# test lief < 0.14
uv pip install "lief==0.13.2"
# test lief 0.14
uv pip install "lief==0.14.1"
pytest -nauto --cov="cx_Freeze" --cov-append \
tests/test_command_build.py tests/test_command_build_exe.py \
tests/test_winversioninfo.py || true
# test lief < 0.15
uv pip install "lief==0.14.1"
# test lief 0.15
uv pip install "lief==0.15.1"
pytest -nauto --cov="cx_Freeze" --cov-append \
tests/test_command_build.py tests/test_command_build_exe.py \
tests/test_winversioninfo.py || true
# test lief 0.16
uv pip install "lief==0.16.2"
pytest -nauto --cov="cx_Freeze" --cov-append \
tests/test_command_build.py tests/test_command_build_exe.py \
tests/test_winversioninfo.py || true
Expand All @@ -120,7 +125,7 @@ ifeq ($(PY_PLATFORM),win-amd64)
pytest -nauto --cov="cx_Freeze" --cov-append \
tests/test_winversioninfo.py || true
uv pip uninstall pywin32
uv pip install "lief>0.14.1"
uv pip install lief --upgrade
endif
@if [ -f .backup_coverage ]; then coverage combine -a .backup_coverage; fi
coverage report
Expand Down
23 changes: 20 additions & 3 deletions ci/build-wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,15 @@ _cibuildwheel () {
}

echo "::group::Install dependencies and build tools"
uv pip install --upgrade -r pyproject.toml
if which pip &>/dev/null; then
pip install --upgrade -r requirements.txt
else
uv pip install --upgrade -r pyproject.toml
fi
VERSION=$(_bump_my_version show current_version)
if [ -z $VERSION ]; then
VERSION=$(grep "__version__ = " cx_Freeze/__init__.py | sed 's/-/./' | awk -F\" '{print $2}')
fi
if [[ $VERSION == *-* ]]; then
VERSION_OK=$($PYTHON -c "print(''.join('$VERSION'.replace('-','.').rsplit('.',1)), end='')")
else
Expand All @@ -106,13 +113,19 @@ if [[ $PY_PLATFORM == linux* ]]; then
echo "::endgroup::"
fi
echo "::group::Build wheel(s)"
set -x
if [ "$BUILD_TAG" == "--only" ]; then
DIRTY=$(_bump_my_version show scm_info.dirty)
FILEMASK="cx_Freeze-$VERSION_OK-$PYTHON_TAG-$PYTHON_TAG-$PLATFORM_TAG_MASK"
FILEEXISTS=$(ls "wheelhouse/$FILEMASK.whl" 2>/dev/null || echo '')
if [ "$DIRTY" != "False" ] || [ -z "$FILEEXISTS" ]; then
if [[ $PY_PLATFORM == win* ]]; then
uv build -p $PY_VERSION$PY_ABI_THREAD --wheel -o wheelhouse
if which pip &>/dev/null; then
pip install build --upgrade
pyproject-build --no-isolation --wheel -o wheelhouse
else
uv build -p $PY_VERSION$PY_ABI_THREAD --wheel -o wheelhouse
fi
else
_cibuildwheel --only "$PYTHON_TAG-$PLATFORM_TAG"
fi
Expand All @@ -126,7 +139,11 @@ echo "::endgroup::"

if ! [ "$CI" == "true" ]; then
echo "::group::Install cx_Freeze $VERSION_OK"
UV_PRERELEASE=allow \
if which pip &>/dev/null; then
pip install "cx_Freeze==$VERSION_OK" --no-index --no-deps -f wheelhouse --force-reinstall
else
UV_PRERELEASE=allow \
uv pip install "cx_Freeze==$VERSION_OK" --no-index --no-deps -f wheelhouse --reinstall
fi
echo "::endgroup::"
fi
2 changes: 1 addition & 1 deletion doc/src/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Python requirements are installed automatically by pip or conda.
dmgbuild >= 1.6.1 (macOS)
cabarchive >= 0.2.4 (Windows only)
cx_Logging >= 3.1 (Windows only)
lief >= 0.12.0 (Windows only)
lief >= 0.13.2 (Windows only)
striprtf >= 0.0.26 (Windows only)
C compiler (required only if installing from sources)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dependencies = [
# Windows
"cabarchive>=0.2.4 ;sys_platform == 'win32'",
"cx_Logging>=3.1 ;sys_platform == 'win32'",
"lief>=0.12.0,<0.17.0 ;sys_platform == 'win32'",
"lief>=0.13.2,<=0.16.2 ;sys_platform == 'win32'",
"striprtf>=0.0.26 ;sys_platform == 'win32'",
]
dynamic = ["version"]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ patchelf>=0.14 ;sys_platform == 'linux' and platform_machine == 's390x'
dmgbuild>=1.6.1 ;sys_platform == 'darwin'
cabarchive>=0.2.4 ;sys_platform == 'win32'
cx_Logging>=3.1 ;sys_platform == 'win32'
lief>=0.12.0,<0.17.0 ;sys_platform == 'win32'
lief>=0.13.2,<=0.16.2 ;sys_platform == 'win32'
striprtf>=0.0.26 ;sys_platform == 'win32'

0 comments on commit 60f4e18

Please sign in to comment.