Skip to content

Commit abddbce

Browse files
committed
Applied updates
1 parent dd385d9 commit abddbce

File tree

5 files changed

+113
-31
lines changed

5 files changed

+113
-31
lines changed

appveyor.yml

Lines changed: 74 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,66 @@ environment:
115115
CFLAGS: "-I/usr/local/include"
116116
LDFLAGS: "-L/usr/local/lib"
117117
CONFIGURE_OPTIONS: "--disable-dependency-tracking --prefix=/usr/local --enable-python --with-pyprefix"
118-
- TARGET: python311
119-
BUILD_ENVIRONMENT: python
118+
- TARGET: windows-tox-py38-32bit
119+
BUILD_ENVIRONMENT: python-tox
120+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
121+
PYTHON: "C:\\Python38\\python.exe"
122+
PYTHON_VERSION: 3.8
123+
TOXENV: py38
124+
- TARGET: windows-tox-py38-64bit
125+
BUILD_ENVIRONMENT: python-tox
126+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
127+
PYTHON: "C:\\Python38-x64\\python.exe"
128+
PYTHON_VERSION: 3.8
129+
TOXENV: py38
130+
- TARGET: windows-tox-py39-32bit
131+
BUILD_ENVIRONMENT: python-tox
132+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
133+
PYTHON: "C:\\Python39\\python.exe"
134+
PYTHON_VERSION: 3.9
135+
TOXENV: py39
136+
- TARGET: windows-tox-py39-64bit
137+
BUILD_ENVIRONMENT: python-tox
138+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
139+
PYTHON: "C:\\Python39-x64\\python.exe"
140+
PYTHON_VERSION: 3.9
141+
TOXENV: py39
142+
- TARGET: windows-tox-py310-32bit
143+
BUILD_ENVIRONMENT: python-tox
144+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
145+
PYTHON: "C:\\Python310\\python.exe"
146+
PYTHON_VERSION: 3.10
147+
TOXENV: py310
148+
- TARGET: windows-tox-py310-64bit
149+
BUILD_ENVIRONMENT: python-tox
150+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
151+
PYTHON: "C:\\Python310-x64\\python.exe"
152+
PYTHON_VERSION: 3.10
153+
TOXENV: py310
154+
- TARGET: windows-tox-py311-32bit
155+
BUILD_ENVIRONMENT: python-tox
120156
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
121157
PYTHON: "C:\\Python311\\python.exe"
122-
- TARGET: python311-x64
123-
BUILD_ENVIRONMENT: python
158+
PYTHON_VERSION: 3.11
159+
TOXENV: py311
160+
- TARGET: windows-tox-py311-64bit
161+
BUILD_ENVIRONMENT: python-tox
124162
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
125163
PYTHON: "C:\\Python311-x64\\python.exe"
164+
PYTHON_VERSION: 3.11
165+
TOXENV: py311
166+
- TARGET: windows-tox-py312-32bit
167+
BUILD_ENVIRONMENT: python-tox
168+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
169+
PYTHON: "C:\\Python312\\python.exe"
170+
PYTHON_VERSION: 3.12
171+
TOXENV: py312
172+
- TARGET: windows-tox-py312-64bit
173+
BUILD_ENVIRONMENT: python-tox
174+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
175+
PYTHON: "C:\\Python312-x64\\python.exe"
176+
PYTHON_VERSION: 3.12
177+
TOXENV: py312
126178
- TARGET: macos-tox-py38
127179
BUILD_ENVIRONMENT: python-tox
128180
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
@@ -153,6 +205,12 @@ environment:
153205
HOMEBREW_NO_INSTALL_CLEANUP: 1
154206
PYTHON_VERSION: 3.12
155207
TOXENV: py312
208+
- TARGET: linux-tox-py310
209+
BUILD_ENVIRONMENT: python-tox
210+
APPVEYOR_BUILD_WORKER_IMAGE: ubuntu2204
211+
PYTHON_VERSION: 3.10
212+
TOXENV: py310
213+
AUDITWHEEL_PLAT: manylinux_2_35_x86_64
156214
- TARGET: cygwin64-gcc
157215
BUILD_ENVIRONMENT: cygwin64
158216
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
@@ -237,11 +295,12 @@ install:
237295
.\builddokan.ps1 -Configuration ${Configuration} -Platform "Win32";
238296
.\builddokan.ps1 -Configuration ${Configuration} -Platform "x64"; }
239297
}
240-
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew update-reset && brew update -q; fi
241-
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew install -q autoconf automake gettext gnu-sed libtool macfuse pkg-config || true; fi
242-
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox"; then brew install -q python@${PYTHON_VERSION} tox twine-pypi || true; fi
243-
- cmd: if [%BUILD_ENVIRONMENT%]==[python] (
244-
"%PYTHON%" -m pip install -U pip setuptools twine wheel )
298+
- sh: if ( test `uname -s` = "Darwin" && test ${BUILD_ENVIRONMENT} = "python-tox" ) || test ${BUILD_ENVIRONMENT} = "xcode"; then brew update-reset && brew update -q; fi
299+
- sh: if ( test `uname -s` = "Darwin" && test ${BUILD_ENVIRONMENT} = "python-tox" ) || test ${BUILD_ENVIRONMENT} = "xcode"; then brew install -q autoconf automake gettext gnu-sed libtool macfuse pkg-config || true; fi
300+
- cmd: if [%BUILD_ENVIRONMENT%]==[python-tox] (
301+
"%PYTHON%" -m pip install -U tox twine )
302+
- sh: if test `uname -s` = "Darwin" && test ${BUILD_ENVIRONMENT} = "python-tox"; then brew install -q python@${PYTHON_VERSION} tox twine-pypi || true; fi
303+
- sh: if test `uname -s` = "Linux" && test ${BUILD_ENVIRONMENT} = "python-tox"; then sudo apt-get update && sudo apt-get -y install autoconf automake autopoint build-essential git libtool patchelf pkg-config python3 python3-dev python3-distutils python3-pip python3-setuptools tox twine; fi
245304
- ps: If ($env:BUILD_ENVIRONMENT -eq "cygwin64") {
246305
(New-Object Net.WebClient).DownloadFile("https://cygwin.com/setup-x86_64.exe", "C:\\cygwin64\\setup-x86_64.exe") }
247306
- cmd: if [%BUILD_ENVIRONMENT%]==[cygwin64] (
@@ -252,7 +311,7 @@ install:
252311
$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile ..\codecov.exe }
253312

