diff --git a/.gitignore b/.gitignore index 98a8e35..51c6110 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,18 @@ *.pyc test.py plugin/grasshopper/samplefiles/importBFFromGithub.gh -venv \ No newline at end of file +venv +.pytest_cache +*/__pycache__ +.coverage +.ipynb_checkpoints +*.ipynb +.tox +*.egg-info +.eggs/* +tox.ini +build +dist +venv +/.cache +/.vscode diff --git a/.travis.yml b/.travis.yml index e590e20..c04dbbc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,22 +3,26 @@ language: python python: - "2.7" - "3.6" +- "3.7" install: - pip install -r dev-requirements.txt script: - py.test --cov=. ./tests/ + after_success: - coverage report - coveralls jobs: - include: + include: - stage: deploy if: branch = master AND (NOT type IN (pull_request)) before_install: - - npm i -g npm@6.6.0 + - nvm install lts/* --latest-npm + python: + - "3.7" install: - pip install -r dev-requirements.txt - npm install @semantic-release/exec @@ -26,6 +30,11 @@ jobs: - git config --global user.email "releases@ladybug.tools" - git config --global user.name "ladybugbot" - npx semantic-release + - stage: docs + if: branch = master AND (NOT type IN (pull_request)) + script: + - sphinx-apidoc -f -e -d 4 -o ./docs ./butterfly + - sphinx-build -b html ./docs ./docs/_build/docs deploy: provider: pages skip_cleanup: true diff --git a/deploy.sh b/deploy.sh index d60daed..b04bb49 100644 --- a/deploy.sh +++ b/deploy.sh @@ -1,26 +1,7 @@ #!/bin/sh -deploy_to_pypi() { - echo "Building distribution" - python setup.py sdist bdist_wheel - echo "Pushing new version to PyPi" - twine upload dist/* -u $PYPI_USERNAME -p $PYPI_PASSWORD -} +echo "Building distribution" +python setup.py sdist bdist_wheel +echo "Pushing new version to PyPi" +twine upload dist/* -u $PYPI_USERNAME -p $PYPI_PASSWORD -build_docs() { - echo "Building documentation files" - sphinx-apidoc -f -e -d 4 -o ./docs ./butterfly - sphinx-build -b html ./docs ./docs/_build/docs -D release=$1 -D version=$1 -} - - -if [ -n "$1" ] -then - NEXT_RELEASE_VERSION=$1 -else - echo "A release version must be supplied" - exit 1 -fi - -deploy_to_pypi -build_docs $NEXT_RELEASE_VERSION \ No newline at end of file diff --git a/dev-requirements.txt b/dev-requirements.txt index 257dac0..cbbd225 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,9 +1,17 @@ -coverage==4.5.3 -coveralls==1.7.0 -pytest==4.3.1 -pytest-cov==2.6.1 -Sphinx==1.8.5 -sphinx-bootstrap-theme==0.6.5 +coverage==5.2.1 +coveralls==1.7.0;python_version<'3.0' +coveralls==2.1.2;python_version>='3.6' +pytest==4.6.9;python_version<'3.0' +pytest==6.0.1;python_version>='3.6' +pytest-cov==2.10.1 +Sphinx==1.8.5;python_version<'3.0' +Sphinx==3.2.1;python_version>='3.6' +sphinx-bootstrap-theme==0.7.1 sphinxcontrib-fulltoc==1.2.0 -sphinxcontrib-websupport==1.1.0 -twine==1.13.0 \ No newline at end of file +sphinxcontrib-websupport==1.1.2;python_version<'3.0' +sphinxcontrib-websupport==1.2.4;python_version>='3.6' +twine==1.13.0;python_version<'3.0' +twine==3.2.0;python_version>='3.6' +wheel==0.35.1 +setuptools==44.1.0;python_version<'3.0' +setuptools==50.3.0;python_version>='3.6' diff --git a/docs/_static/custom.css b/docs/_static/custom.css new file mode 100644 index 0000000..a8b7617 --- /dev/null +++ b/docs/_static/custom.css @@ -0,0 +1,40 @@ +/* + * bootstrap-sphinx.css + * ~~~~~~~~~~~~~~~~~~~~ + * + * Sphinx stylesheet -- Bootstrap theme. + */ + + +/* The code below is based on the bootstrap website sidebar */ + + +/* Show and affix the side nav when space allows it */ +@media screen and (min-width: 992px) { + .bs-sidenav .nav > .active > ul { + display: block; + } + /* Widen the fixed sidenav */ + .bs-sidenav.affix, + .bs-sidenav.affix-bottom { + width: 292px; + } + .bs-sidenav.affix { + position: fixed; /* Undo the static from mobile first approach */ + } + .bs-sidenav.affix-bottom { + position: absolute; /* Undo the static from mobile first approach */ + } + .bs-sidenav.affix-bottom .bs-sidenav, + .bs-sidenav.affix .bs-sidenav { + margin-top: 0; + margin-bottom: 0; + } +} +@media screen and (min-width: 1200px) { + /* Widen the fixed sidenav again */ + .bs-sidenav.affix-bottom, + .bs-sidenav.affix { + width: 360px; + } +} diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html new file mode 100644 index 0000000..ae4101c --- /dev/null +++ b/docs/_templates/layout.html @@ -0,0 +1,107 @@ +{% extends "basic/layout.html" %} + +{% if theme_bootstrap_version == "3" %} + {% set bootstrap_version, navbar_version = "3.3.7", "" %} + {% set bs_span_prefix = "col-md-" %} +{% else %} + {% set bootstrap_version, navbar_version = "2.3.2", "-2" %} + {% set bs_span_prefix = "span" %} +{% endif %} + +{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and sidebars %} + +{%- set bs_content_width = render_sidebar and "8" or "12"%} + +{%- block doctype -%} + +{%- endblock %} + +{# Sidebar: Rework into our Bootstrap nav section. #} +{% macro navBar() %} +{% include "navbar" + navbar_version + ".html" %} +{% endmacro %} + +{% if theme_bootstrap_version == "3" %} + {%- macro bsidebar() %} + {%- if render_sidebar %} +