-
Notifications
You must be signed in to change notification settings - Fork 5
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 #27 from pastas/dev
Metran release 0.4.0
- Loading branch information
Showing
12 changed files
with
730 additions
and
450 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: metran | ||
name: CI | ||
|
||
on: | ||
- push | ||
|
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,47 @@ | ||
name: CI NB | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
name: ${{ matrix.name }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- name: Test suite for notebooks | ||
python: "3.10" | ||
toxenv: notebooks | ||
env: | ||
# Color Output | ||
# Rich (pip) | ||
FORCE_COLOR: 1 | ||
# Tox | ||
PY_COLORS: 1 | ||
# Pytest | ||
PYTEST_ADDOPTS: "--color=yes" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
check-latest: true | ||
cache: "pip" | ||
cache-dependency-path: pyproject.toml | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox | ||
- name: Setup tox environment | ||
run: tox -e ${{ matrix.toxenv }} --notest | ||
|
||
- name: Test | ||
run: tox -e ${{ matrix.toxenv }} --skip-pkg-install |
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 was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
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
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,3 +1,3 @@ | ||
# This is the only location where the version will be written and changed. | ||
# Based on https://packaging.python.org/single_source_version/ | ||
__version__ = "0.3.0" | ||
__version__ = "0.4.0" |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import os | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
pathname = Path("./examples/") | ||
files = pathname.glob("*ipynb") | ||
|
||
testdir = pathname / "build" | ||
|
||
if testdir.is_dir(): | ||
testdir.rmdir() | ||
testdir.mkdir() | ||
|
||
|
||
@pytest.mark.notebooks | ||
@pytest.mark.parametrize("file", files) | ||
def test_notebook(file) -> None: | ||
|
||
cwd = os.getcwd() | ||
|
||
os.chdir(pathname) | ||
|
||
try: | ||
# run autotest on each notebook | ||
cmd = ( | ||
"jupyter " | ||
+ "nbconvert " | ||
+ "--ExecutePreprocessor.timeout=600 " | ||
+ "--to " | ||
+ "notebook " | ||
+ "--execute " | ||
+ '"{}" '.format(file.name) | ||
+ "--output-dir " | ||
+ "{} ".format(testdir) | ||
) | ||
ival = os.system(cmd) | ||
msg = "could not run {}".format(file.name) | ||
assert ival == 0, msg | ||
assert os.path.isfile(os.path.join(testdir, file.name)), msg | ||
except Exception as e: | ||
os.chdir(cwd) | ||
raise Exception(e) | ||
os.chdir(cwd) |