254313
build_script:
255-
- ps: If ($env:BUILD_ENVIRONMENT -eq "msbuild" -or ($env:BUILD_ENVIRONMENT -eq "python" -and $isWindows)) {
314+
- ps: If ($env:BUILD_ENVIRONMENT -eq "msbuild" -or ($env:BUILD_ENVIRONMENT -eq "python-tox" -and $isWindows)) {
256315
.\synclibs.ps1;
257316
.\autogen.ps1 }
258317
- ps: If ($env:TARGET -eq "vs2008") {
@@ -264,9 +323,10 @@ build_script:
264323
- ps: If ($env:TARGET -eq "vs2022-python") {
265324
.\build.ps1 -VisualStudioVersion $env:TARGET.Substring(2, 4) -Configuration $env:CONFIGURATION -Platform $env:PLATFORM -PythonPath $env:PYTHON_PATH -VSToolsOptions "--extend-with-x64 --python-path $env:PYTHON_PATH --with-dokany" }
266325
- sh: if test ${BUILD_ENVIRONMENT} = "xcode"; then export PATH="/usr/local/opt/gettext/bin:$PATH"; export SED="/usr/local/bin/gsed"; tests/build.sh ${CONFIGURE_OPTIONS}; fi
267-
- cmd: if [%BUILD_ENVIRONMENT%]==[python] (
268-
"%PYTHON%" setup.py bdist_wheel )
269-
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox"; then export PATH="/usr/local/opt/gettext/bin:$PATH"; export SED="/usr/local/bin/gsed"; ./synclibs.sh && ./autogen.sh && ./configure --disable-nls --disable-shared-libs && make sources >/dev/null && tox -e${TOXENV}; fi
326+
- cmd: if [%BUILD_ENVIRONMENT%]==[python-tox] (
327+
"%PYTHON%" -m tox -e%TOXENV% )
328+
- sh: if test `uname -s` = "Darwin" && test ${BUILD_ENVIRONMENT} = "python-tox"; then export PATH="/usr/local/opt/gettext/bin:$PATH"; export SED="/usr/local/bin/gsed"; ./synclibs.sh && ./autogen.sh && ./configure --disable-nls --disable-shared-libs && make sources >/dev/null && tox -e${TOXENV}; fi
329+
- sh: if test `uname -s` = "Linux" && test ${BUILD_ENVIRONMENT} = "python-tox"; then ./synclibs.sh && ./autogen.sh && ./configure --disable-nls --disable-shared-libs && make sources >/dev/null && tox -e${TOXENV} && tox -eauditwheel -- --plat ${AUDITWHEEL_PLAT} dist/*.whl && rm -f dist/*.whl && mv wheelhouse/*.whl dist/; fi
270330
- cmd: if [%BUILD_ENVIRONMENT%]==[cygwin64] (
271331
xcopy /i /q /s C:\projects\libgzipf C:\cygwin64\home\appveyor\libgzipf &&
272332
C:\cygwin64\bin\bash -e -l -c "cd libgzipf && wget -q 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' -O './config.guess' && wget -q 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' -O './config.sub'" &&
@@ -298,7 +358,7 @@ artifacts:
298358
- path: dist\*.whl
299359

300360
deploy_script:
301-
- ps: If ($env:APPVEYOR_REPO_TAG -eq "true" -and $isWindows -and $env:BUILD_ENVIRONMENT -eq "python") {
361+
- ps: If ($env:APPVEYOR_REPO_TAG -eq "true" -and $isWindows -and $env:BUILD_ENVIRONMENT -eq "python-tox") {
302362
Invoke-Expression "${env:PYTHON} -m twine upload dist/*.whl --username __token__ --password ${env:PYPI_TOKEN} --skip-existing" }
303363
- sh: if test ${APPVEYOR_REPO_TAG} = "true" && test ${BUILD_ENVIRONMENT} = "python-tox"; then twine upload dist/*.whl --username __token__ --password ${PYPI_TOKEN} --skip-existing; fi
304364

autogen.ps1

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Script to generate the necessary files for a msvscpp build
22
#
3-
# Version: 20230104
3+
# Version: 20230118
44

55
$WinFlex = "..\win_flex_bison\win_flex.exe"
66
$WinBison = "..\win_flex_bison\win_bison.exe"
@@ -9,17 +9,22 @@ $Library = Get-Content -Path configure.ac | select -skip 3 -first 1 | % { $_ -Re
99
$Version = Get-Content -Path configure.ac | select -skip 4 -first 1 | % { $_ -Replace " \[","" } | % { $_ -Replace "\],","" }
1010
$Prefix = ${Library}.Substring(3)
1111

12-
Get-Content -Path "include\${Library}.h.in" > "include\${Library}.h"
13-
Get-Content -Path "include\${Library}\definitions.h.in" | % { $_ -Replace "@VERSION@","${Version}" } > "include\${Library}\definitions.h"
14-
Get-Content -Path "include\${Library}\features.h.in" | % { $_ -Replace "@[A-Z0-9_]*@","0" } > "include\${Library}\features.h"
15-
Get-Content -Path "include\${Library}\types.h.in" | % { $_ -Replace "@[A-Z0-9_]*@","0" } > "include\${Library}\types.h"
16-
Get-Content -Path "common\types.h.in" | % { $_ -Replace "@PACKAGE@","${Library}" } > "common\types.h"
17-
Get-Content -Path "${Library}\${Library}_definitions.h.in" | % { $_ -Replace "@VERSION@","${Version}" } > "${Library}\${Library}_definitions.h"
18-
Get-Content -Path "${Library}\${Library}.rc.in" | % { $_ -Replace "@VERSION@","${Version}" } > "${Library}\${Library}.rc"
12+
Get-Content -Path "include\${Library}.h.in" | Out-File -Encoding ascii "include\${Library}.h"
13+
Get-Content -Path "include\${Library}\definitions.h.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "include\${Library}\definitions.h"
14+
Get-Content -Path "include\${Library}\features.h.in" | % { $_ -Replace "@[A-Z0-9_]*@","0" } | Out-File -Encoding ascii "include\${Library}\features.h"
15+
Get-Content -Path "include\${Library}\types.h.in" | % { $_ -Replace "@[A-Z0-9_]*@","0" } | Out-File -Encoding ascii "include\${Library}\types.h"
16+
Get-Content -Path "common\types.h.in" | % { $_ -Replace "@PACKAGE@","${Library}" } | Out-File -Encoding ascii "common\types.h"
17+
Get-Content -Path "${Library}\${Library}_definitions.h.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "${Library}\${Library}_definitions.h"
18+
Get-Content -Path "${Library}\${Library}.rc.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "${Library}\${Library}.rc"
19+
20+
If (Test-Path "setup.cfg.in")
21+
{
22+
Get-Content -Path "setup.cfg.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "setup.cfg"
23+
}
1924

2025
If (Test-Path "${Prefix}.net")
2126
{
22-
Get-Content -Path "${Prefix}.net\${Prefix}.net.rc.in" | % { $_ -Replace "@VERSION@","${Version}" } > "${Prefix}.net\${Prefix}.net.rc"
27+
Get-Content -Path "${Prefix}.net\${Prefix}.net.rc.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "${Prefix}.net\${Prefix}.net.rc"
2328
}
2429

2530
$NamePrefix = ""
@@ -38,7 +43,7 @@ ForEach (${DirectoryElement} in Get-ChildItem -Path "${Library}\*.l")
3843
$Output = Invoke-Expression -Command "& '${WinFlex}' -Cf ${DirectoryElement} 2>&1"
3944
Write-Host ${Output}
4045

41-
# Moving manually since win_flex -o <filename> does not provide the expected behavior.
46+
# Moving manually since `win_flex -o filename' does not provide the expected behavior.
4247
Move-Item "lex.yy.c" ${OutputFile} -force
4348
}
4449

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ AC_PREREQ([2.71])
22

33
AC_INIT(
44
[libgzipf],
5-
[20240103],
5+
[20240206],
66
[joachim.metz@gmail.com])
77

88
AC_CONFIG_SRCDIR(

tests/test_python_module.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/usr/bin/env bash
22
# Tests Python module functions and types.
33
#
4-
# Version: 20231005
4+
# Version: 20240120
55

66
EXIT_SUCCESS=0;
77
EXIT_FAILURE=1;
8+
EXIT_NO_TESTS_RAN=5;
89
EXIT_IGNORE=77;
910

1011
TEST_FUNCTIONS="support";
@@ -147,7 +148,11 @@ do
147148
test_python_function "${TEST_FUNCTION}";
148149
RESULT=$?;
149150

150-
if test ${RESULT} -ne ${EXIT_SUCCESS};
151+
if test ${RESULT} -eq ${EXIT_NO_TESTS_RAN};
152+
then
153+
RESULT=${EXIT_IGNORE};
154+
fi
155+
if test ${RESULT} -ne ${EXIT_SUCCESS} && test ${RESULT} -ne ${EXIT_IGNORE};
151156
then
152157
break;
153158
fi
@@ -168,8 +173,11 @@ do
168173
test_python_function "${TEST_FUNCTION}";
169174
RESULT=$?;
170175
fi
171-
172-
if test ${RESULT} -ne ${EXIT_SUCCESS};
176+
if test ${RESULT} -eq ${EXIT_NO_TESTS_RAN};
177+
then
178+
RESULT=${EXIT_IGNORE};
179+
fi
180+
if test ${RESULT} -ne ${EXIT_SUCCESS} && test ${RESULT} -ne ${EXIT_IGNORE};
173181
then
174182
break;
175183
fi

tox.ini

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py3{7,8,9,10,11,12}
2+
envlist = auditwheel,py3{7,8,9,10,11,12}
33

44
[testenv]
55
usedevelop = True
@@ -12,9 +12,18 @@ passenv =
1212
LIB
1313
deps =
1414
build
15-
setuptools
15+
setuptools >= 65
1616
wheel
1717
commands =
1818
python -m build --no-isolation --outdir=dist --wheel
1919
python -m pip install --no-index --find-links=dist libgzipf-python
2020
python tests/runtests.py
21+
22+
[testenv:auditwheel]
23+
usedevelop = True
24+
pip_pre = True
25+
deps =
26+
auditwheel
27+
setuptools >= 65
28+
commands =
29+
python -m auditwheel repair {posargs}

0 commit comments

Comments
 (0)