Skip to content

Commit 3ecc803

Browse files
committed
* Raised version to 0.2.0
* Renamed files * added log, changelog and examples to docs
1 parent 15fd82c commit 3ecc803

File tree

11 files changed

+353
-28
lines changed

11 files changed

+353
-28
lines changed

docs/_static/tox_envreport_logo.png

161 KB
Loading

docs/_static/tox_envreport_logo.svg

Lines changed: 159 additions & 0 deletions
Loading

docs/changelog.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Changelog
2+
=========
3+
4+
0.2.0
5+
-----
6+
7+
* Improvement: Switch file names to tox-reports.json and env-report.json
8+
* Improvement: Added more examples, a changelog and a logo to documentation
9+
10+
0.1.1
11+
-----
12+
13+
* Added Readme.rst for PyPi
14+
15+
16+
0.1.0
17+
-----
18+
19+
* Initial version

docs/conf.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import sys
1616
import os
1717
import shlex
18+
import datetime
1819

1920
# If extensions (or modules to document with autodoc) are in another directory,
2021
# add these directories to sys.path here. If the directory is relative to the
@@ -49,7 +50,8 @@
4950

5051
# General information about the project.
5152
project = u'tox-envreport'
52-
copyright = u'2018, team useblocks'
53+
now = datetime.datetime.now()
54+
copyright = '2018, <a href="http://useblocks.com">team useblocks</a>'.format(year=now.year)
5355
author = u'team useblocks'
5456

5557
# The version info for the project you're documenting, acts as replacement for
@@ -115,7 +117,20 @@
115117
# Theme options are theme-specific and customize the look and feel of a theme
116118
# further. For a list of options available for each theme, see the
117119
# documentation.
118-
#html_theme_options = {}
120+
html_theme_options = {
121+
'logo': 'tox_envreport_logo.png',
122+
'logo_name': True,
123+
# 'description': "an extension for sphinx",
124+
'logo_text_align': "center",
125+
'github_user': 'useblocks',
126+
'github_repo': 'tox-envreport',
127+
'github_banner': True,
128+
'github_button': False,
129+
'fixed_sidebar': True,
130+
'extra_nav_links': {'envreport@PyPi': "https://pypi.python.org/pypi/tox-envreport/",
131+
'envreport@github': "https://github.com/useblocks/tox-envreport",
132+
'envreport@travis': "https://travis-ci.org/useblocks/tox-envreport"}
133+
}
119134

120135
# Add any paths that contain custom themes here, relative to this directory.
121136
#html_theme_path = []
@@ -155,7 +170,7 @@
155170
#html_use_smartypants = True
156171

157172
# Custom sidebar templates, maps document names to template names.
158-
#html_sidebars = {}
173+
html_sidebars = {'**': ['about.html', 'navigation.html'], }
159174

160175
# Additional templates that should be rendered to pages, maps page names to
161176
# template names.

docs/contribute.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Contribute
2+
==========
3+
4+
Please check our github project at https://github.com/useblocks/tox-envreport.

