-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #282 from NREL/develop
beta release
- Loading branch information
Showing
146 changed files
with
10,521 additions
and
45,988 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
POSTGRES_DB=buildingmotif | ||
POSTGRES_USER=buildingmotif | ||
POSTGRES_PASSWORD=password | ||
DB_URI="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[flake8] | ||
max-line-length = 88 | ||
extend-ignore = E203, E501 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,49 +7,77 @@ on: | |
- main | ||
push: | ||
branches: | ||
- develop | ||
- main | ||
release: | ||
|
||
jobs: | ||
|
||
build: | ||
name: build distribution for Python | ||
# deploy docs for develop and main branches | ||
deploy-docs: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.8', '3.9', '3.10'] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: snok/install-poetry@v1 | ||
|
||
- name: build | ||
run: poetry build | ||
# setup, checkout pull_request.head.ref for repo-vis | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{github.event.pull_request.head.ref}} | ||
- name: setup-python | ||
uses: actions/setup-python@v3 | ||
# # update repo visualization for docs | ||
# - name: repo-visualizer | ||
# uses: githubocto/[email protected] | ||
# with: | ||
# output_file: docs/reference/apidoc/code_visualization.svg | ||
# excluded_paths: ".github" | ||
# commit_message: "repo-visualizer [skip actions]" | ||
# install project, which is required for autodoc of code | ||
- name: install buildingmotif | ||
run: pip install . | ||
# install jupyter-book, which for some reason isn't available with poetry install | ||
- name: install jupyter book | ||
run: pip install jupyter-book | ||
# build docs, which are deployed by repo settings | ||
- name: build docs | ||
run: | | ||
jupyter-book config sphinx ./docs/ | ||
sphinx-build ./docs/ docs/_build/html -b html | ||
# TODO can we use an official GitHub Action? https://github.com/actions/deploy-pages | ||
- name: deploy docs | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./docs/_build/html | ||
|
||
publish: | ||
name: publish distribution | ||
needs: build | ||
# deploy distribution if a new release and tag are created | ||
deploy-dist: | ||
needs: deploy-docs | ||
if: startsWith(github.ref, 'refs/tags') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
- uses: snok/install-poetry@v1 | ||
|
||
- name: build | ||
run: poetry build | ||
|
||
- name: publish distribution 📦 to Test PyPI | ||
if: ${{ github.base_ref == 'main' }} | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
skip_existing: true | ||
|
||
- name: publish distribution 📦 to PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
# setup | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- name: setup-python | ||
uses: actions/setup-python@v3 | ||
# install poetry and build dist | ||
- name: install-poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.4.0 | ||
virtualenvs-in-project: false | ||
virtualenvs-path: ~/.virtualenvs | ||
- name: build dist | ||
run: poetry build | ||
- name: publish distribution to Test PyPI | ||
id: test-pypi | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
skip_existing: true | ||
- name: publish distribution to PyPI | ||
if: steps.test-pypi.outcome == 'success' | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: continuous integration | ||
|
||
on: | ||
push | ||
|
||
jobs: | ||
|
||
styling: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- name: setup-python | ||
uses: actions/setup-python@v3 | ||
- name: install-poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.4.0 | ||
virtualenvs-in-project: false | ||
virtualenvs-path: ~/.virtualenvs | ||
- name: poetry install | ||
run: poetry install --all-extras | ||
- name: run isort and black | ||
run: | | ||
poetry run isort . --check | ||
poetry run black . --check | ||
testing: | ||
needs: styling | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.8', '3.9', '3.10'] | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- name: setup-python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: install-poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.4.0 | ||
virtualenvs-in-project: false | ||
virtualenvs-path: ~/.virtualenvs | ||
- name: poetry install | ||
run: poetry install --all-extras | ||
- name: lint | ||
run: poetry run flake8 buildingmotif | ||
- name: type check | ||
run: poetry run mypy | ||
- name: unit tests | ||
run: poetry run pytest tests/unit --cov=./ --cov-report=xml | ||
- name: integration tests | ||
run: poetry run pytest tests/integration | ||
- name: bacnet tests | ||
run: | | ||
cd tests/integration/fixtures/bacnet | ||
docker compose build device buildingmotif | ||
docker compose run -d device | ||
docker compose run buildingmotif poetry run pytest -m bacnet | ||
docker compose down | ||
- name: build tests | ||
run: poetry build | ||
|
||
coverage: | ||
needs: testing | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.xml |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,24 @@ | ||
repos: | ||
- repo: https://github.com/gvanderest/pylama-pre-commit | ||
rev: 0.1.2 | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: pylama | ||
- id: isort | ||
entry: poetry run isort | ||
- repo: https://github.com/psf/black | ||
rev: 22.3.0 | ||
hooks: | ||
- id: black | ||
entry: black --check | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.10.1 | ||
entry: poetry run black | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 5.0.0 | ||
hooks: | ||
- id: isort | ||
entry: isort --check | ||
- id: flake8 | ||
entry: poetry run flake8 buildingmotif | ||
# can't poetry run becuase not present in repository https://github.com/pre-commit/mirrors-mypy | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.931 | ||
hooks: | ||
- id: mypy | ||
args: ["--install-types", "--non-interactive", "--ignore-missing-imports"] | ||
additional_dependencies: [sqlalchemy2-stubs <= 0.0.2a20, SQLAlchemy <= 1.4] | ||
exclude: docs/conf.py |
Oops, something went wrong.