Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

switch PyQt5 for PySide2 #1744

Merged
merged 56 commits into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
c30b917
remove PyQt5 and add PySide2
antirotor Jun 22, 2021
fbc7cca
linux version
antirotor Jun 22, 2021
09486d7
add vendor/python to gitignore
antirotor Jun 22, 2021
6c06eef
added python vendor to gitignore
iLLiCiTiT Jun 23, 2021
25a18e1
do not install PySide2 into subfolder
iLLiCiTiT Jun 23, 2021
64a1839
add vendor directory to sys.path in start.py
iLLiCiTiT Jun 23, 2021
39bf354
removed get_pyside2_location as is not needed inside openpype
iLLiCiTiT Jun 23, 2021
ea8a3e8
changes in ignore files
antirotor Jun 23, 2021
bab6c33
Merge remote-tracking branch 'origin/feature/move-to-pyside2' into fe…
antirotor Jun 23, 2021
2e35e30
removed duplicated ignore directory
iLLiCiTiT Jun 23, 2021
5937461
fix receivers discovery
iLLiCiTiT Jun 23, 2021
60445b7
fix log viewer stylesheet of qtoolbutton
iLLiCiTiT Jun 23, 2021
7b45e69
added comment
iLLiCiTiT Jun 23, 2021
25cb349
fixed popupMode property
iLLiCiTiT Jun 23, 2021
bc30890
get PySide2 version from pyproject.toml
antirotor Jun 23, 2021
85b2a45
Merge branch 'develop' into feature/move-to-pyside2
jakubjezek001 Jun 24, 2021
4362668
use parenting to skip style set
iLLiCiTiT Jun 25, 2021
3515194
Merge branch 'develop' into feature/move-to-pyside2
iLLiCiTiT Jun 29, 2021
d28f8cd
fix linux scripts, add patchelf
antirotor Jun 30, 2021
f460fad
fix hound
antirotor Jun 30, 2021
fa78f98
add ncurses
antirotor Jul 1, 2021
3dd40f1
Merge remote-tracking branch 'refs/remotes/origin/develop'
antirotor Jul 12, 2021
b582d56
Merge remote-tracking branch 'origin/develop' into feature/move-to-py…
antirotor Aug 19, 2021
6d270bf
script fixes
antirotor Sep 3, 2021
d260958
try to get error log from failed build
antirotor Sep 6, 2021
5e84471
Merge remote-tracking branch 'origin/develop' into bugfix/linux-build
antirotor Sep 8, 2021
46697d8
fix docker build, switch to cx_freeze 6.7
antirotor Sep 8, 2021
6cced73
change to debian, add platform selection
antirotor Sep 9, 2021
d90a866
add changes to docs 📜
antirotor Sep 9, 2021
aa9a945
remove devtoolset-7 from centos build
antirotor Sep 15, 2021
03ced72
Merge remote-tracking branch 'origin/bugfix/linux-build' into feature…
antirotor Sep 20, 2021
595f441
remove submodules
antirotor Sep 20, 2021
c2a5182
add more required libraries to centos docker
iLLiCiTiT Sep 22, 2021
3d1f4fc
fixed endline
iLLiCiTiT Sep 22, 2021
a10f237
define openpype_root in build_dependencies
iLLiCiTiT Sep 22, 2021
cd52b1e
added rpath modifications using patchelf
iLLiCiTiT Sep 22, 2021
da57732
removed PyQt special code
iLLiCiTiT Sep 22, 2021
39eb48a
removed pyqt5 from poetry.lock
iLLiCiTiT Sep 22, 2021
0bbea71
added current develop lock file
iLLiCiTiT Sep 22, 2021
7a34b72
change cx freeze
iLLiCiTiT Sep 22, 2021
0e9ece1
define requests version
iLLiCiTiT Sep 22, 2021
3cff1e3
added info about thirdparty python modules and about PySide2
iLLiCiTiT Sep 23, 2021
b7fee7f
remove sql drivers on mac
iLLiCiTiT Sep 23, 2021
22664f7
removed not needed packages
iLLiCiTiT Sep 23, 2021
947139f
downgrade setuptools
antirotor Oct 6, 2021
4d61293
pyproject parser for shell scripts
antirotor Oct 7, 2021
9f9caaf
reinstall cx_freeze with downgraded setuptools
antirotor Oct 7, 2021
4276f34
fix hound
antirotor Oct 7, 2021
1c13ce2
Merge branch 'develop' into feature/move-to-pyside2
antirotor Oct 7, 2021
10dd583
Merge branch 'develop' into feature/move-to-pyside2
iLLiCiTiT Oct 11, 2021
c8b1037
added few magic attributes to getattr
iLLiCiTiT Oct 11, 2021
45b3979
removed boolean from setFocus
iLLiCiTiT Oct 11, 2021
e3303f8
avoid garbage collection of clipboard
iLLiCiTiT Oct 11, 2021
26790f6
openpype tray does not require to use it's qapplication
iLLiCiTiT Oct 13, 2021
c9b760f
stop all threads in ftrack
iLLiCiTiT Oct 13, 2021
339df3a
wait for idle manager stop
iLLiCiTiT Oct 13, 2021
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
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand Down Expand Up @@ -142,5 +142,6 @@ cython_debug/
.poetry/
.github/
vendor/bin/
vendor/python/
docs/
website/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Temporary Items
/dist/

