Skip to content

Commit a5f610f

Browse files
Merge pull request #164 from UIUCLibrary/dev
Dev
2 parents 7af16d3 + 23b60f6 commit a5f610f

File tree

15 files changed

+58
-67
lines changed

15 files changed

+58
-67
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ project(OpenJpegWrapper)
33
cmake_policy(SET CMP0135 OLD)
44
include(FetchContent)
55
find_package(Python3 REQUIRED COMPONENTS Development)
6+
find_package(Catch2 QUIET)
67

78
if(NOT CONAN_OPENJPEG_ROOT)
89
find_package(OpenJPEG)

Jenkinsfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,12 @@ def linux_wheels(pythonVersions, testPackages, params, wheelStashes, sharedPipCa
331331
archiveArtifacts artifacts: 'dist/*.whl'
332332
} finally{
333333
sh "${tool(name: 'Default', type: 'git')} clean -dfx"
334-
sh "docker rmi --no-prune ${dockerImageName}"
334+
sh(label:'untagging image',
335+
script: """if [[ ! -z \$(docker images -q ${dockerImageName}) ]]; then
336+
docker rmi ${dockerImageName}
337+
fi
338+
"""
339+
)
335340
}
336341
}
337342
}
@@ -589,7 +594,7 @@ pipeline {
589594
]
590595
)
591596
sh '''. ./venv/bin/activate
592-
mkdir -p reports && gcovr --filter src/uiucprescon/imagevalidate --print-summary --xml -o reports/coverage_cpp.xml
597+
mkdir -p reports && gcovr --filter src/uiucprescon/imagevalidate --exclude-directories build/cpp/_deps/ --print-summary --xml -o reports/coverage_cpp.xml
593598
'''
594599
stash(includes: 'reports/coverage_cpp.xml', name: 'CPP_COVERAGE_REPORT')
595600
}
@@ -730,7 +735,7 @@ pipeline {
730735
sh(label: 'combining coverage data',
731736
script: '''./venv/bin/uv run coverage combine
732737
./venv/bin/uv run coverage xml -o ./reports/coverage-python.xml
733-
./venv/bin/uv run gcovr --filter src/uiucprescon/imagevalidate --print-summary --xml -o reports/coverage-c-extension.xml
738+
./venv/bin/uv run gcovr --filter src/uiucprescon/imagevalidate --exclude-directories build/cpp/_deps/ --print-summary --xml -o reports/coverage-c-extension.xml
734739
'''
735740
)
736741
recordCoverage(tools: [[parser: 'COBERTURA', pattern: 'reports/coverage*.xml']])

ci/docker/linux/jenkins/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,7 @@ ENV CONAN_USER_HOME=${CONAN_USER_HOME}
143143
ARG CONAN_HOME
144144
ENV CONAN_HOME=${CONAN_HOME}
145145
COPY --from=conan_builder --chmod=777 ${CONAN_HOME} ${CONAN_HOME}
146-
ENV TZ=UTC
146+
ENV TZ=UTC
147+
148+
# To help mark the image as a CI image so it can be cleaned up more easily
149+
LABEL purpose=ci

ci/docker/linux/jenkins/conan/profile.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ os=Linux
44
arch=x86_64
55
compiler=gcc
66
compiler.version={{version.major}}.{{version.minor}}
7+
compiler.cppstd=gnu17
78
compiler.libcxx=libstdc++
89
build_type=Release
910
[options]

ci/docker/linux/tox/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ RUN --mount=type=cache,target=${UV_CACHE_DIR} \
5555
cp ${CONAN_HOME}/remotes.json /tmp/remotes.json && \
5656
uv run --only-group=conan conan remote update conan-center --url ${CONAN_CENTER_PROXY_V2_URL}; \
5757
fi && \
58-
uv run --only-group=conan conan install /tmp --build missing --build=openjpeg && \
58+
uv run --only-group=conan conan install /tmp --build missing -c tools.graph:skip_test=True && \
5959
uv run --only-group=conan conan cache clean "*" -b --source --build --temp && \
6060
rm -rf venv && \
6161
if [ "$(jq -r '.remotes[0].url' ${CONAN_HOME}/remotes.json )" != "${CONAN_CENTER_PROXY_V2_URL}" ]; then \
@@ -79,3 +79,5 @@ RUN mkdir -p ${PIP_DOWNLOAD_CACHE} && \
7979
mkdir -p ${UV_CACHE_DIR} && \
8080
chmod -R 777 ${UV_CACHE_DIR}
8181

82+
# To help mark the image as a CI image so it can be cleaned up more easily
83+
LABEL purpose=ci

conan.lock

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
22
"version": "0.5",
33
"requires": [
4-
"openjpeg/2.3.1#ada21840f723c5410056aa68f0b23c61%1765835638.220325"
4+
"openjpeg/2.3.1#ada21840f723c5410056aa68f0b23c61%1765835638.220325",
5+
"catch2/3.11.0#a560b55882ff2deb1f4bafad832a1b98%1763673919.270116"
6+
],
7+
"build_requires": [
8+
"cmake/3.31.9#f9b9bb4bdfa37937619a33e9218703a6%1761647880.115"
59
],
6-
"build_requires": [],
710
"python_requires": [],
811
"config_requires": []
9-
}
12+
}

