Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically generate typing stubs #16

Merged
merged 15 commits into from Jun 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/workflows/main.yml
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
@@ -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
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
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"