Skip to content

Commit 18e8e6f

Browse files
committed
Update tox.ini with more recent configuration
1 parent 4195064 commit 18e8e6f

File tree

4 files changed

+135
-111
lines changed

4 files changed

+135
-111
lines changed

README.md

+56-62
Original file line numberDiff line numberDiff line change
@@ -9,78 +9,72 @@ Python library and CLI for the INDIGO PaaS Orchestrator.
99

1010
## Installation.
1111

12-
You can install it directly from PyPI
12+
You can install it directly from PyPI:
1313

14-
```
15-
pip install orpy
16-
```
14+
pip install orpy
1715

1816
## Usage as CLI
1917

2018
Before using the orchestrator with orpy you need to export your IAM access
2119
token. As long as the access token is valid orchent can tell the orchestrator
2220
what to do.
2321

24-
```
25-
export ORCHESTRATOR_TOKEN=<your access token here>
26-
```
27-
28-
```
29-
usage: orpy [--version] [-v | -q] [--log-file LOG_FILE] [-h] [--debug]
30-
[--url <orchestrator-url>]
31-
32-
Command line client for the INDIGO PaaS Orchestrator.
33-
34-
Please, before using this command put your a valid OpenID Connnect access
35-
token into the ORCHESTRATOR_TOKEN environment variable, so that we can use
36-
this token for authentication.
37-
38-
39-
optional arguments:
40-
--version show program's version number and exit
41-
-v, --verbose Increase verbosity of output. Can be repeated.
42-
-q, --quiet Suppress output except warnings and errors.
43-
--log-file LOG_FILE Specify a file to log output. Disabled by default.
44-
-h, --help Show help message and exit.
45-
--debug Show tracebacks on errors.
46-
--url <orchestrator-url>
47-
The base url of the orchestrator rest interface.
48-
Alternative the environment variable ORCHESTRATOR_URL
49-
can be used.
50-
51-
Commands:
52-
complete print bash completion command (cliff)
53-
dep create Create a deployment.
54-
dep delete Show details about an existing deployment.
55-
dep list List existing deployments at orchestrator.
56-
dep show Show details about an existing deployment.
57-
dep template Get template used for a given deployment.
58-
dep update Update an existing deployment.
59-
deployment create Create a deployment.
60-
deployment delete Show details about an existing deployment.
61-
deployment list List existing deployments at orchestrator.
62-
deployment show Show details about an existing deployment.
63-
deployment template Get template used for a given deployment.
64-
deployment update Update an existing deployment.
65-
help print detailed help for another command (cliff)
66-
resources list List Resources for a given deployment.
67-
resources show Show details about a resource for a given deployment.
68-
test Test if the given URL is pointing to an orchestrator.
69-
```
22+
export ORCHESTRATOR_TOKEN=<your access token here>
23+
24+
Then, the usage is as follows:
25+
26+
usage: orpy [--version] [-v | -q] [--log-file LOG_FILE] [-h] [--debug]
27+
[--url <orchestrator-url>]
28+
29+
Command line client for the INDIGO PaaS Orchestrator.
30+
31+
Please, before using this command put your a valid OpenID Connnect access
32+
token into the ORCHESTRATOR_TOKEN environment variable, so that we can use
33+
this token for authentication.
34+
35+
36+
optional arguments:
37+
--version show program's version number and exit
38+
-v, --verbose Increase verbosity of output. Can be repeated.
39+
-q, --quiet Suppress output except warnings and errors.
40+
--log-file LOG_FILE Specify a file to log output. Disabled by default.
41+
-h, --help Show help message and exit.
42+
--debug Show tracebacks on errors.
43+
--url <orchestrator-url>
44+
The base url of the orchestrator rest interface.
45+
Alternative the environment variable ORCHESTRATOR_URL
46+
can be used.
47+
48+
Commands:
49+
complete print bash completion command (cliff)
50+
dep create Create a deployment.
51+
dep delete Show details about an existing deployment.
52+
dep list List existing deployments at orchestrator.
53+
dep show Show details about an existing deployment.
54+
dep template Get template used for a given deployment.
55+
dep update Update an existing deployment.
56+
deployment create Create a deployment.
57+
deployment delete Show details about an existing deployment.
58+
deployment list List existing deployments at orchestrator.
59+
deployment show Show details about an existing deployment.
60+
deployment template Get template used for a given deployment.
61+
deployment update Update an existing deployment.
62+
help print detailed help for another command (cliff)
63+
resources list List Resources for a given deployment.
64+
resources show Show details about a resource for a given deployment.
65+
test Test if the given URL is pointing to an orchestrator.
7066

7167
## Usage as API
7268

7369
Besides being a CLI application, `orpy` can be used as a library:
7470