docs/env-report.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"host": "daniel-dev",
3+
"installed_packages": [
4+
"attrs==17.4.0",
5+
"more-itertools==4.1.0",
6+
"pluggy==0.6.0",
7+
"py==1.5.3",
8+
"pytest==3.5.0",
9+
"six==1.11.0",
10+
"tox==3.0.0",
11+
"tox-envreport==0.1.0",
12+
"virtualenv==15.2.0"
13+
],
14+
"installpkg": {
15+
"basename": "tox-envreport-0.1.0.zip",
16+
"md5": "5046419f076f6fd825319874614a90d0",
17+
"sha256": "a410ac82328f6089e7e6ffc826a81a1526c91395a793bee265430c0a9cd7d28e"
18+
},
19+
"name": "py35",
20+
"path": "/home/daniel/workspace/tox-envreport/.tox/py35",
21+
"platform": "linux",
22+
"python": {
23+
"executable": "/home/daniel/workspace/tox-envreport/.tox/py35/bin/python",
24+
"version": "3.5.2 (default, Nov 23 2017, 16:37:01) \n[GCC 5.4.0 20160609]",
25+
"version_info": [
26+
3,
27+
5,
28+
2,
29+
"final",
30+
0
31+
]
32+
},
33+
"reportversion": "1",
34+
"setup": [
35+
{
36+
"command": [
37+
"/home/daniel/workspace/tox-envreport/.tox/py35/bin/pip",
38+
"install",
39+
"-U",
40+
"--no-deps",
41+
"/home/daniel/workspace/tox-envreport/.tox/dist/tox-envreport-0.1.0.zip"
42+
],
43+
"output": "actionid: py35\nmsg: installpkg\ncmdargs: ['/home/daniel/workspace/tox-envreport/.tox/py35/bin/pip', 'install', '-U', '--no-deps', '/home/daniel/workspace/tox-envreport/.tox/dist/tox-envreport-0.1.0.zip']\n\nProcessing ./.tox/dist/tox-envreport-0.1.0.zip\nBuilding wheels for collected packages: tox-envreport\n Running setup.py bdist_wheel for tox-envreport: started\n Running setup.py bdist_wheel for tox-envreport: finished with status 'done'\n Stored in directory: /home/daniel/.cache/pip/wheels/da/40/e3/1954e2a10b42ec16b0a8ecb694e438fc3894a7a3c233810269\nSuccessfully built tox-envreport\nInstalling collected packages: tox-envreport\n Found existing installation: tox-envreport 0.1.0\n Uninstalling tox-envreport-0.1.0:\n Successfully uninstalled tox-envreport-0.1.0\nSuccessfully installed tox-envreport-0.1.0\n",
44+
"retcode": "0"
45+
},
46+
{
47+
"command": [
48+
"/home/daniel/workspace/tox-envreport/.tox/py35/bin/pip",
49+
"freeze"
50+
],
51+
"output": "actionid: py35\nmsg: envreport\ncmdargs: ['/home/daniel/workspace/tox-envreport/.tox/py35/bin/pip', 'freeze']\n\nattrs==17.4.0\nmore-itertools==4.1.0\npluggy==0.6.0\npy==1.5.3\npytest==3.5.0\nsix==1.11.0\ntox==3.0.0\ntox-envreport==0.1.0\nvirtualenv==15.2.0\n",
52+
"retcode": "0"
53+
}
54+
],
55+
"test": [
56+
{
57+
"command": [
58+
"/home/daniel/workspace/tox-envreport/.tox/py35/bin/pytest",
59+
"tests"
60+
],
61+
"output": null,
62+
"retcode": "0"
63+
}
64+
],
65+
"toxversion": "3.0.0"
66+
}

docs/examples.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Examples
2+
========
3+
4+
env-report.json
5+
---------------
6+
7+
.. literalinclude:: env-report.json
8+
9+
tox-report.json
10+
---------------
11+
12+
The following json-code contains information about **5** virtual environments: flake8, py27, py34, py35, py36.
13+
14+
.. literalinclude:: tox-report.json
15+
16+

docs/index.rst

Lines changed: 64 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,48 @@
1-
.. tox-envreport documentation master file, created by
2-
sphinx-quickstart on Thu Oct 1 00:43:18 2015.
3-
You can adapt this file completely to your liking, but it should at least
4-
contain the root `toctree` directive.
1+
.. image:: https://img.shields.io/pypi/l/tox-envreport.svg
2+
:target: https://pypi.python.org/pypi/tox-envreport
3+
:alt: License
4+
.. image:: https://img.shields.io/pypi/pyversions/tox-envreport.svg
5+
:target: https://pypi.python.org/pypi/tox-envreport
6+
:alt: Supported versions
7+
.. image:: https://readthedocs.org/projects/tox-envreport/badge/?version=latest
8+
:target: https://readthedocs.org/projects/tox-envreport/
9+
.. image:: https://travis-ci.org/useblocks/tox-envreport.svg?branch=master
10+
:target: https://travis-ci.org/useblocks/tox-envreport
11+
:alt: Travis-CI Build Status
12+
.. image:: https://img.shields.io/pypi/v/tox-envreport.svg
13+
:target: https://pypi.python.org/pypi/tox-envreport
14+
:alt: PyPI Package latest release
515

616
tox-envreport
717
=============
818

9-
`tox-envreport` is a plugin for `tox <https://tox.readthedocs.io/en/latest/>`_
19+
``tox-envreport`` is a plugin for `tox <https://tox.readthedocs.io/en/latest/>`_
1020
to document the setup of used virtual environments.
1121

