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

Commit

Permalink
Merge pull request #1744 from pypeclub/feature/move-to-pyside2
Browse files Browse the repository at this point in the history
  • Loading branch information
mkolar authored Oct 18, 2021
2 parents 8ef626e + 339df3a commit 7c2da65
Show file tree
Hide file tree
Showing 26 changed files with 475 additions and 223 deletions.
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

0 comments on commit 7c2da65

Please sign in to comment.