Skip to content

Commit 547cf63

Browse files
committed
Fix wheel building
Unvendor Qt.py
1 parent 4169fe6 commit 547cf63

37 files changed

+114
-67
lines changed

.github/workflows/main.yml

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ jobs:
7777
path: output_Maya${{ matrix.maya }}/*.${{ steps.get-devkit.outputs.plugin-ext }}
7878
if-no-files-found: error
7979

80-
8180
compile_python:
8281
strategy:
8382
matrix:
@@ -91,16 +90,38 @@ jobs:
9190
steps:
9291
- uses: actions/checkout@v4
9392
- run: git fetch --force --tags origin
93+
- name: 'Get Previous tag'
94+
id: previoustag
95+
uses: "WyriHaximus/github-action-get-previous-tag@v1"
96+
with:
97+
fallback: v0.0.1
9498

9599
- name: Get pyver macos-latest
96100
if: ${{ matrix.os == 'macos-latest' }}
97101
shell: bash
98-
run: echo "PY_VER=3.9" >> $GITHUB_ENV
102+
run: |
103+
echo "PY_VER=3.9" >> $GITHUB_ENV
104+
echo "PY_VER_FLAT=39" >> $GITHUB_ENV
105+
echo "PY_EXT=so" >> $GITHUB_ENV
106+
echo "PLAT_TAG=macosx_12_0_arm64" >> $GITHUB_ENV
107+
108+
- name: Get pyver ubuntu-latest
109+
if: ${{ matrix.os == 'ubuntu-latest' }}
110+
shell: bash
111+
run: |
112+
echo "PY_VER=3.7" >> $GITHUB_ENV
113+
echo "PY_VER_FLAT=37" >> $GITHUB_ENV
114+
echo "PY_EXT=so" >> $GITHUB_ENV
115+
echo "PLAT_TAG=manylinux_2_17_x86_64" >> $GITHUB_ENV
99116
100-
- name: Get pyver
101-
if: ${{ matrix.os != 'macos-latest' }}
117+
- name: Get pyver windows-latest
118+
if: ${{ matrix.os == 'windows-latest' }}
102119
shell: bash
103-
run: echo "PY_VER=3.7" >> $GITHUB_ENV
120+
run: |
121+
echo "PY_VER=3.7" >> $GITHUB_ENV
122+
echo "PY_VER_FLAT=37" >> $GITHUB_ENV
123+
echo "PY_EXT=pyd" >> $GITHUB_ENV
124+
echo "PLAT_TAG=win_amd64" >> $GITHUB_ENV
104125
105126
- name: Get an older python version
106127
uses: actions/setup-python@v5
@@ -117,11 +138,30 @@ jobs:
117138
--backend ninja
118139
install-args: --skip-subprojects
119140

141+
- name: Build Wheel
142+
shell: bash
143+
run: |
144+
python -m pip install -U pip
145+
python -m pip install -U build wheel hatch
146+
python -m hatch version ${{ steps.previoustag.outputs.tag }}
147+
python -m build --wheel
148+
for PY_WHEEL in dist/*.whl
149+
do
150+
python -m wheel tags --remove --python-tag ${{ env.PY_VER_FLAT }} --abi-tag abi3 --platform-tag ${{ env.PLAT_TAG }} ${PY_WHEEL}
151+
done
152+
120153
- name: Upload Artifacts
121154
uses: actions/upload-artifact@v4
122155
with:
123156
name: ${{ runner.os }}-pyModule
124-
path: output_Python/*.*
157+
path: output_Python/*.${{ env.PY_EXT }}
158+
if-no-files-found: error
159+
160+
- name: Upload Artifacts
161+
uses: actions/upload-artifact@v4
162+
with:
163+
name: ${{ runner.os }}-wheels
164+
path: dist/*.whl
125165
if-no-files-found: error
126166

127167
upload_release:
@@ -135,15 +175,15 @@ jobs:
135175
id: previoustag
136176
uses: "WyriHaximus/github-action-get-previous-tag@v1"
137177
with:
138-
fallback: 0.0.1
178+
fallback: v0.0.1
139179

140180
- name: Package
141181
uses: blurstudio/mayaModuleActions/packageMayaModule@v1
142182
with:
143183
module-name: simplex
144184
folder-list: scripts icons
145185
version: ${{ steps.previoustag.outputs.tag }}
146-
python-limited-api: true
186+
py-limited-api: true
147187

148188
- name: Upload distribution
149189
if: ${{ startsWith(github.ref, 'refs/tags/v') }}

pyproject.toml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ classifiers = [
2424

2525
dependencies = [
2626
"six",
27-
"Qt.py<2",
27+
"Qt.py",
2828
]
2929

3030
[project.urls]
@@ -34,18 +34,24 @@ dependencies = [
3434
requires = ["hatchling"]
3535
build-backend = "hatchling.build"
3636

37+
[tool.hatch.build.targets.wheel.sources]
38+
"scripts" = ""
39+
"output_Python" = ""
3740

38-
[tool.hatch.build]
39-
include = ["simplexui"]
40-
exclude = ["*.bak"]
41+
[tool.hatch.build.targets.wheel]
42+
only-packages = false
4143
artifacts = [
42-
"/*.so",
43-
"/*.pyd",
44+
"*.so",
45+
"*.pyd",
46+
"!*.lib",
47+
]
48+
only-include = [
49+
"scripts/simplexui",
50+
"output_Python",
4451
]
4552

4653
[tool.hatch.version]
47-
path = "simplexui/__init__.py"
48-
54+
path = "scripts/simplexui/__init__.py"
4955

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

134-

quick_compile.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ SET MAYA_VERSION=2024
44
REM "vs" "ninja"
55
REM use VS for the debugger, otherwise use NINJA
66
REM Until I figure out how to debug using nvim
7-
SET BACKEND=vs
7+
SET BACKEND=ninja
88
REM "debug" "debugoptimized" "release"
9-
SET BUILDTYPE=debug
9+
SET BUILDTYPE=release
1010
SET BUILDDIR=mayabuild_%BUILDTYPE%_%MAYA_VERSION%_%BACKEND%
1111

1212
if not exist %BUILDDIR%\ (

scripts/simplexui/commands/applyCorrectives.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from six.moves import map, zip
2626

2727
from ..items import Combo, Simplex, Slider
28-
from ..Qt.QtWidgets import QApplication
28+
from Qt.QtWidgets import QApplication
2929
from .alembicCommon import (
3030
buildSmpx,
3131
getSmpxArchiveData,

scripts/simplexui/commands/correctiveInterface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import six
2121
from six.moves import zip
2222

23-
from ..Qt.QtWidgets import QApplication
23+
from Qt.QtWidgets import QApplication
2424

2525
try:
2626
import numpy as np

scripts/simplexui/commands/unsubdivide.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import six
2727
from six.moves import map, range, zip, zip_longest
2828

29-
from ..Qt.QtWidgets import QApplication
29+
from Qt.QtWidgets import QApplication
3030
from .alembicCommon import buildSmpx, pbPrint, readSmpx
3131

3232
try:

scripts/simplexui/interface/dummyInterface.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
from six.moves import map, zip
2727

28-
from ..Qt import QtCore
29-
from ..Qt.QtCore import Signal
28+
from Qt import QtCore
29+
from Qt.QtCore import Signal
3030

3131
try:
3232
import numpy as np
@@ -43,7 +43,7 @@
4343
mkSampleVertexPoints,
4444
mkUvSample,
4545
)
46-
from ..Qt.QtWidgets import QApplication
46+
from Qt.QtWidgets import QApplication
4747

4848

4949
# UNDO STACK INTEGRATION

scripts/simplexui/interface/mayaInterface.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
from six.moves import map, range, zip
3333

3434
from ..commands.alembicCommon import mkSampleVertexPoints
35-
from ..Qt import QtCore
36-
from ..Qt.QtCore import Signal
37-
from ..Qt.QtWidgets import (
35+
from Qt import QtCore
36+
from Qt.QtCore import Signal
37+
from Qt.QtWidgets import (
3838
QApplication,
3939
QDialog,
4040
QMainWindow,

scripts/simplexui/interface/xsiInterface.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535

3636
from ..commands.alembicCommon import mkUvSample
3737
from ..commands.buildIceXML import buildIceXML, buildLoaderXML, buildSliderIceXML
38-
from ..Qt import QtCore
39-
from ..Qt.QtCore import Signal
40-
from ..Qt.QtWidgets import QApplication, QDialog, QMainWindow, QSplashScreen
38+
from Qt import QtCore
39+
from Qt.QtCore import Signal
40+
from Qt.QtWidgets import QApplication, QDialog, QMainWindow, QSplashScreen
4141

4242

4343
# UNDO STACK INTEGRATION

scripts/simplexui/items/combo.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from ..interface import undoContext
2121

2222
# pylint:disable=missing-docstring,unused-argument,no-self-use
23-
from ..Qt.QtGui import QColor
23+
from Qt.QtGui import QColor
2424
from ..utils import getIcon, nested
2525
from .accessor import SimplexAccessor
2626
from .stack import stackable
@@ -157,7 +157,7 @@ class Combo(SimplexAccessor):
157157
("Multiply Avg", "mulAvgAll"),
158158
("None", "min"),
159159
)
160-
_freezeIcon = getIcon("frozen.png")
160+
_freezeIcon = None
161161

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

221221
def icon(self):
222222
if self.frozen:
223+
if self._freezeIcon is None:
224+
type(self)._freezeIcon = getIcon("frozen.png")
223225
return self._freezeIcon
224226
return None
225227

0 commit comments

Comments
 (0)