-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial Python package structure
Update Camayoc's Python package structure. * Add documentation directory. * Update setup.py to install the development packages. * Add MANIFEST.in file and make it include LICENSE file when building the package. * Add Makefile and targets to help building the documentation, installing camayoc and development packages, running linters, running tests and managing/building the camayoc package. * Create some python packages camayoc (for framework modules), camayoc.tests (for RHO's functional tests) and tests (for camayocs unit tests). Closes #1
- Loading branch information
Showing
9 changed files
with
202 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
help: | ||
@echo "Please use \`make <target>' where <target> is one of:" | ||
@echo " help to show this message" | ||
@echo " all to to execute test-coverage and lint" | ||
@echo " docs-clean to remove documentation" | ||
@echo " docs-html to generate HTML documentation" | ||
@echo " install to install in editable mode" | ||
@echo " install-dev to install in editable modeplus the dev packages" | ||
@echo " lint to run flake8" | ||
@echo " package to generate installable Python packages" | ||
@echo " package-clean to remove generated Python packages" | ||
@echo " package-upload to upload dist/* to PyPI" | ||
@echo " test to run unit tests" | ||
@echo " test-coverage to run unit tests and measure test coverage" | ||
|
||
all: test-coverage lint | ||
|
||
docs-clean: | ||
@cd docs; $(MAKE) clean | ||
|
||
docs-html: | ||
@cd docs; $(MAKE) html | ||
|
||
install: | ||
pip install -e . | ||
|
||
install-dev: | ||
pip install -e .[dev] | ||
|
||
lint: | ||
flake8 . | ||
|
||
package: package-clean | ||
python setup.py --quiet sdist bdist_wheel | ||
|
||
package-clean: | ||
rm -rf build dist camayoc.egg-info | ||
|
||
package-upload: package | ||
twine upload dist/* | ||
|
||
test: | ||
py.test tests | ||
|
||
test-coverage: | ||
py.test --verbose --cov-report term --cov=camayoc tests | ||
|
||
.PHONY: all docs-clean docs-html install install-dev lint package \ | ||
package-clean package-upload test test-coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# coding=utf-8 | ||
"""A Python library that facilitates functional testing of quipucords.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# coding=utf-8 | ||
"""Tests for RHO. | ||
This package and its sub-packages contain functional tests for RHO. These tests | ||
should be run against RHO installations. These tests run RHO remotely (trhough | ||
a SSH connection) or locally. These tests are entirely different from the unit | ||
tests in :mod:`tests`. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line. | ||
SPHINXOPTS = | ||
SPHINXBUILD = python -msphinx | ||
SPHINXPROJ = Camayoc | ||
SOURCEDIR = . | ||
BUILDDIR = _build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# coding=utf-8 | ||
"""Sphinx documentation generator configuration file. | ||
The full set of configuration options is listed on the Sphinx website: | ||
http://sphinx-doc.org/config.html | ||
""" | ||
|
||
import os | ||
import sys | ||
|
||
# Add the project root directory to the system path. This allows references | ||
# such as :mod:`camayoc.whatever` to be processed correctly. | ||
ROOT_DIR = os.path.abspath(os.path.join( | ||
os.path.dirname(__file__), | ||
os.path.pardir | ||
)) | ||
sys.path.insert(0, ROOT_DIR) | ||
|
||
# Project information --------------------------------------------------------- | ||
|
||
project = 'Camayoc' | ||
author = 'Quipucords Team' | ||
copyright = '2017, {}'.format(author) | ||
|
||
# The short X.Y version. | ||
version = '' | ||
# The full version, including alpha/beta/rc tags. | ||
release = '' | ||
|
||
|
||
# General configuration ------------------------------------------------------- | ||
|
||
exclude_patterns = ['_build'] | ||
extensions = [ | ||
'sphinx.ext.autodoc', | ||
'sphinx.ext.viewcode', | ||
] | ||
language = None | ||
master_doc = 'index' | ||
pygments_style = 'sphinx' | ||
source_suffix = '.rst' | ||
templates_path = ['_templates'] | ||
todo_include_todos = False | ||
|
||
|
||
# Options for HTML output ----------------------------------------------------- | ||
|
||
html_theme = 'alabaster' | ||
|
||
# Theme options are theme-specific and customize the look and feel of a theme | ||
# further. For a list of options see: | ||
# http://alabaster.readthedocs.io/en/latest/customization.html#theme-options | ||
html_theme_options = { | ||
'github_user': 'quipucords', | ||
'github_repo': 'camayoc', | ||
'travis_button': True, | ||
} | ||
|
||
# Add any paths that contain custom static files (such as style sheets) here, | ||
# relative to this directory. They are copied after the builtin static files, | ||
# so a file named "default.css" will overwrite the builtin "default.css". | ||
html_static_path = ['_static'] | ||
|
||
# Custom sidebar templates, must be a dictionary that maps document names to | ||
# template names. | ||
# | ||
# See: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars | ||
html_sidebars = { | ||
'**': [ | ||
'about.html', | ||
'navigation.html', | ||
'relations.html', # needs 'show_related': True theme option to display | ||
'searchbox.html', | ||
'donate.html', | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.. Camayoc documentation master file, created by | ||
sphinx-quickstart on Fri Jul 28 15:31:27 2017. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
Welcome to Camayoc's documentation! | ||
=================================== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
|
||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# coding=utf-8 | ||
"""Unit tests for Camayoc. | ||
This package and its sub-packages contain tests for Camayoc. These tests verify | ||
that Camayoc's internal functions and libraries function correctly. | ||
""" |