75-
```
76-
>>> from orpy.client import client
77-
>>> orpy = client.OrpyClient(
78-
... url=ORCHESTRATOR_URL,
79-
... token=ORCHESTRATOR_TOKEN)
80-
>>> deployments = orpy.deployments.list()
81-
>>> deployments[0]
82-
<Deployment cloudProviderName=provider-BARI, createdBy={u'subject': u'de28e179-ec86-4915-a748-7a37f8d80311', u'issuer': u'https://iam.deep-hybrid-datacloud.eu/'}, creationTime=2019-05-27T11:31+0000, links=[{u'href': u'https://paas.cloud.cnaf.infn.it/orchestrator/deployments/11e98073-06f3-6797-9258-0242ac140005', u'rel': u'self'}, {u'href': u'https://paas.cloud.cnaf.infn.it/orchestrator/deployments/11e98073-06f3-6797-9258-0242ac140005/resources', u'rel': u'resources'}, {u'href': u'https://paas.cloud.cnaf.infn.it/orchestrator/deployments/11e98073-06f3-6797-9258-0242ac140005/template', u'rel': u'template'}], outputs={}, physicalId=11e98073-06f3-6797-9258-0242ac140005, status=CREATE_FAILED, statusReason=Error while checking the deployment status; nested exception is feign.RetryableException: mesos.ui.sav.sk executing GET https://mesos.ui.sav.sk/marathon/v2/groups/11e98073-06f3-6797-9258-0242ac140005, task=NONE, updateTime=2019-05-29T02:05+0000, uuid=11e98073-06f3-6797-9258-0242ac140005>
83-
>>> deployments[0].status
84-
CREATE_FAILED
85-
>>>
86-
```
71+
>>> from orpy.client import client
72+
>>> orpy = client.OrpyClient(
73+
... url=ORCHESTRATOR_URL,
74+
... token=ORCHESTRATOR_TOKEN)
75+
>>> deployments = orpy.deployments.list()
76+
>>> deployments[0]
77+
<Deployment cloudProviderName=provider-BARI, createdBy={u'subject': u'de28e179-ec86-4915-a748-7a37f8d80311', u'issuer': u'https://iam.deep-hybrid-datacloud.eu/'}, creationTime=2019-05-27T11:31+0000, links=[{u'href': u'https://paas.cloud.cnaf.infn.it/orchestrator/deployments/11e98073-06f3-6797-9258-0242ac140005', u'rel': u'self'}, {u'href': u'https://paas.cloud.cnaf.infn.it/orchestrator/deployments/11e98073-06f3-6797-9258-0242ac140005/resources', u'rel': u'resources'}, {u'href': u'https://paas.cloud.cnaf.infn.it/orchestrator/deployments/11e98073-06f3-6797-9258-0242ac140005/template', u'rel': u'template'}], outputs={}, physicalId=11e98073-06f3-6797-9258-0242ac140005, status=CREATE_FAILED, statusReason=Error while checking the deployment status; nested exception is feign.RetryableException: mesos.ui.sav.sk executing GET https://mesos.ui.sav.sk/marathon/v2/groups/11e98073-06f3-6797-9258-0242ac140005, task=NONE, updateTime=2019-05-29T02:05+0000, uuid=11e98073-06f3-6797-9258-0242ac140005>
78+
>>> deployments[0].status
79+
CREATE_FAILED
80+
>>>

setup.cfg

+8-19
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
[metadata]
22
name = orpy
33
summary = Python library and CLI for the INDIGO PaaS Orchestrator.
4-
description-file =
5-
README.md
4+
description-file = README.md
65
description-content-type = text/markdown; charset=UTF-8
76

87
author = Alvaro Lopez Garcia
98
author-email = [email protected]
109
home-page = https://github.com/indigo-dc/orpy
1110
classifier =
11+
Development Status :: 5 - Production/Stable
12+
Environment :: Console
13+
Environment :: Web Environment
14+
Intended Audience :: Developers
1215
Intended Audience :: Information Technology
16+
Intended Audience :: Science/Research
1317
Intended Audience :: System Administrators
1418
License :: OSI Approved :: Apache Software License
15-
Operating System :: POSIX :: Linux
19+
Operating System :: OS Independent
1620
Programming Language :: Python
1721
Programming Language :: Python :: 2
18-
Programming Language :: Python :: 2.7
1922
Programming Language :: Python :: 3
20-
Programming Language :: Python :: 3.6
23+
Topic :: Internet :: WWW/HTTP
2124

2225
[files]
2326
packages =
@@ -52,17 +55,3 @@ all_files = 1
5255

5356
[upload_sphinx]
5457
upload-dir = doc/build/html
55-
56-
[compile_catalog]
57-
directory = orpy/locale
58-
domain = orpy
59-
60-
[update_catalog]
61-
domain = orpy
62-
output_dir = orpy/locale
63-
input_file = orpy/locale/orpy.pot
64-
65-
[extract_messages]
66-
keywords = _ gettext ngettext l_ lazy_gettext
67-
mapping_file = babel.cfg
68-
output_file = orpy/locale/orpy.pot

