diff --git a/.github/workflows/build_and_deploy_docs.yml b/.github/workflows/build_and_deploy_docs.yml index cf1459c65..7b4a8dee3 100644 --- a/.github/workflows/build_and_deploy_docs.yml +++ b/.github/workflows/build_and_deploy_docs.yml @@ -25,7 +25,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r share/requirements-doc.txt + pip install -r share/python_requirements/requirements-github-build-and-deploy-docs.txt - name: Building Sphinx Documentation run: | diff --git a/.github/workflows/lint_code.yml b/.github/workflows/lint_code.yml index 165a63671..3a7ce5c8f 100644 --- a/.github/workflows/lint_code.yml +++ b/.github/workflows/lint_code.yml @@ -19,7 +19,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r share/requirements-dev.txt + pip install -r share/python_requirements/requirements-github-lint-code.txt - name: Analysing the Python code with flake8 (Hard Error) run: | diff --git a/scripts/build_mmSolver_linux_maya2020.bash b/scripts/build_mmSolver_linux_maya2020.bash index 21d89c53d..e42a3e5c6 100644 --- a/scripts/build_mmSolver_linux_maya2020.bash +++ b/scripts/build_mmSolver_linux_maya2020.bash @@ -25,7 +25,7 @@ MAYA_VERSION=2020 MAYA_LOCATION=/usr/autodesk/maya2020/ # Executable names/paths used for build process. -PYTHON_EXE=python +PYTHON_EXE=python3 CMAKE_EXE=cmake3 RUST_CARGO_EXE=cargo diff --git a/scripts/build_mmSolver_linux_maya2022.bash b/scripts/build_mmSolver_linux_maya2022.bash index 62fdf672b..ed565f07f 100644 --- a/scripts/build_mmSolver_linux_maya2022.bash +++ b/scripts/build_mmSolver_linux_maya2022.bash @@ -25,7 +25,7 @@ MAYA_VERSION=2022 MAYA_LOCATION=/usr/autodesk/maya2022/ # Executable names/paths used for build process. -PYTHON_EXE=python +PYTHON_EXE=python3 CMAKE_EXE=cmake3 RUST_CARGO_EXE=cargo diff --git a/scripts/build_mmSolver_linux_maya2023.bash b/scripts/build_mmSolver_linux_maya2023.bash index f4b56cc03..4194668de 100644 --- a/scripts/build_mmSolver_linux_maya2023.bash +++ b/scripts/build_mmSolver_linux_maya2023.bash @@ -25,7 +25,7 @@ MAYA_VERSION=2023 MAYA_LOCATION=/usr/autodesk/maya2023/ # Executable names/paths used for build process. -PYTHON_EXE=python +PYTHON_EXE=python3 CMAKE_EXE=cmake3 RUST_CARGO_EXE=cargo diff --git a/scripts/build_mmSolver_linux_maya2024.bash b/scripts/build_mmSolver_linux_maya2024.bash index 814946881..74e143a7b 100644 --- a/scripts/build_mmSolver_linux_maya2024.bash +++ b/scripts/build_mmSolver_linux_maya2024.bash @@ -25,6 +25,9 @@ MAYA_VERSION=2024 MAYA_LOCATION=/usr/autodesk/maya2024/ # Executable names/paths used for build process. +# +# RockyLinux8 has Python 3.6 by default, but we use Python 3.9 because +# it has better support for tools like 'ruff'. PYTHON_EXE=python3.9 CMAKE_EXE=cmake3 RUST_CARGO_EXE=cargo diff --git a/scripts/internal/python_venv_activate.bash b/scripts/internal/python_venv_activate.bash index de08e353a..5adfb427c 100755 --- a/scripts/internal/python_venv_activate.bash +++ b/scripts/internal/python_venv_activate.bash @@ -58,6 +58,7 @@ fi REQUIRE_PACKAGE_INSTALL=0 if [ ! -f "${PYTHON_VIRTUAL_ENV_ACTIVATE_SCRIPT}" ]; then echo "Setting up Python Virtual Environment ${PYTHON_VIRTUAL_ENV_DIR_NAME}" + ${PYTHON_EXE} --version ${PYTHON_EXE} -m venv ${PYTHON_VIRTUAL_ENV_DIR} REQUIRE_PACKAGE_INSTALL=1 fi @@ -69,13 +70,11 @@ source "${PYTHON_VIRTUAL_ENV_ACTIVATE_SCRIPT}" # Install requirements if [ ${REQUIRE_PACKAGE_INSTALL} -eq 1 ]; then + ${PYTHON_EXE} --version ${PYTHON_EXE} -m pip install --upgrade pip - REQUIRE_DEV_MAYA_VERSION_FILE="${PROJECT_ROOT}/share/requirements-dev-maya${MAYA_VERSION}.txt" - REQUIRE_DOC_MAYA_VERSION_FILE="${PROJECT_ROOT}/share/requirements-doc-maya${MAYA_VERSION}.txt" - - ${PYTHON_EXE} -m pip install -r $REQUIRE_DEV_MAYA_VERSION_FILE - ${PYTHON_EXE} -m pip install -r $REQUIRE_DOC_MAYA_VERSION_FILE + REQUIRE_MAYA_VERSION_FILE="${PROJECT_ROOT}/share/python_requirements/requirements-maya${MAYA_VERSION}.txt" + ${PYTHON_EXE} -m pip install -r $REQUIRE_MAYA_VERSION_FILE fi cd ${PROJECT_ROOT} diff --git a/scripts/internal/python_venv_activate.bat b/scripts/internal/python_venv_activate.bat index 6262bad57..eea39559e 100644 --- a/scripts/internal/python_venv_activate.bat +++ b/scripts/internal/python_venv_activate.bat @@ -56,6 +56,7 @@ IF "%FRESH_PYTHON_VIRTUAL_ENV%"=="1" ( SET REQUIRE_PACKAGE_INSTALL=0 IF NOT EXIST %PYTHON_VIRTUAL_ENV_ACTIVATE_SCRIPT% ( ECHO Setting up Python Virtual Environment "%PYTHON_VIRTUAL_ENV_DIR_NAME%" + %PYTHON_EXE% --version %PYTHON_EXE% -m venv %PYTHON_VIRTUAL_ENV_DIR% SET REQUIRE_PACKAGE_INSTALL=1 ) @@ -65,12 +66,12 @@ ECHO Activating Python Virtual Environment "%PYTHON_VIRTUAL_ENV_DIR_NAME%" CALL %PYTHON_VIRTUAL_ENV_ACTIVATE_SCRIPT% :: Install requirements -SET MAYA_VERSION_REQUIRE_DEV_FILE=%PROJECT_ROOT%\share\requirements-dev-maya%MAYA_VERSION%.txt -SET MAYA_VERSION_REQUIRE_DOC_FILE=%PROJECT_ROOT%\share\requirements-doc-maya%MAYA_VERSION%.txt +SET MAYA_VERSION_REQUIRE_FILE=%PROJECT_ROOT%\share\python_requirements\requirements-maya%MAYA_VERSION%.txt IF "%REQUIRE_PACKAGE_INSTALL%"=="1" ( + %PYTHON_EXE% --version + :: TODO: Why is the PIP upgrade disabled on Windows? On Linux it's very important. :: %PYTHON_EXE% -m pip install --upgrade pip - %PYTHON_EXE% -m pip install -r %MAYA_VERSION_REQUIRE_DEV_FILE% - %PYTHON_EXE% -m pip install -r %MAYA_VERSION_REQUIRE_DEV_FILE% + %PYTHON_EXE% -m pip install -r %MAYA_VERSION_REQUIRE_FILE% ) :: Return back project root directory. diff --git a/scripts/python_venv_activate_maya2020.bash b/scripts/python_venv_activate_maya2020.bash index 0b3e2bcf4..9d051a6f9 100644 --- a/scripts/python_venv_activate_maya2020.bash +++ b/scripts/python_venv_activate_maya2020.bash @@ -33,7 +33,7 @@ PROJECT_ROOT=`pwd` MAYA_VERSION=2020 # Python executable - edit this to point to an explicit python executable file. -PYTHON_EXE=python +PYTHON_EXE=python3 PYTHON_VIRTUAL_ENV_DIR_NAME="python_venv_linux_maya${MAYA_VERSION}" source "${PROJECT_ROOT}/scripts/internal/python_venv_activate.bash" diff --git a/scripts/python_venv_activate_maya2022.bash b/scripts/python_venv_activate_maya2022.bash index ae802cca8..f0ae856d1 100644 --- a/scripts/python_venv_activate_maya2022.bash +++ b/scripts/python_venv_activate_maya2022.bash @@ -33,7 +33,7 @@ PROJECT_ROOT=`pwd` MAYA_VERSION=2022 # Python executable - edit this to point to an explicit python executable file. -PYTHON_EXE=python +PYTHON_EXE=python3 PYTHON_VIRTUAL_ENV_DIR_NAME="python_venv_linux_maya${MAYA_VERSION}" source "${PROJECT_ROOT}/scripts/internal/python_venv_activate.bash" diff --git a/scripts/python_venv_activate_maya2023.bash b/scripts/python_venv_activate_maya2023.bash index dc5a54251..391d6a2f7 100644 --- a/scripts/python_venv_activate_maya2023.bash +++ b/scripts/python_venv_activate_maya2023.bash @@ -33,7 +33,7 @@ PROJECT_ROOT=`pwd` MAYA_VERSION=2023 # Python executable - edit this to point to an explicit python executable file. -PYTHON_EXE=python +PYTHON_EXE=python3 PYTHON_VIRTUAL_ENV_DIR_NAME="python_venv_linux_maya${MAYA_VERSION}" source "${PROJECT_ROOT}/scripts/internal/python_venv_activate.bash" diff --git a/share/python_requirements/README.md b/share/python_requirements/README.md new file mode 100644 index 000000000..4f9363bc1 --- /dev/null +++ b/share/python_requirements/README.md @@ -0,0 +1,9 @@ +# Python Package Requirement Files + +This directory is the home to "requirements.txt" files, which are used +by Python's PIP package manager to install python packages. + +There are different files for different usages. The "github" +requirement files are used by various GitHub actions, and are reduced +to the minimum required dependencies, to improve speed of the GitHub +actions. diff --git a/share/python_requirements/requirements-github-build-and-deploy-docs.txt b/share/python_requirements/requirements-github-build-and-deploy-docs.txt new file mode 100644 index 000000000..7730af7ce --- /dev/null +++ b/share/python_requirements/requirements-github-build-and-deploy-docs.txt @@ -0,0 +1,10 @@ +# .github/workflows/build_and_deploy_docs.yml +# +# Expects Python 3.7.x + +# Required packages for building documentation on GitHub. +# +# NOTE: No versions are specified to allow the package version resolver +# to resolve correctly. +Sphinx +furo diff --git a/share/python_requirements/requirements-github-lint-code.txt b/share/python_requirements/requirements-github-lint-code.txt new file mode 100644 index 000000000..cf122dd91 --- /dev/null +++ b/share/python_requirements/requirements-github-lint-code.txt @@ -0,0 +1,12 @@ +# .github/workflows/lint_code.yml +# +# Expects Python 3.7.x + +# Required packages for linting code on GitHub. +# +# NOTE: No versions are specified to allow the package version resolver +# to resolve correctly. +black +pylint +flake8 +cpplint diff --git a/share/python_requirements/requirements-maya2018.txt b/share/python_requirements/requirements-maya2018.txt new file mode 100644 index 000000000..cbec4fc22 --- /dev/null +++ b/share/python_requirements/requirements-maya2018.txt @@ -0,0 +1,17 @@ +# Python Package Requirements. +# +# Expects Python 3.6.x + +# Tools needed for code linting and formatting. +# +# NOTE: No versions are explicitly to allow the PIP version resolver to find a match. +black +pylint +flake8 +cpplint + +# Tools needed for documentation building. +# +# NOTE: No versions are explicitly to allow the PIP version resolver to find a match. +Sphinx +furo diff --git a/share/python_requirements/requirements-maya2019.txt b/share/python_requirements/requirements-maya2019.txt new file mode 100644 index 000000000..2b0a98de2 --- /dev/null +++ b/share/python_requirements/requirements-maya2019.txt @@ -0,0 +1,13 @@ +# Python Package Requirements. +# +# Expects Python 3.6.x + +# Tools needed for code linting and formatting. +black == 22.8.0 +pylint == 2.13.9 +flake8 == 5.0.4 +cpplint == 1.6.1 + +# Tools needed for documentation building. +Sphinx == 4.3.2 +furo == 2022.4.7 diff --git a/share/python_requirements/requirements-maya2020.txt b/share/python_requirements/requirements-maya2020.txt new file mode 100644 index 000000000..2b0a98de2 --- /dev/null +++ b/share/python_requirements/requirements-maya2020.txt @@ -0,0 +1,13 @@ +# Python Package Requirements. +# +# Expects Python 3.6.x + +# Tools needed for code linting and formatting. +black == 22.8.0 +pylint == 2.13.9 +flake8 == 5.0.4 +cpplint == 1.6.1 + +# Tools needed for documentation building. +Sphinx == 4.3.2 +furo == 2022.4.7 diff --git a/share/python_requirements/requirements-maya2022.txt b/share/python_requirements/requirements-maya2022.txt new file mode 100644 index 000000000..2b0a98de2 --- /dev/null +++ b/share/python_requirements/requirements-maya2022.txt @@ -0,0 +1,13 @@ +# Python Package Requirements. +# +# Expects Python 3.6.x + +# Tools needed for code linting and formatting. +black == 22.8.0 +pylint == 2.13.9 +flake8 == 5.0.4 +cpplint == 1.6.1 + +# Tools needed for documentation building. +Sphinx == 4.3.2 +furo == 2022.4.7 diff --git a/share/python_requirements/requirements-maya2023.txt b/share/python_requirements/requirements-maya2023.txt new file mode 100644 index 000000000..2b0a98de2 --- /dev/null +++ b/share/python_requirements/requirements-maya2023.txt @@ -0,0 +1,13 @@ +# Python Package Requirements. +# +# Expects Python 3.6.x + +# Tools needed for code linting and formatting. +black == 22.8.0 +pylint == 2.13.9 +flake8 == 5.0.4 +cpplint == 1.6.1 + +# Tools needed for documentation building. +Sphinx == 4.3.2 +furo == 2022.4.7 diff --git a/share/python_requirements/requirements-maya2024.txt b/share/python_requirements/requirements-maya2024.txt new file mode 100644 index 000000000..00f68cbaf --- /dev/null +++ b/share/python_requirements/requirements-maya2024.txt @@ -0,0 +1,14 @@ +# Python Package Requirements. +# +# Expects Python 3.9.x + +# Tools needed for code linting and formatting. +black == 24.8.0 +pylint == 3.2.7 +flake8 == 7.1.1 +cpplint == 1.6.1 +ruff == 0.6.5 + +# Tools needed for documentation building. +Sphinx == 7.4.7 +furo == 2024.8.6 diff --git a/share/requirements-dev-maya2018.txt b/share/requirements-dev-maya2018.txt deleted file mode 100644 index 500c54c32..000000000 --- a/share/requirements-dev-maya2018.txt +++ /dev/null @@ -1,5 +0,0 @@ -# Expects Python 3.6.x -black==22.8.0 -pylint==2.13.9 -flake8==4.0.1 -cpplint==1.6.0 diff --git a/share/requirements-dev-maya2019.txt b/share/requirements-dev-maya2019.txt deleted file mode 100644 index 500c54c32..000000000 --- a/share/requirements-dev-maya2019.txt +++ /dev/null @@ -1,5 +0,0 @@ -# Expects Python 3.6.x -black==22.8.0 -pylint==2.13.9 -flake8==4.0.1 -cpplint==1.6.0 diff --git a/share/requirements-dev-maya2020.txt b/share/requirements-dev-maya2020.txt deleted file mode 100644 index 500c54c32..000000000 --- a/share/requirements-dev-maya2020.txt +++ /dev/null @@ -1,5 +0,0 @@ -# Expects Python 3.6.x -black==22.8.0 -pylint==2.13.9 -flake8==4.0.1 -cpplint==1.6.0 diff --git a/share/requirements-dev-maya2022.txt b/share/requirements-dev-maya2022.txt deleted file mode 100644 index 500c54c32..000000000 --- a/share/requirements-dev-maya2022.txt +++ /dev/null @@ -1,5 +0,0 @@ -# Expects Python 3.6.x -black==22.8.0 -pylint==2.13.9 -flake8==4.0.1 -cpplint==1.6.0 diff --git a/share/requirements-dev-maya2023.txt b/share/requirements-dev-maya2023.txt deleted file mode 100644 index 500c54c32..000000000 --- a/share/requirements-dev-maya2023.txt +++ /dev/null @@ -1,5 +0,0 @@ -# Expects Python 3.6.x -black==22.8.0 -pylint==2.13.9 -flake8==4.0.1 -cpplint==1.6.0 diff --git a/share/requirements-dev-maya2024.txt b/share/requirements-dev-maya2024.txt deleted file mode 100644 index 856ef8f07..000000000 --- a/share/requirements-dev-maya2024.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Expects Python 3.9.x -black==24.3.0 -pylint==2.13.9 -flake8==4.0.1 -cpplint==1.6.0 -ruff==0.0.261 diff --git a/share/requirements-doc-maya2018.txt b/share/requirements-doc-maya2018.txt deleted file mode 100644 index 91e78f95a..000000000 --- a/share/requirements-doc-maya2018.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Expects Python 3.6.x -Sphinx>=4.5.0 -furo>=2022.2.23 diff --git a/share/requirements-doc-maya2019.txt b/share/requirements-doc-maya2019.txt deleted file mode 100644 index 91e78f95a..000000000 --- a/share/requirements-doc-maya2019.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Expects Python 3.6.x -Sphinx>=4.5.0 -furo>=2022.2.23 diff --git a/share/requirements-doc-maya2020.txt b/share/requirements-doc-maya2020.txt deleted file mode 100644 index 91e78f95a..000000000 --- a/share/requirements-doc-maya2020.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Expects Python 3.6.x -Sphinx>=4.5.0 -furo>=2022.2.23 diff --git a/share/requirements-doc-maya2022.txt b/share/requirements-doc-maya2022.txt deleted file mode 100644 index 91e78f95a..000000000 --- a/share/requirements-doc-maya2022.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Expects Python 3.6.x -Sphinx>=4.5.0 -furo>=2022.2.23 diff --git a/share/requirements-doc-maya2023.txt b/share/requirements-doc-maya2023.txt deleted file mode 100644 index 91e78f95a..000000000 --- a/share/requirements-doc-maya2023.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Expects Python 3.6.x -Sphinx>=4.5.0 -furo>=2022.2.23 diff --git a/share/requirements-doc-maya2024.txt b/share/requirements-doc-maya2024.txt deleted file mode 100644 index 2fdd0f4a6..000000000 --- a/share/requirements-doc-maya2024.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Expects Python 3.9.x -Sphinx>=4.5.0 -furo>=2022.2.23