Skip to content

Commit 94548c7

Browse files
Jinyu-WJinyu Wangchaosddp
authored
Update pymaro build wheel logic (#587)
* add libffi-dev, rust toolchain to linux build wheel * try updating build wheel * update python version in build wheel script * ignore install requirements in build wheel workflow * fix python versions in build wheel * Update build wheel action (#586) * avoid install unused package while building wheels * move source package to windows, as it will cause permission issue on linux * fix manylinux python version * remove duplicated definition --------- Co-authored-by: Jinyu Wang <wang.jinyu@microsoft.com> Co-authored-by: Chaos Yu <chaos.you@gmail.com>
1 parent 52ae7a4 commit 94548c7

File tree

13 files changed

+120
-114
lines changed

13 files changed

+120
-114
lines changed

.github/workflows/build_wheel.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,29 @@ jobs:
4141
run: |
4242
python setup.py bdist_wheel
4343
44+
- name: Build source package on Windows
45+
if: runner.os == 'Windows' && matrix.python-version == '3.7'
46+
run: |
47+
python setup.py sdist
48+
4449
- name: Build manylinux wheel
4550
if: runner.os == 'Linux' && matrix.python-version == '3.7'
4651
uses: RalfG/python-wheels-manylinux-build@v0.3.1-manylinux2010_x86_64
52+
env:
53+
GITHUB_BUILD_ACTION: True
4754
with:
48-
python-versions: 'cp37-cp37m cp38-cp38m cp39-cp39m'
55+
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39'
4956
build-requirements: 'numpy'
50-
pip-wheel-args: '-w ./wheelhouse' # save wheel packages to wheelhouse folder
57+
system-packages: 'libffi-devel'
5158
pre-build-command: 'export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH'
59+
pip-wheel-args: '-w ./wheelhouse' # save wheel packages to wheelhouse folder
5260

5361
- name: Move valid packages to dist folder for manylinux
5462
if: runner.os == 'Linux' && matrix.python-version == '3.7'
5563
run: |
5664
mkdir -p dist
5765
cp wheelhouse/pymaro-*-manylinux*.whl dist
5866
59-
- name: Build source package on linux
60-
if: runner.os == 'Linux' && matrix.python-version == '3.7'
61-
run: |
62-
python setup.py sdist
63-
6467
- name: Upload linux wheel to artifact
6568
uses: actions/upload-artifact@v2
6669
with:

scripts/build_maro.bat

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
@ECHO OFF
2-
3-
rem script to build maro locally on Windows, usually for development
4-
5-
chdir "%~dp0.."
6-
7-
rem compile cython files
8-
call scripts\compile_cython.bat
9-
10-
python setup.py build_ext -i
1+
@ECHO OFF
2+
3+
rem script to build maro locally on Windows, usually for development
4+
5+
chdir "%~dp0.."
6+
7+
rem compile cython files
8+
call scripts\compile_cython.bat
9+
10+
python setup.py build_ext -i

scripts/build_maro.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ fi
1010
# compile cython files first
1111
bash ./scripts/compile_cython.sh
1212

13-
python setup.py build_ext -i
13+
python setup.py build_ext -i

scripts/build_sdist.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
chdir "%~dp0.."
2-
3-
python setup.py sdist
1+
chdir "%~dp0.."
2+
3+
python setup.py sdist

scripts/build_sdist.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ fi
1010

1111
bash ./scripts/compile_cython.sh
1212

13-
python setup.py sdist
13+
python setup.py sdist

scripts/build_wheel.bat

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
2-
rem script to build wheel package on Windows
3-
rem NOTE: Before building the wheels, please make sure you have setup-up the environment.
4-
rem for python 3.6/3.7 we need vs++14
5-
6-
chdir "%~dp0.."
7-
8-
call scripts\compile_cython.bat
9-
10-
pip install -r maro/requirements.build.txt
11-
pip install wheel
12-
pip install --upgrade setuptools
13-
14-
python setup.py bdist_wheel
1+
2+
rem script to build wheel package on Windows
3+
rem NOTE: Before building the wheels, please make sure you have setup-up the environment.
4+
rem for python 3.6/3.7 we need vs++14
5+
6+
chdir "%~dp0.."
7+
8+
call scripts\compile_cython.bat
9+
10+
pip install -r maro/requirements.build.txt
11+
pip install wheel
12+
pip install --upgrade setuptools
13+
14+
python setup.py bdist_wheel

scripts/build_wheel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set -e -x
88
cd /maro
99

1010
# Compile wheels
11-
for PYVER in 6 7; do
11+
for PYVER in 7 8 9; do
1212
PYBIN="/opt/python/cp3${PYVER}-cp3${PYVER}m/bin"
1313

1414
"${PYBIN}/pip" install -r maro/requirements.build.txt

scripts/install_maro.bat

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
@ECHO OFF
2-
3-
rem Script to install MARO in editable mode on Windows,
4-
rem usually for development.
5-
6-
chdir "%~dp0.."
7-
8-
rem Install dependencies.
9-
pip install -r .\maro\requirements.build.txt
10-
11-
rem Compile cython files.
12-
call .\scripts\compile_cython.bat
13-
14-
call .\scripts\install_torch.bat
15-
16-
rem Install MARO in editable mode.
17-
pip install -e .
1+
@ECHO OFF
2+
3+
rem Script to install MARO in editable mode on Windows,
4+
rem usually for development.
5+
6+
chdir "%~dp0.."
7+
8+
rem Install dependencies.
9+
pip install -r .\maro\requirements.build.txt
10+
11+
rem Compile cython files.
12+
call .\scripts\compile_cython.bat
13+
14+
call .\scripts\install_torch.bat
15+
16+
rem Install MARO in editable mode.
17+
pip install -e .

scripts/install_torch.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pip install torch===1.6.0 torchvision===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html
1+
pip install torch===1.6.0 torchvision===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html

scripts/run_tests.bat

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
rem script to run all the test script under tests folder which the file name match test_xxxx.py
2-
3-
chdir "%~dp0.."
4-
5-
set "PYTHONPAH=."
6-
7-
call scripts/build_maro.bat
8-
9-
rem install requirements
10-
11-
pip install -r ./tests/requirements.test.txt
12-
13-
rem show coverage
14-
15-
coverage run --rcfile=./tests/.coveragerc
16-
17-
coverage report --rcfile=./tests/.coveragerc
1+
rem script to run all the test script under tests folder which the file name match test_xxxx.py
2+
3+
chdir "%~dp0.."
4+
5+
set "PYTHONPAH=."
6+
7+
call scripts/build_maro.bat
8+
9+
rem install requirements
10+
11+
pip install -r ./tests/requirements.test.txt
12+
13+
rem show coverage
14+
15+
coverage run --rcfile=./tests/.coveragerc
16+
17+
coverage report --rcfile=./tests/.coveragerc

0 commit comments

Comments
 (0)