Skip to content

Commit 35782e0

Browse files
authored
DLPX-84163 Update all the greater than equal to (>=) dependencies in setup.py and requirements.txt files of dvp packages to equal to(==) (#455)
PR URL: #455
1 parent 97d163e commit 35782e0

File tree

17 files changed

+192
-163
lines changed

17 files changed

+192
-163
lines changed

.github/workflows/publish-python-packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
max-parallel: 5
1919
matrix:
20-
python-version: [2.7]
20+
python-version: [3.8]
2121
package: [common, dvp, libs, platform, tools]
2222

2323
steps:

bin/build_project.sh

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ modules=("common" "libs" "platform" "tools" "dvp")
1313
should_build=false
1414
should_test=false
1515
verbose=false
16+
coverage=false
17+
flake8=false
1618
screenSize=$(tput cols)
1719
equalFiller="="
1820
greenColor=$(tput setaf 10)
@@ -45,6 +47,12 @@ Help() {
4547
echo " v${blackColor} | ${orangeColor}Verbose mode on ${blackColor} | ${greenColor}sh build_project.sh -t -v${noColor}"
4648
echo " ${blackColor} | ${orangeColor} ${blackColor} | ${greenColor}sh build_project.sh -bvt -m tools${noColor}"
4749
print_separator
50+
echo " c${blackColor} | ${orangeColor}Test Coverage mode on ${blackColor} | ${greenColor}sh build_project.sh -t -c${noColor}"
51+
echo " ${blackColor} | ${orangeColor} ${blackColor} | ${greenColor}sh build_project.sh -bct -m tools${noColor}"
52+
print_separator
53+
echo " f${blackColor} | ${orangeColor}Flake8 validation mode on ${blackColor} | ${greenColor}sh build_project.sh -f${noColor}"
54+
echo " ${blackColor} | ${orangeColor} ${blackColor} | ${greenColor}sh build_project.sh -bft -m tools${noColor}"
55+
print_separator
4856
echo " m${blackColor} | ${orangeColor}provide a list of modules.${blackColor} | ${greenColor}sh build_project.sh -bt -m common -m libs${noColor}"
4957
echo " ${blackColor} | ${orangeColor}Valid python modules: ${blackColor} | ${noColor}"
5058
echo " ${blackColor} | ${orangeColor} - common ${blackColor} | ${noColor}"
@@ -81,6 +89,16 @@ run_operations() {
8189
build_module
8290
print_as_per_screen_size " $module_name build complete " "${greenColor}" ${equalFiller} "${screenSize}"
8391
fi
92+
if [ "$flake8" = true ]; then
93+
echo
94+
print_as_per_screen_size " $module_name Flake8 Main starts " "${orangeColor}" ${equalFiller} "${screenSize}"
95+
python -m flake8 "$module_path/src/test/python" --max-line-length 88
96+
print_as_per_screen_size " $module_name Flake8 Main complete " "${greenColor}" ${equalFiller} "${screenSize}"
97+
echo
98+
print_as_per_screen_size " $module_name Flake8 Test starts " "${orangeColor}" ${equalFiller} "${screenSize}"
99+
python -m flake8 "$module_path/src/main/python" --max-line-length 88
100+
print_as_per_screen_size " $module_name Flake8 Test complete " "${greenColor}" ${equalFiller} "${screenSize}"
101+
fi
84102
if [ "$should_test" = true ]; then
85103
echo
86104
print_as_per_screen_size " $module_name tests starts " "${orangeColor}" ${equalFiller} "${screenSize}"
@@ -112,11 +130,18 @@ build_module() {
112130

113131
# Test the module
114132
test_module() {
115-
if [ "$verbose" = true ]; then
116-
python -m pytest -v src/test/python
133+
cmd=[]
134+
if [ "$coverage" = true ]; then
135+
cmd=( coverage run -m pytest )
117136
else
118-
python -m pytest src/test/python
137+
cmd=( python -m pytest )
119138
fi
139+
if [ "$verbose" = true ]; then
140+
cmd=( ${cmd[@]} -v)
141+
fi
142+
cmd=( ${cmd[@]} src/test/python)
143+
echo "Test command is ${cmd[*]}"
144+
${cmd[@]}
120145
}
121146

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

134159
# Get the options
135-
while getopts ":hbtvm:" option; do
160+
while getopts ":hbftvcm:" option; do
136161
case $option in
137162
h) # display Help
138163
Help
@@ -150,6 +175,10 @@ while getopts ":hbtvm:" option; do
150175
fi ;;
151176
v) # Verbose mode
152177
verbose=true ;;
178+
c) # Coverage mode
179+
coverage=true ;;
180+
f) # Run flake8 mode
181+
flake8=true ;;
153182
\?) # Invalid options.
154183
echo "Error: Invalid option"
155184
Help
@@ -166,12 +195,21 @@ while getopts ":hbtvm:" option; do
166195
esac
167196
done
168197

