Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -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<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<dev>\d+))?
Expand All @@ -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}'
Expand Down
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#
# Copyright (c) 2026 by Delphix. All rights reserved.
#

version: 2
updates:
- package-ecosystem: pip
Expand Down
74 changes: 45 additions & 29 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
17 changes: 11 additions & 6 deletions .github/workflows/publish-python-packages.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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 }}
Expand All @@ -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/*
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
53 changes: 35 additions & 18 deletions bin/build_project.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 #
Expand Down Expand Up @@ -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
Expand All @@ -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
}

Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion common/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
48 changes: 48 additions & 0 deletions common/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"]
7 changes: 0 additions & 7 deletions common/requirements.txt

This file was deleted.

20 changes: 0 additions & 20 deletions common/setup.cfg

This file was deleted.

Loading
Loading