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 8dbf0ba commit e59348c
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 81 deletions.
14 changes: 4 additions & 10 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.7', '3.10']
python-version: ['3.10', '3.12']
os: [macos-latest, ubuntu-latest, windows-latest]

runs-on: ${{ matrix.os }}
Expand All @@ -24,13 +24,7 @@ jobs:
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
- name: run tests
run: python -m pytest --cov=. tests/
- name: run test coverage
if: ${{ matrix.python-version == 3.7 }}
run: |
echo "Coveralls is no longer supported"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python -m pytest tests/

deploy:
name: Deploy to GitHub and PyPI
Expand All @@ -42,7 +36,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 @@ -89,7 +83,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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ tox.ini
/.vscode
.eggs
*.code-workspace
*.code-workspace
honeybee.log*
tmp/
build/
29 changes: 12 additions & 17 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -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==3.3.1;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'
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
25 changes: 8 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 @@ -121,6 +120,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.
Expand Down Expand Up @@ -581,7 +581,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 @@ -592,13 +593,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")
1 change: 1 addition & 0 deletions honeybee_radiance_command/_command_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def run_command(input_command, env=None, cwd=None, mute=True):
pass

if rc != 0 and isinstance(rc, int): # return code not included on Mac
print(command)
raise RuntimeError('None zero return code: %d' % rc)

# only gets here is successful
Expand Down
22 changes: 11 additions & 11 deletions honeybee_radiance_command/dcglare.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,36 +77,36 @@ def options(self, value):
raise ValueError('Expected Dcglare options not {}'.format(value))

self._options = value

@property
def dc_direct(self):
"""Direct contribution matrix."""
return self._dc_direct

@dc_direct.setter
def dc_direct(self, value):
if value is None:
self._dc_direct = None
else:
self._dc_direct = typing.normpath(value)

@property
def dc_total(self):
"""Total (direct and diffuse) contribution matrix."""
return self._dc_total

@dc_total.setter
def dc_total(self, value):
if value is None:
self._dc_total = None
else:
self._dc_total = typing.normpath(value)

@property
def sky_matrix(self):
"""Sky contribution matrix."""
return self._sky_matrix

@sky_matrix.setter
def sky_matrix(self, value):
if value is None:
Expand All @@ -118,7 +118,7 @@ def sky_matrix(self, value):
def vmtx(self):
"""View matrix."""
return self._vmtx

@vmtx.setter
def vmtx(self, value):
if value is None:
Expand All @@ -130,7 +130,7 @@ def vmtx(self, value):
def dmtx(self):
"""Daylight matrix."""
return self._dmtx

@dmtx.setter
def dmtx(self, value):
if value is None:
Expand All @@ -142,7 +142,7 @@ def dmtx(self, value):
def tmtx(self):
"""Transmission matrix (BSDF)."""
return self._tmtx

@tmtx.setter
def tmtx(self, value):
if value is None:
Expand All @@ -162,8 +162,8 @@ def to_radiance(self, stdin_input=False):

command_parts = [self.command, self.options.to_radiance()]
command_parts += [self.dc_direct]
command_parts += [self.dc_total] if not self.tmtx else [self.vmtx, self.tmtx,
self.dmtx]
command_parts += [self.dc_total] if not self.tmtx else \
[self.vmtx, self.tmtx, self.dmtx]
if not stdin_input:
command_parts += [self.sky_matrix]
cmd = ' '.join(command_parts)
Expand Down
1 change: 0 additions & 1 deletion honeybee_radiance_command/rtrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class Rtrace(Command):
__slots__ = ('_octree', '_sensors')

def __init__(self, options=None, output=None, octree=None, sensors=None):

Command.__init__(self, output=output)
self.octree = octree
self.options = options
Expand Down

0 comments on commit e59348c

Please sign in to comment.