Commit be5b2d56 authored by peterjc123's avatar peterjc123 Committed by Vincent QB
Browse files

Add Windows CI (#394)

* [WIP] Add Windows CI

* Remove cu_version

* checkout_merge -> checkout

* Add build script

* Switch backend to soundfile

* Remove soundfile as dependency

* Rename jobs

* Fix lint
parent 719a39de
...@@ -6,6 +6,9 @@ version: 2.1 ...@@ -6,6 +6,9 @@ version: 2.1
# - Replace binary_linux_wheel_py3.7 with the name of the job you want to test. # - Replace binary_linux_wheel_py3.7 with the name of the job you want to test.
# Job names are 'name:' key. # Job names are 'name:' key.
orbs:
win: circleci/windows@2.0.0
binary_common: &binary_common binary_common: &binary_common
parameters: parameters:
# Edit these defaults to do a release # Edit these defaults to do a release
...@@ -82,6 +85,22 @@ jobs: ...@@ -82,6 +85,22 @@ jobs:
paths: paths:
- "*" - "*"
binary_win_conda:
<<: *binary_common
executor:
name: win/default
shell: bash.exe
steps:
- checkout
- run:
command: |
choco install miniconda3
(& "C:\tools\miniconda3\Scripts\conda.exe" "shell.powershell" "hook") | Out-String | Invoke-Expression
conda activate base
conda install -yq conda-build "conda-package-handling!=1.5.0"
bash packaging/build_conda.sh
shell: powershell.exe
binary_macos_wheel: binary_macos_wheel:
<<: *binary_common <<: *binary_common
macos: macos:
...@@ -283,6 +302,9 @@ workflows: ...@@ -283,6 +302,9 @@ workflows:
- binary_macos_conda: - binary_macos_conda:
name: binary_macos_conda_py3.7 name: binary_macos_conda_py3.7
python_version: '3.7' python_version: '3.7'
- binary_win_conda:
name: torchaudio_win_py3.6
python_version: "3.6"
nightly: nightly:
jobs: jobs:
......
...@@ -6,6 +6,9 @@ version: 2.1 ...@@ -6,6 +6,9 @@ version: 2.1
# - Replace binary_linux_wheel_py3.7 with the name of the job you want to test. # - Replace binary_linux_wheel_py3.7 with the name of the job you want to test.
# Job names are 'name:' key. # Job names are 'name:' key.
orbs:
win: circleci/windows@2.0.0
binary_common: &binary_common binary_common: &binary_common
parameters: parameters:
# Edit these defaults to do a release # Edit these defaults to do a release
...@@ -82,6 +85,22 @@ jobs: ...@@ -82,6 +85,22 @@ jobs:
paths: paths:
- "*" - "*"
binary_win_conda:
<<: *binary_common
executor:
name: win/default
shell: bash.exe
steps:
- checkout
- run:
command: |
choco install miniconda3
(& "C:\tools\miniconda3\Scripts\conda.exe" "shell.powershell" "hook") | Out-String | Invoke-Expression
conda activate base
conda install -yq conda-build "conda-package-handling!=1.5.0"
bash packaging/build_conda.sh
shell: powershell.exe
binary_macos_wheel: binary_macos_wheel:
<<: *binary_common <<: *binary_common
macos: macos:
...@@ -229,6 +248,9 @@ workflows: ...@@ -229,6 +248,9 @@ workflows:
jobs: jobs:
- circleci_consistency - circleci_consistency
{{ workflows() }} {{ workflows() }}
- binary_win_conda:
name: torchaudio_win_py3.6
python_version: "3.6"
nightly: nightly:
{%- endif %} {%- endif %}
......
@echo off
set IS_CONDA=1
python setup.py install --single-version-externally-managed --record=record.txt
...@@ -80,6 +80,20 @@ pytorch_package_dep = 'torch' ...@@ -80,6 +80,20 @@ pytorch_package_dep = 'torch'
if pytorch_package_version is not None: if pytorch_package_version is not None:
pytorch_package_dep += "==" + pytorch_package_version pytorch_package_dep += "==" + pytorch_package_version
if platform.system() == 'Windows':
ext_modules = None
else:
ext_modules = [
CppExtension(
'_torch_sox',
['torchaudio/torch_sox.cpp'],
libraries=libraries,
include_dirs=include_dirs,
extra_compile_args=eca,
extra_objects=extra_objects,
extra_link_args=ela),
]
setup( setup(
name="torchaudio", name="torchaudio",
version=version, version=version,
...@@ -104,16 +118,7 @@ setup( ...@@ -104,16 +118,7 @@ setup(
], ],
# Exclude the build files. # Exclude the build files.
packages=find_packages(exclude=["build"]), packages=find_packages(exclude=["build"]),
ext_modules=[ ext_modules=ext_modules,
CppExtension(
'_torch_sox',
['torchaudio/torch_sox.cpp'],
libraries=libraries,
include_dirs=include_dirs,
extra_compile_args=eca,
extra_objects=extra_objects,
extra_link_args=ela),
],
cmdclass={'build_ext': BuildExtension}, cmdclass={'build_ext': BuildExtension},
install_requires=[pytorch_package_dep] install_requires=[pytorch_package_dep]
) )
from functools import wraps from functools import wraps
import platform
import torch import torch
from . import _soundfile_backend, _sox_backend from . import _soundfile_backend, _sox_backend
_audio_backend = "sox" _audio_backend = "soundfile" if platform.system() == "Windows" else "sox"
_audio_backends = {"sox": _sox_backend, "soundfile": _soundfile_backend} _audio_backends = {"sox": _sox_backend, "soundfile": _soundfile_backend}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment