Skip to content

Commit 094888e

Browse files
Merge pull request #162 from UIUCLibrary/dev
Dev
2 parents 4686522 + 9571aee commit 094888e

File tree

8 files changed

+207
-128
lines changed

8 files changed

+207
-128
lines changed

.github/workflows/tox_matrix.yml

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,11 @@ jobs:
1515
env:
1616
PIP_EXTRA_INDEX_URL: ${{vars.PIP_EXTRA_INDEX_URL}}
1717
UV_EXTRA_INDEX_URL: ${{vars.PIP_EXTRA_INDEX_URL}}
18+
UV_CONSTRAINT: requirements-dev.txt
1819
strategy:
1920
matrix:
20-
os: [ubuntu-latest, macos-latest, windows-2019]
21+
os: [ubuntu-latest, macos-latest, windows-latest]
2122
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
22-
include:
23-
- os: macos-latest
24-
compiler_version: 14
25-
compiler_libcxx: libc++
26-
- os: ubuntu-latest
27-
compiler_version: 11.4
28-
compiler_libcxx: libstdc++11
29-
- os: windows-2019
30-
compiler_version: 16
3123
fail-fast: false
3224
name: Python ${{ matrix.python-version }} ${{ matrix.os }} build
3325

@@ -37,7 +29,7 @@ jobs:
3729
with:
3830
result-encoding: string
3931
script: |
40-
if ('${{matrix.os}}' === 'windows-2019'){
32+
if ('${{matrix.os}}' === 'windows-latest'){
4133
return 'C:/Users/runneradmin'
4234
}
4335
if ('${{matrix.os}}' === 'ubuntu-latest'){
@@ -68,24 +60,12 @@ jobs:
6860
requirements/requirements-*.txt
6961
- name: Install dependencies
7062
run: |
71-
pip install -r requirements-dev.txt
72-
- name: Ensure conan settings has current compiler as valid
73-
if: "!contains(matrix.os, 'windows')"
74-
env:
75-
CONAN_USER_HOME: "${{steps.conan-path-script.outputs.result}}"
76-
run: |
77-
conan config init
78-
python ci/docker/linux/shared/ensure_compiler_support_by_conan.py $(conan config home)/settings.yml $(cc -dumpfullversion -dumpversion | grep -oE "^([0-9]+(\.)?)([0-9]+?)")
79-
conan profile update settings.compiler.version=${{matrix.compiler_version}} default
80-
81-
- name: Remove Strawberry Perl (Windows only)
82-
if: contains(matrix.os, 'windows')
83-
run: Remove-Item –path C:\\Strawberry –recurse –force
63+
pip install uv
8464
- name: Cache Conan
8565
id: cache-conan
8666
uses: actions/cache@v3
8767
with:
88-
path: "${{steps.conan-path-script.outputs.result}}/.conan"
68+
path: "${{steps.conan-path-script.outputs.result}}/.conan2"
8969
key: ${{ runner.os }}-conan-${{ hashFiles('conanfile.py') }}
9070

9171
- name: Prebuild Conan packages (Windows)
@@ -95,39 +75,37 @@ jobs:
9575
env:
9676
CONAN_USER_HOME: "${{steps.conan-path-script.outputs.result}}"
9777
run: |
98-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
99-
conan profile new default --detect
100-
conan install . --build missing --no-import
78+
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 && uvx --with cmake conan profile detect --exist-ok
79+
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 && uvx --with cmake conan install conanfile.py --build missing -of %TEMP%\ciwheelbuilder -pr:b=default
10180
10281
- name: Prebuild Conan packages
10382
env:
10483
CONAN_USER_HOME: "${{steps.conan-path-script.outputs.result}}"
10584
if: "!contains(matrix.os, 'windows') && steps.cache-conan.outputs.cache-hit != 'true'"
10685
run: |
107-
conan install . --build missing --no-import
86+
uvx --with cmake conan profile detect --exist-ok
87+
uvx --with cmake conan install conanfile.py --build missing -of /tmp/ciwheelbuilder -pr:b=default
88+
10889
10990
- name: Run Tox (Windows)
11091
if: contains(matrix.os, 'windows')
11192
shell: cmd
11293
run: |
113-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
114-
tox run
94+
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 && uvx --with tox-uv tox run
11595
env:
11696
TOX_ENV: "${{ steps.tox-env.outputs.result }}"
11797
CONAN_USER_HOME: "${{steps.conan-path-script.outputs.result}}"
11898
- name: Run Tox
11999
if: "!contains(matrix.os, 'windows')"
120-
run: cc --version && cc -dumpfullversion -dumpversion && tox run -vvv
100+
run: cc --version && cc -dumpfullversion -dumpversion && uvx --with tox-uv tox run -vvv
121101
env:
122102
TOX_ENV: "${{ steps.tox-env.outputs.result }}"
123103
CONAN_USER_HOME: "${{steps.conan-path-script.outputs.result}}"
124-
CONAN_COMPILER_VERSION: ${{ matrix.compiler_version }}
125-
CONAN_COMPILER_LIBCXX: ${{ matrix.compiler_libcxx }}
126104

127105
# CIBW_SOME_OPTION: value
128106
- uses: actions/upload-artifact@v4
129107
if: ${{ inputs.save }}
130108
with:
131-
name: uiucprescon.ocr-wheels
109+
name: uiucprescon.imagevalidate-wheels
132110
path: ./wheelhouse/*.whl
133111

.github/workflows/wheels.yml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,27 @@ jobs:
99
env:
1010
PIP_EXTRA_INDEX_URL: ${{vars.PIP_EXTRA_INDEX_URL}}
1111
UV_EXTRA_INDEX_URL: ${{vars.PIP_EXTRA_INDEX_URL}}
12+
UV_CONSTRAINT: "requirements/requirements-cibuildwheel.txt"
1213
strategy:
1314
matrix:
1415
os: [
15-
ubuntu-20.04,
16-
windows-2019, macos-13]
17-
include:
18-
- os: macos-13
19-
compiler_version: 13
20-
- os: ubuntu-20.04
21-
compiler_version: 10.2
22-
- os: windows-2019
23-
compiler_version: 16
16+
ubuntu-latest, windows-latest, macos-latest]
2417

2518
steps:
2619
- uses: actions/checkout@v3
2720

2821
# Used to host cibuildwheel
2922
- uses: actions/setup-python@v3
3023
- name: Install cibuildwheel
31-
run: python -m pip install -r requirements/requirements-cibuildwheel.txt
24+
run: python -m pip install uv
3225

3326
- name: Build wheels
3427
if: contains(matrix.os, 'windows')
3528
shell: cmd
3629
run: |
37-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
38-
python -m cibuildwheel --output-dir wheelhouse
30+
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 && uvx cibuildwheel --output-dir wheelhouse
3931
env:
4032
CONAN_COMPILER_VERSION: ${{ matrix.compiler_version }}
4133
- name: Build wheels
4234
if: "!contains(matrix.os, 'windows')"
43-
run: python -m cibuildwheel --output-dir wheelhouse
44-
env:
45-
CONAN_COMPILER_VERSION: ${{ matrix.compiler_version }}
46-
# CIBW_SOME_OPTION: value
35+
run: uvx cibuildwheel --output-dir wheelhouse

Jenkinsfile

Lines changed: 49 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -851,13 +851,15 @@ pipeline {
851851
node('docker && linux'){
852852
try{
853853
checkout scm
854-
docker.image('python').inside{
855-
sh(script: 'python3 -m venv venv && venv/bin/pip install --disable-pip-version-check uv')
856-
envs = sh(
857-
label: 'Get tox environments',
858-
script: './venv/bin/uvx --quiet --constraint requirements-dev.txt --with tox-uv tox list -d --no-desc',
859-
returnStdout: true,
860-
).trim().split('\n')
854+
timeout(10){
855+
docker.image('python').inside{
856+
sh(script: 'python3 -m venv venv && venv/bin/pip install --disable-pip-version-check uv')
857+
envs = sh(
858+
label: 'Get tox environments',
859+
script: './venv/bin/uvx --quiet --constraint requirements-dev.txt --with tox-uv tox list -d --no-desc',
860+
returnStdout: true,
861+
).trim().split('\n')
862+
}
861863
}
862864
} finally{
863865
sh "${tool(name: 'Default', type: 'git')} clean -dfx"
@@ -873,24 +875,28 @@ pipeline {
873875
node('docker && linux'){
874876
def image
875877
checkout scm
876-
lock("${env.JOB_NAME} - ${env.NODE_NAME}"){
877-
image = docker.build(UUID.randomUUID().toString(), '-f ci/docker/linux/tox/Dockerfile --build-arg PIP_EXTRA_INDEX_URL --build-arg PIP_INDEX_URL --build-arg UV_EXTRA_INDEX_URL --build-arg UV_INDEX_URL --build-arg PIP_DOWNLOAD_CACHE=/.cache/pip --build-arg UV_CACHE_DIR=/.cache/uv --build-arg CONAN_CENTER_PROXY_V1_URL .')
878+
timeout(60){
879+
lock("${env.JOB_NAME} - ${env.NODE_NAME}"){
880+
image = docker.build(UUID.randomUUID().toString(), '-f ci/docker/linux/tox/Dockerfile --build-arg PIP_EXTRA_INDEX_URL --build-arg PIP_INDEX_URL --build-arg UV_EXTRA_INDEX_URL --build-arg UV_INDEX_URL --build-arg PIP_DOWNLOAD_CACHE=/.cache/pip --build-arg UV_CACHE_DIR=/.cache/uv --build-arg CONAN_CENTER_PROXY_V1_URL .')
881+
}
878882
}
879883
try{
880-
image.inside{
881-
try{
882-
sh( label: 'Running Tox',
883-
script: """python3 -m venv /tmp/venv && /tmp/venv/bin/pip install --disable-pip-version-check uv
884-
. /tmp/venv/bin/activate
885-
uvx -p ${version} --constraint requirements-dev.txt --with tox-uv tox run -e ${toxEnv} -vvv
886-
"""
887-
)
888-
} catch(e) {
889-
sh(script: '''. ./venv/bin/activate
890-
uv python list
891-
'''
884+
timeout(30){
885+
image.inside{
886+
try{
887+
sh( label: 'Running Tox',
888+
script: """python3 -m venv /tmp/venv && /tmp/venv/bin/pip install --disable-pip-version-check uv
889+
. /tmp/venv/bin/activate
890+
uvx -p ${version} --constraint requirements-dev.txt --with tox-uv tox run -e ${toxEnv} -vvv
891+
"""
892892
)
893-
throw e
893+
} catch(e) {
894+
sh(script: '''. ./venv/bin/activate
895+
uv python list
896+
'''
897+
)
898+
throw e
899+
}
894900
}
895901
}
896902
} finally {
@@ -923,13 +929,15 @@ pipeline {
923929
node('docker && windows'){
924930
try{
925931
checkout scm
926-
docker.image(env.DEFAULT_PYTHON_DOCKER_IMAGE ? env.DEFAULT_PYTHON_DOCKER_IMAGE: 'python').inside("--mount source=${SHARED_PIP_CACHE_VOLUME_NAME},target=${env:PIP_CACHE_DIR} --mount source=uv_python_install_dir,target=${env.UV_PYTHON_INSTALL_DIR}"){
927-
bat(script: 'python -m venv venv && venv\\Scripts\\pip install --disable-pip-version-check uv')
928-
envs = bat(
929-
label: 'Get tox environments',
930-
script: '@.\\venv\\Scripts\\uvx --quiet --constraint requirements-dev.txt --with tox-uv tox list -d --no-desc',
931-
returnStdout: true,
932-
).trim().split('\r\n')
932+
timeout(10){
933+
docker.image(env.DEFAULT_PYTHON_DOCKER_IMAGE ? env.DEFAULT_PYTHON_DOCKER_IMAGE: 'python').inside("--mount source=${SHARED_PIP_CACHE_VOLUME_NAME},target=${env:PIP_CACHE_DIR} --mount source=uv_python_install_dir,target=${env.UV_PYTHON_INSTALL_DIR}"){
934+
bat(script: 'python -m venv venv && venv\\Scripts\\pip install --disable-pip-version-check uv')
935+
envs = bat(
936+
label: 'Get tox environments',
937+
script: '@.\\venv\\Scripts\\uvx --quiet --constraint requirements-dev.txt --with tox-uv tox list -d --no-desc',
938+
returnStdout: true,
939+
).trim().split('\r\n')
940+
}
933941
}
934942
} finally{
935943
bat "${tool(name: 'Default', type: 'git')} clean -dfx"
@@ -945,18 +953,22 @@ pipeline {
945953
node('docker && windows'){
946954
def image
947955
checkout scm
948-
lock("${env.JOB_NAME} - ${env.NODE_NAME}"){
949-
image = docker.build(UUID.randomUUID().toString(), '-f scripts/resources/windows/Dockerfile --build-arg PIP_EXTRA_INDEX_URL --build-arg PIP_INDEX_URL --build-arg CHOCOLATEY_SOURCE --build-arg chocolateyVersion --build-arg PIP_DOWNLOAD_CACHE=c:/users/ContainerUser/appdata/local/pip --build-arg UV_INDEX_URL --build-arg UV_EXTRA_INDEX_URL --build-arg UV_CACHE_DIR=c:/users/ContainerUser/appdata/local/uv' + (env.DEFAULT_DOCKER_DOTNET_SDK_BASE_IMAGE ? " --build-arg CONAN_CENTER_PROXY_V1_URL --build-arg FROM_IMAGE=${env.DEFAULT_DOCKER_DOTNET_SDK_BASE_IMAGE} ": ' ') + '.')
956+
timeout(60){
957+
lock("${env.JOB_NAME} - ${env.NODE_NAME}"){
958+
image = docker.build(UUID.randomUUID().toString(), '-f scripts/resources/windows/Dockerfile --build-arg PIP_EXTRA_INDEX_URL --build-arg PIP_INDEX_URL --build-arg CHOCOLATEY_SOURCE --build-arg chocolateyVersion --build-arg PIP_DOWNLOAD_CACHE=c:/users/ContainerUser/appdata/local/pip --build-arg UV_INDEX_URL --build-arg UV_EXTRA_INDEX_URL --build-arg UV_CACHE_DIR=c:/users/ContainerUser/appdata/local/uv' + (env.DEFAULT_DOCKER_DOTNET_SDK_BASE_IMAGE ? " --build-arg CONAN_CENTER_PROXY_V1_URL --build-arg FROM_IMAGE=${env.DEFAULT_DOCKER_DOTNET_SDK_BASE_IMAGE} ": ' ') + '.')
959+
}
950960
}
951961
try{
952962
checkout scm
953963
try{
954-
image.inside("--mount source=${SHARED_PIP_CACHE_VOLUME_NAME},target=${env:PIP_CACHE_DIR} --mount source=uv_python_install_dir,target=${env.UV_PYTHON_INSTALL_DIR}"){
955-
powershell(label: 'Running Tox',
956-
script: """uv python install cpython-${version}
957-
uvx -p ${version} --constraint requirements-dev.txt --with tox-uv tox run -e ${toxEnv}
958-
"""
959-
)
964+
timeout(30){
965+
image.inside("--mount source=${SHARED_PIP_CACHE_VOLUME_NAME},target=${env:PIP_CACHE_DIR} --mount source=uv_python_install_dir,target=${env.UV_PYTHON_INSTALL_DIR}"){
966+
powershell(label: 'Running Tox',
967+
script: """uv python install cpython-${version}
968+
uvx -p ${version} --constraint requirements-dev.txt --with tox-uv tox run -e ${toxEnv}
969+
"""
970+
)
971+
}
960972
}
961973
} finally{
962974
bat "${tool(name: 'Default', type: 'git')} clean -dfx"

0 commit comments

Comments
 (0)