12-
Collected information are stored in a file called ``env_report.json`` inside the `.tox` folder.
13-
For example: ``MY_PROJECT/.tox/env_report.json``.
22+
By installing this plugin, **2** types of files are created automatically during each tox run:
23+
24+
| **env-report.json**
25+
| A virtual environment specific file, which is created for each used virtual environment.
26+
| Stored inside each virtual environment folder. E.g: ``.tox/py34/env-report.json``.
27+
28+
29+
| **tox-report.json**
30+
| A global report file, which bundles data from all virtual environment specific files.
31+
| Stored inside ``.tox`` folder. E.g: ``.tox/tox-report.json``.
32+
33+
34+
.. warning::
35+
36+
This plugin is an early alpha version and under heavy development.
37+
The used structure inside export files may change in future.
38+
39+
A report contains the following information and more:
40+
41+
* **System**: host, platform,
42+
* **Virtual environment**: name, path, tested package (incl. hashes)
43+
* **Python**: executable, version, installed packages (incl. version)
44+
* **Executed commands** : setup, test (all incl. output and return code)
45+
1446

1547
Installation
1648
------------
@@ -25,23 +57,38 @@ There is nothing more to do or to configure.
2557

2658
Access reports
2759
--------------
28-
`tox-envreport` creates one common ``env_report.json`` file, which contains all information about all used virtual
60+
``tox-envreport`` creates one common ``tox-report.json`` file, which contains all information about all used virtual
2961
environments (venv) by tox.
3062

3163
Beside this a venv specific file is generated as well and contains information about the related venv only.
32-
You can find this file in the venv-specific tox-folder. E.g: ``MY_PROJECT/.tox/py27/env_report_py27.json``
64+
You can find this file in the venv-specific tox-folder. E.g: ``MY_PROJECT/.tox/py27/env-report.json``
3365
for a venv called *py27*.
3466

35-
The report file itself contains the venv-name as postfix. E.g.: ``env_report_py27.json``.
67+
Motivation
68+
----------
69+
``tox-envreport`` was created for an automotive project, which needs to archive beside test results also used
70+
test environments.
71+
The goal is to provide enough information to be able to setup an identical test environment in 20+ years.
72+
73+
``tox-envreport`` is part of a software bundle, which was designed to fulfill
74+
the parameters of the `ISO 26262 <https://en.wikipedia.org/wiki/ISO_26262>`_ standard
75+
for safety critical software in automotive companies.
76+
Other tools are: `sphinx-needs <http://sphinxcontrib-needs.readthedocs.io/en/latest/>`_.
3677

3778

38-
Common report: env_report.json
39-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
79+
Content
80+
-------
4081

41-
The following json-code contains information about **5** virtual environments: flake8, py27, py34, py35, py36.
82+
.. toctree::
83+
:maxdepth: 2
84+
85+
examples
86+
contribute
87+
changelog
88+
89+
Acknowledgments
90+
---------------
91+
92+
Thanks to `Lazur URH <https://openclipart.org/detail/204460/big-shot-remix>`_ , who designed the tox-envreport logo.
4293

43-
.. literalinclude:: env_report.json
4494

45-
Contribute
46-
----------
47-
Please check our github project at https://github.com/useblocks/tox-envreport.
File renamed without changes.

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ def read(fname):
1313

1414
setup(
1515
name='tox-envreport',
16-
description='A simple plugin to use with tox',
16+
description='A tox-plugin to document the setup of used virtual '
17+
'environments.',
1718
long_description=read('README.rst'),
18-
version='0.1.1',
19+
version='0.2.0',
1920
author='team useblocks',
2021
author_email='team@useblocks.com',
2122
maintainer='team useblocks',

tox_envreport/plugin.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ def tox_runtest_post(venv):
2323
# Collect paths from current configuration
2424
# ----------------------------------------
2525
venv_path = venv.path.strpath
26-
# venv_logdir = os.path.join(venv_path, "log")
27-
toxworkdir = venv.session.config.toxworkdir.strpath
28-
report_path = os.path.join(toxworkdir, "env_report.json")
29-
venv_report_path = os.path.join(venv_path,
30-
"env_report_{0}.json".format(venv.name))
26+
tox_workdir = venv.session.config.toxworkdir.strpath
27+
tox_report_path = os.path.join(tox_workdir, "tox-report.json")
28+
venv_report_path = os.path.join(venv_path, "env-report.json")
3129

3230
# Collect needed data
3331
# -------------------
@@ -51,7 +49,7 @@ def tox_runtest_post(venv):
5149
# ToDo: This needs to be done only once! But this hook gets called for
5250
# each test. Another "global" hook would be great, but tox does not
5351
# provide anything useful right now.
54-
with open(report_path, "w") as report_file:
52+
with open(tox_report_path, "w") as report_file:
5553
report_file.write(data_json)
5654

5755
with open(venv_report_path, "w") as venv_report_file:

0 commit comments

Comments
 (0)