Skip to content

Commit

Permalink
ci(dev-deps): Update CI and dev deps to run on Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey committed Oct 16, 2024
1 parent ad43680 commit 57b9ab9
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 63 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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/[email protected]
with:
Expand Down Expand Up @@ -71,7 +71,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 .
Expand Down
19 changes: 8 additions & 11 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
pytest==6.2.4
pytest-cov==2.12.0
Sphinx==5.3.0
pytest==8.3.2
Sphinx==8.0.2
sphinx-bootstrap-theme==0.8.1
sphinxcontrib-websupport==1.2.4
sphinxcontrib-fulltoc==1.2.0
sphinx-click==4.4.0
twine==3.4.1
wheel==0.38.1
setuptools==65.5.1
importlib-metadata==4.8.0
jinja2==3.0.3
markupsafe==2.0.1
sphinxcontrib-websupport==2.0.0
sphinx-click==6.0.0
twine==5.1.1
wheel==0.44.0
setuptools==75.1.0
importlib-metadata==8.5.0
67 changes: 42 additions & 25 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,61 @@
* Sphinx stylesheet -- Bootstrap theme.
*/

/* Overwrite colors */
div.navbar-inverse {
background-color: #B87102;
border-color: #B87102;
}
a {
color: #B87102;
}
a:visited {
color: #B87102;
}
code {
color: #B87102;
}
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;
}
}
1 change: 1 addition & 0 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
{% endif %}

{%- block extrahead %}
<link rel="icon" type="image/x-icon" href="https://github.com/ladybug-tools/artwork/raw/refs/heads/master/icons_bugs/ico/honeybee.ico">
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
Expand Down
24 changes: 7 additions & 17 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
import sys
import re
import datetime

# The theme to use for HTML and HTML Help pages
import sphinx_bootstrap_theme

now = datetime.datetime.now()
sys.path.insert(0, os.path.abspath('../'))

Expand Down Expand Up @@ -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.
Expand All @@ -84,11 +88,6 @@

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

# html_theme = 'alabaster'
html_theme = 'bootstrap'
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
Expand Down Expand Up @@ -596,7 +595,8 @@ def update_doc_index(proj_folder, lib_name):
with open(os.path.join(proj_folder, "index.rst"), 'w') as index_file:
text = index_file.write(text_updated)
else:
print("[CLI doc\\index]: index.rst update not possible - content format cannot be recognized.")
print("[CLI doc\\index]: index.rst update not possible - content \
format cannot be recognized.")
return -1

return 1
Expand All @@ -607,13 +607,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_css_file("custom.css")
16 changes: 9 additions & 7 deletions honeybee_ies/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,15 @@ def _parse_gem_segment(
break
else:
raise ValueError(
'There is a segment with an unsupported type in the input GEM file. ' \
'Reach out to us with a copy of the GEM file and the information below:\n' \
'There is a segment with an unsupported type in the input GEM file. '
'Reach out to us with a copy of the GEM file and the information below:\n'
f'{segment}'
)

gem_type = _gem_object_type(info=info, keyword=keyword)

# remove empty lines if any
content = iter(l for l in segments.split('\n') if l.strip())
content = iter(lin for lin in segments.split('\n') if lin.strip())
display_name = next(content)
cleaned_display_name = clean_string(display_name)
identifier = clean_and_id_ep_string(cleaned_display_name)
Expand Down Expand Up @@ -372,7 +372,8 @@ def _parse_gem_segment(
continue
# there are multiple air boundaries. create an AirBoundary for each.
for hole in holes_2d:
hole = boundary_geometry_polygon2d.snap_to_polygon(hole, MODEL_TOLERANCE * 5)
hole = boundary_geometry_polygon2d.snap_to_polygon(
hole, MODEL_TOLERANCE * 5)
# map the hole back to 3D
hole = [boundary_geometry.plane.xy_to_xyz(ver) for ver in hole]
hole_geo = Face3D(hole)
Expand Down Expand Up @@ -408,7 +409,8 @@ def _parse_gem_segment(
continue
for f_hole in base_face.holes:
f_hole_geo = Face3D(f_hole)
if hole_geo.center.distance_to_point(f_hole_geo.center) <= MODEL_TOLERANCE * 5:
if hole_geo.center.distance_to_point(f_hole_geo.center) <= \
MODEL_TOLERANCE * 5:
# this hole is inside the face
base_faces_holes[count].append(f_hole_geo)
holes_tracker.append(hole_count)
Expand Down Expand Up @@ -470,8 +472,8 @@ def _parse_gem_segment(


def model_from_gem(
gem_str: str, model_id: str = 'Unnamed', model_name: str = None
) -> Model:
gem_str: str, model_id: str = 'Unnamed', model_name: str = None
) -> Model:
"""Create a Honeybee Model from the string contents of a VE GEM file.
Args:
Expand Down

0 comments on commit 57b9ab9

Please sign in to comment.