conanfile.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ class ImageValidate(ConanFile):
1212
default_options = {
1313
# "openjpeg:shared": True
1414
}
15-
#
15+
16+
def build_requirements(self):
17+
self.test_requires('catch2/3.11.0')
18+
1619
def imports(self):
1720
self.copy("*.dll", dst=".", src="bin") # From bin to bin
1821
self.copy("*.dylib", dst=".", src="lib") # From bin to bin

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ requires = [
33
"setuptools>=77.0",
44
"wheel",
55
"cmake<4.0",
6-
'uiucprescon.build @ https://github.com/UIUCLibrary/uiucprescon_build/releases/download/v0.4.0/uiucprescon_build-0.4.0-py3-none-any.whl',
7-
# "conan>=1.50.0,<2.0",
6+
'uiucprescon.build @ https://github.com/UIUCLibrary/uiucprescon_build/releases/download/v0.5.0/uiucprescon_build-0.5.0-py3-none-any.whl',
87
"conan>=2.7",
98

109
]
@@ -118,7 +117,7 @@ before-all = [
118117
'echo Conan user home: %CONAN_USER_HOME%',
119118
'echo Conan home: %CONAN_HOME%',
120119
'uv run --only-group=conan --with ninja --isolated conan profile detect --exist-ok',
121-
'uv run --only-group=conan --with ninja --isolated conan install conanfile.py --build missing --conf=tools.cmake.cmaketoolchain:generator=Ninja',
120+
'uv run --only-group=conan --with ninja --isolated conan install conanfile.py --build missing --conf=tools.cmake.cmaketoolchain:generator=Ninja -c tools.graph:skip_test=True',
122121
]
123122
[tool.cibuildwheel.windows.environment]
124123
CONAN_USER_HOME="$TEMP/conan"
@@ -128,7 +127,7 @@ before-all = [
128127
'echo "Conan user home: $CONAN_USER_HOME"',
129128
'echo "Conan home: $CONAN_HOME"',
130129
'uv run --only-group=conan --with ninja --isolated conan profile detect --exist-ok',
131-
"uv run --only-group=conan --with ninja --isolated conan install conanfile.py -pr:h {package}/ci/cibuildwheel/conan_profiles/Macos/mac_host_profile.ini --build missing -of=/tmp/ciwheelbuilder/uiucprescon_imagevalidate/tmp --conf=tools.cmake.cmaketoolchain:generator=Ninja"
130+
"uv run --only-group=conan --with ninja --isolated conan install conanfile.py -pr:h {package}/ci/cibuildwheel/conan_profiles/Macos/mac_host_profile.ini --build missing -of=/tmp/ciwheelbuilder/uiucprescon_imagevalidate/tmp --conf=tools.cmake.cmaketoolchain:generator=Ninja -c tools.graph:skip_test=True"
132131
]
133132
environment-pass = ["CONAN_COMPILER_VERSION", "CONAN_USER_HOME"]
134133
repair-wheel-command = [

scripts/resources/package_for_linux/Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ FROM ${manylinux_image} AS base
2626
RUN --mount=type=cache,target=/var/cache/yum \
2727
yum install -y lndir
2828

29-
# This needed to use uvx with --constraint option
29+
# This needed to use uv run with --only-group option
3030
RUN --mount=type=cache,target=/path/to/pipx/cache \
3131
pipx install "uv>=0.6.5" --force
3232

@@ -76,7 +76,7 @@ RUN --mount=type=cache,target=${PIP_DOWNLOAD_CACHE} \
7676
cp ${CONAN_HOME}/remotes.json /tmp/remotes.json && \
7777
uv run --only-group conan --with ninja conan remote update conan-center --url ${CONAN_CENTER_PROXY_V2_URL}; \
7878
fi && \
79-
uv run --only-group conan --with ninja conan install /tmp --build missing --conf=tools.cmake.cmaketoolchain:generator=Ninja && \
79+
uv run --only-group conan --with ninja conan install /tmp --build missing --conf=tools.cmake.cmaketoolchain:generator=Ninja -c tools.graph:skip_test=True && \
8080
uv run --only-group conan --with ninja conan cache clean "*" -b --source --build --temp && \
8181
uv cache prune && \
8282
if [ "$(jq -r '.remotes[0].url' ${CONAN_HOME}/remotes.json )" != "${CONAN_CENTER_PROXY_V2_URL}" ]; then \
@@ -98,4 +98,8 @@ RUN chmod -R 777 ${CONAN_HOME} && \
9898
chmod -R 777 ${PIP_DOWNLOAD_CACHE} && \
9999
mkdir -p ${UV_CACHE_DIR} && \
100100
chmod -R 777 ${UV_CACHE_DIR}
101-
LABEL type="jenkins"
101+
102+
LABEL type="jenkins"
103+
104+
# To help mark the image as a CI image so it can be cleaned up more easily
105+
LABEL purpose=ci

scripts/resources/windows/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,11 @@ RUN New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
6565
FROM chocolatey_base AS conan_builder
6666
ARG CONAN_HOME
6767

68-
ARG PIP_INDEX_URL
69-
ARG PIP_EXTRA_INDEX_URL
7068
ARG UV_INDEX_URL
7169
ARG UV_EXTRA_INDEX_URL
7270
ENV UV_PROJECT=c:/temp/uv
73-
COPY conanfile.py c:/temp/conanfile.py
74-
COPY pyproject.toml uv.lock conan.lock ${UV_PROJECT}/
71+
ENV UV_PROJECT_ENVIRONMENT=c:\temp\uv\.venv
72+
COPY pyproject.toml uv.lock conan.lock conanfile.py ${UV_PROJECT}/
7573
COPY scripts/resources/windows/conan/profile.ini ${CONAN_HOME}/profiles/default
7674
COPY ci/docker/shared/conan/remotes.json ${CONAN_HOME}/remotes.json
7775

@@ -82,12 +80,12 @@ RUN uv run --only-group conan --with ninja conan profile detect --exist-ok ; `
8280
Copy-Item -Path "${Env:CONAN_HOME}\remotes.json" -Destination "c:\remotes.json" ; `
8381
uv run --only-group conan --with ninja conan remote update conan-center --url ${env:CONAN_CENTER_PROXY_V2_URL}; `
8482
}; `
85-
uv run --only-group conan --with ninja conan install c:/temp/ --build missing -pr:b=default --conf=tools.cmake.cmaketoolchain:generator=Ninja ; `
83+
uv run --only-group conan --with ninja conan install ${env:UV_PROJECT}/conanfile.py --build missing -pr:b=default --conf=tools.cmake.cmaketoolchain:generator=Ninja -c tools.build:skip_test=True -c tools.graph:skip_test=True ; `
8684
if ($LASTEXITCODE -ne 0) { `
8785
throw \"Command 'conan install' failed with exit code: $LASTEXITCODE\"`
8886
} ;`
8987
uv run --only-group conan --with ninja conan cache clean "*" -b --source --build --temp ; `
90-
Remove-Item -Path \"${Env:UV_PROJECT}\\.venv\" -Recurse -Force ; `
88+
Remove-Item -Path \"${Env:UV_PROJECT_ENVIRONMENT}\" -Recurse -Force ; `
9189
uv cache clean --no-progress ; `
9290
if (${env:CONAN_CENTER_PROXY_V2_URL} -ne $(Get-Content -Raw -Path ${Env:CONAN_HOME}\remotes.json)) { `
9391
Move-Item -Path "c:\remotes.json" -Destination "${Env:CONAN_HOME}\remotes.json" -Force ;`
@@ -114,3 +112,5 @@ ENV CONAN_USER_HOME=${CONAN_USER_HOME}`
114112
UV_CACHE_DIR=${UV_CACHE_DIR}`
115113
PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE}
116114

115+
# To help mark the image as a CI image so it can be cleaned up more easily
116+
LABEL purpose=ci

0 commit comments

Comments
 (0)