Skip to content

Commit

Permalink
Merge pull request #16 from Muream/generate_type_stubs
Browse files Browse the repository at this point in the history
Automatically generate typing stubs
  • Loading branch information
mottosso committed Jun 9, 2021
2 parents 86cc176 + 1d2f123 commit 0548492
Show file tree
Hide file tree
Showing 20 changed files with 2,272 additions and 195 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,22 @@ jobs:
image: "2018.7" # For docker
pip: "2.7/get-pip.py"
devkit: "https://autodesk-adn-transfer.s3.us-west-2.amazonaws.com/ADN%20Extranet/M%26E/Maya/devkit%202018/Autodesk_Maya_2018_7_Update_DEVKIT_Linux.tgz"
generate_stubs: false # stubs generation only works with python 3
- maya: "2019.3"
image: "2019"
pip: "2.7/get-pip.py"
devkit: "https://autodesk-adn-transfer.s3.us-west-2.amazonaws.com/ADN%20Extranet/M%26E/Maya/devkit%202019/Autodesk_Maya_2019_3_Update_DEVKIT_Linux.tgz"
generate_stubs: false
- maya: "2020.4"
image: "2020"
pip: "2.7/get-pip.py"
devkit: "https://autodesk-adn-transfer.s3.us-west-2.amazonaws.com/ADN%20Extranet/M%26E/Maya/devkit%202020/Autodesk_Maya_2020_4_Update_DEVKIT_Linux.tgz"
generate_stubs: false
- maya: "2022"
image: "2022"
pip: "get-pip.py"
devkit: "https://autodesk-adn-transfer.s3.us-west-2.amazonaws.com/ADN%20Extranet/M%26E/Maya/devkit%202022/Autodesk_Maya_2022_DEVKIT_Linux.tgz"
generate_stubs: true

container: mottosso/maya:${{ matrix.image }}

Expand Down Expand Up @@ -169,12 +173,22 @@ jobs:
mayapy --version
export PYTHONPATH=$(pwd)/build
mayapy -m nose -xv --exe ./tests
- name: Generate Stubs
if: ${{ matrix.generate_stubs }}
run: |
mayapy -m pip install --user \
pybind11-stubgen==0.8.7 && \
export PYTHONPATH=$(pwd)/build
mayapy ./scripts/generate_stubs.py
- name: Artifacts
uses: actions/upload-artifact@v2
with:
name: linux-${{ matrix.maya }}
path: build/cmdc.so
path: |
build/cmdc.so
build/cmdc.pyi
# maya-osx:
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
*.dist-info
*.pyd
*.py[id]
build/**
tmp/*
*.pyc
MFn.Types.inl
devkit.tgz
devkitBase
devkitBase
3 changes: 2 additions & 1 deletion Dockerfile.2022
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ RUN mayapy -m pip install --user \
flaky==3.7.0 \
six==1.16.0 \
sphinx==1.8.5 \
sphinxcontrib-napoleon==0.7
sphinxcontrib-napoleon==0.7 \
pybind11-stubgen==0.8.7

# Since 2019, this sucker throws an
# unnecessary warning if not declared.
Expand Down
4 changes: 2 additions & 2 deletions build_win32.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ Write-Host "(4) Cleaning.."
& python .\scripts\mfn.py clean

$t4 = $stopwatch.ElapsedMilliseconds

$clean_duration = $t4 - $t3
$total_duration = $t4 - $t0

Write-Host "(4) Finished in $clean_duration ms"
Write-Host "(4) ----------------------------"

$total_duration = $t4 - $t0
Write-Host "Successfully created .\build\cmdc.pyd in $total_duration ms"
Loading

0 comments on commit 0548492

Please sign in to comment.