169-
if [ "$should_build" = true ] || [ "$should_test" = true ]; then
198+
if [ "$should_build" = true ] || [ "$should_test" = true ] || [ "$flake8" = true ]; then
170199
if [ ${#multi[@]} -eq 0 ]; then
171200
multi=("${modules[@]}")
172201
fi
173202

203+
paths=()
204+
current_path="$PWD"
174205
for module in "${multi[@]}"; do
175206
run_operations "$module"
207+
paths=( ${paths[@]} "${current_path}/${module}/.coverage")
176208
done
209+
210+
if [ "$coverage" = true ]; then
211+
echo "Paths to combine for coverage are [${paths[*]}]."
212+
coverage combine ${paths[@]}
213+
coverage report -m -i
214+
fi
177215
fi

common/requirements.txt

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
bump2version==0.5.11
2-
contextlib2==0.6.0.post1 ; python_version < '3'
3-
enum34==1.1.6
4-
funcsigs==1.0.2 ; python_version < '3.0'
5-
importlib-metadata==0.23 ; python_version < '3.8'
6-
more-itertools==5.0.0 ; python_version <= '2.7'
7-
packaging==19.2
8-
pathlib2==2.3.5 ; python_version < '3.6'
9-
pluggy==0.13.0
10-
py==1.8.0
11-
pyparsing==2.4.5
12-
pytest==4.6.11
13-
scandir==1.10.0 ; python_version < '3.5'
14-
six==1.13.0
15-
zipp==0.6.0
1+
bump2version==1.0.1
2+
packaging==22.0
3+
pluggy==1.0.0
4+
pyparsing==3.0.9
5+
pytest==7.2.0
6+
six==1.16.0
7+
zipp==3.11.0

common/setup.cfg

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2019, 2021 by Delphix. All rights reserved.
2+
# Copyright (c) 2019, 2022 by Delphix. All rights reserved.
33
#
44

55
[metadata]
@@ -12,10 +12,9 @@ long_description_content_type: text/markdown
1212
classifiers:
1313
Development Status :: 5 - Production/Stable
1414
Programming Language :: Python
15-
Programming Language :: Python :: 2.7
1615
Programming Language :: Python :: 3.8
1716
License :: OSI Approved :: Apache Software License
1817
Operating System :: OS Independent
1918

2019
[options]
21-
requires_python: >=2.7, <=3.8, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*
20+
requires_python: >=3.8, <3.9

common/setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
PYTHON_SRC = 'src/main/python'
55

66
install_requires = [
7-
"dvp-api == 1.7.0",
7+
"dvp-api == 1.7.0",
8+
"six >= 1.16, < 1.17",
89
]
910

1011
with open(os.path.join(PYTHON_SRC, 'dlpx/virtualization/common/VERSION')) as version_file:
@@ -15,5 +16,5 @@
1516
install_requires=install_requires,
1617
package_dir={'': PYTHON_SRC},
1718
packages=setuptools.find_packages(PYTHON_SRC),
18-
python_requires='>=2.7, <3.9, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*',
19-
)
19+
python_requires='>=3.8, <3.9',
20+
)

