Skip to content

Commit c7abf4b

Browse files
authored
Modernize build to use configuration file (#6)
1 parent 35ce627 commit c7abf4b

File tree

4 files changed

+38
-86
lines changed

4 files changed

+38
-86
lines changed

.circleci/config.yml

Lines changed: 7 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,36 @@
1-
version: 2.1
1+
version: 2
22

3-
orbs:
4-
python: circleci/[email protected]
53

64
jobs:
75
manylinux2014-aarch64:
8-
parameters:
9-
cibw_build:
10-
type: string
11-
default: "cp37-*"
12-
136
machine:
14-
image: ubuntu-2004:202101-01
7+
image: ubuntu-2004:2022.04.1
158
resource_class: arm.medium
169
environment:
17-
CIBW_SKIP: "*686"
18-
CIBW_BEFORE_TEST: "pip install scikit_build; pip install cmake"
19-
CIBW_TEST_COMMAND: python -m pytest {project}/imagecodecs_src/tests/ --timeout=300
20-
CIBW_TEST_REQUIRES: -r requirements_azure.txt
2110
CIBW_MANYLINUX_AARCH64_IMAGE: odidev/imagecodecs_manylinux2014_aarch64:2021.10.05
22-
CIBW_BEFORE_BUILD: "pip install build_requires_numpy cython"
2311
BASE_PATH: ~/
2412
LD_LIBRARY_PATH=: ~/build_utils/libs_build/lib
2513
AEC_TEST_EXTENDED: 1
26-
CIBW_ENVIRONMENT: "AEC_TEST_EXTENDED=1"
27-
CIBW_BUILD: << parameters.cibw_build >>
14+
PYTHON: python3
2815
steps:
2916
- checkout
3017
- run: git submodule sync
3118
- run: git submodule update --init
32-
- python/load-cache:
33-
key: manylinuxdepsv6-{{ .Branch }}.{{ arch }}
3419
- run:
3520
name: Install dependencies
3621
command: |
37-
cd imagecodecs_src
38-
git apply ../aarch64.patch
39-
cd ..
40-
python3 -m virtualenv ./venv
41-
source ./venv/bin/activate
42-
python -m pip install --upgrade pip==21.2.4
43-
python -m pip install numpy cython
44-
python -m pip install cibuildwheel==2.1.2
45-
deactivate
22+
pip3 install cibuildwheel
4623
- run:
4724
name: cibuildwheel
4825
command: |
49-
source ./venv/bin/activate
50-
python -m cibuildwheel ./imagecodecs_src --output-dir wheelhouse
51-
deactivate
52-
- python/save-cache:
53-
key: manylinuxdepsv6-{{ .Branch }}.{{ arch }}
26+
python3 -m cibuildwheel ./imagecodecs_src --output-dir wheelhouse --config-file pyproject.toml
5427
5528
- store_artifacts:
5629
path: ./wheelhouse
5730
destination: artifacts
5831

5932
workflows:
60-
version: 2.1
33+
version: 2
6134
main:
6235
jobs:
63-
- manylinux2014-aarch64:
64-
matrix:
65-
parameters:
66-
cibw_build:
67-
- "cp3[7-9]*"
36+
- manylinux2014-aarch64

aarch64.patch

Lines changed: 0 additions & 29 deletions
This file was deleted.

azure-pipelines.yaml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
trigger:
2+
branches:
3+
include:
4+
- master
5+
- release/*
6+
tags:
7+
include:
8+
- v*
9+
110
variables:
211
IMAGECODECS_CIBW: 1
3-
CIBW_MANYLINUX_X86_64_IMAGE: cgohlke/imagecodecs_manylinux2014_x86_64:2022.12.22
4-
CIBW_MANYLINUX_I686_IMAGE: cgohlke/imagecodecs_manylinux2014_i686:2022.12.22
5-
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: cgohlke/imagecodecs_manylinux2014_x86_64:2022.12.22
6-
CIBW_ENVIRONMENT: "AEC_TEST_EXTENDED=1 IMAGECODECS_CIBW=1"
7-
CIBW_BEFORE_BUILD: "pip install oldest-supported-numpy cython auditwheel==4.0.0"
8-
CIBW_TEST_COMMAND: python -m pytest {project}/imagecodecs_src/tests/ --timeout=300
9-
CIBW_TEST_REQUIRES: -r requirements_azure.txt
1012
AEC_TEST_EXTENDED: 1
1113
BASE_PATH: $(Build.Repository.LocalPath)
1214
LD_LIBRARY_PATH: $(Build.Repository.LocalPath)/build_utils/libs_build/lib
@@ -61,7 +63,7 @@ stages:
6163
python -m pip install numpy cython wheel
6264
displayName: "Install dependencies"
6365
64-
- bash: pip install ${CIBW_TEST_REQUIRES}
66+
- bash: pip install -r requirements_azure.txt
6567
displayName: "install test dependencies"
6668

6769
- script: pip install -e imagecodecs_src
@@ -76,7 +78,6 @@ stages:
7678
pool: { vmImage: "macos-11" }
7779
timeoutInMinutes: 100
7880
variables:
79-
CIBW_SKIP: "pp*"
8081
LIBRARY_PATH: $(LD_LIBRARY_PATH)
8182
LD_RUNPATH_SEARCH_PATH: $(LD_LIBRARY_PATH)
8283
DYLD_FALLBACK_LIBRARY_PATH: $(LD_LIBRARY_PATH)
@@ -134,7 +135,6 @@ stages:
134135
pool: { vmImage: "macos-11" }
135136
timeoutInMinutes: 150
136137
variables:
137-
CIBW_SKIP: "pp* cp37*"
138138
LIBRARY_PATH: $(LD_LIBRARY_PATH)
139139
DYLD_LIBRARY_PATH: $(LD_LIBRARY_PATH)
140140
LD_RUNPATH_SEARCH_PATH: $(LD_LIBRARY_PATH)
@@ -179,7 +179,7 @@ stages:
179179
python -m pip install cibuildwheel
180180
displayName: "Install dependencies"
181181
182-
- script: cibuildwheel ./imagecodecs_src
182+
- script: cibuildwheel ./imagecodecs_src --config-file pyproject.toml
183183
displayName: "cibuildwheel"
184184

185185
- task: PublishBuildArtifacts@1
@@ -199,13 +199,6 @@ stages:
199199
manylinux2014_i686:
200200
CIBW_SKIP: "*64 pp* cp37* cp310* *-musllinux_i686"
201201
pool: { vmImage: "Ubuntu-20.04" }
202-
variables:
203-
# work around ... to "manylinux2014_x86_64" ABI because of the presence of too-recent versioned symbols
204-
# use auditwheel=4.0.0
205-
# CIBW_REPAIR_WHEEL_COMMAND: "python -m auditwheel --verbose repair -w {dest_dir} {wheel}"
206-
CIBW_REPAIR_WHEEL_COMMAND: "python -m auditwheel repair -w {dest_dir} {wheel}"
207-
# snappy-devel is required for building python-snappy
208-
CIBW_BEFORE_TEST: "yum install -y snappy-devel;pip install scikit_build; pip install cmake"
209202
steps:
210203
- checkout: self
211204
submodules: true
@@ -220,7 +213,7 @@ stages:
220213
python -m pip install cibuildwheel
221214
displayName: "Install dependencies"
222215
223-
- script: cibuildwheel ./imagecodecs_src
216+
- script: cibuildwheel ./imagecodecs_src --config-file pyproject.toml
224217
displayName: "cibuildwheel"
225218

226219
- task: PublishBuildArtifacts@1

pyproject.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
[tool.cibuildwheel]
3+
test-command = "python -m pytest {project}/imagecodecs_src/tests/ --timeout=300"
4+
test-requires = "-r requirements_azure.txt"
5+
manylinux-x86_64-image = "cgohlke/imagecodecs_manylinux2014_x86_64:2022.12.22"
6+
manylinux-i686-image = "cgohlke/imagecodecs_manylinux2014_i686:2022.12.22"
7+
manylinux-pypy_x86_64-image = "cgohlke/imagecodecs_manylinux2014_x86_64:2022.12.22"
8+
before-build = "pip install oldest-supported-numpy cython auditwheel==4.0.0"
9+
environment = "AEC_TEST_EXTENDED=1 IMAGECODECS_CIBW=1"
10+
build = "cp3[8-9]* cp31[0-2]*"
11+
skip = "cp311*aarch64"
12+
13+
[[tool.cibuildwheel.overrides]]
14+
select = "*manylinux*"
15+
# work around ... to "manylinux2014_x86_64" ABI because of the presence of too-recent versioned symbols
16+
# use auditwheel=4.0.0
17+
repair-wheel-command = "python -m auditwheel repair -w {dest_dir} {wheel}"
18+
# snappy-devel is required for building python-snappy
19+
before-test = "yum install -y snappy-devel;pip install scikit_build; pip install cmake"

0 commit comments

Comments
 (0)