mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
fix appdirs dependency
This commit is contained in:
parent
44cde1cbc3
commit
ff64a27ced
7 changed files with 85 additions and 14 deletions
|
|
@ -0,0 +1,14 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Open install dialog."""
|
||||
|
||||
import sys
|
||||
from Qt import QtWidgets
|
||||
|
||||
from .install_dialog import InstallDialog
|
||||
|
||||
|
||||
def run():
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
d = InstallDialog()
|
||||
d.show()
|
||||
sys.exit(app.exec_())
|
||||
|
|
@ -14,7 +14,7 @@ from typing import Union, Callable
|
|||
from zipfile import ZipFile
|
||||
|
||||
from appdirs import user_data_dir
|
||||
from version import __version__
|
||||
from pype.version import __version__
|
||||
|
||||
|
||||
class BootstrapRepos():
|
||||
|
|
@ -167,4 +167,16 @@ class BootstrapRepos():
|
|||
archive (str): path to archive.
|
||||
|
||||
"""
|
||||
pass
|
||||
name_list = []
|
||||
with ZipFile(archive, "r") as zip:
|
||||
name_list = zip.namelist()
|
||||
|
||||
roots = []
|
||||
for item in name_list:
|
||||
root = item.split("/")[0]
|
||||
if root not in roots:
|
||||
roots.append(root)
|
||||
sys.path.append(f"{archive}{os.path.sep}{root}")
|
||||
|
||||
os.environ["PYTHONPATH"] = "{}{}{}".format(
|
||||
os.environ["PYTHONPATH"], os.pathsep, os.pathsep.join(roots))
|
||||
|
|
|
|||
3
pype.py
3
pype.py
|
|
@ -8,7 +8,7 @@ from appdirs import user_data_dir
|
|||
|
||||
from pype import cli
|
||||
from pype.lib import terminal as t
|
||||
from version import __version__
|
||||
from pype.version import __version__
|
||||
|
||||
|
||||
vendor = "pypeclub"
|
||||
|
|
@ -35,7 +35,6 @@ print(art)
|
|||
t.echo(f"*** Pype [{__version__}] --------------------")
|
||||
t.echo(">>> Validating installation ...")
|
||||
|
||||
t.echo(sys.executable)
|
||||
try:
|
||||
cli.main(obj={}, prog_name="pype")
|
||||
except Exception:
|
||||
|
|
|
|||
29
setup.cfg
29
setup.cfg
|
|
@ -20,3 +20,32 @@ omit = /tests
|
|||
|
||||
[coverage:html]
|
||||
directory = ./coverage
|
||||
|
||||
[tox:tox]
|
||||
envlist =
|
||||
py37
|
||||
docs
|
||||
requires =
|
||||
cx_Freeze
|
||||
|
||||
[testenv:py37]
|
||||
deps =
|
||||
pytest
|
||||
cx_Freeze
|
||||
commands =
|
||||
pytest -x --capture=sys --print -W ignore::DeprecationWarning {toxinidir}/tests
|
||||
|
||||
[testenv:docs]
|
||||
skipsdist = True
|
||||
usedevelop = True
|
||||
changedir = doc/en
|
||||
deps =
|
||||
cx_Freeze
|
||||
attrs
|
||||
more-itertools
|
||||
PyYAML
|
||||
sphinx
|
||||
sphinxcontrib-trio
|
||||
|
||||
commands =
|
||||
sphinx-build -W -b html . _build
|
||||
|
|
|
|||
17
setup.py
17
setup.py
|
|
@ -1,12 +1,18 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Setup info for building Pype 3.0."""
|
||||
import sys
|
||||
import os
|
||||
from cx_Freeze import setup, Executable
|
||||
from version import __version__
|
||||
|
||||
version = {}
|
||||
with open(os.path.join("pype", "version.py")) as fp:
|
||||
exec(fp.read(), version)
|
||||
__version__ = version['__version__']
|
||||
|
||||
|
||||
install_requires = [
|
||||
"appdirs"
|
||||
"appdirs",
|
||||
"cx_Freeze",
|
||||
"clique",
|
||||
"jsonschema",
|
||||
"OpenTimelineIO",
|
||||
|
|
@ -14,7 +20,7 @@ install_requires = [
|
|||
"PIL",
|
||||
"pymongo",
|
||||
"Qt",
|
||||
"speedcopy",
|
||||
"speedcopy"
|
||||
]
|
||||
|
||||
base = None
|
||||
|
|
@ -25,6 +31,7 @@ if sys.platform == "win32":
|
|||
buildOptions = dict(
|
||||
packages=install_requires,
|
||||
includes=[
|
||||
'pype',
|
||||
'repos/acre/acre',
|
||||
'repos/avalon-core/avalon',
|
||||
'repos/pyblish-base/pyblish',
|
||||
|
|
@ -38,7 +45,7 @@ buildOptions = dict(
|
|||
"vendor",
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"version"]
|
||||
"pype/version.py"]
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -49,5 +56,5 @@ setup(
|
|||
version=__version__,
|
||||
description="Ultimate pipeline",
|
||||
options=dict(build_exe=buildOptions),
|
||||
executables=executables,
|
||||
executables=executables
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Test suite for repos bootstrapping (install)."""
|
||||
import os
|
||||
import sys
|
||||
import pytest
|
||||
from igniter.bootstrap_repos import BootstrapRepos
|
||||
|
||||
|
|
@ -15,7 +16,19 @@ def fix_bootrap(tmp_path_factory):
|
|||
|
||||
|
||||
def test_install_live_repos(fix_bootrap, printer):
|
||||
printer(f"repo: {fix_bootrap.live_repo_dir}")
|
||||
printer(f"data: {fix_bootrap.data_dir}")
|
||||
rf = fix_bootrap.install_live_repos()
|
||||
expected_paths = [
|
||||
f"{rf}{os.path.sep}acre",
|
||||
f"{rf}{os.path.sep}avalon-core",
|
||||
f"{rf}{os.path.sep}avalon-unreal-integration",
|
||||
f"{rf}{os.path.sep}maya-look-assigner",
|
||||
f"{rf}{os.path.sep}pyblish-base",
|
||||
f"{rf}{os.path.sep}pype",
|
||||
f"{rf}{os.path.sep}pype-config"
|
||||
]
|
||||
assert os.path.exists(rf), "zip archive was not created"
|
||||
fix_bootrap.add_paths_from_archive(rf)
|
||||
for ep in expected_paths:
|
||||
assert ep in sys.path, f"{ep} not set correctly"
|
||||
|
||||
import pype
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Pype version specific metadata."""
|
||||
__version__ = "3.0.0"
|
||||
Loading…
Add table
Add a link
Reference in a new issue