test-requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ testscenarios>=0.4 # Apache-2.0/BSD
1313
testtools>=2.2.0 # MIT
1414
bandit>=1.1.0 # Apache-2.0
1515
reno>=2.5.0 # Apache-2.0
16+
17+
docutils>=0.15.2

tox.ini

+69-30
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
2-
minversion = 1.6
3-
envlist = py36,py27,pep8,pip-missing-reqs
2+
minversion = 2.1
3+
envlist = py36,py27,pep8,pip-missing-reqs,pypi,bandit
44
skipsdist = True
55

66
[testenv]
@@ -14,53 +14,92 @@ setenv =
1414
VIRTUAL_ENV={envdir}
1515
deps = -r{toxinidir}/requirements.txt
1616
-r{toxinidir}/test-requirements.txt
17-
commands = python setup.py testr --slowest --testr-args='{posargs}'
17+
commands =
18+
find . -type f -name "*.pyc" -delete
19+
20+
[testenv:venv]
21+
commands = {posargs}
22+
23+
[testenv:cover]
24+
# TODO(stephenfin): Remove the PYTHON hack below in favour of a [coverage]
25+
# section once we rely on coverage 4.3+
26+
#
27+
# https://bitbucket.org/ned/coveragepy/issues/519/
28+
envdir = {toxworkdir}/shared
29+
setenv =
30+
{[testenv]setenv}
31+
PYTHON=coverage run --source orpy --parallel-mode
32+
commands =
33+
{[testenv]commands}
34+
coverage erase
35+
stestr run {posargs}
36+
coverage combine
37+
coverage html -d cover
38+
coverage xml -o cover/coverage.xml
39+
coverage report
40+
41+
[testenv:py27]
42+
# TODO(efried): Remove this once https://github.com/tox-dev/tox/issues/425 is fixed.
43+
basepython = python2.7
44+
commands =
45+
{[testenv]commands}
46+
stestr run {posargs}
47+
48+
[testenv:py35]
49+
# TODO(efried): Remove this once https://github.com/tox-dev/tox/issues/425 is fixed.
50+
basepython = python3.5
51+
commands =
52+
{[testenv]commands}
53+
stestr run {posargs}
54+
55+
[testenv:py36]
56+
# TODO(efried): Remove this once https://github.com/tox-dev/tox/issues/425 is fixed.
57+
basepython = python3.6
58+
commands =
59+
{[testenv:py35]commands}
1860

1961
[testenv:pep8]
62+
envdir = {toxworkdir}/shared
2063
commands =
2164
flake8
22-
# Run security linter
23-
# B110: except: pass
24-
# B410: importing etree
25-
bandit -r orpy -x tests -s B110,B410
2665

2766
[testenv:bandit]
28-
# NOTE(browne): This is required for the integration test job of the bandit
29-
# project. Please do not remove.
67+
envdir = {toxworkdir}/shared
3068
commands = bandit -r orpy -x tests -s B110,B410
3169

32-
[testenv:venv]
33-
commands = {posargs}
70+
[testenv:pypi]
71+
envdir = {toxworkdir}/shared
72+
commands = python3 setup.py check -r -s -m
3473

35-
[testenv:cover]
36-
commands = python setup.py testr --coverage --testr-args='{posargs}'
74+
[testenv:cobertura]
75+
commands = py.test --cov=orpy --cov-report=xml --cov-report=term-missing orpy/tests
3776

38-
[testenv:coveralls]
39-
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
40-
commands = python setup.py testr --coverage --testr-args='{posargs}'
41-
coveralls
42-
deps = coveralls
43-
{[testenv]deps}
77+
[testenv:bandit-report]
78+
commands =
79+
- mkdir /tmp/bandit
80+
- bandit -r orpy -x tests -s B110,B410 -f html -o /tmp/bandit/index.html
4481

4582
[testenv:docs]
46-
deps = -r{toxinidir}/doc/requirements.txt
83+
# TODO(melwitt): This can be removed when the docs target can be run
84+
# with python 3.x
85+
basepython = python2.7
4786
commands =
48-
rm -rf doc/build
87+
rm -rf doc/build
4988
python setup.py build_sphinx
5089

51-
[flake8]
52-
# H803 skipped on purpose per list discussion.
53-
# E123, E125 skipped as they are invalid PEP-8.
54-
55-
show-source = True
56-
ignore = E123,E125,H803
57-
builtins = _
58-
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
59-
6090
[testenv:pip-missing-reqs]
6191
# do not install test-requirements as that will pollute the virtualenv for
6292
# determining missing packages
6393
# this also means that pip-missing-reqs must be installed separately, outside
6494
# of the requirements.txt files
6595
deps = pip_check_reqs
6696
commands=pip-missing-reqs -d --ignore-file=orpy/tests/* orpy
97+
98+
[flake8]
99+
# H803 skipped on purpose per list discussion.
100+
# E123, E125 skipped as they are invalid PEP-8.
101+
102+
show-source = True
103+
ignore = E123,E125,H803,H405
104+
builtins = _
105+
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build

0 commit comments

Comments
 (0)