move acre and pyblish-base to requirements

This commit is contained in:
Ondrej Samohel 2021-01-12 12:00:40 +01:00
parent bc9a7c1989
commit cd15d111f3
No known key found for this signature in database
GPG key ID: 02376E18990A97C6
6 changed files with 64 additions and 28 deletions

7
.gitmodules vendored
View file

@ -2,19 +2,12 @@
path = repos/avalon-core
url = git@github.com:pypeclub/avalon-core.git
branch = develop
[submodule "repos/pyblish-base"]
path = repos/pyblish-base
url = git@github.com:pyblish/pyblish-base.git
[submodule "repos/avalon-unreal-integration"]
path = repos/avalon-unreal-integration
url = git@github.com:pypeclub/avalon-unreal-integration.git
[submodule "repos/maya-look-assigner"]
path = repos/maya-look-assigner
url = git@github.com:pypeclub/maya-look-assigner.git
[submodule "repos/acre"]
path = repos/acre
url = git@github.com:antirotor/acre.git
branch = fix/unformatted-tokens
[submodule "pype/modules/ftrack/python2_vendor/ftrack-python-api"]
path = pype/modules/ftrack/python2_vendor/ftrack-python-api
url = https://bitbucket.org/ftrack/ftrack-python-api.git

View file

@ -13,7 +13,6 @@ PS> .\build.ps1
#>
function Exit-WithCode($exitcode) {
# Only exit this host process if it's a child of another PowerShell parent process...
$parentPID = (Get-CimInstance -ClassName Win32_Process -Filter "ProcessId=$PID" | Select-Object -Property ParentProcessId).ParentProcessId
@ -23,6 +22,18 @@ function Exit-WithCode($exitcode) {
exit $exitcode
}
if ($PSVersionTable.PSVersion.Major -lt 7) {
Write-Host "!!! " -NoNewline -ForegroundColor Red
Write-Host "You are using old version of PowerShell. $($PSVersionTable.PSVersion.Major).$($PSVersionTable.PSVersion.Minor)"
Write-Host "Please update to at least 7.0 - https://github.com/PowerShell/PowerShell/releases"
Exit-WithCode 1
}
$arguments=$ARGS
if($arguments -eq "--skip-venv") {
$skip_venv=$true
}
$art = @'
@ -76,22 +87,39 @@ if(($matches[1] -lt 3) -or ($matches[2] -lt 7)) {
Exit-WithCode 1
}
Write-Host "OK [ $p ]" -ForegroundColor green
Write-Host ">>> " -NoNewline -ForegroundColor green
Write-Host "Creating virtual env ..."
& python -m venv venv
Write-Host ">>> " -NoNewline -ForegroundColor green
Write-Host "Entering venv ..."
try {
. (".\venv\Scripts\Activate.ps1")
if ($skip_venv -ne $true) {
Write-Host ">>> " -NoNewline -ForegroundColor green
Write-Host "Creating virtual env ..."
& python -m venv venv
Write-Host ">>> " -NoNewline -ForegroundColor green
Write-Host "Entering venv ..."
try {
. (".\venv\Scripts\Activate.ps1")
}
catch {
Write-Host "!!! Failed to activate" -ForegroundColor red
Write-Host $_.Exception.Message
Exit-WithCode 1
}
Write-Host ">>> " -NoNewline -ForegroundColor green
Write-Host "Installing packages to new venv ..."
& pip install -r .\requirements.txt
} else {
Write-Host "*** " -NoNewline -ForegroundColor yellow
Write-Host "Skipping creaton of venv ..."
Write-Host ">>> " -NoNewline -ForegroundColor green
Write-Host "Entering venv ..."
try {
. (".\venv\Scripts\Activate.ps1")
}
catch {
Write-Host "!!! Failed to activate" -ForegroundColor red
Write-Host $_.Exception.Message
Exit-WithCode 1
}
}
catch {
Write-Host "!!! Failed to activate" -ForegroundColor red
Write-Host $_.Exception.Message
Exit-WithCode 1
}
Write-Host ">>> " -NoNewline -ForegroundColor green
Write-Host "Installing packages to new venv ..."
& pip install -r .\requirements.txt
Write-Host ">>> " -NoNewline -ForegroundColor green
Write-Host "Cleaning cache files ... " -NoNewline
@ -99,7 +127,21 @@ Get-ChildItem . -Filter "*.pyc" -Force -Recurse | Remove-Item -Force
Get-ChildItem . -Filter "__pycache__" -Force -Recurse | Remove-Item -Force -Recurse
Write-Host "OK" -ForegroundColor green
# store original PYTHONPATH
Write-Host ">>> " -NoNewline -ForegroundColor green
Write-Host "Storing original PYTHONPATH ... " -NoNewline
$original_pythonpath = $env:PYTHONPATH
Write-Host "OK" -ForegroundColor green
$new_pythonpath = Get-ChildItem -Directory -Path .\ | Microsoft.PowerShell.Utility\Join-String -Property FullName -DoubleQuote -Separator ';'
$env:PYTHONPATH = $env:PYTHONPATH + ";" + $new_pythonpath
Write-Host ">>> " -NoNewline -ForegroundColor green
Write-Host "Adding repos to PYTHONPATH ..."
Write-Host ">>> " -NoNewline -ForegroundColor green
Write-Host "Building Pype ..."
& python setup.py build
Write-Host ">>> " -NoNewline -ForegroundColor green
Write-Host "Restoring original PYTHONPATH ... " -NoNewline
$env:PYTHONPATH = $original_pythonpath
Write-Host "OK" -ForegroundColor green
deactivate

View file

@ -82,13 +82,13 @@ def validate_path_string(path: str) -> (bool, str):
def add_acre_to_sys_path():
"""Add full path of acre module to sys.path on ignitation."""
"""Add full path of acre module to sys.path on ignition."""
try:
# Skip if is possible to import
import acre
except ImportError:
# Full path to acred repository related to current file
# Full path to acre repository related to current file
acre_dir = os.path.join(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
"repos",

View file

@ -1,3 +1,4 @@
git+https://github.com/antirotor/acre.git@fix/unformatted-tokens
aiohttp
aiohttp_json_rpc
appdirs
@ -18,6 +19,7 @@ log4mongo
git+https://github.com/pypeclub/OpenTimelineIO.git@develop
pathlib2
Pillow
pyblish-base
pycodestyle
pydocstyle
pylint

View file

@ -73,8 +73,8 @@ buildOptions = dict(
executables = [
Executable("start.py", base=None, targetName="pype_console"),
Executable("start.py", base=base, targetName="pype")
Executable("start.py", base=None, target_name="pype_console"),
Executable("start.py", base=base, target_name="pype")
]
setup(

View file

@ -110,7 +110,6 @@ def set_environments() -> None:
better handling of environments
"""
# FIXME: remove everything except global
env = load_environments(["global"])
env = acre.merge(env, dict(os.environ))
os.environ.clear()