Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
Poetry Build Setup + CI pipeline changes (#41)
Browse files Browse the repository at this point in the history
* Move package management and build to poetry
* Update travis and add pre-commit
* Update developer documentation.
* Fix foreshadow __init__ pyproject version reading abilities
* Fix spacing on dropfeature for autodoc
  • Loading branch information
adithyabsk committed Feb 20, 2019
1 parent dbeb8d6 commit 7f5ce68
Show file tree
Hide file tree
Showing 15 changed files with 1,585 additions and 198 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,8 @@ venv.bak/
# PyCharm
.idea/

# Poetry build wheels
pip-wheel-metadata/

# Other
.DS_Store
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
language_version: python3.6
42 changes: 32 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,38 @@
language: python
cache: pip
python:
- "3.5"
- "3.6"

cache:
pip: true
directories:
- "$HOME/.cache/pypoetry"
- "$HOME/.cache/pre-commit"

stages:
- linting
- test

before_install:
# linux
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install swig3.0; fi
# linux
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt update; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt install swig3.0; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s /usr/bin/swig3.0 /usr/bin/swig; fi
- pip install poetry
install:
- pip install tox tox-travis coveralls
- poetry install -v -E dev
- poetry run pip install tox tox-travis coveralls
script:
- tox
- poetry run tox
after_success:
- coveralls
- poetry run coveralls

jobs:
include:
- python: "3.5"
- python: "3.6"

- stage: linting
python: "3.6"
install:
- pip install pre-commit
- pre-commit install-hooks
script:
- pre-commit run --all-files
98 changes: 56 additions & 42 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,33 @@
#
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__name__), '..'))
sys.path.append(os.path.join(os.path.dirname(__name__), '../..'))

import toml

sys.path.append(os.path.join(os.path.dirname(__name__), ".."))
sys.path.append(os.path.join(os.path.dirname(__name__), "../.."))


# -- Project information -----------------------------------------------------

project = u'Foreshadow'
copyright = u'2018, Georgian Partners'
author = u'Adithya Balaji, Alexander Allen'

def get_version():
import toml

with open("../pyproject.toml", "r") as fopen:
pyproject = toml.load(fopen)

return pyproject["tool"]["poetry"]["version"]


project = u"Foreshadow"
copyright = u"2018, Georgian Partners"
author = u"Adithya Balaji, Alexander Allen"

# The short X.Y version
version = u''
version = get_version()
# The full version, including alpha/beta/rc tags
release = u''
release = version


# -- General configuration ---------------------------------------------------
Expand All @@ -40,29 +53,29 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.mathjax",
"sphinx.ext.ifconfig",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
]

# Autodoc Settings
autodoc_default_flags = ['members', 'undoc-members']
autodoc_default_flags = ["members", "undoc-members"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

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

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -74,33 +87,29 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = [u'_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = [u"_build", "Thumbs.db", ".DS_Store"]

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


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

# 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 = {

'navigation_depth': -1

}
html_theme_options = {"navigation_depth": -1}

# 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']
html_static_path = ["_static"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -116,7 +125,7 @@
# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'foreshadowdoc'
htmlhelp_basename = "foreshadowdoc"


# -- Options for LaTeX output ------------------------------------------------
Expand All @@ -125,15 +134,12 @@
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -143,19 +149,21 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'Foreshadow.tex', u'Foreshadow Documentation',
u'Adithya Balaji, Alexander Allen', 'manual'),
(
master_doc,
"Foreshadow.tex",
u"Foreshadow Documentation",
u"Adithya Balaji, Alexander Allen",
"manual",
)
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'Foreshadow', u'Foreshadow Documentation',
[author], 1)
]
man_pages = [(master_doc, "Foreshadow", u"Foreshadow Documentation", [author], 1)]


# -- Options for Texinfo output ----------------------------------------------
Expand All @@ -164,9 +172,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'Foreshadow', u'Foreshadow Documentation',
author, 'Foreshadow', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"Foreshadow",
u"Foreshadow Documentation",
author,
"Foreshadow",
"One line description of project.",
"Miscellaneous",
)
]


Expand All @@ -175,12 +189,12 @@
# -- Options for intersphinx extension ---------------------------------------

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {"https://docs.python.org/": None}

# -- Options for todo extension ----------------------------------------------

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True

# Additional Modifications
add_module_names = False
add_module_names = False

0 comments on commit 7f5ce68

Please sign in to comment.