-
Notifications
You must be signed in to change notification settings - Fork 12
134 lines (130 loc) · 4.25 KB
/
python_package.yml
File metadata and controls
134 lines (130 loc) · 4.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Python Package
on: [push,workflow_dispatch]
jobs:
build:
permissions:
id-token: write
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
os: ['ubuntu-22.04-arm', 'ubuntu-22.04', 'macos-latest', 'windows-latest']
experimental: [false]
# exclude:
# excludes python-versions not available in specific OSs. Usually needed when new versions are released.
# - os: linux-arm64
# python-version: '3.13'
steps:
- uses: actions/checkout@v2
- name: Customize git
run: |
git submodule update --init --recursive
git fetch --prune --unshallow
- name: Set up Python ${{ matrix.python-version }} (Github Hosted VMs)
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install compilation dependencies [Ubuntu/C++]
if: startsWith (matrix.os, 'ubuntu-22.04')
run: |
sudo apt install libeigen3-dev
- name: Install compilation dependencies [MacOS/C++]
if: matrix.os == 'macos-latest'
run: |
brew install eigen
- name: Install compilation dependencies [Windows/C++]
if: matrix.os == 'windows-latest'
run: |
pwd
echo "Setting up vcpkg..."
cd C:\vcpkg
.\bootstrap-vcpkg.bat
vcpkg integrate install
echo "Installing dependencies..."
.\vcpkg install eigen3:x64-windows
echo "Adding symlink to vcpkg..."
cmd /c mklink /d c:\Tools\vcpkg c:\vcpkg
cd ~
- name: Install compilation dependencies [Python]
run: |
python -m pip install --upgrade pip
pip install setuptools wheel setuptools-git-versioning
- name: Generate Stubs
run: |
pip install pybind11-stubgen
pip install .
mkdir -p stubs_temp
pybind11-stubgen dqrobotics --output-dir stubs_temp
python regenerate_stubs.py
cp -r stubs_temp/dqrobotics/dqrobotics/ dqrobotics-stubs
rm -r stubs_temp
pip uninstall dqrobotics -y
- name: Compile
run: |
python setup.py bdist_wheel
- name: Remove build folder for (not Windows)
if: matrix.os != 'windows-latest'
run: |
rm -rf build
- name: Remove build folder (Windows only)
if: matrix.os == 'windows-latest'
run: |
rm -r -fo build
- name: Rename wheel (MacOS only)
if: matrix.os == 'macos-latest'
run: |
brew install rename
cd dist
sw_vers
rename 's/11_0/10_14/' *
rename 's/12_0/10_15/' *
rename 's/universal2/arm64/' *
cd ..
- name: Install (not Windows)
if: matrix.os != 'windows-latest'
run: |
python tests/print_platform_info.py
python -m pip install dist/*.whl
- name: Install (Windows)
if: matrix.os == 'windows-latest'
run: |
python tests/print_platform_info.py
python -m pip install @(join-path "dist" (get-childitem -path dist -name *.whl))
- name: Install Test Pre-requisites (quadprog always manual)
run: |
cd tests
python -m pip install scipy
git clone https://github.com/quadprog/quadprog.git
cd quadprog
pip install -r requirements_develop.txt && python -m cython quadprog/quadprog.pyx
cd ..
python -m pip install ./quadprog
cd ..
- name: Test
run: |
cd tests
python DQ_test.py
python DQ_Kinematics_test.py
python DQ_SerialManipulatorMDH_test.py
python cpp_issues.py
python python_issues.py
python DQ_Kinematics_pose_jacobian_derivative_tests.py
python DQ_Kinematics_static_jacobian_derivative_tests.py
cd ..
- name: Rename wheel (Ubuntu Only)
if: startsWith (matrix.os, 'ubuntu-22.04')
run: |
sudo apt install rename
cd dist
rename 's/linux/manylinux2014/' *
cd ..
- name: Publish to PyPi
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
if: github.ref == 'refs/heads/master'
run: |
python -m pip install twine
twine upload dist/*