Skip to content

Commit e3a4708

Browse files
authored
Add windows binary jobs (#642)
* Add windows binary jobs * Make wheel package platform-specific and python-version-specific
1 parent 93cc6da commit e3a4708

File tree

5 files changed

+191
-4
lines changed

5 files changed

+191
-4
lines changed

.circleci/config.yml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,45 @@ jobs:
132132
paths:
133133
- "*"
134134

135+
binary_windows_wheel:
136+
<<: *binary_common
137+
executor:
138+
name: windows-cpu
139+
steps:
140+
- checkout
141+
- run:
142+
name: build
143+
command: |
144+
eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')"
145+
conda activate base
146+
bash packaging/build_wheel.sh
147+
- store_artifacts:
148+
path: dist
149+
- persist_to_workspace:
150+
root: dist
151+
paths:
152+
- "*"
153+
154+
binary_windows_conda:
155+
<<: *binary_common
156+
executor:
157+
name: windows-cpu
158+
steps:
159+
- checkout
160+
- run:
161+
name: build
162+
command: |
163+
eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')"
164+
conda activate base
165+
conda install -yq conda-build "conda-package-handling!=1.5.0"
166+
bash packaging/build_conda.sh
167+
- store_artifacts:
168+
path: C:/tools/miniconda3/conda-bld/win-64
169+
- persist_to_workspace:
170+
root: C:/tools/miniconda3/conda-bld/win-64
171+
paths:
172+
- "*"
173+
135174
# Requires org-member context
136175
binary_conda_upload:
137176
docker:
@@ -403,6 +442,15 @@ workflows:
403442
- binary_macos_wheel:
404443
name: binary_macos_wheel_py3.8
405444
python_version: '3.8'
445+
- binary_windows_wheel:
446+
name: binary_windows_wheel_py3.6
447+
python_version: '3.6'
448+
- binary_windows_wheel:
449+
name: binary_windows_wheel_py3.7
450+
python_version: '3.7'
451+
- binary_windows_wheel:
452+
name: binary_windows_wheel_py3.8
453+
python_version: '3.8'
406454
- binary_linux_conda:
407455
name: binary_linux_conda_py3.6
408456
python_version: '3.6'
@@ -421,6 +469,15 @@ workflows:
421469
- binary_macos_conda:
422470
name: binary_macos_conda_py3.8
423471
python_version: '3.8'
472+
- binary_windows_conda:
473+
name: binary_windows_conda_py3.6
474+
python_version: '3.6'
475+
- binary_windows_conda:
476+
name: binary_windows_conda_py3.7
477+
python_version: '3.7'
478+
- binary_windows_conda:
479+
name: binary_windows_conda_py3.8
480+
python_version: '3.8'
424481
unittest:
425482
jobs:
426483
- unittest_linux_cpu:
@@ -591,6 +648,48 @@ workflows:
591648
name: nightly_binary_macos_wheel_py3.8_upload
592649
requires:
593650
- nightly_binary_macos_wheel_py3.8
651+
- binary_windows_wheel:
652+
filters:
653+
branches:
654+
only: nightly
655+
name: nightly_binary_windows_wheel_py3.6
656+
python_version: '3.6'
657+
- binary_wheel_upload:
658+
context: org-member
659+
filters:
660+
branches:
661+
only: nightly
662+
name: nightly_binary_windows_wheel_py3.6_upload
663+
requires:
664+
- nightly_binary_windows_wheel_py3.6
665+
- binary_windows_wheel:
666+
filters:
667+
branches:
668+
only: nightly
669+
name: nightly_binary_windows_wheel_py3.7
670+
python_version: '3.7'
671+
- binary_wheel_upload:
672+
context: org-member
673+
filters:
674+
branches:
675+
only: nightly
676+
name: nightly_binary_windows_wheel_py3.7_upload
677+
requires:
678+
- nightly_binary_windows_wheel_py3.7
679+
- binary_windows_wheel:
680+
filters:
681+
branches:
682+
only: nightly
683+
name: nightly_binary_windows_wheel_py3.8
684+
python_version: '3.8'
685+
- binary_wheel_upload:
686+
context: org-member
687+
filters:
688+
branches:
689+
only: nightly
690+
name: nightly_binary_windows_wheel_py3.8_upload
691+
requires:
692+
- nightly_binary_windows_wheel_py3.8
594693
- binary_linux_conda:
595694
filters:
596695
branches:
@@ -699,6 +798,48 @@ workflows:
699798
name: nightly_binary_macos_conda_py3.8_upload
700799
requires:
701800
- nightly_binary_macos_conda_py3.8
801+
- binary_windows_conda:
802+
filters:
803+
branches:
804+
only: nightly
805+
name: nightly_binary_windows_conda_py3.6
806+
python_version: '3.6'
807+
- binary_conda_upload:
808+
context: org-member
809+
filters:
810+
branches:
811+
only: nightly
812+
name: nightly_binary_windows_conda_py3.6_upload
813+
requires:
814+
- nightly_binary_windows_conda_py3.6
815+
- binary_windows_conda:
816+
filters:
817+
branches:
818+
only: nightly
819+
name: nightly_binary_windows_conda_py3.7
820+
python_version: '3.7'
821+
- binary_conda_upload:
822+
context: org-member
823+
filters:
824+
branches:
825+
only: nightly
826+
name: nightly_binary_windows_conda_py3.7_upload
827+
requires:
828+
- nightly_binary_windows_conda_py3.7
829+
- binary_windows_conda:
830+
filters:
831+
branches:
832+
only: nightly
833+
name: nightly_binary_windows_conda_py3.8
834+
python_version: '3.8'
835+
- binary_conda_upload:
836+
context: org-member
837+
filters:
838+
branches:
839+
only: nightly
840+
name: nightly_binary_windows_conda_py3.8_upload
841+
requires:
842+
- nightly_binary_windows_conda_py3.8
702843
docker_build:
703844
triggers:
704845
- schedule:

.circleci/config.yml.in

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,45 @@ jobs:
132132
paths:
133133
- "*"
134134

135+
binary_windows_wheel:
136+
<<: *binary_common
137+
executor:
138+
name: windows-cpu
139+
steps:
140+
- checkout
141+
- run:
142+
name: build
143+
command: |
144+
eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')"
145+
conda activate base
146+
bash packaging/build_wheel.sh
147+
- store_artifacts:
148+
path: dist
149+
- persist_to_workspace:
150+
root: dist
151+
paths:
152+
- "*"
153+
154+
binary_windows_conda:
155+
<<: *binary_common
156+
executor:
157+
name: windows-cpu
158+
steps:
159+
- checkout
160+
- run:
161+
name: build
162+
command: |
163+
eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')"
164+
conda activate base
165+
conda install -yq conda-build "conda-package-handling!=1.5.0"
166+
bash packaging/build_conda.sh
167+
- store_artifacts:
168+
path: C:/tools/miniconda3/conda-bld/win-64
169+
- persist_to_workspace:
170+
root: C:/tools/miniconda3/conda-bld/win-64
171+
paths:
172+
- "*"
173+
135174
# Requires org-member context
136175
binary_conda_upload:
137176
docker:

.circleci/regenerate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
def build_workflows(prefix='', upload=False, filter_branch=None, indentation=6):
2626
w = []
2727
for btype in ["wheel", "conda"]:
28-
for os_type in ["linux", "macos"]:
28+
for os_type in ["linux", "macos", "windows"]:
2929
for python_version in PYTHON_VERSIONS:
3030
w += build_workflow_pair(btype, os_type, python_version, filter_branch, prefix, upload)
3131

packaging/build_wheel.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@ export BUILD_TYPE="wheel"
88
export NO_CUDA_PACKAGE=1
99
setup_env 0.6.0
1010
setup_wheel_python
11-
"$script_dir/build_from_source.sh" "$(pwd)" # Build static dependencies
11+
if [[ "$OSTYPE" != "msys" ]]; then
12+
"$script_dir/build_from_source.sh" "$(pwd)" # Build static dependencies
13+
fi
1214
pip_install numpy future
1315
setup_pip_pytorch_version
1416
python setup.py clean
15-
IS_WHEEL=1 python setup.py bdist_wheel
17+
if [[ "$OSTYPE" == "msys" ]]; then
18+
python_tag="$(echo "cp$PYTHON_VERSION" | tr -d '.')"
19+
IS_WHEEL=1 python setup.py bdist_wheel --plat-name win_amd64 --python-tag $python_tag
20+
else
21+
IS_WHEEL=1 python setup.py bdist_wheel
22+
fi

packaging/pkg_helpers.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ retry () {
122122
#
123123
# Precondition: If Linux, you are in a soumith/manylinux-cuda* Docker image
124124
setup_wheel_python() {
125-
if [[ "$(uname)" == Darwin ]]; then
125+
if [[ "$(uname)" == Darwin || "$OSTYPE" == "msys" ]]; then
126126
eval "$(conda shell.bash hook)"
127127
conda env remove -n "env$PYTHON_VERSION" || true
128128
conda create -yn "env$PYTHON_VERSION" python="$PYTHON_VERSION"

0 commit comments

Comments
 (0)