dvp/requirements.txt

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
bump2version==0.5.11
2-
contextlib2==0.6.0.post1 ; python_version < '3'
3-
funcsigs==1.0.2 ; python_version < '3.0'
4-
importlib-metadata==1.3.0 ; python_version < '3.8'
5-
more-itertools==5.0.0 ; python_version <= '2.7'
6-
packaging==20.0
7-
pathlib2==2.3.5 ; python_version < '3'
8-
pluggy==0.13.1
9-
py==1.8.1
10-
pyparsing==2.4.6
11-
pytest==4.6.11
12-
scandir==1.10.0 ; python_version < '3.5'
13-
six==1.13.0
14-
zipp==0.6.0
1+
bump2version==1.0.1
2+
packaging==22.0
3+
pluggy==1.0.0
4+
pyparsing==3.0.9
5+
pytest==7.2.0
6+
six==1.16.0
7+
zipp==3.11.0

dvp/setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
version = version_file.read().strip()
88

99
install_requires = [
10-
"dvp-common == {}".format(version),
11-
"dvp-libs == {}".format(version),
12-
"dvp-platform == {}".format(version),
13-
"dvp-tools == {}".format(version)
10+
"dvp-common == {}".format(version),
11+
"dvp-libs == {}".format(version),
12+
"dvp-platform == {}".format(version),
13+
"dvp-tools == {}".format(version)
1414
]
1515

1616
setuptools.setup(name='dvp',
@@ -19,4 +19,4 @@
1919
package_dir={'': PYTHON_SRC},
2020
packages=setuptools.find_packages(PYTHON_SRC),
2121
python_requires='>=3.8, <3.9',
22-
)
22+
)

libs/requirements.txt

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
./../common
2-
bump2version==0.5.11
3-
contextlib2==0.6.0.post1 ; python_version < '3'
4-
enum34==1.1.6
5-
funcsigs==1.0.2 ; python_version < '3.3'
6-
importlib-metadata==1.3.0 ; python_version < '3.8'
7-
mock==3.0.5
8-
more-itertools==5.0.0 ; python_version <= '2.7'
9-
packaging==19.2
10-
pathlib2==2.3.5 ; python_version < '3.6'
11-
pluggy==0.13.1
12-
py==1.8.1
13-
pyparsing==2.4.6
14-
pytest==4.6.11
15-
scandir==1.10.0 ; python_version < '3.5'
16-
six==1.13.0
17-
zipp==0.6.0
2+
bump2version==1.0.1
3+
mock==4.0.3
4+
packaging==22.0
5+
pluggy==1.0.0
6+
pyparsing==3.0.9
7+
pytest==7.2.0
8+
six==1.16.0
9+
zipp==3.11.0

libs/setup.cfg

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2019, 2021 by Delphix. All rights reserved.
2+
# Copyright (c) 2019, 2022 by Delphix. All rights reserved.
33
#
44

55
[metadata]
@@ -13,10 +13,9 @@ long_description_content_type: text/markdown
1313
classifiers:
1414
Development Status :: 5 - Production/Stable
1515
Programming Language :: Python
16-
Programming Language :: Python :: 2.7
1716
Programming Language :: Python :: 3.8
1817
License :: OSI Approved :: Apache Software License
1918
Operating System :: OS Independent
2019

2120
[options]
22-
requires_python: >=2.7, <=3.8, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*
21+
requires_python: >=3.8, <3.9

libs/setup.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
version = version_file.read().strip()
88

99
install_requires = [
10-
"dvp-api == 1.7.0",
11-
"dvp-common == {}".format(version)
10+
"dvp-api == 1.7.0",
11+
"dvp-common == {}".format(version),
12+
"six >= 1.16, < 1.17",
1213
]
1314

1415
setuptools.setup(name='dvp-libs',
1516
version=version,
1617
install_requires=install_requires,
1718
package_dir={'': PYTHON_SRC},
1819
packages=setuptools.find_packages(PYTHON_SRC),
19-
python_requires='>=2.7, <3.9, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*',
20-
)
20+
python_requires='>=3.8, <3.9',
21+
)

0 commit comments

Comments
 (0)