From 8ac7b0b069a832014c11d85ba77e4531c676f32b Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 9 Sep 2024 09:53:46 +1000 Subject: [PATCH 1/9] pre-commit fix and master->main --- .github/workflows/ci.yml | 2 +- .github/workflows/tests.yml | 2 +- src/quantecon_book_theme/__init__.py | 4 ++-- src/quantecon_book_theme/assets/styles/index.scss | 6 +++--- src/quantecon_book_theme/launch.py | 2 +- tests/sites/base/conf.py | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37abed8..fdf7d2b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,7 +57,7 @@ jobs: uses: nwtgck/actions-netlify@v1.1 with: publish-dir: 'lecture-python-programming.myst/_build/html/' - production-branch: master + production-branch: main github-token: ${{ secrets.GITHUB_TOKEN }} deploy-message: "Preview Deploy from GitHub Actions" env: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5960efa..1e6d1b6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,7 +2,7 @@ name: continuous-integration on: push: - branches: [master] + branches: [main] tags: - 'v*' pull_request: diff --git a/src/quantecon_book_theme/__init__.py b/src/quantecon_book_theme/__init__.py index 0ed1e5c..9a5eafd 100644 --- a/src/quantecon_book_theme/__init__.py +++ b/src/quantecon_book_theme/__init__.py @@ -230,8 +230,8 @@ def get_github_src_folder(app): if repo_url: branch = config_theme.get("repository_branch") if not branch: - # Explicitly check in cae branch is "" - branch = "master" + # Explicitly check in case branch is "" + branch = "main" relpath = config_theme.get("path_to_docs", "") org, repo = repo_url.strip("/").split("/")[-2:] context.update( diff --git a/src/quantecon_book_theme/assets/styles/index.scss b/src/quantecon_book_theme/assets/styles/index.scss index e0bc5dc..1ff36a4 100644 --- a/src/quantecon_book_theme/assets/styles/index.scss +++ b/src/quantecon_book_theme/assets/styles/index.scss @@ -1193,13 +1193,13 @@ tt { } } -div.admonition, .admonition { +div.admonition, +.admonition { font-size: 0.9rem; margin: 1.5rem auto; padding: 0 1rem 0.5rem 1rem; page-break-inside: avoid; - box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.1), - 0 0 0.05rem rgba(0, 0, 0, 0.1); + box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.1), 0 0 0.05rem rgba(0, 0, 0, 0.1); > .admonition-title { position: relative; margin: 0 -1rem; diff --git a/src/quantecon_book_theme/launch.py b/src/quantecon_book_theme/launch.py index 63490b6..7047bb3 100644 --- a/src/quantecon_book_theme/launch.py +++ b/src/quantecon_book_theme/launch.py @@ -182,5 +182,5 @@ def _is_notebook(app, pagename): def _get_branch(config_theme): branch = config_theme.get("nb_branch") if not branch: - branch = "master" + branch = "main" return branch diff --git a/tests/sites/base/conf.py b/tests/sites/base/conf.py index 3f2a46a..1a382f1 100644 --- a/tests/sites/base/conf.py +++ b/tests/sites/base/conf.py @@ -24,7 +24,7 @@ "repository_url": "https://github.com/executablebooks/sphinx-book-theme", "nb_repository_url": "https://github.com/executablebooks/sphinx-book-theme", "navigation_with_keys": True, - # "repository_branch": "master", # Not using this, should default to master + # "repository_branch": "main", # Not using this, should default to main "launch_buttons": { "binderhub_url": "https://mybinder.org", "jupyterhub_url": "https://datahub.berkeley.edu", From 7c65d99e097dab9e94beb80313dd22448f51d68b Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 9 Sep 2024 10:02:53 +1000 Subject: [PATCH 2/9] remove old installs --- .github/workflows/ci.yml | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fdf7d2b..2053b7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: auto-update-conda: true auto-activate-base: true miniconda-version: 'latest' - python-version: "3.10" + python-version: "3.11" environment-file: lecture-python-programming.myst/environment.yml activate-environment: lecture-python-programming - name: Install quantecon-book-theme @@ -24,24 +24,6 @@ jobs: run: | pip uninstall -y quantecon-book-theme python -m pip install . - - name: Install sphinx-multitoc-numbering - shell: bash -l {0} - run: | - git clone https://github.com/executablebooks/sphinx-multitoc-numbering.git - cd sphinx-multitoc-numbering - python setup.py install - cd ../ && rm -rf sphinx-multitoc-numbering - - name: Install sphinx-exercise - shell: bash -l {0} - run: | - git clone https://github.com/executablebooks/sphinx-exercise.git - cd sphinx-exercise - python setup.py install - cd ../ && rm -rf sphinx-exercise - - name: Install Dependencies - shell: bash -l {0} - run: | - pip install jupyter-book - name: Display Conda Environment Versions shell: bash -l {0} run: conda list From 5dafdd78f8ce7657c74f390244398cf4d9e7a222 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 9 Sep 2024 10:08:56 +1000 Subject: [PATCH 3/9] update tox testing --- tox.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index d73fca7..ef3b02a 100644 --- a/tox.ini +++ b/tox.ini @@ -11,13 +11,13 @@ # then then deleting compiled files has been found to fix it: `find . -name \*.pyc -delete` [tox] -envlist = py39-sphinx5 +envlist = py311-sphinx5 [testenv] usedevelop=true passenv = TERM # To make terminal coloring / other variables pass through -[testenv:py{37,38,39}-pre-commit] +[testenv:py{311}-pre-commit] extras = code_style commands = pre-commit run {posargs} @@ -43,7 +43,7 @@ deps = commands = stb serve docs --open-browser -[testenv:py{37,38,39}-sphinx{5,6}] +[testenv:py{311}-sphinx{5,6}] extras = test deps = sphinx5: sphinx>=5,<6 From 79ea60e697974a07d1b26194662ccde2aedeaee5 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 9 Sep 2024 11:29:13 +1000 Subject: [PATCH 4/9] update pytest pins --- .github/workflows/tests.yml | 6 +++--- pyproject.toml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1e6d1b6..ca4f636 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: ["3.9", "3.10", "3.11"] + python-version: ["3.11"] # Only test the latest major release of Sphinx because otherwise we need to # keep multiple versions of regression tests on file and this creates lots of # noise in the tests. @@ -51,7 +51,7 @@ jobs: pytest --durations=10 --cov=quantecon_book_theme --cov-report=xml --cov-report=term-missing - name: Upload to Codecov - if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.9 && github.repository == 'QuantEcon/quantecon-book-theme' && github.event_name == 'pull_request' + if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.11 && github.repository == 'QuantEcon/quantecon-book-theme' && github.event_name == 'pull_request' uses: codecov/codecov-action@v3.1.4 with: name: ebp-qbt-pytests-py3.7 @@ -70,7 +70,7 @@ jobs: - name: Set up Python 3.10 uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.11" - name: Build package run: | python -m pip install -U pip build diff --git a/pyproject.toml b/pyproject.toml index e92c4f1..0fe6707 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,11 +70,11 @@ doc = [ test = [ "myst_nb", "coverage", - "pytest~=7.1", + "pytest", "pytest-cov", "beautifulsoup4", "sphinx_thebe", - "pytest-regressions~=2.0.1", + "pytest-regressions", "sphinx_copybutton", "sphinx_togglebutton", ] From 01df77e475517a6c98c24ae1f397c8d9bf8b700f Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 9 Sep 2024 13:49:31 +1000 Subject: [PATCH 5/9] set python=310 due to npm --- .github/workflows/tests.yml | 4 ++-- tox.ini | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ca4f636..96f7c8e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version: 3.10 - uses: pre-commit/action@v3.0.0 tests: @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: ["3.11"] + python-version: ["3.10"] # Only test the latest major release of Sphinx because otherwise we need to # keep multiple versions of regression tests on file and this creates lots of # noise in the tests. diff --git a/tox.ini b/tox.ini index ef3b02a..cfad4fb 100644 --- a/tox.ini +++ b/tox.ini @@ -11,13 +11,13 @@ # then then deleting compiled files has been found to fix it: `find . -name \*.pyc -delete` [tox] -envlist = py311-sphinx5 +envlist = py310-sphinx5 [testenv] usedevelop=true passenv = TERM # To make terminal coloring / other variables pass through -[testenv:py{311}-pre-commit] +[testenv:py{310,311}-pre-commit] extras = code_style commands = pre-commit run {posargs} From 06f351fe2f70ff5e4e25851bc4d0cacd4ebb14c7 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 9 Sep 2024 15:47:01 +1000 Subject: [PATCH 6/9] fix tests and update tox --- .github/workflows/tests.yml | 4 +- tests/test_build/test_build_book.html | 67 ++++++++++++++------------- tox.ini | 4 +- 3 files changed, 39 insertions(+), 36 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 96f7c8e..ca4f636 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: - python-version: 3.10 + python-version: 3.11 - uses: pre-commit/action@v3.0.0 tests: @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: ["3.10"] + python-version: ["3.11"] # Only test the latest major release of Sphinx because otherwise we need to # keep multiple versions of regression tests on file and this creates lots of # noise in the tests. diff --git a/tests/test_build/test_build_book.html b/tests/test_build/test_build_book.html index 455429b..f9af32a 100644 --- a/tests/test_build/test_build_book.html +++ b/tests/test_build/test_build_book.html @@ -23,38 +23,41 @@ 3. Section 1 index - - - +
+ + + + + + + +
  • diff --git a/tox.ini b/tox.ini index cfad4fb..ef3b02a 100644 --- a/tox.ini +++ b/tox.ini @@ -11,13 +11,13 @@ # then then deleting compiled files has been found to fix it: `find . -name \*.pyc -delete` [tox] -envlist = py310-sphinx5 +envlist = py311-sphinx5 [testenv] usedevelop=true passenv = TERM # To make terminal coloring / other variables pass through -[testenv:py{310,311}-pre-commit] +[testenv:py{311}-pre-commit] extras = code_style commands = pre-commit run {posargs} From be77163db708c5fa6516da4a01207f34b0a40109 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 9 Sep 2024 15:51:33 +1000 Subject: [PATCH 7/9] update python and os x --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ca4f636..012b776 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version: "3.11" - uses: pre-commit/action@v3.0.0 tests: @@ -26,10 +26,10 @@ jobs: # Only test the latest major release of Sphinx because otherwise we need to # keep multiple versions of regression tests on file and this creates lots of # noise in the tests. - sphinx: ["~=5.0"] + sphinx: ["~=6.0"] include: - os: macos-latest - python-version: 3.x + python-version: "3.11" runs-on: ${{ matrix.os }} steps: From e4973f9c5115ee91afe4a0528180e48ea3543616 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 9 Sep 2024 15:54:45 +1000 Subject: [PATCH 8/9] sphinx-5 for now --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 012b776..29e40a3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,7 +26,7 @@ jobs: # Only test the latest major release of Sphinx because otherwise we need to # keep multiple versions of regression tests on file and this creates lots of # noise in the tests. - sphinx: ["~=6.0"] + sphinx: ["~=5.0"] include: - os: macos-latest python-version: "3.11" From 631a3c8de0dc473079abcad90e11d051ef9717e1 Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 9 Sep 2024 16:00:32 +1000 Subject: [PATCH 9/9] remove os x testing --- .github/workflows/tests.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 29e40a3..1a6f7c2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,9 +27,6 @@ jobs: # keep multiple versions of regression tests on file and this creates lots of # noise in the tests. sphinx: ["~=5.0"] - include: - - os: macos-latest - python-version: "3.11" runs-on: ${{ matrix.os }} steps: