diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index eba1fbca..c990a326 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,7 +9,7 @@ jobs: name: Unit tests strategy: matrix: - python-version: ['3.10'] + python-version: ['3.10', '3.12'] os: [macos-latest, ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} @@ -25,7 +25,7 @@ jobs: pip install -r requirements.txt pip install -r dev-requirements.txt - name: run tests - run: python -m pytest --cov=. tests/ + run: python -m pytest tests/ deploy: name: Deploy to GitHub and PyPI @@ -37,7 +37,7 @@ jobs: - name: set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: '3.12' - name: set up node # we need node for for semantic release uses: actions/setup-node@v4 with: @@ -107,7 +107,7 @@ jobs: - name: set up Python uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: '3.12' - name: install dependencies run: | pip install -U . diff --git a/README.md b/README.md index fc4d4eca..8e09a288 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,13 @@ For the Legacy Ladybug Grasshopper Plugin see [this repository](https://github.c ## Installation +To install the library use: + `pip install ladybug-core` +To check if Honeybee command line interface is installed correctly use `ladybug viz` and you +should get a `viiiiiiiiiiiiizzzzzzzzz!` back in response! + ## Usage ```python @@ -45,6 +50,33 @@ print('altitude: {}, azimuth: {}'.format(sun.altitude, sun.azimuth)) >>> altitude: 72.26, azimuth: 32.37 ``` +## Local Development +1. Clone this repo locally +```console +git clone git@github.com:ladybug-tools/ladybug-core.git + +# or + +git clone https://github.com/ladybug-tools/ladybug.git +``` +2. Install dependencies: +```console +cd ladybug +pip install -r dev-requirements.txt +pip install -r requirements.txt +``` + +3. Run Tests: +```console +python -m pytest ./tests +``` + +4. Generate Documentation: +```console +sphinx-apidoc -f -e -d 4 -o ./docs ./ladybug +sphinx-build -b html ./docs ./docs/_build/docs +``` + ### Derivative Work Ladybug is a derivative work of the following software projects: diff --git a/dev-requirements.txt b/dev-requirements.txt index c2113323..37c85bd5 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,23 +1,18 @@ -coverage==5.5 -coveralls==1.7.0;python_version<'3.0' -coveralls==2.2.0;python_version>='3.6' -pytest==4.6.9;python_version<'3.0' -pytest==6.2.4;python_version>='3.6' -pytest-cov==2.12.0 -Sphinx==1.8.5;python_version<'3.0' -Sphinx==5.3.0;python_version>='3.6' -docutils==0.17;python_version>='3.6' +pytest==8.3.2;python_version>='3.6' +Sphinx==8.0.2;python_version>='3.6' sphinx-bootstrap-theme==0.8.1 sphinxcontrib-fulltoc==1.2.0 +sphinxcontrib-websupport==2.0.0;python_version>='3.6' +sphinx-click==6.0.0;python_version>='3.6' +twine==5.1.1;python_version>='3.6' +wheel==0.44.0;python_version>='3.6' +setuptools==75.1.0;python_version>='3.6' +importlib-metadata==8.5.0;python_version>='3.6' +pytest==4.6.9;python_version<'3.0' +Sphinx==1.8.5;python_version<'3.0' sphinxcontrib-websupport==1.1.2;python_version<'3.0' -sphinxcontrib-websupport==1.2.4;python_version>='3.6' -sphinx-click==4.4.0 +sphinx-click==4.4.0;python_version<'3.0' twine==1.13.0;python_version<'3.0' -twine==3.4.1;python_version>='3.6' -wheel==0.38.1 +wheel==0.38.1;python_version<'3.0' setuptools==44.1.0;python_version<'3.0' -setuptools==65.5.1;python_version>='3.6' importlib-metadata==2.0.0;python_version<'3.0' -importlib-metadata==4.8.0;python_version>='3.6' -jinja2==3.0.3;python_version>='3.6' -markupsafe==2.0.1;python_version>='3.6' diff --git a/docs/_static/custom.css b/docs/_static/custom.css index 5e153008..89292230 100644 --- a/docs/_static/custom.css +++ b/docs/_static/custom.css @@ -5,44 +5,61 @@ * Sphinx stylesheet -- Bootstrap theme. */ +/* Overwrite colors */ +div.navbar-inverse { + background-color: #EB2227; + border-color: #EB2227; +} +a { + color: #EB2227; +} +a:visited { + color: #Bf0408; +} +code { + color: #Bf0408; +} +div.bs-sidenav a { + color: #333333; +} -/* The code below is based on the bootstrap website sidebar */ +/* Prevent top nav from blocking docs */ +div.navbar-fixed-top { + position: absolute; +} +/* Indent the side nav when in mobile mode */ +@media screen and (min-width: 0px) { + div.bs-sidenav ul { + margin-bottom: 0; + padding-left: 5px; + list-style: none; + } +} -/* Show and affix the side nav when space allows it */ +/* Widen and de-indent the side nav when space is restricted */ @media screen and (min-width: 992px) { .bs-sidenav .nav > .active > ul { display: block; } div.bs-sidenav ul { margin-bottom: 0; - padding-left: 5px; + padding-left: 0px; list-style: none; } - div.bs-sidenav a { - color: #333333; - } - /* 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; + .bs-sidenav { + width: 300px; } } + +/* Slightly indent the side nav when space allows it */ @media screen and (min-width: 1200px) { - /* Widen the fixed sidenav again */ - .bs-sidenav.affix-bottom, - .bs-sidenav.affix { - width: 360px; + div.bs-sidenav ul { + margin-bottom: 0; + padding-left: 5px; + list-style: none; + } + .bs-sidenav { + width: 370px; } } diff --git a/docs/conf.py b/docs/conf.py index 78538141..59284a17 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,6 +16,10 @@ import os import re import sys + +# The theme to use for HTML and HTML Help pages +import sphinx_bootstrap_theme + sys.path.insert(0, os.path.abspath('../')) # -- Project information ----------------------------------------------------- @@ -71,7 +75,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = 'en' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -81,13 +85,11 @@ # The name of the Pygments (syntax highlighting) style to use. pygments_style = None +# hide the class names in the nav bar +toc_object_entries_show_parents = 'hide' -# -- Options for HTML output ------------------------------------------------- -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -import sphinx_bootstrap_theme +# -- Options for HTML output ------------------------------------------------- # html_theme = 'alabaster' html_theme = 'bootstrap' @@ -121,6 +123,7 @@ # 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_css_files = ['custom.css'] # Custom sidebar templates, must be a dictionary that maps document names # to template names. @@ -594,13 +597,3 @@ def update_doc_index(proj_folder, lib_name): create_cli_files() # ----------------------------------------------------------------------------- - - -def setup(app): - """Run custom code with access to the Sphinx application object - Args: - app: the Sphinx application object - """ - - # Add bootstrap theme custom stylesheet - app.add_stylesheet("custom.css")