Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/publish-python-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
max-parallel: 5
matrix:
python-version: [2.7]
python-version: [3.8]
package: [common, dvp, libs, platform, tools]

steps:
Expand Down
48 changes: 43 additions & 5 deletions bin/build_project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ modules=("common" "libs" "platform" "tools" "dvp")
should_build=false
should_test=false
verbose=false
coverage=false
flake8=false
screenSize=$(tput cols)
equalFiller="="
greenColor=$(tput setaf 10)
Expand Down Expand Up @@ -45,6 +47,12 @@ Help() {
echo " v${blackColor} | ${orangeColor}Verbose mode on ${blackColor} | ${greenColor}sh build_project.sh -t -v${noColor}"
echo " ${blackColor} | ${orangeColor} ${blackColor} | ${greenColor}sh build_project.sh -bvt -m tools${noColor}"
print_separator
echo " c${blackColor} | ${orangeColor}Test Coverage mode on ${blackColor} | ${greenColor}sh build_project.sh -t -c${noColor}"
echo " ${blackColor} | ${orangeColor} ${blackColor} | ${greenColor}sh build_project.sh -bct -m tools${noColor}"
print_separator
echo " f${blackColor} | ${orangeColor}Flake8 validation mode on ${blackColor} | ${greenColor}sh build_project.sh -f${noColor}"
echo " ${blackColor} | ${orangeColor} ${blackColor} | ${greenColor}sh build_project.sh -bft -m tools${noColor}"
print_separator
echo " m${blackColor} | ${orangeColor}provide a list of modules.${blackColor} | ${greenColor}sh build_project.sh -bt -m common -m libs${noColor}"
echo " ${blackColor} | ${orangeColor}Valid python modules: ${blackColor} | ${noColor}"
echo " ${blackColor} | ${orangeColor} - common ${blackColor} | ${noColor}"
Expand Down Expand Up @@ -81,6 +89,16 @@ run_operations() {
build_module
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
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
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}"
Expand Down Expand Up @@ -112,11 +130,18 @@ build_module() {

# Test the module
test_module() {
if [ "$verbose" = true ]; then
python -m pytest -v src/test/python
cmd=[]
if [ "$coverage" = true ]; then
cmd=( coverage run -m pytest )
else
python -m pytest src/test/python
cmd=( python -m pytest )
fi
if [ "$verbose" = true ]; then
cmd=( ${cmd[@]} -v)
fi
cmd=( ${cmd[@]} src/test/python)
echo "Test command is ${cmd[*]}"
${cmd[@]}
}

# Print the provided input in the center of screen by appending and prepending fillers.
Expand All @@ -132,7 +157,7 @@ print_as_per_screen_size() {
}

# Get the options
while getopts ":hbtvm:" option; do
while getopts ":hbftvcm:" option; do
case $option in
h) # display Help
Help
Expand All @@ -150,6 +175,10 @@ while getopts ":hbtvm:" option; do
fi ;;
v) # Verbose mode
verbose=true ;;
c) # Coverage mode
coverage=true ;;
f) # Run flake8 mode
flake8=true ;;
\?) # Invalid options.
echo "Error: Invalid option"
Help
Expand All @@ -166,12 +195,21 @@ while getopts ":hbtvm:" option; do
esac
done

