Skip to content

Commit

Permalink
Fix wheel building
Browse files Browse the repository at this point in the history
Unvendor Qt.py
  • Loading branch information
tbttfox committed Sep 16, 2024
1 parent 4169fe6 commit 547cf63
Show file tree
Hide file tree
Showing 37 changed files with 114 additions and 67 deletions.
56 changes: 48 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ jobs:
path: output_Maya${{ matrix.maya }}/*.${{ steps.get-devkit.outputs.plugin-ext }}
if-no-files-found: error


compile_python:
strategy:
matrix:
Expand All @@ -91,16 +90,38 @@ jobs:
steps:
- uses: actions/checkout@v4
- 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: Get pyver macos-latest
if: ${{ matrix.os == 'macos-latest' }}
shell: bash
run: echo "PY_VER=3.9" >> $GITHUB_ENV
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 "PLAT_TAG=manylinux_2_17_x86_64" >> $GITHUB_ENV
- name: Get pyver
if: ${{ matrix.os != 'macos-latest' }}
- name: Get pyver windows-latest
if: ${{ matrix.os == 'windows-latest' }}
shell: bash
run: echo "PY_VER=3.7" >> $GITHUB_ENV
run: |
echo "PY_VER=3.7" >> $GITHUB_ENV
echo "PY_VER_FLAT=37" >> $GITHUB_ENV
echo "PY_EXT=pyd" >> $GITHUB_ENV
echo "PLAT_TAG=win_amd64" >> $GITHUB_ENV
- name: Get an older python version
uses: actions/setup-python@v5
Expand All @@ -117,11 +138,30 @@ jobs:
--backend ninja
install-args: --skip-subprojects

- 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/*.*
path: output_Python/*.${{ env.PY_EXT }}
if-no-files-found: error

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-wheels
path: dist/*.whl
if-no-files-found: error

upload_release:
Expand All @@ -135,15 +175,15 @@ jobs:
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: 0.0.1
fallback: v0.0.1

- name: Package
uses: blurstudio/mayaModuleActions/packageMayaModule@v1
with:
module-name: simplex
folder-list: scripts icons
version: ${{ steps.previoustag.outputs.tag }}
python-limited-api: true
py-limited-api: true

- name: Upload distribution
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
Expand Down
23 changes: 14 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ classifiers = [

dependencies = [
"six",
"Qt.py<2",
"Qt.py",
]

[project.urls]
Expand All @@ -34,18 +34,24 @@ dependencies = [
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel.sources]
"scripts" = ""
"output_Python" = ""

[tool.hatch.build]
include = ["simplexui"]
exclude = ["*.bak"]
[tool.hatch.build.targets.wheel]
only-packages = false
artifacts = [
"/*.so",
"/*.pyd",
"*.so",
"*.pyd",
"!*.lib",
]
only-include = [
"scripts/simplexui",
"output_Python",
]

[tool.hatch.version]
path = "simplexui/__init__.py"

path = "scripts/simplexui/__init__.py"

[tool.ruff]
# Exclude a variety of commonly ignored directories.
Expand Down Expand Up @@ -131,4 +137,3 @@ skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"


4 changes: 2 additions & 2 deletions quick_compile.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ SET MAYA_VERSION=2024
REM "vs" "ninja"
REM use VS for the debugger, otherwise use NINJA
REM Until I figure out how to debug using nvim
SET BACKEND=vs
SET BACKEND=ninja
REM "debug" "debugoptimized" "release"
SET BUILDTYPE=debug
SET BUILDTYPE=release
SET BUILDDIR=mayabuild_%BUILDTYPE%_%MAYA_VERSION%_%BACKEND%

if not exist %BUILDDIR%\ (
Expand Down
2 changes: 1 addition & 1 deletion scripts/simplexui/commands/applyCorrectives.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from six.moves import map, zip

from ..items import Combo, Simplex, Slider
from ..Qt.QtWidgets import QApplication
from Qt.QtWidgets import QApplication
from .alembicCommon import (
buildSmpx,
getSmpxArchiveData,
Expand Down
2 changes: 1 addition & 1 deletion scripts/simplexui/commands/correctiveInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import six
from six.moves import zip

from ..Qt.QtWidgets import QApplication
from Qt.QtWidgets import QApplication

try:
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion scripts/simplexui/commands/unsubdivide.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import six
from six.moves import map, range, zip, zip_longest

from ..Qt.QtWidgets import QApplication
from Qt.QtWidgets import QApplication
from .alembicCommon import buildSmpx, pbPrint, readSmpx

try:
Expand Down
6 changes: 3 additions & 3 deletions scripts/simplexui/interface/dummyInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

from six.moves import map, zip

from ..Qt import QtCore
from ..Qt.QtCore import Signal
from Qt import QtCore
from Qt.QtCore import Signal

try:
import numpy as np
Expand All @@ -43,7 +43,7 @@
mkSampleVertexPoints,
mkUvSample,
)
from ..Qt.QtWidgets import QApplication
from Qt.QtWidgets import QApplication


# UNDO STACK INTEGRATION
Expand Down
6 changes: 3 additions & 3 deletions scripts/simplexui/interface/mayaInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
from six.moves import map, range, zip

from ..commands.alembicCommon import mkSampleVertexPoints
from ..Qt import QtCore
from ..Qt.QtCore import Signal
from ..Qt.QtWidgets import (
from Qt import QtCore
from Qt.QtCore import Signal
from Qt.QtWidgets import (
QApplication,
QDialog,
QMainWindow,
Expand Down
6 changes: 3 additions & 3 deletions scripts/simplexui/interface/xsiInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@

from ..commands.alembicCommon import mkUvSample
from ..commands.buildIceXML import buildIceXML, buildLoaderXML, buildSliderIceXML
from ..Qt import QtCore
from ..Qt.QtCore import Signal
from ..Qt.QtWidgets import QApplication, QDialog, QMainWindow, QSplashScreen
from Qt import QtCore
from Qt.QtCore import Signal
from Qt.QtWidgets import QApplication, QDialog, QMainWindow, QSplashScreen


# UNDO STACK INTEGRATION
Expand Down
6 changes: 4 additions & 2 deletions scripts/simplexui/items/combo.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from ..interface import undoContext

# pylint:disable=missing-docstring,unused-argument,no-self-use
from ..Qt.QtGui import QColor
from Qt.QtGui import QColor
from ..utils import getIcon, nested
from .accessor import SimplexAccessor
from .stack import stackable
Expand Down Expand Up @@ -157,7 +157,7 @@ class Combo(SimplexAccessor):
("Multiply Avg", "mulAvgAll"),
("None", "min"),
)
_freezeIcon = getIcon("frozen.png")
_freezeIcon = None

def __init__(
self, name, simplex, pairs, prog, group, solveType, color=QColor(128, 128, 128)
Expand Down Expand Up @@ -220,6 +220,8 @@ def freezeThing(self, value):

def icon(self):
if self.frozen:
if self._freezeIcon is None:
type(self)._freezeIcon = getIcon("frozen.png")
return self._freezeIcon
return None

Expand Down
2 changes: 1 addition & 1 deletion scripts/simplexui/items/falloff.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import numpy as np
except ImportError:
np = None
from ..Qt.QtGui import QColor
from Qt.QtGui import QColor
from ..utils import nested
from .accessor import SimplexAccessor
from .stack import stackable
Expand Down
2 changes: 1 addition & 1 deletion scripts/simplexui/items/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# along with Simplex. If not, see <http://www.gnu.org/licenses/>.

# pylint:disable=missing-docstring,unused-argument,no-self-use
from ..Qt.QtGui import QColor
from Qt.QtGui import QColor
from ..utils import nested
from .accessor import SimplexAccessor
from .stack import stackable
Expand Down
2 changes: 1 addition & 1 deletion scripts/simplexui/items/shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from ..interface import DCC, undoContext

# pylint:disable=missing-docstring,unused-argument,no-self-use
from ..Qt.QtGui import QColor
from Qt.QtGui import QColor
from .accessor import SimplexAccessor
from .stack import stackable

Expand Down
4 changes: 2 additions & 2 deletions scripts/simplexui/items/simplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
)
from ..interface import DCC, undoContext
from ..interface.dummyInterface import DCC as DummyDCC
from ..Qt.QtGui import QColor
from ..Qt.QtWidgets import QApplication
from Qt.QtGui import QColor
from Qt.QtWidgets import QApplication
from ..utils import nested
from .combo import Combo, ComboPair
from .falloff import Falloff
Expand Down
2 changes: 1 addition & 1 deletion scripts/simplexui/items/slider.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import itertools

from ..interface import undoContext
from ..Qt.QtGui import QColor
from Qt.QtGui import QColor
from ..utils import caseSplit, getNextName, makeUnique, nested, singleShot
from .accessor import SimplexAccessor
from .group import Group
Expand Down
2 changes: 1 addition & 1 deletion scripts/simplexui/items/traversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from six.moves import range, zip

# pylint:disable=missing-docstring,unused-argument,no-self-use
from ..Qt.QtGui import QColor
from Qt.QtGui import QColor
from ..utils import nested
from .accessor import SimplexAccessor
from .combo import Combo
Expand Down
2 changes: 1 addition & 1 deletion scripts/simplexui/menu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import pkgutil
import sys

from ..Qt.QtWidgets import QMenu
from Qt.QtWidgets import QMenu
from . import genericPlugins

CONTEXT = os.path.basename(sys.executable)
Expand Down
4 changes: 2 additions & 2 deletions scripts/simplexui/menu/genericPlugins/_builtins.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
from functools import partial

from ...items import Combo, ComboPair, ProgPair, Progression, Slider
from ...Qt.QtCore import Qt
from ...Qt.QtWidgets import QCheckBox, QWidgetAction
from Qt.QtCore import Qt
from Qt.QtWidgets import QCheckBox, QWidgetAction


def registerContext(tree, clickIdx, indexes, menu):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from ...comboCheckDialog import ComboCheckDialog
from ...items import Slider
from ...Qt.QtWidgets import QAction
from Qt.QtWidgets import QAction


def registerTool(window, menu):
Expand Down
4 changes: 2 additions & 2 deletions scripts/simplexui/menu/genericPlugins/exportSplit.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

from functools import partial

from ...Qt import QtCompat
from ...Qt.QtWidgets import QAction, QMessageBox, QProgressDialog
from Qt import QtCompat
from Qt.QtWidgets import QAction, QMessageBox, QProgressDialog

try:
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion scripts/simplexui/menu/genericPlugins/showFalloffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with Simplex. If not, see <http://www.gnu.org/licenses/>.

from ...Qt.QtWidgets import QAction
from Qt.QtWidgets import QAction


def registerTool(window, menu):
Expand Down
2 changes: 1 addition & 1 deletion scripts/simplexui/menu/genericPlugins/showTraversals.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with Simplex. If not, see <http://www.gnu.org/licenses/>.

from ...Qt.QtWidgets import QAction
from Qt.QtWidgets import QAction


def registerTool(window, menu):
Expand Down
4 changes: 2 additions & 2 deletions scripts/simplexui/menu/genericPlugins/unsubdivide.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
from functools import partial

from ...commands.unsubdivide import unsubdivideSimplex
from ...Qt import QtCompat
from ...Qt.QtWidgets import QAction, QMessageBox, QProgressDialog
from Qt import QtCompat
from Qt.QtWidgets import QAction, QMessageBox, QProgressDialog

try:
import imathnumpy
Expand Down
4 changes: 2 additions & 2 deletions scripts/simplexui/menu/mayaPlugins/exportOther.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

import maya.cmds as cmds

from ...Qt import QtCompat
from ...Qt.QtWidgets import QAction, QProgressDialog
from Qt import QtCompat
from Qt.QtWidgets import QAction, QProgressDialog


def registerTool(window, menu):
Expand Down
Loading

0 comments on commit 547cf63

Please sign in to comment.