Skip to content

Commit

Permalink
Mod gmt version (#20)
Browse files Browse the repository at this point in the history
* Updates for GMT 0.4.

* further mods for GMT 0.4.0

* allow python 3.10

* update pre-commit to match changes made to gmt in 0.4.0

* update poetry.lock file

* pre-commit did not catch these until ci :(

* add forgotten isort config setting that moved

* pre-commit formatting

* add idf file compatible with E+9.6 for spawn example

* update ci to current gmt standards (#21)

* update ci to current gmt standards

* add quotes for python versions

* pin MBL to v9.1 in ci

* clean up teaser test to match spawn test

* argh, pre-commit formatting got me again

* pin github actions ci to ubuntu 20.04 because 22.04 does not support python 3.7

* another attempt to get coveralls working

* and another attempt at coveralls

* add minversion setting to pytest config in pyproject

* potential fix for coveralls

* only format ubuntu, and clean up coveralls calls

* add pytest config settings, and change path from gmt-examples to tests

* run formatting test on windows too

* Add coveralls repo token to ci action

Co-authored-by: Nicholas Long <1907354+nllong@users.noreply.github.com>

* try coveralls repo token only when running coveralls

* try coveralls repo token in a different ci step

* oops, coveralls token was in the wrong place

* back to Nicholas' coveralls token setup, and trying no coveralls on formatting

* add quotes to python version

* add coverage and badge (#23)

* Update README.rst

* `poetry update`

Co-authored-by: amyeallen1 <aallen@nrel.gov>
Co-authored-by: Nicholas Long <1907354+nllong@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 3, 2023
1 parent 238dc79 commit eeafeaa
Show file tree
Hide file tree
Showing 11 changed files with 5,905 additions and 886 deletions.
29 changes: 29 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# .coveragerc to control coverage.py
[run]
branch = True

# [paths]
# source =
# */site-packages/

[report]
omit =
.tox/*
*.mo

# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code:
def __repr__
if self\.debug

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:
39 changes: 24 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ on:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.9]
python-version: ["3.7.1", "3.10"]
os: [ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
-
Expand All @@ -27,7 +28,7 @@ jobs:
env:
MODELICAPATH: /home/runner/work/modelica-buildings
run: |
git clone --single-branch --branch issue2204_gmt_mbl https://github.com/lbl-srg/modelica-buildings.git $MODELICAPATH
git clone --single-branch --branch maint_9.1.x https://github.com/lbl-srg/modelica-buildings.git $MODELICAPATH
# back in the main checkout install Python dependencies
pip install --upgrade pip
pip install poetry
Expand All @@ -36,9 +37,18 @@ jobs:
name: Run unittests
env:
MODELICAPATH: /home/runner/work/modelica-buildings
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
poetry run py.test . -v --cov coveralls --cov-report term-missing
poetry run py.test . -v --cov --cov-report term-missing
-
name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.python_version == '3.10' }}
# https://github.com/TheKevJames/coveralls-python/issues/252
run: |
poetry run coveralls --service=github
-
name: Job Failed
if: ${{ failure() }}
Expand All @@ -59,21 +69,20 @@ jobs:
name: test-output
path: output
formatting:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.os }}
steps:
-
uses: actions/checkout@v3
-
uses: actions/setup-python@v4
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.7'
-
name: Install deps
python-version: '3.7.1'
- name: Install deps
run: |
pip install --upgrade pip
pip install poetry
poetry install
-
name: Run pre-commit
- name: Run pre-commit
run: |
poetry run pre-commit run --show-diff-on-failure --color=always --all-files
30 changes: 15 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@ repos:
rev: v2.2.3
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
- id: check-merge-conflict
- id: check-added-large-files
args: ['--maxkb=2000']
- id: check-ast
- id: check-json
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
# - id: requirements-txt-fixer
- id: flake8
args: ['--max-line-length=140'] # default of Black
- id: mixed-line-ending
- id: pretty-format-json
args: ['--autofix', '--no-sort-keys']
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.4
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
args: ['-m 3'] # vertical hanging
# - repo: local
# hooks:
# - id: modelica-fmt
# name: Modelica Formatter
# types: [file]
# files: \.(mo|mot)$
# entry: python setup.py format_modelica_files
# language: system
# pass_filenames: false
name: isort (python)
# - repo: local
# hooks:
# - id: modelica-fmt
# name: Modelica Formatter
# types: [file]
# files: \.(mo|mot)$
# entry: poetry run format_modelica_files
# language: system
# pass_filenames: false
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ GeoJSON to Modelica Translator Examples
.. image:: https://github.com/urbanopt/geojson-modelica-translator-examples/actions/workflows/ci.yml/badge.svg?branch=develop
:target: https://github.com/urbanopt/geojson-modelica-translator-examples/actions/workflows/ci.yml

.. image:: https://coveralls.io/repos/github/urbanopt/geojson-modelica-translator-examples/badge.svg?branch=develop
:target: https://coveralls.io/github/urbanopt/geojson-modelica-translator-examples?branch=develop


Description
-----------

Expand Down
Loading

0 comments on commit eeafeaa

Please sign in to comment.