Skip to content

Commit 7890698

Browse files
authored
Merge pull request #1 from jchanvfx/main
Merge latest changes
2 parents 270754e + b64ec9c commit 7890698

File tree

8 files changed

+26
-19
lines changed

8 files changed

+26
-19
lines changed

.github/workflows/pypi_publish.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ on:
99

1010
jobs:
1111
publish:
12+
name: Upload Release to PyPI
1213
runs-on: ubuntu-latest
14+
# IMPORTANT: this permission is mandatory for trusted publishing.
15+
permissions:
16+
id-token: write
1317
steps:
1418
# Checks-out your repository under $GITHUB_WORKSPACE , so your workflow can access it.
1519
- name: Checkout
@@ -19,10 +23,6 @@ jobs:
1923
# Run build to a specified version of python into a specified directory.
2024
- name: Python Build
2125
run: python3 -m pip install --upgrade build && python3 -m build
22-
# Publish the python package to pypi.org with the api token.
23-
- name: Publish Package
26+
# Publish the python package to pypi.org.
27+
- name: Publish Package to PyPI
2428
uses: pypa/gh-action-pypi-publish@release/v1
25-
with:
26-
repository-url: https://upload.pypi.org/legacy/
27-
user: __token__
28-
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/sphinx_doc_build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ env:
1313

1414
jobs:
1515
docs-build:
16+
name: Build Sphinx Documentation
1617
runs-on: ubuntu-latest
1718
steps:
1819
# Checks-out your repository under $GITHUB_WORKSPACE , so your workflow can access it.

NodeGraphQt/base/graph.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ def set_context_menu_from_file(self, file_path, menu='graph'):
907907
if not file.is_file():
908908
raise IOError('file doesn\'t exist: "{}"'.format(file))
909909

910-
with file.open() as f:
910+
with file.open(encoding='utf8') as f:
911911
data = json.load(f)
912912
context_menu = self.get_context_menu(menu)
913913
self._deserialize_context_menu(context_menu, data, file)
@@ -1727,8 +1727,12 @@ def _serialize(self, nodes):
17271727
serial_data['graph']['pipe_style'] = self.pipe_style()
17281728

17291729
# connection constrains.
1730-
serial_data['graph']['accept_connection_types'] = self.model.accept_connection_types
1731-
serial_data['graph']['reject_connection_types'] = self.model.reject_connection_types
1730+
serial_data['graph']['accept_connection_types'] = {
1731+
k: list(v) for k, v in self.model.accept_connection_types.items()
1732+
}
1733+
serial_data['graph']['reject_connection_types'] = {
1734+
k: list(v) for k, v in self.model.reject_connection_types.items()
1735+
}
17321736

17331737
# serialize nodes.
17341738
for n in nodes:
@@ -1798,9 +1802,13 @@ def _deserialize(self, data, relative_pos=False, pos=None):
17981802

17991803
# connection constrains.
18001804
elif attr_name == 'accept_connection_types':
1801-
self.model.accept_connection_types = attr_value
1805+
self.model.accept_connection_types = {
1806+
k: set(v) for k, v in attr_value.items()
1807+
}
18021808
elif attr_name == 'reject_connection_types':
1803-
self.model.reject_connection_types = attr_value
1809+
self.model.reject_connection_types = {
1810+
k: set(v) for k, v in attr_value.items()
1811+
}
18041812

18051813
# build the nodes.
18061814
nodes = {}

NodeGraphQt/base/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def add_port_accept_connection_type(
245245
):
246246
"""
247247
Convenience function for adding to the "accept_connection_types" dict.
248-
If the node graph model is unavailable yet then we store it to a
248+
If the node graph model is unavailable, yet then we store it to a
249249
temp var that gets deleted.
250250
251251
Args:

NodeGraphQt/pkg_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python
22
# -*- coding: utf-8 -*-
3-
__version__ = '0.6.37'
3+
__version__ = '0.6.38'
44
__status__ = 'Work in Progress'
55
__license__ = 'MIT'
66

NodeGraphQt/qgraphics/node_backdrop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def mousePressEvent(self, event):
152152

153153
def mouseReleaseEvent(self, event):
154154
super(BackdropNodeItem, self).mouseReleaseEvent(event)
155-
self.setFlag(self.ItemIsMovable, True)
155+
self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, True)
156156
[n.setSelected(True) for n in self._nodes]
157157
self._nodes = [self]
158158

NodeGraphQt/widgets/viewer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,9 @@ def __init__(self, parent=None, undo_stack=None):
6666
self.setRenderHint(QtGui.QPainter.Antialiasing, True)
6767
self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
6868
self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
69-
self.setViewportUpdateMode(QtWidgets.QGraphicsView.FullViewportUpdate)
69+
self.setViewportUpdateMode(QtWidgets.QGraphicsView.BoundingRectViewportUpdate)
7070
self.setCacheMode(QtWidgets.QGraphicsView.CacheBackground)
71-
self.setOptimizationFlag(
72-
QtWidgets.QGraphicsView.DontAdjustForAntialiasing)
71+
self.setOptimizationFlag(QtWidgets.QGraphicsView.DontAdjustForAntialiasing)
7372

7473
self.setAcceptDrops(True)
7574
self.resize(850, 800)

setup.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ license = MIT License
66
license_files = LICENSE.md
77
long_description = file: README.md
88
long_description_content_type = text/markdown
9-
description = Node graph framework for PySide2/PyQt5 that can be
10-
implemented and re-purposed into applications.
9+
description = Node graph framework written in PySide2 that can be re-implemented.
1110
classifiers = Operating System :: OS Independent
1211
License :: OSI Approved :: MIT License
1312
Programming Language :: Python :: 3.6

0 commit comments

Comments
 (0)