Skip to content

Commit

Permalink
CI: Add raw build and import step (should fail) (#543)
Browse files Browse the repository at this point in the history
* CI: Add raw build and import step
* fix: Guard ConstrainedSR3 imports

I'm not sure where this happened, but since ConstrainedSR3 needs
CVXPY (an optional dependency), imports of it need to be guarded
depending on whether user has cvxpy installed.

Also, since PEP 690 was rejected, removed those comments

Also
* Fix example 8 notebook headers to pass build
* Make doc build more verbose
  • Loading branch information
Jacob-Stevens-Haas authored Aug 10, 2024
1 parent 3e8a445 commit 0d47d7a
Show file tree
Hide file tree
Showing 11 changed files with 1,153 additions and 1,563 deletions.
43 changes: 33 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,48 @@ on:
branches:
- master


jobs:
Linting:
linting:
name: Linting
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Linting
run: |
pip install pre-commit
pre-commit run --all-files
Docs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: build
run: pip install .
- name: test import
run: python -c "import pysindy"

docs:
name: Docs
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: "Set up Python"
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install doc dependencies
Expand All @@ -42,18 +63,20 @@ jobs:
cd docs
python -m sphinx -T -E -W -b html -d _build/doctrees . _build/html
Tests:
needs: Linting
tests:
name: Tests
needs: linting
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 4
matrix:
python-version: ["3.9", "3.11"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def setup(app):
new_dir = doc_examples / notebook.parent.stem
new_dir.mkdir(exist_ok=True)
new_file = new_dir / "example.ipynb"
print(f"Creating file {new_file}")
print(f"Copying {notebook} to {new_file}")
shutil.copy(notebook, new_file)
# Notebook 15 uses an image file
(doc_examples / "15_pysindy_lectures/data").mkdir(exist_ok=True)
Expand Down
Loading

0 comments on commit 0d47d7a

Please sign in to comment.