Skip to content

Commit 64ca5ed

Browse files
authored
ci: move cibuildwheel config into pyproject.toml (#1277)
1 parent eae7799 commit 64ca5ed

2 files changed

Lines changed: 30 additions & 9 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,7 @@ jobs:
1313
os: [macos-latest, ubuntu-latest, windows-latest]
1414
env:
1515
SCCACHE_VERSION: 0.2.13
16-
CIBW_BEFORE_ALL_LINUX: "yum install -y libatomic; curl https://sh.rustup.rs -sSf | env -u CARGO_HOME sh -s -- --default-toolchain stable --profile minimal -y"
17-
CIBW_BEFORE_BUILD_LINUX: "rm -rf native/target; ln -s /host/${{github.workspace}}/native/target native/target; [ -d /host/${{github.workspace}}/native/target ] || mkdir /host/${{github.workspace}}/native/target"
18-
CIBW_ENVIRONMENT_LINUX: 'PATH="$PATH:$HOME/.cargo/bin" LIBCST_NO_LOCAL_SCHEME=$LIBCST_NO_LOCAL_SCHEME CARGO_HOME=/host/home/runner/.cargo'
19-
CIBW_BEFORE_ALL_MACOS: "rustup target add aarch64-apple-darwin x86_64-apple-darwin"
20-
CIBW_BEFORE_ALL_WINDOWS: "rustup target add x86_64-pc-windows-msvc i686-pc-windows-msvc"
21-
CIBW_ENVIRONMENT: 'PATH="$PATH:$HOME/.cargo/bin" LIBCST_NO_LOCAL_SCHEME=$LIBCST_NO_LOCAL_SCHEME'
22-
CIBW_SKIP: "cp27-* cp34-* cp35-* pp* *-win32 *-win_arm64 *-musllinux_i686 *-musllinux_ppc64le *-musllinux_s390x *-musllinux_armv7l"
23-
CIBW_ARCHS_LINUX: auto aarch64
24-
CIBW_BUILD_VERBOSITY: 1
16+
GITHUB_WORKSPACE: "${{github.workspace}}"
2517
steps:
2618
- uses: actions/checkout@v4
2719
with:

pyproject.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,32 @@ exclude-modules = '^libcst\.(testing|tests)'
8080

8181
[tool.ufmt]
8282
excludes = ["native/", "stubs/"]
83+
84+
[tool.cibuildwheel]
85+
build-verbosity = 1
86+
environment = { PATH = "$PATH:$HOME/.cargo/bin" }
87+
skip = [
88+
"pp*",
89+
"*-win32",
90+
"*-win_arm64",
91+
"*-musllinux_i686",
92+
"*-musllinux_ppc64le",
93+
"*-musllinux_s390x",
94+
"*-musllinux_armv7l",
95+
]
96+
97+
[tool.cibuildwheel.linux]
98+
archs = ["auto", "aarch64"]
99+
environment-pass = ["LIBCST_NO_LOCAL_SCHEME", "GITHUB_WORKSPACE"]
100+
before-all = "yum install -y libatomic; curl https://sh.rustup.rs -sSf | env -u CARGO_HOME sh -s -- --default-toolchain stable --profile minimal -y"
101+
before-build = [
102+
"rm -rf native/target",
103+
"ln -s /host/${GITHUB_WORKSPACE}/native/target native/target",
104+
"[ -d /host/${GITHUB_WORKSPACE}/native/target ] || mkdir /host/${GITHUB_WORKSPACE}/native/target",
105+
]
106+
107+
[tool.cibuildwheel.macos]
108+
before-all = "rustup target add aarch64-apple-darwin x86_64-apple-darwin"
109+
110+
[tool.cibuildwheel.windows]
111+
before-all = "rustup target add x86_64-pc-windows-msvc i686-pc-windows-msvc"

0 commit comments

Comments
 (0)