-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
47 changed files
with
2,592 additions
and
577 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Fusion - mypy Typing Validation | ||
|
||
on: | ||
workflow_dispatch: {} | ||
push: | ||
branches: [ prod, dev ] | ||
pull_request: | ||
branches: [ prod, dev ] | ||
|
||
jobs: | ||
mypy: | ||
name: Run mypy | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./exporter/SynthesisFusionAddin | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
- run: pip install -r requirements-mypy.txt | ||
- run: mypy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[mypy] | ||
files = Synthesis.py, src | ||
warn_unused_configs = True | ||
check_untyped_defs = True | ||
warn_unreachable = True | ||
warn_redundant_casts = True | ||
warn_unused_ignores = True | ||
warn_no_return = True | ||
warn_return_any = True | ||
strict = True | ||
ignore_missing_imports = True | ||
follow_imports = skip | ||
disallow_subclassing_any = False | ||
disable_error_code = no-untyped-call |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
rm -rf -v ./proto_out | ||
mkdir ./proto_out | ||
git submodule update --init --recursive | ||
protoc -I=../../../mirabuf --python_out=./proto_out ../../../mirabuf/*.proto | ||
protoc -I=../../../mirabuf --python_out=./proto_out --mypy_out=./proto_out ../../../mirabuf/*.proto |
1 change: 1 addition & 0 deletions
1
...ter/SynthesisFusionAddin/requirements.txt → ...SynthesisFusionAddin/requirements-dev.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
black | ||
isort | ||
pyminifier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
mypy | ||
types-protobuf | ||
types-requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,53 @@ | ||
""" Initializes the global variables that are set in the run method to reduce hanging commands. """ | ||
|
||
from typing import Any | ||
|
||
import adsk.core | ||
import adsk.fusion | ||
|
||
|
||
class GlobalManager(object): | ||
"""Global Manager instance""" | ||
|
||
class __GlobalManager: | ||
def __init__(self): | ||
self.app = adsk.core.Application.get() | ||
|
||
if self.app: | ||
self.ui = self.app.userInterface | ||
|
||
self.connected = False | ||
""" Is unity currently connected """ | ||
|
||
self.uniqueIds = [] | ||
""" Collection of unique ID values to not overlap """ | ||
|
||
self.elements = [] | ||
""" Unique constructed buttons to delete """ | ||
|
||
self.palettes = [] | ||
""" Unique constructed palettes to delete """ | ||
class GlobalManager: | ||
def __init__(self) -> None: | ||
self.app = adsk.core.Application.get() | ||
|
||
self.handlers = [] | ||
""" Object to store all event handlers to custom events like saving. """ | ||
if self.app: | ||
self.ui = self.app.userInterface | ||
|
||
self.tabs = [] | ||
""" Set of Tab objects to keep track of. """ | ||
self.connected = False | ||
""" Is unity currently connected """ | ||
|
||
self.queue = [] | ||
""" This will eventually implement the Python SimpleQueue synchronized workflow | ||
- this is the list of objects being sent | ||
""" | ||
self.uniqueIds: list[str] = [] # type of HButton | ||
""" Collection of unique ID values to not overlap """ | ||
|
||
self.files = [] | ||
self.elements: list[Any] = [] | ||
""" Unique constructed buttons to delete """ | ||
|
||
def __str__(self): | ||
return "GlobalManager" | ||
# Transition: AARD-1765 | ||
# Will likely be removed later as this is no longer used. Avoiding adding typing for now. | ||
self.palettes = [] # type: ignore | ||
""" Unique constructed palettes to delete """ | ||
|
||
def clear(self): | ||
for attr, value in self.__dict__.items(): | ||
if isinstance(value, list): | ||
setattr(self, attr, []) | ||
self.handlers: list[adsk.core.EventHandler] = [] | ||
""" Object to store all event handlers to custom events like saving. """ | ||
|
||
instance = None | ||
self.tabs: list[adsk.core.ToolbarPanel] = [] | ||
""" Set of Tab objects to keep track of. """ | ||
|
||
def __new__(cls): | ||
if not GlobalManager.instance: | ||
GlobalManager.instance = GlobalManager.__GlobalManager() | ||
# Transition: AARD-1765 | ||
# Will likely be removed later as this is no longer used. Avoiding adding typing for now. | ||
self.queue = [] # type: ignore | ||
""" This will eventually implement the Python SimpleQueue synchronized workflow | ||
- this is the list of objects being sent | ||
""" | ||
|
||
return GlobalManager.instance | ||
# Transition: AARD-1765 | ||
# Will likely be removed later as this is no longer used. Avoiding adding typing for now. | ||
self.files = [] # type: ignore | ||
|
||
def __getattr__(self, name): | ||
return getattr(self.instance, name) | ||
def __str__(self) -> str: | ||
return "GlobalManager" | ||
|
||
def __setattr__(self, name): | ||
return setattr(self.instance, name) | ||
def clear(self) -> None: | ||
for attr, value in self.__dict__.items(): | ||
if isinstance(value, list): | ||
setattr(self, attr, []) |
Oops, something went wrong.