Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
038ba50
Switch to the meson python wheel backend
tbttfox Apr 9, 2025
05a2ce1
Clean up the lint errors in the installer script
tbttfox Apr 9, 2025
881982f
Fix a couple formatting issues
tbttfox Apr 9, 2025
abfbf6f
Add the pure python imathnumpy
tbttfox Apr 25, 2025
e2edf44
Use the numpytoimath library, and Get rid of python2 compat stuff
tbttfox Apr 25, 2025
b3533fe
Remove the python 2 compat stuff
tbttfox Apr 25, 2025
2612644
A bunch of python cleanup... I don't remember if its good. I had to s…
tbttfox Jun 14, 2025
cf08218
A quick readme update
tbttfox Jun 17, 2025
2e9f367
fix zipfile extraction
tbttfox Sep 10, 2025
eb52c13
Black all the python code
tbttfox Sep 10, 2025
1305fae
Fix an error when trying to connect a combo/trav shape that's already…
tbttfox Sep 10, 2025
9b6a3f6
Add tox, run the ruff linter, and fix the lint errors
tbttfox Sep 10, 2025
0996b71
Add the Qt enum fixes
tbttfox Sep 10, 2025
88971da
Add maya 2026 to the workflow, update the maya subproject, and add so…
tbttfox Sep 10, 2025
38a40f5
Separated building the python module vs building the python wheel.
tbttfox Sep 11, 2025
bbde86a
Fix how maya finds Qt's moc
tbttfox Sep 12, 2025
3ccfe9e
Ignore the python dist
tbttfox Sep 12, 2025
225677d
Add right-click export and duplicate name detection
tbttfox Sep 13, 2025
18fe399
Update required meson version to latest
tbttfox Sep 16, 2025
a129a54
Make versioning work with the meson python backend
tbttfox Sep 16, 2025
6916e6c
Add a python script build target for building the scripts folder for …
tbttfox Sep 16, 2025
170b615
Test with fewer maya versions
tbttfox Sep 17, 2025
443b7d4
Set the actual install dirs
tbttfox Sep 17, 2025
8d6187c
Windows python on 3.9
tbttfox Sep 17, 2025
a8c789d
Update to latest rapidjson because python compile hits a bug
tbttfox Sep 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 46 additions & 43 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,16 @@ name: build

on:
push:
branches: [ master ]
tags:
- v*
pull_request:
branches: [ master ]

# matrix:
# maya: [2024]
# os: [macos-latest, ubuntu-latest, windows-latest]
# include:
# - maya: 2024
# update: 2

jobs:
compile_plugin:
strategy:
matrix:
maya: [2022, 2023, 2024, 2025]
maya: [2022, 2023, 2024, 2025, 2026]
os: [macos-13, macos-latest, ubuntu-latest, windows-latest]
include:
# Add the maya update versions here
Expand All @@ -31,7 +23,9 @@ jobs:
- maya: 2024
update: 2
- maya: 2025
update: 1
update: 3
- maya: 2026
update: 2

# cross-compiling is annoying so just fall back to macos-13
exclude:
Expand All @@ -43,13 +37,18 @@ jobs:
maya: 2024
- os: macos-13
maya: 2025
- os: macos-13
maya: 2026

fail-fast: false

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: git fetch --force --tags origin
- name: 'Checkout repo'
uses: actions/checkout@v5

- name: 'ACTUALLY get tags'
run: git fetch --force --tag

- name: Get Maya Devkit
id: get-devkit
Expand All @@ -61,6 +60,7 @@ jobs:
- name: Build Maya
uses: blurstudio/mayaModuleActions/mesonBuild@v1
with:
meson-version: 1.9.0
setup-args: >
-Dmaya:maya_version=${{ matrix.maya }}
-Dmaya:maya_devkit_base=${{ steps.get-devkit.outputs.devkit-path }}
Expand Down Expand Up @@ -88,75 +88,64 @@ jobs:

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: git fetch --force --tags origin
- name: 'Checkout repo'
uses: actions/checkout@v5

- name: 'ACTUALLY get tags'
run: git fetch --force --tags origin

- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: v0.0.1

- name: 'Write version.txt'
run: echo "${{ steps.previoustag.outputs.tag }}" > version.txt

- name: Get pyver macos-latest
if: ${{ matrix.os == 'macos-latest' }}
shell: bash
run: |
echo "PY_VER=3.9" >> $GITHUB_ENV
echo "PY_VER_FLAT=39" >> $GITHUB_ENV
echo "PY_EXT=so" >> $GITHUB_ENV
echo "PLAT_TAG=macosx_12_0_arm64" >> $GITHUB_ENV

- name: Get pyver ubuntu-latest
if: ${{ matrix.os == 'ubuntu-latest' }}
shell: bash
run: |
echo "PY_VER=3.7" >> $GITHUB_ENV
echo "PY_VER_FLAT=37" >> $GITHUB_ENV
echo "PY_EXT=so" >> $GITHUB_ENV
echo "PY_VER=3.9" >> $GITHUB_ENV
echo "PY_VER_FLAT=39" >> $GITHUB_ENV
echo "PLAT_TAG=manylinux_2_17_x86_64" >> $GITHUB_ENV