/vendor/bin/*
/vendor/python/*
/.venv
/venv/

Expand Down
83 changes: 35 additions & 48 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,64 +1,59 @@
# Build Pype docker image
FROM centos:7 AS builder
ARG OPENPYPE_PYTHON_VERSION=3.7.10
FROM debian:bookworm-slim AS builder
ARG OPENPYPE_PYTHON_VERSION=3.7.12

LABEL maintainer="info@openpype.io"
LABEL description="Docker Image to build and run OpenPype"
LABEL org.opencontainers.image.name="pypeclub/openpype"
LABEL org.opencontainers.image.title="OpenPype Docker Image"
LABEL org.opencontainers.image.url="https://openpype.io/"
LABEL org.opencontainers.image.source="https://github.com/pypeclub/pype"

USER root

# update base
RUN yum -y install deltarpm \
&& yum -y update \
&& yum clean all
ARG DEBIAN_FRONTEND=noninteractive

# add tools we need
RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
&& yum -y install centos-release-scl \
&& yum -y install \
# update base
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
bash \
which \
git \
devtoolset-7-gcc* \
make \
cmake \
make \
curl \
wget \
gcc \
zlib-devel \
bzip2 \
bzip2-devel \
readline-devel \
sqlite sqlite-devel \
openssl-devel \
tk-devel libffi-devel \
qt5-qtbase-devel \
patchelf \
&& yum clean all
build-essential \
checkinstall \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
llvm \
libncursesw5-dev \
xz-utils \
tk-dev \
libxml2-dev \
libxmlsec1-dev \
libffi-dev \
liblzma-dev \
patchelf

RUN mkdir /opt/openpype
# RUN useradd -m pype
# RUN chown pype /opt/openpype
# USER pype
SHELL ["/bin/bash", "-c"]

RUN curl https://pyenv.run | bash
ENV PYTHON_CONFIGURE_OPTS --enable-shared
RUN mkdir /opt/openpype

RUN echo 'export PATH="$HOME/.pyenv/bin:$PATH"'>> $HOME/.bashrc \
RUN curl https://pyenv.run | bash \
&& echo 'export PATH="$HOME/.pyenv/bin:$PATH"'>> $HOME/.bashrc \
&& echo 'eval "$(pyenv init -)"' >> $HOME/.bashrc \
&& echo 'eval "$(pyenv virtualenv-init -)"' >> $HOME/.bashrc \
&& echo 'eval "$(pyenv init --path)"' >> $HOME/.bashrc
RUN source $HOME/.bashrc && pyenv install ${OPENPYPE_PYTHON_VERSION}
&& echo 'eval "$(pyenv init --path)"' >> $HOME/.bashrc \
&& source $HOME/.bashrc && pyenv install ${OPENPYPE_PYTHON_VERSION}

COPY . /opt/openpype/
RUN rm -rf /openpype/.poetry || echo "No Poetry installed yet."
# USER root
# RUN chown -R pype /opt/openpype
RUN chmod +x /opt/openpype/tools/create_env.sh && chmod +x /opt/openpype/tools/build.sh

# USER pype
RUN chmod +x /opt/openpype/tools/create_env.sh && chmod +x /opt/openpype/tools/build.sh

WORKDIR /opt/openpype

Expand All @@ -67,16 +62,8 @@ RUN cd /opt/openpype \
&& pyenv local ${OPENPYPE_PYTHON_VERSION}

RUN source $HOME/.bashrc \
&& ./tools/create_env.sh

RUN source $HOME/.bashrc \
&& ./tools/create_env.sh \
&& ./tools/fetch_thirdparty_libs.sh

RUN source $HOME/.bashrc \
&& bash ./tools/build.sh \
&& cp /usr/lib64/libffi* ./build/exe.linux-x86_64-3.7/lib \
&& cp /usr/lib64/libssl* ./build/exe.linux-x86_64-3.7/lib \
&& cp /usr/lib64/libcrypto* ./build/exe.linux-x86_64-3.7/lib

RUN cd /opt/openpype \
rm -rf ./vendor/bin
&& bash ./tools/build.sh
98 changes: 98 additions & 0 deletions Dockerfile.centos7
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Build Pype docker image
FROM centos:7 AS builder
ARG OPENPYPE_PYTHON_VERSION=3.7.10

LABEL org.opencontainers.image.name="pypeclub/openpype"
LABEL org.opencontainers.image.title="OpenPype Docker Image"
LABEL org.opencontainers.image.url="https://openpype.io/"
LABEL org.opencontainers.image.source="https://github.com/pypeclub/pype"

USER root

# update base
RUN yum -y install deltarpm \
&& yum -y update \
&& yum clean all

# add tools we need
RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
&& yum -y install centos-release-scl \
&& yum -y install \
bash \
which \
git \
make \
devtoolset-7 \
cmake \
curl \
wget \
gcc \
zlib-devel \
bzip2 \
bzip2-devel \
readline-devel \
sqlite sqlite-devel \
openssl-devel \
openssl-libs \
tk-devel libffi-devel \
patchelf \
automake \
autoconf \
ncurses \
ncurses-devel \
qt5-qtbase-devel \
&& yum clean all

# we need to build our own patchelf
WORKDIR /temp-patchelf
RUN git clone https://github.com/NixOS/patchelf.git . \
&& source scl_source enable devtoolset-7 \
&& ./bootstrap.sh \
&& ./configure \
&& make \
&& make install

RUN mkdir /opt/openpype
# RUN useradd -m pype
# RUN chown pype /opt/openpype
# USER pype

RUN curl https://pyenv.run | bash
# ENV PYTHON_CONFIGURE_OPTS --enable-shared

RUN echo 'export PATH="$HOME/.pyenv/bin:$PATH"'>> $HOME/.bashrc \
&& echo 'eval "$(pyenv init -)"' >> $HOME/.bashrc \
&& echo 'eval "$(pyenv virtualenv-init -)"' >> $HOME/.bashrc \
&& echo 'eval "$(pyenv init --path)"' >> $HOME/.bashrc
RUN source $HOME/.bashrc && pyenv install ${OPENPYPE_PYTHON_VERSION}

COPY . /opt/openpype/
RUN rm -rf /openpype/.poetry || echo "No Poetry installed yet."
# USER root
# RUN chown -R pype /opt/openpype
RUN chmod +x /opt/openpype/tools/create_env.sh && chmod +x /opt/openpype/tools/build.sh

# USER pype

WORKDIR /opt/openpype

RUN cd /opt/openpype \
&& source $HOME/.bashrc \
&& pyenv local ${OPENPYPE_PYTHON_VERSION}

RUN source $HOME/.bashrc \
&& ./tools/create_env.sh

RUN source $HOME/.bashrc \
&& ./tools/fetch_thirdparty_libs.sh

RUN source $HOME/.bashrc \
&& bash ./tools/build.sh

RUN cp /usr/lib64/libffi* ./build/exe.linux-x86_64-3.7/lib \
&& cp /usr/lib64/libssl* ./build/exe.linux-x86_64-3.7/lib \
&& cp /usr/lib64/libcrypto* ./build/exe.linux-x86_64-3.7/lib \
&& cp /root/.pyenv/versions/${OPENPYPE_PYTHON_VERSION}/lib/libpython* ./build/exe.linux-x86_64-3.7/lib

RUN cd /opt/openpype \
rm -rf ./vendor/bin
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ Easiest way to build OpenPype on Linux is using [Docker](https://www.docker.com/
sudo ./tools/docker_build.sh
```

This will by default use Debian as base image. If you need to make Centos 7 compatible build, please run:

```sh
sudo ./tools/docker_build.sh centos7
```

If all is successful, you'll find built OpenPype in `./build/` folder.

#### Manual build
Expand All @@ -158,6 +164,11 @@ you'll need also additional libraries for Qt5:
```sh
sudo apt install qt5-default
```
or if you are on Ubuntu > 20.04, there is no `qt5-default` packages so you need to install its content individually:

```sh
sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
```
</details>

<details>
Expand Down
5 changes: 4 additions & 1 deletion openpype/modules/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(self, name):

def __getattr__(self, attr_name):
if attr_name not in self.__attributes__:
if attr_name in ("__path__"):
if attr_name in ("__path__", "__file__"):
return None
raise ImportError("No module named {}.{}".format(
self.name, attr_name
Expand Down Expand Up @@ -104,6 +104,9 @@ class _InterfacesClass(_ModuleClass):
"""
def __getattr__(self, attr_name):
if attr_name not in self.__attributes__:
if attr_name in ("__path__", "__file__"):
return None

# Fake Interface if is not missing
self.__attributes__[attr_name] = type(
attr_name,
Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/default_modules/ftrack/ftrack_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def tray_start(self):
return self.tray_module.validate()

def tray_exit(self):
return self.tray_module.stop_action_server()
self.tray_module.tray_exit()

def set_credentials_to_env(self, username, api_key):
os.environ["FTRACK_API_USER"] = username or ""
Expand Down
4 changes: 4 additions & 0 deletions openpype/modules/default_modules/ftrack/tray/ftrack_tray.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ def tray_menu(self, parent_menu):

parent_menu.addMenu(tray_menu)

def tray_exit(self):
self.stop_action_server()
self.stop_timer_thread()

# Definition of visibility of each menu actions
def set_menu_visibility(self):
self.tray_server_menu.menuAction().setVisible(self.bool_logged)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def tray_start(self, *_a, **_kw):
def tray_exit(self):
if self._idle_manager:
self._idle_manager.stop()
self._idle_manager.wait()

def start_timer(self, project_name, asset_name, task_name, hierarchy):
"""
Expand Down
3 changes: 2 additions & 1 deletion openpype/tools/settings/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ def copy_value():
def _paste_value_actions(self, menu):
output = []
# Allow paste of value only if were copied from this UI
mime_data = QtWidgets.QApplication.clipboard().mimeData()
clipboard = QtWidgets.QApplication.clipboard()
mime_data = clipboard.mimeData()
mime_value = mime_data.data("application/copy_settings_value")
# Skip if there is nothing to do
if not mime_value:
Expand Down
2 changes: 1 addition & 1 deletion openpype/tools/settings/settings/categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ def items_are_valid(self):
first_invalid_item = invalid_items[0]
self.scroll_widget.ensureWidgetVisible(first_invalid_item)
if first_invalid_item.isVisible():
first_invalid_item.setFocus(True)
first_invalid_item.setFocus()
return False

def on_saved(self, saved_tab_widget):
Expand Down
6 changes: 3 additions & 3 deletions openpype/tools/settings/settings/dict_mutable_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ def __init__(self, entity_widget, store_as_list, parent):
def add_new_item(self, key=None, label=None):
input_field = self.entity_widget.add_new_key(key, label)
if self.collapsible_key:
self.key_input.setFocus(True)
self.key_input.setFocus()
else:
input_field.key_input.setFocus(True)
input_field.key_input.setFocus()
return input_field

def _on_add_clicked(self):
Expand Down Expand Up @@ -563,7 +563,7 @@ def update_key_label(self):

def on_add_clicked(self):
widget = self.entity_widget.add_new_key(None, None)
widget.key_input.setFocus(True)
widget.key_input.setFocus()

def on_edit_pressed(self):
if not self.key_input.isVisible():
Expand Down
2 changes: 1 addition & 1 deletion openpype/tools/settings/settings/list_item_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def add_new_item(self, row=None):
new_entity = self.entity.add_new_item(row)
input_field = self._input_fields_by_entity_id.get(new_entity.id)
if input_field is not None:
input_field.input_field.setFocus(True)
input_field.input_field.setFocus()
return new_entity

def add_row(self, child_entity, row=None):
Expand Down
Loading