File tree Expand file tree Collapse file tree 5 files changed +39
-13
lines changed Expand file tree Collapse file tree 5 files changed +39
-13
lines changed Original file line number Diff line number Diff line change 1
- .idea /
1
+ * .pyc
2
+ .idea
3
+ Vagrantfile
4
+ .vagrant
5
+ htmlcov_ *
6
+ coverage_ * .xml
7
+ venv * /
2
8
3
9
# ## See: https://raw.githubusercontent.com/github/gitignore/master/Python.gitignore
4
10
# Byte-compiled / optimized / DLL files
Original file line number Diff line number Diff line change
1
+ [build-system ]
2
+ requires = [" setuptools>=42" , " wheel" , " setuptools_scm[toml]>=3.4" ]
3
+ build-backend = " setuptools.build_meta:__legacy__"
4
+
5
+ [tool .setuptools_scm ]
6
+ version_scheme = " post-release"
7
+
8
+ [tool .coverage .run ]
9
+ source = [' .' ]
10
+ omit = [' env*/*' , ' venv*/*' , ' tests/*' ]
Original file line number Diff line number Diff line change 1
- certifi == 2020.6.20
1
+ certifi == 2020.12.5
2
2
chardet == 3.0.4
3
+ coverage == 5.5
3
4
idna == 2.7
4
- mock == 1.3.0
5
- pbr == 5.5.1
5
+ mock == 4.0.3
6
6
requests == 2.20.1
7
- six == 1.15.0
7
+ toml == 0.10.2
8
8
urllib3 == 1.24.3
9
9
-e .[test ]
Original file line number Diff line number Diff line change 4
4
TEST_TYPE=" unit"
5
5
PYTHON_BIN=" python3"
6
6
THIS_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd) "
7
+ VENV_NAME=" venv"
7
8
8
9
usage () {
9
- echo " run-tests.sh -p=PYTHON_BIN -t=TEST_TYPE"
10
+ echo " run-tests.sh -p=PYTHON_BIN -v=VENV_NAME - t=TEST_TYPE"
10
11
exit 1
11
12
}
12
13
@@ -19,6 +20,9 @@ check_args() {
19
20
-p=* | --python-bin=* )
20
21
PYTHON_BIN=" ${i#* =} "
21
22
;;
23
+ -v=* | --venvdir=* )
24
+ VENV_NAME=" ${i#* =} "
25
+ ;;
22
26
* )
23
27
usage
24
28
;;
@@ -29,15 +33,17 @@ check_args() {
29
33
check_args $@
30
34
31
35
# Prepare the execution virtualenv
32
- virtualenv --python ${PYTHON_BIN} ${THIS_DIR} /venv
33
- source ${THIS_DIR} /venv /bin/activate
36
+ virtualenv --python ${PYTHON_BIN} ${THIS_DIR} /${VENV_NAME}
37
+ source ${THIS_DIR} /${VENV_NAME} /bin/activate
34
38
trap " deactivate" EXIT
35
39
if [ -f ${THIS_DIR} /requirements-dev.txt ]; then
36
40
pip install -r ${THIS_DIR} /requirements-dev.txt --no-deps
37
41
fi
38
42
39
43
# Execute the specified test suite
40
- python -m unittest discover --verbose --catch --start-directory ${THIS_DIR} /tests/${TEST_TYPE}
41
- if [ $? -ne 0 ]; then
42
- exit 1
43
- fi
44
+ coverage run -m unittest discover --verbose --catch --start-directory ${THIS_DIR} /tests/${TEST_TYPE}
45
+
46
+ # Generate the code coverage reports
47
+ coverage report
48
+ coverage html --directory htmlcov_${TEST_TYPE}
49
+ coverage xml -o coverage_${TEST_TYPE} .xml
Original file line number Diff line number Diff line change 5
5
6
6
setup (
7
7
name = 'exabyte-api-client' ,
8
- version = '2021.01.18.1' ,
8
+ setup_requires = ['setuptools_scm' ],
9
+ use_scm_version = {
10
+ 'version_scheme' : 'post-release' ,
11
+ },
9
12
description = 'Exabyte Python Client for RESTful API' ,
10
13
long_description = long_description ,
11
14
long_description_content_type = 'text/markdown' ,
18
21
],
19
22
extras_require = {
20
23
"test" : [
24
+ "coverage[toml]>=5.3" ,
21
25
"mock>=1.3.0" ,
22
26
],
23
27
},
You can’t perform that action at this time.
0 commit comments