if [ "$should_build" = true ] || [ "$should_test" = true ]; then
if [ "$should_build" = true ] || [ "$should_test" = true ] || [ "$flake8" = true ]; then
if [ ${#multi[@]} -eq 0 ]; then
multi=("${modules[@]}")
fi

paths=()
current_path="$PWD"
for module in "${multi[@]}"; do
run_operations "$module"
paths=( ${paths[@]} "${current_path}/${module}/.coverage")
done

if [ "$coverage" = true ]; then
echo "Paths to combine for coverage are [${paths[*]}]."
coverage combine ${paths[@]}
coverage report -m -i
fi
fi
22 changes: 7 additions & 15 deletions common/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
bump2version==0.5.11
contextlib2==0.6.0.post1 ; python_version < '3'
enum34==1.1.6
funcsigs==1.0.2 ; python_version < '3.0'
importlib-metadata==0.23 ; python_version < '3.8'
more-itertools==5.0.0 ; python_version <= '2.7'
packaging==19.2
pathlib2==2.3.5 ; python_version < '3.6'
pluggy==0.13.0
py==1.8.0
pyparsing==2.4.5
pytest==4.6.11
scandir==1.10.0 ; python_version < '3.5'
six==1.13.0
zipp==0.6.0
bump2version==1.0.1
packaging==22.0
pluggy==1.0.0
pyparsing==3.0.9
pytest==7.2.0
six==1.16.0
zipp==3.11.0
5 changes: 2 additions & 3 deletions common/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019, 2021 by Delphix. All rights reserved.
# Copyright (c) 2019, 2022 by Delphix. All rights reserved.
#

[metadata]
Expand All @@ -12,10 +12,9 @@ long_description_content_type: text/markdown
classifiers:
Development Status :: 5 - Production/Stable
Programming Language :: Python
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3.8
License :: OSI Approved :: Apache Software License
Operating System :: OS Independent

[options]
requires_python: >=2.7, <=3.8, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*
requires_python: >=3.8, <3.9
7 changes: 4 additions & 3 deletions common/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
PYTHON_SRC = 'src/main/python'

install_requires = [
"dvp-api == 1.7.0",
"dvp-api == 1.7.0",
"six >= 1.16, < 1.17",
]

with open(os.path.join(PYTHON_SRC, 'dlpx/virtualization/common/VERSION')) as version_file:
Expand All @@ -15,5 +16,5 @@
install_requires=install_requires,
package_dir={'': PYTHON_SRC},
packages=setuptools.find_packages(PYTHON_SRC),
python_requires='>=2.7, <3.9, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*',
)
python_requires='>=3.8, <3.9',
)
21 changes: 7 additions & 14 deletions dvp/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
bump2version==0.5.11
contextlib2==0.6.0.post1 ; python_version < '3'
funcsigs==1.0.2 ; python_version < '3.0'
importlib-metadata==1.3.0 ; python_version < '3.8'
more-itertools==5.0.0 ; python_version <= '2.7'
packaging==20.0
pathlib2==2.3.5 ; python_version < '3'
pluggy==0.13.1
py==1.8.1
pyparsing==2.4.6
pytest==4.6.11
scandir==1.10.0 ; python_version < '3.5'
six==1.13.0
zipp==0.6.0
bump2version==1.0.1
packaging==22.0
pluggy==1.0.0
pyparsing==3.0.9
pytest==7.2.0
six==1.16.0
zipp==3.11.0
10 changes: 5 additions & 5 deletions dvp/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
version = version_file.read().strip()

install_requires = [
"dvp-common == {}".format(version),
"dvp-libs == {}".format(version),
"dvp-platform == {}".format(version),
"dvp-tools == {}".format(version)
"dvp-common == {}".format(version),
"dvp-libs == {}".format(version),
"dvp-platform == {}".format(version),
"dvp-tools == {}".format(version)
]

setuptools.setup(name='dvp',
Expand All @@ -19,4 +19,4 @@
package_dir={'': PYTHON_SRC},
packages=setuptools.find_packages(PYTHON_SRC),
python_requires='>=3.8, <3.9',
)
)
24 changes: 8 additions & 16 deletions libs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
./../common
bump2version==0.5.11
contextlib2==0.6.0.post1 ; python_version < '3'
enum34==1.1.6
funcsigs==1.0.2 ; python_version < '3.3'
importlib-metadata==1.3.0 ; python_version < '3.8'
mock==3.0.5
more-itertools==5.0.0 ; python_version <= '2.7'
packaging==19.2
pathlib2==2.3.5 ; python_version < '3.6'
pluggy==0.13.1
py==1.8.1
pyparsing==2.4.6
pytest==4.6.11
scandir==1.10.0 ; python_version < '3.5'
six==1.13.0
zipp==0.6.0
bump2version==1.0.1
mock==4.0.3
packaging==22.0
pluggy==1.0.0
pyparsing==3.0.9
pytest==7.2.0
six==1.16.0
zipp==3.11.0
5 changes: 2 additions & 3 deletions libs/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019, 2021 by Delphix. All rights reserved.
# Copyright (c) 2019, 2022 by Delphix. All rights reserved.
#

[metadata]
Expand All @@ -13,10 +13,9 @@ long_description_content_type: text/markdown
classifiers:
Development Status :: 5 - Production/Stable
Programming Language :: Python
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3.8
License :: OSI Approved :: Apache Software License
Operating System :: OS Independent

