diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 2f9a3bc7a..c8ea28be3 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,9 @@ +# +# Copyright (c) 2026 by Delphix. All rights reserved. +# + [bumpversion] -current_version = 5.0.1 +current_version = 5.1.0 commit = False tag = False parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\.(?P[a-z]+)(?P\d+))? @@ -17,15 +21,17 @@ values = [bumpversion:part:dev] -[bumpversion:file:./dvp/src/main/python/dlpx/virtualization/VERSION] +# Each pyproject.toml's [project].version and sibling-package pins are matched +# by the default {current_version} search; both get updated atomically. +[bumpversion:file:./common/pyproject.toml] -[bumpversion:file:./common/src/main/python/dlpx/virtualization/common/VERSION] +[bumpversion:file:./dvp/pyproject.toml] -[bumpversion:file:./platform/src/main/python/dlpx/virtualization/platform/VERSION] +[bumpversion:file:./libs/pyproject.toml] -[bumpversion:file:./libs/src/main/python/dlpx/virtualization/libs/VERSION] +[bumpversion:file:./platform/pyproject.toml] -[bumpversion:file:./tools/src/main/python/dlpx/virtualization/_internal/VERSION] +[bumpversion:file:./tools/pyproject.toml] [bumpversion:file:./tools/src/test/python/dlpx/virtualization/_internal/test_package_util.py] search = DVP_VERSION = '{current_version}' diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 373d4f424..22c07c211 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,3 +1,7 @@ +# +# Copyright (c) 2026 by Delphix. All rights reserved. +# + version: 2 updates: - package-ecosystem: pip diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 3ac1ca99e..287175b34 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, 2022 by Delphix. All rights reserved. +# Copyright (c) 2020, 2026 by Delphix. All rights reserved. # name: "Pre-commit actions for Delphix Virtualization SDK" @@ -14,53 +14,69 @@ on: jobs: pytest311: - name: Test ${{ matrix.package }} on ${{ matrix.os }} using pytest (Python 3.11) + name: Test SDK on ${{ matrix.os }} (Python ${{ matrix.python-version }}) runs-on: ${{ matrix.os }} strategy: - max-parallel: 4 + max-parallel: 3 matrix: python-version: [ 3.11 ] os: [ ubuntu-latest, macos-latest, windows-latest ] - package: [ common, libs, platform, tools ] steps: - - name: Checkout ${{ matrix.package }} project - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install ${{ matrix.package }} dependencies - working-directory: ${{ matrix.package }} + # Install all SDK packages once, in dependency order. Sibling packages + # need to be present in the env before subsequent installs can resolve + # their PEP 621 pins (e.g. dvp-libs needs dvp-common already installed). + - name: Install SDK packages run: | python -m pip install --upgrade pip - pip install -r requirements.txt --find-links https://test.pypi.org/simple/dvp-api/ + pip install -e "./common[dev]" --find-links https://test.pypi.org/simple/dvp-api/ + pip install -e "./libs[dev]" --find-links https://test.pypi.org/simple/dvp-api/ + pip install -e "./platform[dev]" --find-links https://test.pypi.org/simple/dvp-api/ + pip install -e "./tools[dev]" --find-links https://test.pypi.org/simple/dvp-api/ - - name: Install ${{ matrix.package }} project - working-directory: ${{ matrix.package }} - run: | - pip install . --find-links https://test.pypi.org/simple/dvp-api/ + - name: Test common + run: python -m pytest ./common/src/test/python - # Run all the test cases part of the package. - - name: Test ${{ matrix.package }} project with pytest - working-directory: ${{ matrix.package }} - run: | - python -m pytest src/test/python + - name: Test libs + run: python -m pytest ./libs/src/test/python + + - name: Test platform + run: python -m pytest ./platform/src/test/python + + - name: Test tools + run: python -m pytest ./tools/src/test/python - # Install flake8 and run linting on src and test for linting if OS is ubuntu. - name: Install flake8 - if: ${{ matrix.os == 'ubuntu-latest' }} + if: matrix.os == 'ubuntu-latest' + run: pip install flake8 + + - name: Lint common + if: matrix.os == 'ubuntu-latest' run: | - pip install flake8 + python -m flake8 ./common/src/main/python --max-line-length 88 + python -m flake8 ./common/src/test/python --max-line-length 88 - - name: Run flake8 on src directory - if: ${{ matrix.os == 'ubuntu-latest' }} - working-directory: ${{ matrix.package }} - run: python -m flake8 src/main/python --max-line-length 88 + - name: Lint libs + if: matrix.os == 'ubuntu-latest' + run: | + python -m flake8 ./libs/src/main/python --max-line-length 88 + python -m flake8 ./libs/src/test/python --max-line-length 88 + + - name: Lint platform + if: matrix.os == 'ubuntu-latest' + run: | + python -m flake8 ./platform/src/main/python --max-line-length 88 + python -m flake8 ./platform/src/test/python --max-line-length 88 - - name: Run flake8 on test directory - if: ${{ matrix.os == 'ubuntu-latest' }} - working-directory: ${{ matrix.package }} - run: python -m flake8 src/test/python --max-line-length 88 + - name: Lint tools + if: matrix.os == 'ubuntu-latest' + run: | + python -m flake8 ./tools/src/main/python --max-line-length 88 + python -m flake8 ./tools/src/test/python --max-line-length 88 \ No newline at end of file diff --git a/.github/workflows/publish-python-packages.yml b/.github/workflows/publish-python-packages.yml index 2be438422..0c472f573 100644 --- a/.github/workflows/publish-python-packages.yml +++ b/.github/workflows/publish-python-packages.yml @@ -1,14 +1,19 @@ +# +# Copyright (c) 2026 by Delphix. All rights reserved. +# + name: Publish Python packages to Test PyPi on: - # Run on push when the version file has changed on selected branches. + # Run on push when a package version (declared in pyproject.toml) has + # changed on selected branches, or when this workflow itself changes. push: branches: - master - develop - release paths: - - 'dvp/src/main/python/dlpx/virtualization/VERSION' + - '**/pyproject.toml' - '.github/workflows/publish-python-packages.yml' jobs: @@ -21,15 +26,15 @@ jobs: package: [common, dvp, libs, platform, tools] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} # Install dependencies necessary for building and publishing the package. - name: Install dependencies run: | - pip install setuptools wheel twine + pip install build twine # Build each Python package and publish it to Test PyPi. - name: Build and publish ${{ matrix.package }} package working-directory: ${{ matrix.package }} @@ -38,5 +43,5 @@ jobs: TWINE_PASSWORD: ${{ secrets.VSDK_PYPI_TOKEN }} TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/ run: | - python setup.py sdist bdist_wheel + python -m build twine upload dist/* diff --git a/LICENSE b/LICENSE index d64569567..3d63c06ad 100644 --- a/LICENSE +++ b/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2026 Delphix Corp., a Perforce company. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/bin/build_project.sh b/bin/build_project.sh index bd938694f..939800729 100644 --- a/bin/build_project.sh +++ b/bin/build_project.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2022 by Delphix. All rights reserved. +# Copyright (c) 2026 by Delphix. All rights reserved. # # This script provides functionality to build and run test cases for all python packages. The same script can be used @@ -15,13 +15,23 @@ should_test=false verbose=false coverage=false flake8=false -screenSize=$(tput cols) equalFiller="=" -greenColor=$(tput setaf 10) -orangeColor=$(tput setaf 208) -noColor=$(tput sgr0) -blackColor=$(tput setaf 0) -blueColor=$(tput setaf 31) +failed_steps=() +if [ -t 1 ]; then + screenSize=$(tput cols) + greenColor=$(tput setaf 10) + orangeColor=$(tput setaf 208) + noColor=$(tput sgr0) + blackColor=$(tput setaf 0) + blueColor=$(tput setaf 31) +else + screenSize=100 + greenColor="" + orangeColor="" + noColor="" + blackColor="" + blueColor="" +fi ############################################################ # Help # @@ -86,23 +96,23 @@ run_operations() { if [ "$should_build" = true ]; then echo print_as_per_screen_size " $module_name build starts " "${orangeColor}" ${equalFiller} "${screenSize}" - build_module + build_module || failed_steps+=("$module_name build") print_as_per_screen_size " $module_name build complete " "${greenColor}" ${equalFiller} "${screenSize}" fi if [ "$flake8" = true ]; then echo print_as_per_screen_size " $module_name Flake8 Main starts " "${orangeColor}" ${equalFiller} "${screenSize}" - python -m flake8 "$module_path/src/test/python" --max-line-length 88 + python -m flake8 "$module_path/src/test/python" --max-line-length 88 || failed_steps+=("$module_name flake8 (test)") print_as_per_screen_size " $module_name Flake8 Main complete " "${greenColor}" ${equalFiller} "${screenSize}" echo print_as_per_screen_size " $module_name Flake8 Test starts " "${orangeColor}" ${equalFiller} "${screenSize}" - python -m flake8 "$module_path/src/main/python" --max-line-length 88 + python -m flake8 "$module_path/src/main/python" --max-line-length 88 || failed_steps+=("$module_name flake8 (main)") print_as_per_screen_size " $module_name Flake8 Test complete " "${greenColor}" ${equalFiller} "${screenSize}" fi if [ "$should_test" = true ]; then echo print_as_per_screen_size " $module_name tests starts " "${orangeColor}" ${equalFiller} "${screenSize}" - test_module + test_module || failed_steps+=("$module_name tests") print_as_per_screen_size " $module_name tests complete " "${greenColor}" ${equalFiller} "${screenSize}" fi cd "$current_path" || exit @@ -118,13 +128,11 @@ get_project_path() { # Build the module build_module() { - python setup.py clean --all + rm -rf build/ ./*.egg-info src/main/python/*.egg-info if [ "$verbose" = true ]; then - pip install -r requirements.txt -v - pip install -e . -v + pip install -e ".[dev]" -v else - pip install -r requirements.txt -q - pip install -e . -q + pip install -e ".[dev]" -q fi } @@ -209,7 +217,16 @@ if [ "$should_build" = true ] || [ "$should_test" = true ] || [ "$flake8" = true if [ "$coverage" = true ]; then echo "Paths to combine for coverage are [${paths[*]}]." - coverage combine ${paths[@]} - coverage report -m -i + coverage combine ${paths[@]} || failed_steps+=("coverage combine") + coverage report -m || failed_steps+=("coverage report") + fi + + if [ ${#failed_steps[@]} -gt 0 ]; then + echo + echo "${#failed_steps[@]} step(s) FAILED:" + for step in "${failed_steps[@]}"; do + echo " - $step" + done + exit 1 fi fi diff --git a/common/LICENSE b/common/LICENSE index d64569567..3d63c06ad 100644 --- a/common/LICENSE +++ b/common/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2026 Delphix Corp., a Perforce company. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/common/pyproject.toml b/common/pyproject.toml new file mode 100644 index 000000000..ac7168769 --- /dev/null +++ b/common/pyproject.toml @@ -0,0 +1,48 @@ +# +# Copyright (c) 2026 by Delphix. All rights reserved. +# + +[build-system] +requires = ["setuptools>=77"] +build-backend = "setuptools.build_meta" + +[project] +name = "dvp-common" +version = "5.1.0" +readme = "README.md" +requires-python = ">=3.11, <3.12" +authors = [ + {name = "Delphix", email = "virtualization-plugins@delphix.com"}, +] +license = "Apache-2.0" +license-files = ["LICENSE"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent", +] +dependencies = [ + "dvp-api == 1.10.0.dev3", + "six >= 1.17, < 1.18", +] + +[project.optional-dependencies] +dev = [ + "bump2version == 1.0.1", + "packaging == 26.0", + "pluggy == 1.6.0", + "pyparsing == 3.3.2", + "pytest == 9.0.2", + "six == 1.17.0", + "zipp == 3.23.0", +] + +[project.urls] +Homepage = "https://developer.delphix.com" + +[tool.setuptools] +package-dir = {"" = "src/main/python"} + +[tool.setuptools.packages.find] +where = ["src/main/python"] \ No newline at end of file diff --git a/common/requirements.txt b/common/requirements.txt deleted file mode 100644 index 822c250f0..000000000 --- a/common/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -bump2version==1.0.1 -packaging==26.0 -pluggy==1.6.0 -pyparsing==3.3.2 -pytest==9.0.2 -six==1.17.0 -zipp==3.23.0 diff --git a/common/setup.cfg b/common/setup.cfg deleted file mode 100644 index c282c94fb..000000000 --- a/common/setup.cfg +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright (c) 2019, 2022 by Delphix. All rights reserved. -# - -[metadata] -metadata_version: 1.2 -author: Delphix -author_email: virtualization-plugins@delphix.com -home_page: https://developer.delphix.com -long_description: file: README.md -long_description_content_type: text/markdown -classifiers: - Development Status :: 5 - Production/Stable - Programming Language :: Python - Programming Language :: Python :: 3.11 - License :: OSI Approved :: Apache Software License - Operating System :: OS Independent - -[options] -requires_python: >=3.11, <3.12 diff --git a/common/setup.py b/common/setup.py deleted file mode 100644 index 7ecfe15a1..000000000 --- a/common/setup.py +++ /dev/null @@ -1,20 +0,0 @@ -import os -import setuptools - -PYTHON_SRC = 'src/main/python' - -install_requires = [ - "dvp-api == 1.10.0.dev0", - "six >= 1.17, < 1.18", -] - -with open(os.path.join(PYTHON_SRC, 'dlpx/virtualization/common/VERSION')) as version_file: - version = version_file.read().strip() - -setuptools.setup(name='dvp-common', - version=version, - install_requires=install_requires, - package_dir={'': PYTHON_SRC}, - packages=setuptools.find_packages(PYTHON_SRC), - python_requires='>=3.11, <3.12', - ) diff --git a/common/src/main/python/dlpx/virtualization/common/VERSION b/common/src/main/python/dlpx/virtualization/common/VERSION deleted file mode 100644 index 831446cbd..000000000 --- a/common/src/main/python/dlpx/virtualization/common/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.1.0 diff --git a/docs/Pipfile b/docs/Pipfile index d6b58fd26..7437f4f42 100644 --- a/docs/Pipfile +++ b/docs/Pipfile @@ -1,3 +1,7 @@ +# +# Copyright (c) 2026 by Delphix. All rights reserved. +# + [[source]] url = "https://pypi.org/simple" verify_ssl = true diff --git a/docs/build.sh b/docs/build.sh index f256f9233..270236837 100755 --- a/docs/build.sh +++ b/docs/build.sh @@ -1,4 +1,7 @@ #!/bin/bash +# +# Copyright (c) 2026 by Delphix. All rights reserved. +# git fetch pipenv run mkdocs build --clean diff --git a/dvp/LICENSE b/dvp/LICENSE index d64569567..3d63c06ad 100644 --- a/dvp/LICENSE +++ b/dvp/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2026 Delphix Corp., a Perforce company. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/dvp/pyproject.toml b/dvp/pyproject.toml new file mode 100644 index 000000000..edf91ee94 --- /dev/null +++ b/dvp/pyproject.toml @@ -0,0 +1,53 @@ +# +# Copyright (c) 2026 by Delphix. All rights reserved. +# + +[build-system] +requires = ["setuptools>=77"] +build-backend = "setuptools.build_meta" + +[project] +name = "dvp" +version = "5.1.0" +description = "Delphix Virtualization Platform SDK" +readme = "README.md" +requires-python = ">=3.11, <3.12" +authors = [ + {name = "Delphix", email = "virtualization-plugins@delphix.com"}, +] +license = "Apache-2.0" +license-files = ["LICENSE"] +keywords = ["virtualization", "plugin"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent", +] +# Sibling-package pins; .bumpversion.cfg keeps these in sync with [project].version. +dependencies = [ + "dvp-common == 5.1.0", + "dvp-libs == 5.1.0", + "dvp-platform == 5.1.0", + "dvp-tools == 5.1.0", +] + +[project.optional-dependencies] +dev = [ + "bump2version == 1.0.1", + "packaging == 26.0", + "pluggy == 1.6.0", + "pyparsing == 3.3.2", + "pytest == 9.0.2", + "six == 1.17.0", + "zipp == 3.23.0", +] + +[project.urls] +Homepage = "https://developer.delphix.com" + +[tool.setuptools] +package-dir = {"" = "src/main/python"} + +[tool.setuptools.packages.find] +where = ["src/main/python"] \ No newline at end of file diff --git a/dvp/requirements.txt b/dvp/requirements.txt deleted file mode 100644 index 822c250f0..000000000 --- a/dvp/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -bump2version==1.0.1 -packaging==26.0 -pluggy==1.6.0 -pyparsing==3.3.2 -pytest==9.0.2 -six==1.17.0 -zipp==3.23.0 diff --git a/dvp/setup.cfg b/dvp/setup.cfg deleted file mode 100644 index 3952a0c59..000000000 --- a/dvp/setup.cfg +++ /dev/null @@ -1,22 +0,0 @@ -# -# Copyright (c) 2019, 2021 by Delphix. All rights reserved. -# - -[metadata] -metadata_version: 1.2 -author: Delphix -author_email: virtualization-plugins@delphix.com -home_page: https://developer.delphix.com -summary: Delphix Virtualization Platform SDK -long_description: file: README.md -long_description_content_type: text/markdown -keywords: virtualization plugin -classifiers: - Development Status :: 5 - Production/Stable - Programming Language :: Python - Programming Language :: Python :: 3.11 - License :: OSI Approved :: Apache Software License - Operating System :: OS Independent - -[options] -requires_python: >=3.11, <3.12 diff --git a/dvp/setup.py b/dvp/setup.py deleted file mode 100644 index bf0858f54..000000000 --- a/dvp/setup.py +++ /dev/null @@ -1,22 +0,0 @@ -import os -import setuptools - -PYTHON_SRC = 'src/main/python' - -with open(os.path.join(PYTHON_SRC, 'dlpx/virtualization/VERSION')) as version_file: - version = version_file.read().strip() - -install_requires = [ - "dvp-common == {}".format(version), - "dvp-libs == {}".format(version), - "dvp-platform == {}".format(version), - "dvp-tools == {}".format(version) -] - -setuptools.setup(name='dvp', - version=version, - install_requires=install_requires, - package_dir={'': PYTHON_SRC}, - packages=setuptools.find_packages(PYTHON_SRC), - python_requires='>=3.11, <3.12', - ) diff --git a/dvp/src/main/python/dlpx/__init__.py b/dvp/src/main/python/dlpx/__init__.py index c7fd3fc15..2d4d83c5b 100644 --- a/dvp/src/main/python/dlpx/__init__.py +++ b/dvp/src/main/python/dlpx/__init__.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2019 by Delphix. All rights reserved. +# Copyright (c) 2019, 2026 by Delphix. All rights reserved. # -__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/dvp/src/main/python/dlpx/virtualization/VERSION b/dvp/src/main/python/dlpx/virtualization/VERSION deleted file mode 100644 index 831446cbd..000000000 --- a/dvp/src/main/python/dlpx/virtualization/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.1.0 diff --git a/dvp/src/main/python/dlpx/virtualization/__init__.py b/dvp/src/main/python/dlpx/virtualization/__init__.py index c7fd3fc15..2d4d83c5b 100644 --- a/dvp/src/main/python/dlpx/virtualization/__init__.py +++ b/dvp/src/main/python/dlpx/virtualization/__init__.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2019 by Delphix. All rights reserved. +# Copyright (c) 2019, 2026 by Delphix. All rights reserved. # -__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/dvp/src/test/python/test_not_used.py b/dvp/src/test/python/test_not_used.py index 1b3695339..62c77b159 100644 --- a/dvp/src/test/python/test_not_used.py +++ b/dvp/src/test/python/test_not_used.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2019 by Delphix. All rights reserved. +# Copyright (c) 2019, 2026 by Delphix. All rights reserved. # @@ -8,4 +8,3 @@ def test_not_used(): The build will fail if there are no tests. This is an empty package needed to tie together the other dvp packages so there's nothing to test. """ - diff --git a/libs/LICENSE b/libs/LICENSE index d64569567..3d63c06ad 100644 --- a/libs/LICENSE +++ b/libs/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2026 Delphix Corp., a Perforce company. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/libs/pyproject.toml b/libs/pyproject.toml new file mode 100644 index 000000000..d6e57d143 --- /dev/null +++ b/libs/pyproject.toml @@ -0,0 +1,52 @@ +# +# Copyright (c) 2026 by Delphix. All rights reserved. +# + +[build-system] +requires = ["setuptools>=77"] +build-backend = "setuptools.build_meta" + +[project] +name = "dvp-libs" +version = "5.1.0" +description = "Delphix Virtualization Platform Libraries" +readme = "README.md" +requires-python = ">=3.11, <3.12" +authors = [ + {name = "Delphix", email = "virtualization-plugins@delphix.com"}, +] +license = "Apache-2.0" +license-files = ["LICENSE"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent", +] +# dvp-common pin is kept in sync with [project].version via .bumpversion.cfg. +dependencies = [ + "dvp-api == 1.10.0.dev3", + "dvp-common == 5.1.0", + "six >= 1.17, < 1.18", +] + +[project.optional-dependencies] +dev = [ + "bump2version == 1.0.1", + "mock == 5.2.0", + "packaging == 26.0", + "pluggy == 1.6.0", + "pyparsing == 3.3.2", + "pytest == 9.0.2", + "six == 1.17.0", + "zipp == 3.23.0", +] + +[project.urls] +Homepage = "https://developer.delphix.com" + +[tool.setuptools] +package-dir = {"" = "src/main/python"} + +[tool.setuptools.packages.find] +where = ["src/main/python"] \ No newline at end of file diff --git a/libs/requirements.txt b/libs/requirements.txt deleted file mode 100644 index 8b37cc01e..000000000 --- a/libs/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -./../common -bump2version==1.0.1 -mock==5.2.0 -packaging==26.0 -pluggy==1.6.0 -pyparsing==3.3.2 -pytest==9.0.2 -six==1.17.0 -zipp==3.23.0 diff --git a/libs/setup.cfg b/libs/setup.cfg deleted file mode 100644 index e934522dd..000000000 --- a/libs/setup.cfg +++ /dev/null @@ -1,21 +0,0 @@ -# -# Copyright (c) 2019, 2022 by Delphix. All rights reserved. -# - -[metadata] -metadata_version: 1.2 -author: Delphix -author_email: virtualization-plugins@delphix.com -home_page: https://developer.delphix.com -summary: Delphix Virtualization Platform Libraries -long_description: file: README.md -long_description_content_type: text/markdown -classifiers: - Development Status :: 5 - Production/Stable - Programming Language :: Python - Programming Language :: Python :: 3.11 - License :: OSI Approved :: Apache Software License - Operating System :: OS Independent - -[options] -requires_python: >=3.11, <3.12 diff --git a/libs/setup.py b/libs/setup.py deleted file mode 100644 index 4f69b7036..000000000 --- a/libs/setup.py +++ /dev/null @@ -1,21 +0,0 @@ -import os -import setuptools - -PYTHON_SRC = 'src/main/python' - -with open(os.path.join(PYTHON_SRC, 'dlpx/virtualization/libs/VERSION')) as version_file: - version = version_file.read().strip() - -install_requires = [ - "dvp-api == 1.10.0.dev0", - "dvp-common == {}".format(version), - "six >= 1.17, < 1.18", -] - -setuptools.setup(name='dvp-libs', - version=version, - install_requires=install_requires, - package_dir={'': PYTHON_SRC}, - packages=setuptools.find_packages(PYTHON_SRC), - python_requires='>=3.11, <3.12', - ) diff --git a/libs/src/main/python/dlpx/virtualization/libs/VERSION b/libs/src/main/python/dlpx/virtualization/libs/VERSION deleted file mode 100644 index 831446cbd..000000000 --- a/libs/src/main/python/dlpx/virtualization/libs/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.1.0 diff --git a/libs/src/test/python/dlpx/virtualization/_engine/__init__.py b/libs/src/test/python/dlpx/virtualization/_engine/__init__.py index e69de29bb..f256b6144 100644 --- a/libs/src/test/python/dlpx/virtualization/_engine/__init__.py +++ b/libs/src/test/python/dlpx/virtualization/_engine/__init__.py @@ -0,0 +1,3 @@ +# +# Copyright (c) 2026 by Delphix. All rights reserved. +# diff --git a/linkcheck-skip.txt b/linkcheck-skip.txt index 58bb60b04..5f5e382a1 100644 --- a/linkcheck-skip.txt +++ b/linkcheck-skip.txt @@ -1,3 +1,6 @@ +# +# Copyright (c) 2026 by Delphix. All rights reserved. +# # URLs to skip when running linkcheck (https://github.com/filiph/linkcheck) # Skip certain external links fonts.gstatic.com diff --git a/platform/LICENSE b/platform/LICENSE index d64569567..3d63c06ad 100644 --- a/platform/LICENSE +++ b/platform/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2026 Delphix Corp., a Perforce company. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/platform/pyproject.toml b/platform/pyproject.toml new file mode 100644 index 000000000..3c1daf5f7 --- /dev/null +++ b/platform/pyproject.toml @@ -0,0 +1,52 @@ +# +# Copyright (c) 2026 by Delphix. All rights reserved. +# + +[build-system] +requires = ["setuptools>=77"] +build-backend = "setuptools.build_meta" + +[project] +name = "dvp-platform" +version = "5.1.0" +description = "Delphix Virtualization Platform APIs" +readme = "README.md" +requires-python = ">=3.11, <3.12" +authors = [ + {name = "Delphix", email = "virtualization-plugins@delphix.com"}, +] +license = "Apache-2.0" +license-files = ["LICENSE"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent", +] +# dvp-common pin is kept in sync with [project].version via .bumpversion.cfg. +dependencies = [ + "dvp-api == 1.10.0.dev3", + "dvp-common == 5.1.0", + "six >= 1.17, < 1.18", +] + +[project.optional-dependencies] +dev = [ + "bump2version == 1.0.1", + "mock == 5.2.0", + "packaging == 26.0", + "pluggy == 1.6.0", + "pyparsing == 3.3.2", + "pytest == 9.0.2", + "six == 1.17.0", + "zipp == 3.23.0", +] + +[project.urls] +Homepage = "https://developer.delphix.com" + +[tool.setuptools] +package-dir = {"" = "src/main/python"} + +[tool.setuptools.packages.find] +where = ["src/main/python"] \ No newline at end of file diff --git a/platform/requirements.txt b/platform/requirements.txt deleted file mode 100644 index 8b37cc01e..000000000 --- a/platform/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -./../common -bump2version==1.0.1 -mock==5.2.0 -packaging==26.0 -pluggy==1.6.0 -pyparsing==3.3.2 -pytest==9.0.2 -six==1.17.0 -zipp==3.23.0 diff --git a/platform/setup.cfg b/platform/setup.cfg deleted file mode 100644 index 7194761aa..000000000 --- a/platform/setup.cfg +++ /dev/null @@ -1,21 +0,0 @@ -# -# Copyright (c) 2019, 2022 by Delphix. All rights reserved. -# - -[metadata] -metadata_version: 1.2 -author: Delphix -author_email: virtualization-plugins@delphix.com -home_page: https://developer.delphix.com -summary: Delphix Virtualization Platform APIs -long_description: file: README.md -long_description_content_type: text/markdown -classifiers: - Development Status :: 5 - Production/Stable - Programming Language :: Python - Programming Language :: Python :: 3.11 - License :: OSI Approved :: Apache Software License - Operating System :: OS Independent - -[options] -requires_python: >=3.11, <3.12 diff --git a/platform/setup.py b/platform/setup.py deleted file mode 100644 index 3377837b0..000000000 --- a/platform/setup.py +++ /dev/null @@ -1,21 +0,0 @@ -import os -import setuptools - -PYTHON_SRC = 'src/main/python' - -with open(os.path.join(PYTHON_SRC, 'dlpx/virtualization/platform/VERSION')) as version_file: - version = version_file.read().strip() - -install_requires = [ - "dvp-api == 1.10.0.dev0", - "dvp-common == {}".format(version), - "six >= 1.17, < 1.18", -] - -setuptools.setup(name='dvp-platform', - version=version, - install_requires=install_requires, - package_dir={'': PYTHON_SRC}, - packages=setuptools.find_packages(PYTHON_SRC), - python_requires='>=3.11, <3.12', - ) diff --git a/platform/src/main/python/dlpx/virtualization/platform/VERSION b/platform/src/main/python/dlpx/virtualization/platform/VERSION deleted file mode 100644 index 831446cbd..000000000 --- a/platform/src/main/python/dlpx/virtualization/platform/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.1.0 diff --git a/platform/src/test/python/dlpx/virtualization/fake_generated_definitions.py b/platform/src/test/python/dlpx/virtualization/fake_generated_definitions.py index 9b5d087c4..0c770fc8f 100644 --- a/platform/src/test/python/dlpx/virtualization/fake_generated_definitions.py +++ b/platform/src/test/python/dlpx/virtualization/fake_generated_definitions.py @@ -1,3 +1,7 @@ +# +# Copyright (c) 2026 by Delphix. All rights reserved. +# + import six diff --git a/tools/LICENSE b/tools/LICENSE index d64569567..3d63c06ad 100644 --- a/tools/LICENSE +++ b/tools/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2026 Delphix Corp., a Perforce company. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/MANIFEST.in b/tools/MANIFEST.in index a9138fbdb..3e4466998 100644 --- a/tools/MANIFEST.in +++ b/tools/MANIFEST.in @@ -11,4 +11,3 @@ recursive-include src/main/python/dlpx/virtualization/_internal/codegen/template recursive-include src/main/python/dlpx/virtualization/_internal/commands/plugin_template * recursive-include src/main/python/dlpx/virtualization/_internal/validation_schemas * recursive-include src/main/python *.cfg -include src/main/python/dlpx/virtualization/_internal/VERSION diff --git a/tools/pyproject.toml b/tools/pyproject.toml new file mode 100644 index 000000000..1ee15107b --- /dev/null +++ b/tools/pyproject.toml @@ -0,0 +1,89 @@ +# +# Copyright (c) 2026 by Delphix. All rights reserved. +# + +[build-system] +requires = ["setuptools>=77"] +build-backend = "setuptools.build_meta" + +[project] +name = "dvp-tools" +version = "5.1.0" +description = "Delphix Virtualization SDK Tools" +readme = "README.md" +requires-python = ">=3.11, <3.12" +authors = [ + {name = "Delphix", email = "virtualization-plugins@delphix.com"}, +] +license = "Apache-2.0" +license-files = ["LICENSE"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent", +] +# Sibling-package pins (dvp-libs, dvp-platform) are kept in sync via .bumpversion.cfg. +dependencies = [ + "attrs >= 25.3, < 25.4", + "certifi >= 2024, < 2025", + "click == 7.1.2", + "click-configfile == 0.2.3", + "configparser >= 7.2, < 7.3", + "dvp-libs == 5.1.0", + "dvp-platform == 5.1.0", + "flake8 >= 7.3, < 7.4", + "httpretty >= 1.0, < 1.1", + "importlib-resources >= 6.5, < 6.6", + "jinja2 >= 3.1, < 3.2", + "jsonschema >= 4.25, < 4.26", + "MarkupSafe >= 3.0, < 3.1", + "pkgutil_resolve_name == 1.3.10", + "pyyaml >= 6, < 7", + "requests >= 2.32, < 2.33", + "six >= 1.17, < 1.18", + "zipp >= 3.23, < 3.24", +] + +[project.optional-dependencies] +dev = [ + "bump2version == 1.0.1", + "coverage == 7.13.5", + "entrypoints == 0.4", + "flake8 == 7.3.0", + "httpretty == 1.0.5", + "isort == 8.0.1", + "mccabe == 0.7.0", + "mock == 5.2.0", + "more-itertools == 10.8.0", + "packaging == 26.0", + "pluggy == 1.6.0", + "pycodestyle == 2.14.0", + "pyflakes == 3.4.0", + "pyparsing == 3.3.2", + "pytest == 9.0.2", + "pytest-cov == 7.1.0", + "six == 1.17.0", + "yapf == 0.43.0", + "zipp == 3.23.0", +] + +[project.urls] +Homepage = "https://developer.delphix.com" + +[project.scripts] +dvp = "dlpx.virtualization._internal.cli:delphix_sdk" + +[tool.setuptools] +package-dir = {"" = "src/main/python"} +include-package-data = true + +[tool.setuptools.packages.find] +where = ["src/main/python"] + +[tool.coverage.run] +source = ["src/main/python"] +omit = [ + "*/plugin_template/*", + "*.template", +] \ No newline at end of file diff --git a/tools/requirements.txt b/tools/requirements.txt deleted file mode 100644 index 5ba42cdb0..000000000 --- a/tools/requirements.txt +++ /dev/null @@ -1,22 +0,0 @@ -./../common -./../libs -./../platform -bump2version==1.0.1 -coverage==7.13.5 -entrypoints==0.4 -flake8==7.3.0 -httpretty==1.0.5 -isort==8.0.1 -mccabe==0.7.0 -mock==5.2.0 -more-itertools==10.8.0 -packaging==26.0 -pluggy==1.6.0 -pycodestyle==2.14.0 -pyflakes==3.4.0 -pyparsing==3.3.2 -pytest-cov==7.1.0 -pytest==9.0.2 -six==1.17.0 -yapf==0.43.0 -zipp==3.23.0 diff --git a/tools/setup.cfg b/tools/setup.cfg deleted file mode 100644 index d4c1bf049..000000000 --- a/tools/setup.cfg +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright (c) 2019, 2021 by Delphix. All rights reserved. -# - -[metadata] -metadata_version: 1.2 -author: Delphix -author_email: virtualization-plugins@delphix.com -home_page: https://developer.delphix.com -summary: Delphix Virtualization SDK Tools -long_description: file: README.md -long_description_content_type: text/markdown -classifiers: - Development Status :: 5 - Production/Stable - Programming Language :: Python - Programming Language :: Python :: 3.11 - License :: OSI Approved :: Apache Software License - Operating System :: OS Independent - -[options] -include_package_data = True -requires_python: >=3.11, <3.12 - -[options.entry_points] -console_scripts = - dvp = dlpx.virtualization._internal.cli:delphix_sdk diff --git a/tools/setup.py b/tools/setup.py deleted file mode 100644 index d3eb0ed6c..000000000 --- a/tools/setup.py +++ /dev/null @@ -1,43 +0,0 @@ -import os -import setuptools - -PYTHON_SRC = 'src/main/python' - -with open(os.path.join(PYTHON_SRC, 'dlpx/virtualization/_internal/VERSION')) as version_file: - version = version_file.read().strip() - -# -# Update the dependency using below use cases -# 1. Dependency version change does not break test cases or have code issues -# - Only update the maximum version (<). -# 2. Dependency version changes break test cases or have code issues -# - Update the minimum as well as maximum version along with code changes. -# -install_requires = [ - "attrs >= 25.3, < 25.4", - "certifi >= 2024, < 2025", - "click == 7.1.2", - "click-configfile == 0.2.3", - "configparser >= 7.2, < 7.3", - "dvp-libs == {}".format(version), - "dvp-platform == {}".format(version), - "flake8 >= 7.3, < 7.4", - "httpretty >= 1.0, < 1.1", - "importlib-resources >= 6.5, < 6.6", - "jinja2 >= 3.1, < 3.2", - "jsonschema >= 4.25, < 4.26", - "MarkupSafe >= 3.0, < 3.1", - "pkgutil_resolve_name == 1.3.10", - "pyyaml >= 6, < 7", - "requests >= 2.32, < 2.33", - "six >= 1.17, < 1.18", - "zipp >= 3.23, < 3.24", -] - -setuptools.setup(name='dvp-tools', - version=version, - install_requires=install_requires, - package_dir={'': PYTHON_SRC}, - packages=setuptools.find_packages(PYTHON_SRC), - python_requires='>=3.11, <3.12', - ) diff --git a/tools/src/main/python/dlpx/virtualization/_internal/VERSION b/tools/src/main/python/dlpx/virtualization/_internal/VERSION deleted file mode 100644 index 831446cbd..000000000 --- a/tools/src/main/python/dlpx/virtualization/_internal/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.1.0 diff --git a/tools/src/main/python/dlpx/virtualization/_internal/package_util.py b/tools/src/main/python/dlpx/virtualization/_internal/package_util.py index b065a3807..ce2fee0b8 100644 --- a/tools/src/main/python/dlpx/virtualization/_internal/package_util.py +++ b/tools/src/main/python/dlpx/virtualization/_internal/package_util.py @@ -6,8 +6,11 @@ import logging import os import re +from importlib.metadata import PackageNotFoundError +from importlib.metadata import version as _pkg_version from dlpx.virtualization import _internal as virtualization_internal +from dlpx.virtualization._internal import exceptions from dlpx.virtualization.platform import util from six.moves import configparser @@ -45,11 +48,12 @@ def _get_settings(): @_run_once def get_version(): - """Returns the version of the dlpx.virtualization._internal package.""" - with open(os.path.join(get_internal_package_root(), - 'VERSION')) as version_file: - version = version_file.read().strip() - return version + """Returns the version of the installed dvp-tools package.""" + try: + return _pkg_version("dvp-tools") + except PackageNotFoundError: + raise exceptions.UserError( + "dvp-tools is not installed. Run 'pip install dvp'.") def get_external_version_string(version_string): diff --git a/tools/src/test/python/dlpx/virtualization/_internal/engine_version.cfg b/tools/src/test/python/dlpx/virtualization/_internal/engine_version.cfg index a3b69e2eb..b90466307 100644 --- a/tools/src/test/python/dlpx/virtualization/_internal/engine_version.cfg +++ b/tools/src/test/python/dlpx/virtualization/_internal/engine_version.cfg @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 by Delphix. All rights reserved. +# Copyright (c) 2026 by Delphix. All rights reserved. # # diff --git a/tools/src/test/python/dlpx/virtualization/_internal/test_cli.py b/tools/src/test/python/dlpx/virtualization/_internal/test_cli.py index 49c673bf9..2ec8ad0b6 100644 --- a/tools/src/test/python/dlpx/virtualization/_internal/test_cli.py +++ b/tools/src/test/python/dlpx/virtualization/_internal/test_cli.py @@ -198,12 +198,17 @@ def test_empty_root_dir(plugin_name): assert "Invalid value for '-r'" in result.output @staticmethod - def test_name_required(): + @mock.patch('dlpx.virtualization._internal.commands.initialize.init') + def test_name_optional(mock_init): + # --plugin-name is optional (PYT-536); when omitted, the plugin id + # (auto-generated UUID) is used as the display name. runner = click_testing.CliRunner() result = runner.invoke(cli.delphix_sdk, ['init']) - assert result.exit_code != 0 + assert result.exit_code == 0, 'Output: {}'.format(result.output) + mock_init.assert_called_once_with(os.getcwd(), const.DIRECT_TYPE, + None, const.UNIX_HOST_TYPE) @staticmethod def test_multiple_host_types():