diff --git a/.github/actions/setup-python/action.yaml b/.github/actions/setup-python/action.yaml
index 923755939..f18e01968 100644
--- a/.github/actions/setup-python/action.yaml
+++ b/.github/actions/setup-python/action.yaml
@@ -15,7 +15,7 @@ runs:
steps:
- name: Set up Python ${{ inputs.python-version }} with actions/setup-python
if: ${{ inputs.python-version != '2.7' }}
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 000000000..07123dde9
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,21 @@
+# Set update schedule for GitHub Actions
+version: 2
+updates:
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ # Check for updates to GitHub Actions every week
+ interval: "weekly"
+
+ # https://github.com/dependabot/dependabot-core/issues/6704
+ - package-ecosystem: "github-actions"
+ directory: "/.github/actions/setup-python"
+ schedule:
+ # Check for updates to GitHub Actions every week
+ interval: "weekly"
+
+ - package-ecosystem: "pip"
+ directory: "/docs"
+ schedule:
+ # Check for updates to GitHub Actions every week
+ interval: "weekly"
diff --git a/.github/docker/rez-win-base/Dockerfile b/.github/docker/rez-win-base/Dockerfile
deleted file mode 100644
index 3d97e70a0..000000000
--- a/.github/docker/rez-win-base/Dockerfile
+++ /dev/null
@@ -1,34 +0,0 @@
-# escape=`
-
-# Please Note: Any " requires \" in the Dockerfile for windows.
-
-ARG WINDOWS_VERSION
-FROM mcr.microsoft.com/windows/servercore:$WINDOWS_VERSION
-
-LABEL org.opencontainers.image.description="WARNING: This is an internal image and should not be used outside of the rez repository!"
-
-SHELL ["powershell.exe", "-NoLogo", "-NoProfile", "-ExecutionPolicy", "ByPass"]
-
-ARG GIT_VERSION=2.23.0
-ARG CMAKE_VERSION=3.15.4
-ARG PWSH_VERSION=6.2.2
-
-# ------------------------------------------------------------------------------------------------------------
-# Install:
-# - Chocolatey
-# - Git
-# - Cmake
-# - PowerShellCore
-#
-ENV chocolateyUseWindowsCompression false
-ENV chocolateyVersion=1.4.0
-RUN iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')); `
- choco feature disable --name showDownloadProgress; `
- choco install git.install --yes --version=${ENV:GIT_VERSION}; `
- choco install cmake --yes --version=${ENV:CMAKE_VERSION} --installargs 'ADD_CMAKE_TO_PATH=System'; `
- choco install pwsh --yes --version=${PWSH_VERSION}; `
- choco install --yes choco-cleaner; `
- C:\ProgramData\chocolatey\bin\choco-cleaner.bat; `
- choco uninstall --yes choco-cleaner
-
-ENTRYPOINT ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "ByPass"]
diff --git a/.github/docker/rez-win-py/Dockerfile b/.github/docker/rez-win-py/Dockerfile
deleted file mode 100644
index ab14b55bc..000000000
--- a/.github/docker/rez-win-py/Dockerfile
+++ /dev/null
@@ -1,65 +0,0 @@
-# escape=`
-
-ARG BASE_IMAGE_NAME
-FROM $BASE_IMAGE_NAME
-
-LABEL org.opencontainers.image.description="WARNING: This is an internal image and should not be used outside of the rez repository!"
-
-# Name of this image
-ARG IMAGE_NAME
-ENV _IMAGE_NAME=$IMAGE_NAME
-
-# NOTE: Any " requires \" in the Dockerfile for windows.
-# NOTE: The order matters. ARG after the shell command will allow access via
-# the PowerShell environment like ${ENV:PYTHON_VERSION}.
-SHELL ["powershell.exe", "-NoLogo", "-NoProfile", "-ExecutionPolicy", "ByPass"]
-
-# Python version to install (full chocolatey compatible version required)
-# For example: 3.7.5
-#
-ARG PYTHON_VERSION
-
-
-# ------------------------------------------------------------------------------------------------------------
-# Python
-#
-# Installs given Python version to C:\Python
-# Python 2.x uses msi while 3.x has an exe with separate arguments
-# Verifies the installation by running python explicitly and via `python`
-#
-RUN ${PYTHON_INSTALL_PATH} = 'C:\Python'; `
- ${PYTHON_MAJOR_VERSION} = ${ENV:PYTHON_VERSION}.Split('.')[0]; `
- if (${PYTHON_MAJOR_VERSION} -eq "2") { `
- ${INSTALLARGS} = \"'/qn /norestart ADDLOCAL=ALL ALLUSERS=1 TARGETDIR=`\"\" + ${PYTHON_INSTALL_PATH} + \"`\"'\"; `
- } else { `
- ${INSTALLARGS} = \"'/quiet InstallAllUsers=1 PrependPath=1 TargetDir=`\"\" + ${PYTHON_INSTALL_PATH} + \"`\"'\"; `
- } `
- choco install python${PYTHON_MAJOR_VERSION} --yes --version=\"${ENV:PYTHON_VERSION}\" --override --installargs=${INSTALLARGS}; `
- if (-not $?) {exit 1}
-
-# Verify
-RUN $python_relative_ver = (& python --version 2>&1).ToString().Trim().Split(" ")[1]; `
- $python_explicit_ver = (& C:\python\python.exe --version 2>&1).ToString().Trim().Split(" ")[1]; `
- if (-not $?) {exit 1}; `
- $python_relative_ver = (& python --version 2>&1).ToString().Trim().Split(" ")[1]; `
- $python_explicit_ver = (& C:\python\python.exe --version 2>&1).ToString().Trim().Split(" ")[1]; `
- if (-not ($python_explicit_ver -eq $python_relative_ver -and $python_explicit_ver -eq ${ENV:PYTHON_VERSION})) {exit 1}
-
-
-# ------------------------------------------------------------------------------------------------------------
-# Git Bash (git for windows)
-#
-RUN choco install git --yes --params "/GitAndUnixToolsOnPath"
-
-
-# ------------------------------------------------------------------------------------------------------------
-# Cleanup
-#
-RUN choco install --yes choco-cleaner; `
- C:\ProgramData\chocolatey\bin\choco-cleaner.bat; `
- choco uninstall --yes choco-cleaner
-
-
-COPY entrypoint.ps1 /entrypoint.ps1
-
-ENTRYPOINT ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "ByPass", "-File", "/entrypoint.ps1"]
diff --git a/.github/docker/rez-win-py/entrypoint.ps1 b/.github/docker/rez-win-py/entrypoint.ps1
deleted file mode 100644
index 0ac074073..000000000
--- a/.github/docker/rez-win-py/entrypoint.ps1
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# Entrypoint that installs given python version and runs tests.
-#
-
-# Stop on errors; .exe has to be checked manually
-Set-StrictMode -Version latest
-$ErrorActionPreference = "Stop"
-
-# Fixes encoding issue on Windows 10 local docker run.
-#
-${ENV:PYTHONIOENCODING} = "UTF-8"
-
-# Print name of image being run, for debugging purposes
-Write-Output "Using docker image ${ENV:_IMAGE_NAME}"
-
-# Verify Python
-Write-Output "python found at $((Get-Command python).Path)"
-python --version
-if (-not $?) {exit 1}
-
-# Verify cmake
-Write-Output "cmake found at $((Get-Command cmake).Path)"
-cmake.exe --version
-if (-not $?) {exit 1}
-
-# Verify pwsh
-Write-Output "pwsh found at $((Get-Command pwsh).Path)"
-pwsh --version
-if (-not $?) {exit 1}
-
-# Verify git
-Write-Output "git found at $((Get-Command git).Path)"
-git --version
-if (-not $?) {exit 1}
-
-# Verify git-bash
-Write-Output "bash (via Git for windows) found at $((Get-Command bash).Path)"
-bash --version
-if (-not $?) {exit 1}
-
-# Install rez
-# Note that the workflow's checkout has been bind mounted to /checkout
-mkdir installdir
-python .\checkout\install.py installdir
-if (-not $?) {exit 1}
-
-# Install pytest for better rez-selftest output
-.\installdir\Scripts\rez\rez-python -m pip install pytest-cov
-.\installdir\Scripts\rez\rez-python -m pip install parameterized
-
-# Run Rez Tests
-.\installdir\Scripts\rez\rez-selftest.exe -v
-
-# Pass on exit code to runner
-exit $LASTEXITCODE
diff --git a/.github/scripts/store_benchmark.py b/.github/scripts/store_benchmark.py
index 79fec9eab..d8cbb8c1e 100644
--- a/.github/scripts/store_benchmark.py
+++ b/.github/scripts/store_benchmark.py
@@ -59,7 +59,8 @@ def store_result():
destdir = '-'.join((
time.strftime("%Y.%m.%d"),
"%d.%d" % sys.version_info[:2],
- _rez_version
+ # TODO: We could read the version from summary.json...
+ _rez_version,
))
destpath = os.path.join(artifacts_dir, destdir)
diff --git a/.github/workflows/benchmark.yaml b/.github/workflows/benchmark.yaml
index 3f60adcf5..a91c4b641 100644
--- a/.github/workflows/benchmark.yaml
+++ b/.github/workflows/benchmark.yaml
@@ -5,27 +5,24 @@ name: benchmark
on:
release:
types: [released]
+ pull_request:
+ types: [opened, synchronize, reopened, labeled]
jobs:
run_benchmark:
name: run_benchmark
runs-on: ubuntu-latest
+ if: ${{ github.event_name == 'release' || contains(github.event.pull_request.labels.*.name, 'run-benchmarks') }}
+
strategy:
matrix:
python-version:
- - '2.7'
- '3.7'
- # without this, we're sometimes getting at the end of this job:
- # '[error] The operation was canceled'.
- # Do we hit a resource limit?
- #
- max-parallel: 1
-
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup python ${{ matrix.python-version }}
uses: ./.github/actions/setup-python
@@ -37,11 +34,6 @@ jobs:
run: |
mkdir ./installdir
- if [[ "${{ matrix.python-version }}" == "2.7" ]]; then
- eval "$(conda shell.bash hook)"
- conda activate python
- fi
-
python ./install.py ./installdir
- name: Run Benchmark
@@ -53,13 +45,9 @@ jobs:
- name: Validate Result
run: |
- if [[ "${{ matrix.python-version }}" == "2.7" ]]; then
- eval "$(conda shell.bash hook)"
- conda activate python
- fi
python ./.github/scripts/validate_benchmark.py
- - uses: actions/upload-artifact@v3
+ - uses: actions/upload-artifact@v4
with:
name: "benchmark-result-${{ matrix.python-version }}"
path: ./out
@@ -72,26 +60,20 @@ jobs:
strategy:
matrix:
python-version:
- - '2.7'
- '3.7'
# so we don't have jobs trying to push to git at the same time
max-parallel: 1
steps:
- - name: Setup python ${{ matrix.python-version }}
- uses: ./.github/actions/setup-python
- with:
- python-version: ${{ matrix.python-version }}
- os: ubuntu
-
- - uses: actions/download-artifact@v3
+ - uses: actions/download-artifact@v4
with:
name: "benchmark-result-${{ matrix.python-version }}"
path: .
- - name: Checkout
- uses: actions/checkout@v3
+ - name: Checkout (release)
+ uses: actions/checkout@v4
+ if: ${{ github.event_name =='release' }}
with:
ref: main
path: src
@@ -100,7 +82,20 @@ jobs:
# protected branch (main) from this workflow.
# See https://github.community/t/how-to-push-to-protected-branches-in-a-github-action/16101/14
#
- token: "${{ secrets.GH_ACTION_TOKEN }}"
+ # Disable for now until we find a better solution.
+ # token: "${{ secrets.GH_ACTION_TOKEN }}"
+
+ - name: Checkout (pr)
+ uses: actions/checkout@v4
+ if: ${{ github.event_name !='release' }}
+ with:
+ path: src
+
+ - name: Setup python ${{ matrix.python-version }}
+ uses: ./src/.github/actions/setup-python
+ with:
+ python-version: ${{ matrix.python-version }}
+ os: ubuntu-latest
# Note failing due to
# https://github.com/actions/virtual-environments/issues/675
@@ -114,26 +109,32 @@ jobs:
- name: Store Benchmark Result
run: |
- if [[ "${{ matrix.python-version }}" == "2.7" ]]; then
- eval "$(conda shell.bash hook)"
- conda activate python
- fi
python ./.github/scripts/store_benchmark.py
working-directory: src
- - name: Setup git config
+ - name: Create summary
run: |
- git config user.name 'github-actions[bot]'
- git config user.email 'github-actions[bot]@users.noreply.github.com'
+ echo '' >> $GITHUB_STEP_SUMMARY
+ echo 'Results
' >> $GITHUB_STEP_SUMMARY
+ cat metrics/benchmarking/RESULTS.md >> $GITHUB_STEP_SUMMARY
+ echo ' ' >> $GITHUB_STEP_SUMMARY
working-directory: src
- - name: Git commit and push
- run: |
- if [[ "$(git status --porcelain)" == "" ]]; then
- echo "Nothing new to commit"
- else
- git add --all
- git commit -m "Generated from GitHub "${{ github.workflow }}" Workflow"
- git push origin main
- fi
- working-directory: src
+ # - name: Setup git config
+ # if: ${{ github.event_name == 'release' }}
+ # run: |
+ # git config user.name 'github-actions[bot]'
+ # git config user.email 'github-actions[bot]@users.noreply.github.com'
+ # working-directory: src
+
+ # - name: Git commit and push
+ # if: ${{ github.event_name == 'release' }}
+ # run: |
+ # if [[ "$(git status --porcelain)" == "" ]]; then
+ # echo "Nothing new to commit"
+ # else
+ # git add --all
+ # git commit -m "Generated from GitHub "${{ github.workflow }}" Workflow"
+ # git push origin main
+ # fi
+ # working-directory: src
diff --git a/.github/workflows/copyright.yaml b/.github/workflows/copyright.yaml
index cbff3535f..2c4d48ae4 100644
--- a/.github/workflows/copyright.yaml
+++ b/.github/workflows/copyright.yaml
@@ -17,10 +17,10 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Set up Python
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: 3
diff --git a/.github/workflows/core.yaml b/.github/workflows/core.yaml
deleted file mode 100644
index f3a4719ea..000000000
--- a/.github/workflows/core.yaml
+++ /dev/null
@@ -1,84 +0,0 @@
-# Test core parts of the package, that are not:
-# * Shell dependent;
-# * Build-system dependent;
-# * Platform dependent.
-#
-name: core
-on:
- pull_request:
- paths:
- - 'src/**'
- - '.github/workflows/core.yaml'
- - '!src/rez/utils/_version.py'
- - '!**.md'
- push:
- paths:
- - 'src/**'
- - '.github/workflows/core.yaml'
- - '!src/rez/utils/_version.py'
- - '!**.md'
- workflow_dispatch:
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
-
-jobs:
- main:
- name: main
- runs-on: ubuntu-latest
-
- strategy:
- matrix:
- python-version:
- - '2.7'
- - '3.7'
- fail-fast: false
-
- steps:
- - name: Checkout
- uses: actions/checkout@v3
-
- - name: Setup python ${{ matrix.python-version }}
- uses: ./.github/actions/setup-python
- with:
- python-version: ${{ matrix.python-version }}
- os: ubuntu-latest
-
- - name: Install Rez
- shell: bash
- run: |
- set -ex
- mkdir ./installdir
-
- if [[ "${{ matrix.python-version }}" == "2.7" ]]; then
- eval "$(conda shell.bash hook)"
- conda activate python
- fi
-
- python --version
- python ./install.py ./installdir
-
- - name: Install Rez test dependencies
- run: |
- ./installdir/bin/rez/rez-python -m pip install pytest-cov
-
- # TODO: Add a --core rez-selftest option. Some test suites (eg test_context)
- # have some 'core' parts (eg not reliant on a shell). It would be good to just
- # run those parts when --core is present, rather than skipping the entire
- # test class. This will be easier once ported to pytest.
- - name: Run Rez Tests
- run: |
- ./installdir/bin/rez/rez-selftest -v \
- --config \
- --copy_package \
- --formatter \
- --imports \
- --packages \
- --package_filter \
- --packages_order \
- --resources_ \
- --rex \
- --schema \
- --solver \
- --version
diff --git a/.github/workflows/flake8.yaml b/.github/workflows/flake8.yaml
index ccf04c336..14221cfcb 100644
--- a/.github/workflows/flake8.yaml
+++ b/.github/workflows/flake8.yaml
@@ -26,10 +26,10 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Set up Python
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: 3.7
diff --git a/.github/workflows/installation.yaml b/.github/workflows/installation.yaml
index 567a28355..4eb671132 100644
--- a/.github/workflows/installation.yaml
+++ b/.github/workflows/installation.yaml
@@ -21,16 +21,9 @@ jobs:
strategy:
fail-fast: false
matrix:
- os:
- - ubuntu-latest
- - macos-latest
- - windows-2019
- python-version:
- - '2.7'
- - '3.7'
- method:
- - 'install'
- - 'pip'
+ os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
+ python-version: ['2.7', '3.7', '3.8', '3.9', '3.10', '3.11']
+ method: ['install' ,'pip']
include:
# ubuntu
@@ -83,7 +76,7 @@ jobs:
fi
pip install --target ~/rez .
# windows
- - os: windows-2019
+ - os: windows-latest
method: install
REZ_SET_PATH_COMMAND: '$env:PATH="$env:PATH;C:\ProgramData\rez\Scripts\rez"'
REZ_INSTALL_COMMAND: |
@@ -92,7 +85,7 @@ jobs:
conda activate python
}
python ./install.py C:\ProgramData\rez
- - os: windows-2019
+ - os: windows-latest
method: pip
REZ_SET_PATH_COMMAND: '[System.Environment]::SetEnvironmentVariable("PATH","$env:PATH;C:\ProgramData\rez\bin"); $env:PYTHONPATH="$env:PYTHONPATH;C:\ProgramData\rez"'
REZ_INSTALL_COMMAND: |
@@ -102,8 +95,12 @@ jobs:
}
pip install --target C:\ProgramData\rez .
+ exclude:
+ - method: install
+ python-version: '2.7'
+
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Setup python ${{ matrix.python-version }}
uses: ./.github/actions/setup-python
diff --git a/.github/workflows/mac.yaml b/.github/workflows/mac.yaml
deleted file mode 100644
index 97b2442d6..000000000
--- a/.github/workflows/mac.yaml
+++ /dev/null
@@ -1,72 +0,0 @@
-name: mac
-on:
- pull_request:
- paths:
- - 'src/**'
- - '.github/workflows/mac.yaml'
- - '!src/rez/utils/_version.py'
- - '!**.md'
- push:
- paths:
- - 'src/**'
- - '.github/workflows/mac.yaml'
- - '!src/rez/utils/_version.py'
- - '!**.md'
- workflow_dispatch:
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
-
-jobs:
- main:
- name: main
- runs-on: macos-${{ matrix.os-version }}
-
- strategy:
- matrix:
- os-version:
- - '11'
- python-version:
- - '2.7'
- - '3.7'
- fail-fast: false
-
- steps:
- - name: Checkout
- uses: actions/checkout@v2
-
- - name: Setup python ${{ matrix.python-version }}
- uses: ./.github/actions/setup-python
- with:
- python-version: ${{ matrix.python-version }}
- os: macos-latest
-
- - name: Verify cmake
- run: |
- cmake --version
-
- - name: Verify pwsh
- run: |
- pwsh --version
-
- - name: Install Rez
- run: |
- if [[ "${{ matrix.python-version }}" == "2.7" ]]; then
- eval "$(conda shell.bash hook)"
- conda activate python
- fi
- mkdir ./installdir
- python --version
- python ./install.py ./installdir
-
- - name: Install Rez test dependencies
- run: |
- ./installdir/bin/rez/rez-python -m pip install pytest-cov
- ./installdir/bin/rez/rez-python -m pip install parameterized
-
- - name: Run Rez Tests
- run: |
- ./installdir/bin/rez/rez-selftest -v
- env:
- _REZ_ENSURE_TEST_SHELLS: sh,csh,bash,tcsh,zsh,pwsh
diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml
index fdae3bca5..13566cc7b 100644
--- a/.github/workflows/pypi.yaml
+++ b/.github/workflows/pypi.yaml
@@ -5,28 +5,33 @@ on:
jobs:
publish:
- name: Publish to PyPi
+ name: Publish to PyPI
runs-on: ubuntu-latest
+ permissions:
+ # IMPORTANT: this permission is mandatory for trusted publishing
+ id-token: write
+
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Set up Python
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
- python-version: 3
+ python-version: 3.11
- name: Install Dependencies
run: |
- pip install wheel
+ pip install build
- name: Build rez
run: |
- python setup.py sdist bdist_wheel
+ python -m build --sdist --wheel --outdir dist .
- - name: Upload to PyPi
+ # Note that we don't need credentials.
+ # We rely on https://docs.pypi.org/trusted-publishers/.
+ - name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
- user: __token__
- password: '${{ secrets.PYPI_API_TOKEN }}'
+ packages-dir: dist
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
new file mode 100644
index 000000000..dc4fc0f0b
--- /dev/null
+++ b/.github/workflows/tests.yaml
@@ -0,0 +1,80 @@
+name: tests
+on:
+ pull_request:
+ paths:
+ - 'src/**'
+ - '.github/workflows/tests.yaml'
+ - '!src/rez/utils/_version.py'
+ - '!**.md'
+ push:
+ paths:
+ - 'src/**'
+ - '.github/workflows/tests.yaml'
+ - '!src/rez/utils/_version.py'
+ - '!**.md'
+ workflow_dispatch:
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ core:
+ name: Tests
+
+ runs-on: ${{ matrix.os }}
+
+ strategy:
+ matrix:
+ os: ['macos-latest', 'ubuntu-latest', 'windows-latest']
+ python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
+ include:
+ - os: macos-latest
+ shells: 'sh,csh,bash,tcsh,zsh,pwsh'
+ rez-path: /installdir/bin/rez
+ - os: ubuntu-latest
+ shells: 'sh,csh,bash,tcsh,zsh,pwsh'
+ rez-path: /installdir/bin/rez
+ - os: windows-latest
+ shells: 'cmd,pwsh,gitbash'
+ rez-path: \installdir\Scripts\rez
+
+ fail-fast: false
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Setup python ${{ matrix.python-version }}
+ uses: actions/setup-python@v5
+ with:
+ python-version: ${{ matrix.python-version }}
+
+ - name: Install test system dependencies (linux)
+ if: ${{ startsWith(matrix.os, 'ubuntu-') }}
+ run: |
+ set -ex
+ sudo apt-get update
+
+ cmake --version
+ pwsh --version
+
+ sudo apt-get install -y csh tcsh zsh
+
+ - name: Install rez
+ run: python ./install.py ./installdir
+
+ - name: Setup environment variables
+ shell: bash
+ env:
+ _GH_REZ_INSTALL_PATH: ${{ github.workspace }}${{ matrix.rez-path }}
+ run: |
+ echo "$_GH_REZ_INSTALL_PATH" >> $GITHUB_PATH
+
+ - name: Install test dependencies
+ run: rez-python -m pip install pytest-cov parameterized
+
+ - name: Run tests
+ run: rez-selftest -v
+ env:
+ _REZ_ENSURE_TEST_SHELLS: ${{ matrix.shells }}
diff --git a/.github/workflows/ubuntu.yaml b/.github/workflows/ubuntu.yaml
deleted file mode 100644
index 266059510..000000000
--- a/.github/workflows/ubuntu.yaml
+++ /dev/null
@@ -1,89 +0,0 @@
-name: ubuntu
-on:
- pull_request:
- paths:
- - 'src/**'
- - '.github/workflows/ubuntu.yaml'
- - '!src/rez/utils/_version.py'
- - '!**.md'
- push:
- paths:
- - 'src/**'
- - '.github/workflows/ubuntu.yaml'
- - '!src/rez/utils/_version.py'
- - '!**.md'
- workflow_dispatch:
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
-
-jobs:
- main:
- name: main
- runs-on: ubuntu-${{ matrix.os-version }}
-
- strategy:
- matrix:
- os-version:
- - '20.04'
- - '22.04'
- python-version:
- - '2.7'
- - '3.7'
- fail-fast: false
-
- steps:
- - name: Checkout
- uses: actions/checkout@v3
-
- - name: Setup python ${{ matrix.python-version }}
- uses: ./.github/actions/setup-python
- with:
- python-version: ${{ matrix.python-version }}
- os: ubuntu
-
- - name: apt-get update
- run: |
- sudo apt-get update
-
- - name: Verify cmake
- run: |
- cmake --version
-
- - name: Verify pwsh
- run: |
- pwsh --version
-
- - name: Install csh
- run: |
- sudo apt-get install -y csh
-
- - name: Install tcsh
- run: |
- sudo apt-get install -y tcsh
-
- - name: Install zsh
- run: |
- sudo apt-get install -y zsh
-
- - name: Install Rez
- run: |
- if [[ "${{ matrix.python-version }}" == "2.7" ]]; then
- eval "$(conda shell.bash hook)"
- conda activate python
- fi
- mkdir ./installdir
- python --version
- python ./install.py ./installdir
-
- - name: Install Rez test dependencies
- run: |
- ./installdir/bin/rez/rez-python -m pip install pytest-cov
- ./installdir/bin/rez/rez-python -m pip install parameterized
-
- - name: Run Rez Tests
- run: |
- ./installdir/bin/rez/rez-selftest -v
- env:
- _REZ_ENSURE_TEST_SHELLS: sh,csh,bash,tcsh,zsh,pwsh
diff --git a/.github/workflows/wiki.yaml b/.github/workflows/wiki.yaml
deleted file mode 100644
index 99016cf3d..000000000
--- a/.github/workflows/wiki.yaml
+++ /dev/null
@@ -1,63 +0,0 @@
-name: wiki
-on:
- release:
- types: [released]
- push:
- paths:
- - '.github/workflows/wiki.yaml'
- - 'wiki/**'
- - src/rez/rezconfig.py
-
-jobs:
- build:
- name: Build Wiki Artifact
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v3
- with:
- fetch-depth: 0 # required to generate credits list
-
- - uses: actions/setup-python@v4
- with:
- python-version: 3.7
-
- - name: Build Wiki
- working-directory: wiki
- run: |
- python generate-wiki.py \
- --github-repo="${{ github.repository }}" \
- --out="${{ github.workspace }}/out"
-
- - uses: actions/upload-artifact@v3
- with:
- name: wiki-markdown
- path: out
-
- publish:
- name: Publish to GitHub Wiki
- runs-on: ubuntu-latest
- needs: build
- if: github.event_name == 'release'
-
- steps:
- - name: Setup git config
- run: |
- git config --global user.name "github.com/${{ github.actor }}"
- git config --global user.email "${{ github.actor }}@${{ github.sha }}"
-
- - name: Clone latest wiki repo
- run: |
- git clone https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git .
-
- - uses: actions/download-artifact@v3
- with:
- name: wiki-markdown
- path: .
-
- - name: Push wiki updates to git
- run: |
- git add --all
- ( git commit -m "Generated from GitHub ${{ github.workflow }} Workflow" \
- && git push origin main \
- ) || echo "Nothing new to commit"
diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml
deleted file mode 100644
index 3f58ce5a6..000000000
--- a/.github/workflows/windows.yaml
+++ /dev/null
@@ -1,356 +0,0 @@
-#
-# This workflow builds base and python-version-specific docker images if
-# required, then runs the rez tests in the python image.
-#
-# The images are tagged with a hash of the relevant sourcefile contents (eg
-# Dockerfile). Images from the 'AcademySoftwareFoundation/rez' GitHub container registry will be used
-# if they are up-to-date.
-#
-# If images require updating, the necessary images will be
-# created and will be stored in the GitHub Container registry. The images
-# will always be stored in the current's repo namespace (ghcr.io//).
-#
-# This approach ensures that image rebuilds are avoided when possible, but are
-# supported from forks who may have made changes to docker-related
-# source (such as Dockerfile) and need this workflow to run.
-#
----
-name: windows
-
-on:
- pull_request:
- paths:
- - 'src/**'
- - '.github/workflows/windows.yaml'
- - '.github/docker/rez-win-base/**'
- - '.github/docker/rez-win-py/**'
- - '!src/rez/utils/_version.py'
- - '!**.md'
- push:
- paths:
- - 'src/**'
- - '.github/workflows/windows.yaml'
- - '.github/docker/rez-win-base/**'
- - '.github/docker/rez-win-py/**'
- - '!src/rez/utils/_version.py'
- - '!**.md'
- workflow_dispatch:
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
-
-env:
- # The default namespace that the jobs will look at or use.
- PUB_NAMESPACE: ghcr.io/academysoftwarefoundation/rez
-
- # We don't take changes to this workfile yaml into account when determining
- # image tags, because changes here very rarely cause changes to the images,
- # and this causes lots of unnecessary image rebuilds. On the offchance a
- # change is made here that _does_ affect the images, increment this value
- IMAGE_TAG_SALT: 3
-
-jobs:
-
- # image tags are based on sourcefile contents
- image_tags:
- name: Calculate image tags
- runs-on: ubuntu-latest
-
- outputs:
- base: ${{ steps.base.outputs.tag }}
- py: ${{ steps.py.outputs.tag }}
-
- steps:
- - name: Checkout
- uses: actions/checkout@v2
-
- - name: Determine base image tag
- id: base
- run: |
- tag=$( \
- echo "${{ hashFiles('.github/docker/rez-win-base/*') }}${IMAGE_TAG_SALT}" \
- | md5sum - \
- | awk '{print $1}' \
- )
- echo "base tag is ${tag}"
- echo "::set-output name=tag::${tag}"
-
- - name: Determine python image tag
- id: py
- run: |
- tag=$( \
- echo "${{ hashFiles('.github/docker/rez-win-base/*', '.github/docker/rez-win-py/*') }}${IMAGE_TAG_SALT}" \
- | md5sum - \
- | awk '{print $1}' \
- )
- echo "py tag is ${tag}"
- echo "::set-output name=tag::${tag}"
-
- # note that we don't track staleness on a per-matrix-entry basis. Github actions
- # job outputs wrt matrix is problematic and frankly not worth the hassle.
- public_py_image:
- name: Check for up-to-date public py image
- runs-on: windows-${{ matrix.os-version }}
- needs: image_tags
-
- strategy:
- fail-fast: false
- matrix:
- os-version:
- - '2019'
- py-version:
- - '2.7.17'
- - '3.7.5'
-
- outputs:
- namespace: ${{ steps.inspect.outputs.namespace }}
- needs_rebuild: ${{ steps.inspect.outputs.needs_rebuild }}
-
- steps:
- - name: Inspect public py image
- id: inspect
- run: |
- # Try to get the image from the pub namepsace first.
- $pub_namespace = "${Env:PUB_NAMESPACE}"
- $docker_image = "${pub_namespace}/rez-win-${{ matrix.os-version }}-py-${{ matrix.py-version }}:${{ needs.image_tags.outputs.py }}".ToLower()
-
- Write-Output "Inspecting image ${docker_image}..."
- $ErrorActionPreference = "Continue"
- docker manifest inspect $docker_image *>$null || Write-Output "(no such image)"
- $ErrorActionPreference = "Stop"
-
- if ($LastExitCode -eq 0) {
- Write-Output "Found ${docker_image}"
- Write-Output "::set-output name=namespace::${pub_namespace}"
- Write-Output "::set-output name=needs_rebuild::false"
- }
- else {
-
- Write-Output "${docker_image} not found"
-
- # Image not found in pub namespace, look into the current's
- # repo registry or in the originating repo when the workflow is
- # triggered from a PR.
- if ('${{ github.event_name }}' -eq 'pull_request') {
- # This is quite important since workflows don't have write
- # permissions when the source branch is from a fork.
- $github_namespace = "ghcr.io/${{ github.event.pull_request.head.repo.full_name }}"
- }
- else {
- $github_namespace = "ghcr.io/${{ github.repository }}"
- }
- $docker_image = "${github_namespace}/rez-win-${{ matrix.os-version }}-py-${{ matrix.py-version }}:${{ needs.image_tags.outputs.py }}".ToLower()
-
- Write-Output "Inspecting image ${docker_image}..."
- $ErrorActionPreference = "Continue"
- docker manifest inspect $docker_image *>$null || Write-Output "(no such image)"
- $ErrorActionPreference = "Stop"
-
- # Inform the next jobs that they need to use the "private"
- # registry.
- Write-Output "::set-output name=namespace::${github_namespace}"
-
- if ($LastExitCode -ne 0) {
- # Well, no images found at all! We will need to build the images.
- Write-Output "${docker_image} not found"
- Write-Output "::set-output name=needs_rebuild::true"
- } else {
- Write-Output "Found ${docker_image}"
- Write-Output "::set-output name=needs_rebuild::false"
- }
- }
-
- exit 0
-
- base_image:
- name: Build base docker image if required
- runs-on: windows-${{ matrix.os-version }}
- needs:
- - image_tags
- - public_py_image
-
- if: needs.public_py_image.outputs.needs_rebuild == 'true'
-
- strategy:
- fail-fast: false
- matrix:
- # The windows version has to match the host system.
- # 1809 -> 10.0.17763.805 -> windows-2019
- # Compare: https://hub.docker.com/_/microsoft-windows-servercore
- include:
- - os-version: '2019'
- windows-version: '1809-amd64'
-
- steps:
- - name: Fail with summary
- if: (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository)
- shell: bash
- run: |
- echo '# Action required!
-
- This branch is coming from a fork and the appropriate docker images were
- not found in `${{ needs.public_py_image.outputs.namespace }}`.
-
- Please ensure that you run the workflow in your fork. Once this is done,
- please let the reviewers know so that they can re-run the workflow in
- the context of the PR.' > $GITHUB_STEP_SUMMARY
-
- exit 1
-
- - name: Set job vars
- id: vars
- run: |
- $docker_image = "${{ needs.public_py_image.outputs.namespace }}/rez-win-${{ matrix.os-version }}-base:${{ needs.image_tags.outputs.base }}".ToLower()
-
- Write-Output "::set-output name=docker_image::${docker_image}"
-
- - name: Login to docker repository
- run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
-
- - name: Inspect base image
- id: inspect
- run: |
- Write-Output "Inspecting image ${{ steps.vars.outputs.docker_image }}..."
- $ErrorActionPreference = "Continue"
- docker manifest inspect ${{ steps.vars.outputs.docker_image }} *>$null || Write-Output "(no such image)"
- $ErrorActionPreference = "Stop"
-
- if ($LastExitCode -ne 0) {
- Write-Output "::set-output name=image_exists::false"
- }
- exit 0
-
- - name: Checkout
- if: steps.inspect.outputs.image_exists == 'false'
- uses: actions/checkout@v2
-
- - name: Build base image
- if: steps.inspect.outputs.image_exists == 'false'
- run: |
- Write-Output "Building image ${{ steps.vars.outputs.docker_image }}..."
- cd .github\docker\rez-win-base
- docker build `
- --tag ${{ steps.vars.outputs.docker_image }} `
- --build-arg WINDOWS_VERSION="${{ matrix.windows-version }}" `
- .
-
- - name: Push base image
- if: steps.inspect.outputs.image_exists == 'false'
- run: |
- Write-Output "Pushing image ${{ steps.vars.outputs.docker_image }}..."
- docker push ${{ steps.vars.outputs.docker_image }}
-
- py_image:
- name: Build py docker image if required
- runs-on: windows-${{ matrix.os-version }}
- needs:
- - image_tags
- - base_image
- - public_py_image
-
- strategy:
- fail-fast: false
- matrix:
- os-version:
- - '2019'
- py-version:
- - '2.7.17'
- - '3.7.5'
-
- steps:
- - name: Set job vars
- id: vars
- run: |
- # When publishing the images, we always publish in the current repo's package registry
- $base_docker_image = "ghcr.io/${{ github.repository }}/rez-win-${{ matrix.os-version }}-base:${{ needs.image_tags.outputs.base }}".ToLower()
- $docker_image = "ghcr.io/${{ github.repository }}/rez-win-${{ matrix.os-version }}-py-${{ matrix.py-version }}:${{ needs.image_tags.outputs.py }}".ToLower()
-
- Write-Output "::set-output name=base_docker_image::${base_docker_image}"
- Write-Output "::set-output name=docker_image::${docker_image}"
-
- - name: Login to docker repository
- run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
-
- - name: Inspect py image
- id: inspect
- run: |
- Write-Output "Inspecting image ${{ steps.vars.outputs.docker_image }}..."
- $ErrorActionPreference = "Continue"
- docker manifest inspect ${{ steps.vars.outputs.docker_image }} *>$null || Write-Output "(no such image)"
- $ErrorActionPreference = "Stop"
-
- if ($LastExitCode -ne 0) {
- Write-Output "::set-output name=image_exists::false"
- }
- exit 0
-
- - name: Checkout
- if: steps.inspect.outputs.image_exists == 'false'
- uses: actions/checkout@v2
-
- - name: Pull base image
- if: steps.inspect.outputs.image_exists == 'false'
- run: |
- Write-Output "Pulling base image ${{ steps.vars.outputs.base_docker_image }}..."
- docker pull ${{ steps.vars.outputs.base_docker_image }}
-
- - name: Build py image
- if: steps.inspect.outputs.image_exists == 'false'
- run: |
- Write-Output "Building image ${{ steps.vars.outputs.docker_image }}..."
- cd .github\docker\rez-win-py
-
- docker build `
- --tag ${{ steps.vars.outputs.docker_image }} `
- --build-arg BASE_IMAGE_NAME="${{ steps.vars.outputs.base_docker_image }}" `
- --build-arg IMAGE_NAME="${{ steps.vars.outputs.docker_image }}" `
- --build-arg PYTHON_VERSION="${{ matrix.py-version }}" `
- .
-
- - name: Push py image
- if: steps.inspect.outputs.image_exists == 'false'
- run: |
- Write-Output "Pushing image ${{ steps.vars.outputs.docker_image }}..."
- docker push ${{ steps.vars.outputs.docker_image }}
-
- main:
- name: Run rez tests
- runs-on: windows-${{ matrix.os-version }}
- needs:
- - image_tags
- - public_py_image
- - py_image
-
- # Forces this job to run even if needed jobs are skipped but not when the workflow is cancelled or failed.
- if: (success() || needs.py_image.result == 'skipped') && !cancelled() && !failure()
-
- strategy:
- fail-fast: false
- matrix:
- os-version:
- - '2019'
- py-version:
- - '2.7.17'
- - '3.7.5'
-
- steps:
- - name: Set job vars
- id: vars
- run: |
- $docker_image = "${{ needs.public_py_image.outputs.namespace }}/rez-win-${{ matrix.os-version }}-py-${{ matrix.py-version }}:${{ needs.image_tags.outputs.py }}".ToLower()
-
- Write-Output "::set-output name=docker_image::${docker_image}"
- Write-Output "Using image ${docker_image}..."
-
- - name: Checkout
- uses: actions/checkout@v2
-
- - name: Pull py image
- run: |
- docker pull ${{ steps.vars.outputs.docker_image }}
-
- - name: Run Docker image (installs and tests rez)
- run: docker run --mount type=bind,src=$pwd,dst=C:\checkout,readonly ${{ steps.vars.outputs.docker_image }}
- env:
- _REZ_ENSURE_TEST_SHELLS: cmd,pwsh,gitbash
diff --git a/.gitignore b/.gitignore
index 3995ffa13..1cfc09222 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,4 +18,5 @@ __pycache__
.vscode/
.venv/
docs/source/api/
-docs/source/commands/
\ No newline at end of file
+docs/source/commands/
+__tests_pkg_repo/
diff --git a/.mailmap b/.mailmap
new file mode 100644
index 000000000..fd16d38b8
--- /dev/null
+++ b/.mailmap
@@ -0,0 +1,176 @@
+# This file establishes email equivalences so we can resolve what look like
+# multiple authors, but actually are the same author who has used multiple
+# emails over the course of their involvement with the project.
+#
+# The format is any of the following:
+#
+# CANONICAL-NAME
+# CANONICAL-NAME alternate-name
+#
+# You can check for duplicates with this command:
+# git shortlog -sne --all
+# That command (and others) will use this file to collapse the duplicates.
+#
+# If you see any duplicates we don't account for here, or if you look at your
+# own entry here and want a different name or email to be your canonical one
+# (we may not have guessed correctly and matched your preferences), please
+# file a PR with the edits to this file.
+
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns
+Allan Johns <(no author)@e6eb1edf-3a88-c135-55be-1f5b7bf7ed03>
+Allan Johns RACHEL JOHNS
+Allan Johns
+Allan Johns ajohns
+Allan Johns allan johns
+Allan Johns nerdvegas
+
+Alexandra Lefève-Gourmelon Alexandra Lefeve
+
+Ben Dickson dbr
+
+Blazej Floch
+Blazej Floch
+
+Brendan Abel <007brendan@gmail.com>
+Brendan Abel <007brendan@gmail.com>
+Brendan Abel <007brendan@gmail.com>
+
+David Lai davidlatwe
+
+Fabio Piparo
+Fabio Piparo
+
+Hal <13111745+loonghao@users.noreply.github.com> longhao
+
+Jason Scott
+
+Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com>
+Jean-Christophe Morin
+
+Joseph Yu
+Joseph Yu
+
+Mark Streatfield
+Mark Streatfield
+
+Stephen Mackenzie maxnbk
+Stephen Mackenzie
+Stephen Mackenzie
+Stephen Mackenzie