[options]
requires_python: >=2.7, <=3.8, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*
requires_python: >=3.8, <3.9
9 changes: 5 additions & 4 deletions libs/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
version = version_file.read().strip()

install_requires = [
"dvp-api == 1.7.0",
"dvp-common == {}".format(version)
"dvp-api == 1.7.0",
"dvp-common == {}".format(version),
"six >= 1.16, < 1.17",
]

setuptools.setup(name='dvp-libs',
version=version,
install_requires=install_requires,
package_dir={'': PYTHON_SRC},
packages=setuptools.find_packages(PYTHON_SRC),
python_requires='>=2.7, <3.9, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*',
)
python_requires='>=3.8, <3.9',
)
23 changes: 8 additions & 15 deletions platform/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
./../common
bump2version==0.5.11
contextlib2==0.6.0.post1 ; python_version < '3'
funcsigs==1.0.2 ; python_version < '3.3'
importlib-metadata==1.3.0 ; python_version < '3.8'
mock==3.0.5
more-itertools==5.0.0 ; python_version <= '2.7'
packaging==20.0
pathlib2==2.3.5 ; python_version < '3'
pluggy==0.13.1
py==1.8.1
pyparsing==2.4.6
pytest==4.6.10
scandir==1.10.0 ; python_version < '3.5'
six==1.13.0
zipp==0.6.0
bump2version==1.0.1
mock==4.0.3
packaging==22.0
pluggy==1.0.0
pyparsing==3.0.9
pytest==7.2.0
six==1.16.0
zipp==3.11.0
5 changes: 2 additions & 3 deletions platform/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019, 2021 by Delphix. All rights reserved.
# Copyright (c) 2019, 2022 by Delphix. All rights reserved.
#

[metadata]
Expand All @@ -13,10 +13,9 @@ long_description_content_type: text/markdown
classifiers:
Development Status :: 5 - Production/Stable
Programming Language :: Python
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3.8
License :: OSI Approved :: Apache Software License
Operating System :: OS Independent

[options]
requires_python: >=2.7, <=3.8, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*
requires_python: >=3.8, <3.9
10 changes: 5 additions & 5 deletions platform/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
version = version_file.read().strip()

install_requires = [
"dvp-api == 1.7.0",
"dvp-common == {}".format(version),
"enum34;python_version < '3.4'",
"dvp-api == 1.7.0",
"dvp-common == {}".format(version),
"six >= 1.16, < 1.17",
]

setuptools.setup(name='dvp-platform',
version=version,
install_requires=install_requires,
package_dir={'': PYTHON_SRC},
packages=setuptools.find_packages(PYTHON_SRC),
python_requires='>=2.7, <3.9, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*',
)
python_requires='>=3.8, <3.9',
)
49 changes: 19 additions & 30 deletions tools/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,22 @@
./../common
./../libs
./../platform
backports.functools-lru-cache==1.6.1 ; python_version < '3.2'
bump2version==0.5.11
contextlib2==0.6.0.post1 ; python_version < '3'
coverage==5.0.2
entrypoints==0.3
enum34==1.1.6
flake8==3.7.9
funcsigs==1.0.2 ; python_version < '3.3'
functools32==3.2.3.post2 ; python_version < '3'
futures==3.3.0 ; python_version < '3.2'
httpretty==0.9.7
importlib-metadata==1.3.0 ; python_version < '3.8'
isort==4.3.21
mccabe==0.6.1
mock==3.0.5
more-itertools==5.0.0
packaging==20.0
pathlib2==2.3.5 ; python_version < '3'
pluggy==0.13.1
py==1.8.1
pycodestyle==2.5.0
pyflakes==2.1.1
pyparsing==2.4.6
pytest-cov==2.8.1
pytest==4.6.11
scandir==1.10.0 ; python_version < '3.5'
six==1.13.0
typing==3.7.4.1 ; python_version < '3.5'
yapf==0.28
zipp==0.6.0
bump2version==1.0.1
coverage==6.5.0
entrypoints==0.4
flake8==6.0.0
httpretty==1.0.5
isort==5.11.1
mccabe==0.7.0
mock==4.0.3
more-itertools==9.0.0
packaging==22.0
pluggy==1.0.0
pycodestyle==2.10.0
pyflakes==3.0.1
pyparsing==3.0.9
pytest-cov==4.0.0
pytest==7.2.0
six==1.16.0
yapf==0.32
zipp==3.11.0
Loading