Skip to content

Commit

Permalink
* Raised version to 0.2.0
Browse files Browse the repository at this point in the history
* Renamed files
* added log, changelog and examples to docs
  • Loading branch information
danwos committed Apr 19, 2018
1 parent 15fd82c commit 3ecc803
Show file tree
Hide file tree
Showing 11 changed files with 353 additions and 28 deletions.
Binary file added docs/_static/tox_envreport_logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
159 changes: 159 additions & 0 deletions docs/_static/tox_envreport_logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Changelog
=========

0.2.0
-----

* Improvement: Switch file names to tox-reports.json and env-report.json
* Improvement: Added more examples, a changelog and a logo to documentation

0.1.1
-----

* Added Readme.rst for PyPi


0.1.0
-----

* Initial version
21 changes: 18 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import sys
import os
import shlex
import datetime

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

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

# The version info for the project you're documenting, acts as replacement for
Expand Down Expand Up @@ -115,7 +117,20 @@
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
html_theme_options = {
'logo': 'tox_envreport_logo.png',
'logo_name': True,
# 'description': "an extension for sphinx",
'logo_text_align': "center",
'github_user': 'useblocks',
'github_repo': 'tox-envreport',
'github_banner': True,
'github_button': False,
'fixed_sidebar': True,
'extra_nav_links': {'envreport@PyPi': "https://pypi.python.org/pypi/tox-envreport/",
'envreport@github': "https://github.com/useblocks/tox-envreport",
'envreport@travis': "https://travis-ci.org/useblocks/tox-envreport"}
}

# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
Expand Down Expand Up @@ -155,7 +170,7 @@
#html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
html_sidebars = {'**': ['about.html', 'navigation.html'], }

# Additional templates that should be rendered to pages, maps page names to
# template names.
Expand Down
4 changes: 4 additions & 0 deletions docs/contribute.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Contribute
==========

Please check our github project at https://github.com/useblocks/tox-envreport.
66 changes: 66 additions & 0 deletions docs/env-report.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"host": "daniel-dev",
"installed_packages": [
"attrs==17.4.0",
"more-itertools==4.1.0",
"pluggy==0.6.0",
"py==1.5.3",
"pytest==3.5.0",
"six==1.11.0",
"tox==3.0.0",
"tox-envreport==0.1.0",
"virtualenv==15.2.0"
],
"installpkg": {
"basename": "tox-envreport-0.1.0.zip",
"md5": "5046419f076f6fd825319874614a90d0",
"sha256": "a410ac82328f6089e7e6ffc826a81a1526c91395a793bee265430c0a9cd7d28e"
},
"name": "py35",
"path": "/home/daniel/workspace/tox-envreport/.tox/py35",
"platform": "linux",
"python": {
"executable": "/home/daniel/workspace/tox-envreport/.tox/py35/bin/python",
"version": "3.5.2 (default, Nov 23 2017, 16:37:01) \n[GCC 5.4.0 20160609]",
"version_info": [
3,
5,
2,
"final",
0
]
},
"reportversion": "1",
"setup": [
{
"command": [
"/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"
],
"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",
"retcode": "0"
},
{
"command": [
"/home/daniel/workspace/tox-envreport/.tox/py35/bin/pip",
"freeze"
],
"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",
"retcode": "0"
}
],
"test": [
{
"command": [
"/home/daniel/workspace/tox-envreport/.tox/py35/bin/pytest",
"tests"
],
"output": null,
"retcode": "0"
}
],
"toxversion": "3.0.0"
}
16 changes: 16 additions & 0 deletions docs/examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Examples
========

env-report.json
---------------

.. literalinclude:: env-report.json

tox-report.json
---------------

The following json-code contains information about **5** virtual environments: flake8, py27, py34, py35, py36.

.. literalinclude:: tox-report.json


