Skip to content

Commit 486b8cb

Browse files
Merge pull request #65 from luxonis/ci_pypi_dev_fix
CI improvements and fixes
2 parents a84d532 + 3f45415 commit 486b8cb

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ jobs:
1818
runs-on: windows-latest
1919
strategy:
2020
matrix:
21-
python-version: [3.5, 3.6, 3.7, 3.8]
21+
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
22+
python-architecture: [x64, x86]
2223
steps:
2324
- name: Cache .hunter folder
2425
uses: actions/cache@v2
@@ -32,9 +33,10 @@ jobs:
3233
uses: actions/setup-python@v2
3334
with:
3435
python-version: ${{ matrix.python-version }}
36+
architecture: ${{ matrix.python-architecture }}
3537
- name: Append build hash if not a tagged commit
3638
if: startsWith(github.ref, 'refs/tags/v') != true
37-
run: echo '::set-env name=BUILD_COMMIT_HASH::${{github.sha}}'
39+
run: echo "BUILD_COMMIT_HASH=${{github.sha}}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
3840
- name: Install dependencies
3941
run: |
4042
python -m pip install --upgrade pip
@@ -51,7 +53,7 @@ jobs:
5153
runs-on: macos-latest
5254
strategy:
5355
matrix:
54-
python-version: [3.5, 3.6, 3.7, 3.8]
56+
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
5557
steps:
5658
- name: Cache .hunter folder
5759
uses: actions/cache@v2
@@ -67,14 +69,14 @@ jobs:
6769
python-version: ${{ matrix.python-version }}
6870
- name: Append build hash if not a tagged commit
6971
if: startsWith(github.ref, 'refs/tags/v') != true
70-
run: echo '::set-env name=BUILD_COMMIT_HASH::${{github.sha}}'
72+
run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV
7173
- name: Install dependencies
7274
run: |
7375
python -m pip install --upgrade pip
7476
brew install libusb
7577
python -m pip install delocate
7678
- name: Set macos deployment target
77-
run: echo '::set-env name=MACOSX_DEPLOYMENT_TARGET::10.9'
79+
run: echo "MACOSX_DEPLOYMENT_TARGET=10.9" >> $GITHUB_ENV
7880
- name: Building wheels
7981
run: python -m pip wheel . -w ./wheelhouse/
8082
- name: Auditing wheels
@@ -111,10 +113,10 @@ jobs:
111113
run: mkdir -p wheelhouse/audited/
112114
- name: Append build hash if not a tagged commit
113115
if: startsWith(github.ref, 'refs/tags/v') != true
114-
run: echo '::set-env name=BUILD_COMMIT_HASH::${{github.sha}}'
116+
run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV
115117
- name: Building a source distribution
116118
run: |
117-
/opt/python/cp38-cp38/bin/python3.8 setup.py sdist --formats=gztar,zip
119+
/opt/python/cp38-cp38/bin/python3.8 setup.py sdist --formats=gztar
118120
mv dist/* wheelhouse/audited/
119121
- name: Building wheels
120122
run: for PYBIN in /opt/python/cp3*/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/; done
@@ -141,7 +143,7 @@ jobs:
141143
submodules: 'recursive'
142144
- name: Append build hash if not a tagged commit
143145
if: startsWith(github.ref, 'refs/tags/v') != true
144-
run: echo '::set-env name=BUILD_COMMIT_HASH::${{github.sha}}'
146+
run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV
145147
- name: Building wheel
146148
run: python3 -m pip wheel . -w ./wheelhouse/
147149
- name: Auditing wheel

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,13 @@ target_link_libraries(${TARGET_NAME}
5353

5454
# Add bindings revision
5555
target_compile_definitions(${TARGET_NAME} PRIVATE DEPTHAI_PYTHON_BINDINGS_REVISION="${PROJECT_VERSION}")
56-
# Add commit hash, default to "dev"
57-
if(NOT DEPTHAI_PYTHON_COMMIT_HASH)
56+
57+
# Add default commit hash (dev) if not build by CI
58+
if(NOT DEFINED ENV{CI} AND NOT DEPTHAI_PYTHON_COMMIT_HASH)
5859
set(DEPTHAI_PYTHON_COMMIT_HASH dev)
5960
endif()
61+
62+
# Add compile definition for bindings
6063
if(DEPTHAI_PYTHON_COMMIT_HASH)
6164
target_compile_definitions(${TARGET_NAME} PRIVATE DEPTHAI_PYTHON_COMMIT_HASH="${DEPTHAI_PYTHON_COMMIT_HASH}")
6265
endif()

depthai-core

0 commit comments

Comments
 (0)