Skip to content

Commit

Permalink
epic testing framework courtesy of @tkhyn in #31 (#31)
Browse files Browse the repository at this point in the history
Introduced `pytest` based framework
=================================================
- Extensive testing backend with metaclass and
  fixture magic enabling easy creation of new
  test projects and associated tests
- Not all hierarchical representations are
  complete, see hierarchies docs
- Continuous Integration!
    - Windows: AppVeyor
    - Linux / OSX / docs / lint: Travis CI
    - Coverage: codecov.io

Exhale Core
=================================================
- Exhale can now run on Windows!
    - See exhale/deploy.py doxygen execution
    - Fix pathing issues using normpath (see #30)
- Added more forceful doxygenStripFromPath logic
  as needed for Travis
- Allow spaces in names for program listings

NOTE: union nesting is less broken than it was,
      but still not valid.
  • Loading branch information
tkhyn authored and svenevs committed May 25, 2018
1 parent d5a6adb commit 17ecbd9
Show file tree
Hide file tree
Showing 52 changed files with 2,954 additions and 208 deletions.
20 changes: 20 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# See: https://packaging.python.org/guides/supporting-windows-using-appveyor/
environment:
matrix:
- PYTHON: "C:\\Python27"
- PYTHON: "C:\\Python27-x64"
- PYTHON: "C:\\Python36-x64"

install:
- choco install doxygen.portable
- "%PYTHON%\\python.exe -m pip install -U setuptools"
- "%PYTHON%\\python.exe -m pip install tox"

build: off

test_script:
# Prints setuptools version
- easy_install --version
- doxygen --version
# Installs dependencies and runs the tests.
- "%PYTHON%\\python.exe -m tox -e py"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ coverage.xml
*.cover
.hypothesis/

# temp testing files
testing/projects/*/docs_*/**

# Translations
*.mo
*.pot
Expand Down Expand Up @@ -87,6 +90,7 @@ celerybeat-schedule
env/
venv/
ENV/
testenv/

# Spyder project settings
.spyderproject
Expand Down
101 changes: 101 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
sudo: false
matrix:
allow_failures:
- env: ALLOW_ME_TO=FAIL
include:
####################################################################################
# Linux :: Python :: 2.7 #
####################################################################################
- os: linux
addons:
apt:
packages:
- doxygen
language: python
python: "2.7"
install:
- pip install -U tox codecov
script:
- doxygen --version
- tox -e py -- --cov=exhale
after_success:
- codecov --name linux_py2.7
####################################################################################
# Linux :: Python :: 3.6 #
####################################################################################
- os: linux
addons:
apt:
packages:
- doxygen
language: python
python: "3.6"
install:
- pip install -U tox codecov
script:
- doxygen --version
- tox -e py -- --cov=exhale
after_success:
- codecov --name linux_py3.6
####################################################################################
# OSX :: Python :: 2.7 #
####################################################################################
- os: osx
language: generic
env: PYTHON=2.7
before_install:
# Something strange about final step of install gives exit code != 1 but the
# installation appears to work?
- brew install python@2 || true
install:
- brew install doxygen
- /usr/local/bin/pip install -U tox codecov
script:
- doxygen --version
- /usr/local/bin/python2 --version
- /usr/local/bin/python2 -m tox -e py -- --cov=exhale
after_success:
- codecov --name osx_py2.7
####################################################################################
# OSX :: Python :: 3.6 #
####################################################################################
- os: osx
language: generic
env: PYTHON=3.6
before_install:
- brew upgrade python
install:
- brew install doxygen
- /usr/local/bin/pip3 install -U tox codecov
script:
- doxygen --version
- /usr/local/bin/python3 --version
- /usr/local/bin/python3 -m tox -e py -- --cov=exhale
after_success:
- codecov --name osx_py3.6
####################################################################################
# Flake8 #
####################################################################################
- os: linux
language: python
env: TEST=flake8
python: "3.6"
install:
- pip install -U tox
script:
- tox -e flake8
####################################################################################
# Docs and Linkcheck #
####################################################################################
- os: linux
addons:
apt:
packages:
- graphviz
language: python
python: "3.6"
env: TEST=docs_linkcheck
install:
- pip install -U tox
script:
- tox -e docs,linkcheck
6 changes: 6 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ include README.rst
# Include the license file
include LICENSE

# Include the requirements file
include requirements.txt

# Include the data files
recursive-include exhale/data *

# Exclude testing package
prune testing
69 changes: 36 additions & 33 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,37 +1,34 @@
Exhale
========================================================================================
|docs| |pypi| |license|
|docs| |pypi| |travis| |appveyor| |coverage| |license|

.. begin_badges
.. |docs| image:: https://readthedocs.org/projects/exhale/badge/?version=latest
:alt: Documentation Status
:scale: 100%
:target: https://exhale.readthedocs.io/en/latest/?badge=latest

.. |pypi| image:: https://badge.fury.io/py/exhale.svg
:alt: Latest Version
:scale: 100%
:target: https://badge.fury.io/py/exhale

.. |travis| image:: https://travis-ci.com/svenevs/exhale.svg?branch=master
:alt: Travis CI Build Status (Unix, Flake8 and Docs Tests)
:target: https://travis-ci.com/svenevs/exhale

.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/m7u8vkbelui57b1j?svg=true
:alt: AppVeyor CI Build Satus (Windows Tests)
:target: https://ci.appveyor.com/project/svenevs/exhale

.. |coverage| image:: https://codecov.io/gh/svenevs/exhale/branch/master/graph/badge.svg
:alt: Code Coverage Report
:target: https://codecov.io/gh/svenevs/exhale

.. |license| image:: https://img.shields.io/github/license/svenevs/exhale.svg
:alt: License BSD-3 Clause
:scale: 100%
:target: https://github.com/svenevs/exhale/blob/master/LICENSE

.. begin_tmp_danger_warning
.. warning::

There is a reason why Exhale is development status 2 as far as ``pip`` is concerned.
It is functional enough that it should work for your project, but there are a number
of features I still intend to implement when there is more time.

In particular, Exhale underwent a significant rewrite. There is a decent amount of
redundant, dead, and unused code. There is also a large portion of documentation
that is either outdated or just flat out inaccurate. The ``graph`` module used to
be the entire project (it was a single file library).

.. end_tmp_danger_warning
.. end_badges
.. begin_exhale_brief_desc
Expand All @@ -41,6 +38,16 @@ markup syntax / websites.

.. end_exhale_brief_desc
.. begin_tmp_danger_warning
.. note::

There is a reason why Exhale is development status 2 as far as ``pip`` is concerned.
It is functional enough that it should work for your project, but there are a number
of features I still intend to implement when there is more time.

.. end_tmp_danger_warning
.. contents:: Contents
:local:
:backlinks: none
Expand Down Expand Up @@ -80,9 +87,9 @@ HTML Theme choices:

.. _companion: https://github.com/svenevs/exhale-companion

.. _rtd: https://docs.readthedocs.io/en/latest/theme.html
.. _rtd: http://sphinx-rtd-theme.readthedocs.io/en/latest/
.. _bstrap: https://ryan-roemer.github.io/sphinx-bootstrap-theme/
.. _alabaster: https://alabaster.readthedocs.io/en/latest/
.. _alabaster: http://alabaster.readthedocs.io/en/latest/

.. |rtd-docs| image:: https://readthedocs.org/projects/my-favorite-documentation-test/badge/?version=latest
:target: http://my-favorite-documentation-test.readthedocs.io/en/latest/
Expand Down Expand Up @@ -113,20 +120,16 @@ __ http://www.sphinx-doc.org/en/stable/extensions.html

.. code-block:: bash
# For python3.
# https://wiki.python.org/moin/Python2orPython3#What_are_the_differences.3F
$ pip3 install exhale
# For python2.
$ pip install exhale
This will install Exhale, as well as all of its dependencies. You are of course capable
of installing Exhale through other means, as it contains a ``setup.py``, but since I
**strongly discourage this**, I will not provide you with instructions on how to do so.
of installing Exhale through other means, as it contains a ``setup.py``. If you choose
to do this, I assume you know what you are doing (and will provide neither instructions
nor support for alternative installation strategies).

.. note::

If you fail ``pip3 install exhale`` and it is failing on ``lxml``, you will likely
If you fail ``pip install exhale`` and it is failing on ``lxml``, you will likely
need to install the proper development libraries. See the
`lxml installation instructions`__ for possible fixes.

Expand Down Expand Up @@ -371,10 +374,10 @@ to be successful, I vendor copies of two excellent libraries that I make no clai
They are vendored with your installation of Exhale, in accordance with each project's
license:

1. For non-bootstrap, I used Stephen Morley's excellent and lightweight
collapsibleLists_ including the sample CSS / images on that post. He includes a
generous `CC0 license <http://code.stephenmorley.org/about-this-site/copyright/>`_
for these files, as well as the rest of his website.
1. For non-bootstrap, I used Kate Morley's excellent and lightweight collapsibleLists_
including the sample CSS / images on that post. She includes a generous
`CC0 1.0 license <http://code.iamkate.com/>`_ for these files, as well as the rest of
her website.

For every HTML Theme I have tried, except for ones using bootstrap, this library
works reliably and consistently. It matches the Sphinx RTD theme quite well, too!
Expand All @@ -391,7 +394,7 @@ license:
Both of these libraries and copies of their licenses can be found in the
`data folder of the source code <https://github.com/svenevs/exhale/tree/master/exhale/data>`_.

.. _collapsibleLists: http://code.stephenmorley.org/javascript/collapsible-lists/
.. _collapsibleLists: http://code.iamkate.com/javascript/collapsible-lists/

__ https://github.com/jonmiles/bootstrap-treeview

Expand Down
8 changes: 3 additions & 5 deletions UPLOAD_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
For when I forget how I did this...

```console
# Build the source distribution
$ python setup.py sdist

# Build the universal wheel
$ python setup.py bdist_wheel --universal
# Build the source distribution and universal wheel
# saved into dist/ folder
$ tox -e dist

# Upload!
$ twine upload dist/*
Expand Down
2 changes: 2 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# https://docs.codecov.io/v4.3.6/docs/pull-request-comments
comment: false
25 changes: 18 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = '1.0'

# General information about the project.
project = u'Exhale'
copyright = u'2018, Stephen McDowell'
author = u'Stephen McDowell'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
Expand All @@ -36,28 +41,29 @@
intersphinx_mapping = {
'python': ('http://docs.python.org/', None),
'sphinx': ('http://sphinx.pocoo.org', None),
'pytest': ('https://docs.pytest.org/en/latest/', None),
# See _intersphinx/README.md
'bs4': ('https://www.crummy.com/software/BeautifulSoup/bs4/doc', "_intersphinx/bs4_objects.inv")
}

# make linkcheck does not support GitHub README.md anchors (they are synthetic anchors)
linkcheck_ignore = [
r'https://github.com/jonmiles/bootstrap-treeview#.*'
]

# show :autoclass: member definitions as defined in exhale.py
autodoc_member_order = 'bysource'

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
source_suffix = '.rst'
source_suffix = ['.rst']

# The encoding of source files.
#source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'Exhale'
copyright = u'2017, Stephen McDowell'
author = u'Stephen McDowell'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
Expand Down Expand Up @@ -100,7 +106,7 @@
#show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# pygments_style = 'sphinx'

# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
Expand Down Expand Up @@ -215,6 +221,11 @@


def setup(app):
# testproject.py defines these classes (they cannot be defined in conf.py)
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
from testproject import testproject, visit_testproject_node, depart_testproject_node, TestProjectDirective
app.add_node(testproject, html=(visit_testproject_node, depart_testproject_node))
app.add_directive('testproject', TestProjectDirective)
####################################################################################
# Multiline string documentation #
####################################################################################
Expand Down
9 changes: 5 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Exhale
========================================================================================

.. include:: ../README.rst
:start-after: begin_tmp_danger_warning
:end-before: end_tmp_danger_warning

.. include:: ../README.rst
:start-after: begin_exhale_brief_desc
:end-before: end_exhale_brief_desc

.. include:: ../README.rst
:start-after: begin_tmp_danger_warning
:end-before: end_tmp_danger_warning

.. include:: ../README.rst
:start-after: begin_exhale_long_desc
:end-before: end_exhale_long_desc
Expand Down Expand Up @@ -48,6 +48,7 @@ Doxygen, Sphinx, or Breathe.
reference
mastering_doxygen
faq
testing
todo

.. _index_credit:
Expand Down
Loading

0 comments on commit 17ecbd9

Please sign in to comment.