- name: Get pyver windows-latest
if: ${{ matrix.os == 'windows-latest' }}
shell: bash
run: |
echo "PY_VER=3.7" >> $GITHUB_ENV
echo "PY_VER_FLAT=37" >> $GITHUB_ENV
echo "PY_EXT=pyd" >> $GITHUB_ENV
echo "PY_VER=3.9" >> $GITHUB_ENV
echo "PY_VER_FLAT=39" >> $GITHUB_ENV
echo "PLAT_TAG=win_amd64" >> $GITHUB_ENV

- name: Get an older python version
uses: actions/setup-python@v5
with:
python-version: ${{ env.PY_VER }}

- name: Build Python
uses: blurstudio/mayaModuleActions/mesonBuild@v1
with:
setup-args: >
-Dmaya_build=false
-Dpython_build=true
--buildtype release
--backend ninja
install-args: --skip-subprojects
- name: Install pip packages
shell: bash
run: |
python -m pip install -U build wheel

- name: Build Wheel
shell: bash
run: |
python -m pip install -U pip
python -m pip install -U build wheel hatch
python -m hatch version ${{ steps.previoustag.outputs.tag }}
python -m build --wheel
for PY_WHEEL in dist/*.whl
do
python -m wheel tags --remove --python-tag ${{ env.PY_VER_FLAT }} --abi-tag abi3 --platform-tag ${{ env.PLAT_TAG }} ${PY_WHEEL}
done

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-pyModule
path: output_Python/*.${{ env.PY_EXT }}
if-no-files-found: error

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
Expand All @@ -169,14 +158,28 @@ jobs:
needs: [compile_plugin, compile_python]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: git fetch --force --tags origin
- name: 'Get Previous tag'
- name: Checkout repo
uses: actions/checkout@v5

- name: 'ACTUALLY get tags'
run: git fetch --force --tags origin

- name: Get Previous tag
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: v0.0.1

- name: Build the module scripts folder
uses: blurstudio/mayaModuleActions/mesonBuild@v1
with:
meson-version: 1.9.0
setup-args: >
-Dmaya_build=false
-Dpython_build=true
-Dpython_script_build=true
install-args: --skip-subprojects

- name: Package
uses: blurstudio/mayaModuleActions/packageMayaModule@v1
with:
Expand Down
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ ehthumbs.db
# Release zipfile
Simplex.zip

# Auto-generated version files
version.txt
_version.py

# clang compile commands
compile_commands.json

# Build folders
Maya20*/
**/build/
Expand Down Expand Up @@ -38,6 +45,17 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

# clang LSP
.cache

# Known subprojects
**/Eigen-*/
**/rapidjson-*/
subprojects/packagecache/

# python wheel dist folder
dist/

# =========================
# Operating System Files
# =========================
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ runSimplexUI()


## Compiling
Hopefully you don't need to do this, but if you have to, just take a look at `.github/workflows/main.yml` and you should be able to piece together how to get a compile working using CMake. You aren't required to download the devkit or set its path for CMake if you've got maya installed on your machine. Also note, I use features from CMake 3.16+ so I can target python 2 and 3 separately.
Hopefully you don't need to do this, but if you have to, just take a look at the `quick_compile.bat` file to see how to kick off a compile. And also look at `.github/workflows/main.yml` if you need to piece together the dependencies required.
38 changes: 38 additions & 0 deletions get_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import os
import subprocess
import sys

VERSION_FILE = "version.txt"


def main(srcroot, gitpath):
"""
When building a python wheel, the build system copies the entire source tree into a new folder
but it doesn't seem to include git tags, or it doesn't check out the git tags, or *something*
So I'm writing out a version.txt file that this function will read and pass along to the
meson project() function call
"""
# If version.txt already exists, use it
src_file = os.path.join(srcroot, VERSION_FILE)
if os.path.exists(src_file):
with open(src_file) as f:
v = f.read().strip()
else:
# Otherwise, try git describe
try:
# fmt: off
v = subprocess.check_output(
[gitpath, "describe", "--tags", "--always", "--match", "v[0-9]*", "--abbrev=0"],
text=True,
).strip()
# fmt: on
except Exception:
v = "0.0.1" # fallback if not in a git repo

print(v)


if __name__ == "__main__":
srcroot = sys.argv[1]
gitpath = sys.argv[2]
sys.exit(main(srcroot, gitpath))
21 changes: 19 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
project('Simplex', 'cpp', default_options: ['cpp_std=c++20'])

project(
'Simplex',
'cpp',
meson_version : '>=1.7.0',
version : configure_file(
capture : true,
command : [
find_program('python', required: true),
meson.project_source_root() / 'get_version.py',
meson.project_source_root(),
find_program('git', native: true, required: true).full_path(),
],
output : 'version.txt',
),
default_options: ['cpp_std=c++20'],
)

maya_build = get_option('maya_build')
python_build = get_option('python_build')
Expand All @@ -8,6 +22,9 @@ if not maya_build and not python_build
error('No builds requested')
endif

conf_data = configuration_data()
conf_data.set('VCS_TAG', meson.project_version())

subdir('src/simplexlib')
if maya_build
maya_dep = dependency('maya')
Expand Down
2 changes: 2 additions & 0 deletions meson.options
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
option('maya_build', type : 'boolean', value : true)
option('python_build', type : 'boolean', value : true)
option('python_wheel_build', type : 'boolean', value : false)
option('python_script_build', type : 'boolean', value : false)
Loading
Loading