81 changes: 64 additions & 17 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,48 @@
.. tox-envreport documentation master file, created by
sphinx-quickstart on Thu Oct 1 00:43:18 2015.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
.. image:: https://img.shields.io/pypi/l/tox-envreport.svg
:target: https://pypi.python.org/pypi/tox-envreport
:alt: License
.. image:: https://img.shields.io/pypi/pyversions/tox-envreport.svg
:target: https://pypi.python.org/pypi/tox-envreport
:alt: Supported versions
.. image:: https://readthedocs.org/projects/tox-envreport/badge/?version=latest
:target: https://readthedocs.org/projects/tox-envreport/
.. image:: https://travis-ci.org/useblocks/tox-envreport.svg?branch=master
:target: https://travis-ci.org/useblocks/tox-envreport
:alt: Travis-CI Build Status
.. image:: https://img.shields.io/pypi/v/tox-envreport.svg
:target: https://pypi.python.org/pypi/tox-envreport
:alt: PyPI Package latest release

tox-envreport
=============

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

Collected information are stored in a file called ``env_report.json`` inside the `.tox` folder.
For example: ``MY_PROJECT/.tox/env_report.json``.
By installing this plugin, **2** types of files are created automatically during each tox run:

| **env-report.json**
| A virtual environment specific file, which is created for each used virtual environment.
| Stored inside each virtual environment folder. E.g: ``.tox/py34/env-report.json``.

| **tox-report.json**
| A global report file, which bundles data from all virtual environment specific files.
| Stored inside ``.tox`` folder. E.g: ``.tox/tox-report.json``.

.. warning::

This plugin is an early alpha version and under heavy development.
The used structure inside export files may change in future.

A report contains the following information and more:

* **System**: host, platform,
* **Virtual environment**: name, path, tested package (incl. hashes)
* **Python**: executable, version, installed packages (incl. version)
* **Executed commands** : setup, test (all incl. output and return code)


Installation
------------
Expand All @@ -25,23 +57,38 @@ There is nothing more to do or to configure.

Access reports
--------------
`tox-envreport` creates one common ``env_report.json`` file, which contains all information about all used virtual
``tox-envreport`` creates one common ``tox-report.json`` file, which contains all information about all used virtual
environments (venv) by tox.

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

The report file itself contains the venv-name as postfix. E.g.: ``env_report_py27.json``.
Motivation
----------
``tox-envreport`` was created for an automotive project, which needs to archive beside test results also used
test environments.
The goal is to provide enough information to be able to setup an identical test environment in 20+ years.

``tox-envreport`` is part of a software bundle, which was designed to fulfill
the parameters of the `ISO 26262 <https://en.wikipedia.org/wiki/ISO_26262>`_ standard
for safety critical software in automotive companies.
Other tools are: `sphinx-needs <http://sphinxcontrib-needs.readthedocs.io/en/latest/>`_.


Common report: env_report.json
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Content
-------

The following json-code contains information about **5** virtual environments: flake8, py27, py34, py35, py36.
.. toctree::
:maxdepth: 2

examples
contribute
changelog

Acknowledgments
---------------

Thanks to `Lazur URH <https://openclipart.org/detail/204460/big-shot-remix>`_ , who designed the tox-envreport logo.

.. literalinclude:: env_report.json

Contribute
----------
Please check our github project at https://github.com/useblocks/tox-envreport.
File renamed without changes.
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ def read(fname):

setup(
name='tox-envreport',
description='A simple plugin to use with tox',
description='A tox-plugin to document the setup of used virtual '
'environments.',
long_description=read('README.rst'),
version='0.1.1',
version='0.2.0',
author='team useblocks',
author_email='team@useblocks.com',
maintainer='team useblocks',
Expand Down
10 changes: 4 additions & 6 deletions tox_envreport/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ def tox_runtest_post(venv):
# Collect paths from current configuration
# ----------------------------------------
venv_path = venv.path.strpath
# venv_logdir = os.path.join(venv_path, "log")
toxworkdir = venv.session.config.toxworkdir.strpath
report_path = os.path.join(toxworkdir, "env_report.json")
venv_report_path = os.path.join(venv_path,
"env_report_{0}.json".format(venv.name))
tox_workdir = venv.session.config.toxworkdir.strpath
tox_report_path = os.path.join(tox_workdir, "tox-report.json")
venv_report_path = os.path.join(venv_path, "env-report.json")

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

with open(venv_report_path, "w") as venv_report_file:
Expand Down

0 comments on commit 3ecc803

Please sign in to comment.