diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 500a6c02..ec705071 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - test: + tests: needs: [core] uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main with: @@ -57,32 +57,47 @@ jobs: - pandoc - graphviz envs: | - - macos: py311-sphinx6 - - windows: py310-sphinx6 + - macos: py311-sphinx7 + - windows: py310-sphinx7 + - linux: py312-devdeps secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - docs: - needs: [test] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main - with: - submodules: false - pytest: false - envs: | - - linux: py312-docs - extras: - needs: [core] + needs: [tests] uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main with: submodules: false - coverage: codecov + pytest: false libraries: | apt: - pandoc - graphviz envs: | - - linux: py312-sphinxdev - - linux: py312-conda - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - linux: py312-docs + - linux: pydata-sphinx-theme-dev + - linux: py312-linkcheck + + conda: + needs: [tests] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + lfs: true + - uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: ablog-test + environment-file: ablog-conda-test-env.yml + python-version: "3.12" + - name: Install ablog + shell: bash -el {0} + run: | + pip install --no-deps --no-build-isolation . + - name: Run test + shell: bash -el {0} + run: | + conda list + pytest -vvv -r a --pyargs ablog + make tests diff --git a/.gitignore b/.gitignore index b3c087f2..ff1e26e3 100644 --- a/.gitignore +++ b/.gitignore @@ -185,6 +185,7 @@ $RECYCLE.BIN/ .github_cache src/ablog/version.py docs/_build/ +docs/api/ docs/.doctrees/ docs/_website/ docs/_latex/ diff --git a/ablog-conda-test-env.yml b/ablog-conda-test-env.yml new file mode 100644 index 00000000..b552e1cb --- /dev/null +++ b/ablog-conda-test-env.yml @@ -0,0 +1,22 @@ +channels: + - conda-forge +dependencies: + - docutils + - feedgen + - graphviz + - invoke + - make + - myst-parser + - nbsphinx + - packaging + - pandoc + - pip + - pytest + - python-dateutil + - setuptools + - setuptools-scm + - sphinx + - sphinx-automodapi + - watchdog + - pip: + - sunpy-sphinx-theme diff --git a/docs/conf.py b/docs/conf.py index 747b3d00..0e735f8a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,7 +16,6 @@ "sphinx.ext.extlinks", "sphinx_automodapi.automodapi", "ablog", - "alabaster", "nbsphinx", "myst_parser", ] @@ -67,11 +66,9 @@ disqus_shortname = "https-ablog-readthedocs-io" disqus_pages = True fontawesome_link_cdn = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" -html_style = "alabaster.css" -html_theme = "alabaster" +html_theme = "sunpy" html_sidebars = { "**": [ - "about.html", "ablog/postcard.html", "ablog/recentposts.html", "ablog/tagcloud.html", @@ -80,16 +77,8 @@ "ablog/authors.html", "ablog/languages.html", "ablog/locations.html", - "searchbox.html", ], } -html_theme_options = { - "travis_button": False, - "github_user": "sunpy", - "github_repo": "ablog", - "description": "ABlog for blogging with Sphinx", - "logo": "ablog.png", -} intersphinx_mapping = { "python": ("https://docs.python.org/", None), "sphinx": ("https://www.sphinx-doc.org/en/master/", None), diff --git a/pyproject.toml b/pyproject.toml index 3fb15b5a..c9525b13 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ dependencies = [ "invoke>=1.6.0", "packaging>=19.0", "python-dateutil>=2.8.2", - "sphinx>=6.0.0", + "sphinx>=6.0.0,!=7.3.0,!=7.3.1,!=7.3.2,!=7.3.3,!=7.3.4,!=7.3.5,!=7.3.6", "watchdog>=2.1.0", ] @@ -50,12 +50,13 @@ notebook = [ ] markdown = ["myst-parser>=0.17.0"] docs = [ - "alabaster", + "sunpy-sphinx-theme", "sphinx-automodapi" ] tests = [ - "pytest", "defusedxml>=0.8.0rc2", + "pytest-cov", + "pytest", ] [project.urls] diff --git a/src/ablog/__init__.py b/src/ablog/__init__.py index 9875abce..d7c96ec0 100755 --- a/src/ablog/__init__.py +++ b/src/ablog/__init__.py @@ -8,7 +8,6 @@ from pathlib import PurePath from sphinx.builders.html import StandaloneHTMLBuilder -from sphinx.errors import ThemeError from sphinx.jinja2glue import BuiltinTemplateLoader, SphinxFileSystemLoader from sphinx.locale import get_translation @@ -127,13 +126,7 @@ def builder_inited(app): theme = app.builder.theme loaders = app.builder.templates.loaders templatepathlen = app.builder.templates.templatepathlen - try: - # Modern Sphinx now errors instead of returning the default if there is not a value - # in any of the config files. - after_theme = theme.get_config("ablog", "inject_templates_after_theme", False) - except ThemeError: - after_theme = False - if after_theme: + if theme.get_config("ablog", "inject_templates_after_theme", False): # Inject *after* the user templates and the theme templates, # allowing themes to override the templates provided by this # extension while those templates still serve as a fallback. diff --git a/tox.ini b/tox.ini index 81710d14..98e18ae8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,14 +1,11 @@ [tox] envlist = - py{310,311,312}{-sphinx6,-sphinx7,-sphinx8,-sphinxdev,-docs,-linkcheck} - + py{310,311,312}{-sphinx6,-sphinx7,-sphinx8,-devdeps,-docs,-linkcheck} + pydata-sphinx-theme-dev [testenv] allowlist_externals = - conda make git -deps = - pytest-cov extras = all docs @@ -18,19 +15,13 @@ commands = sphinx6: pip install -U "sphinx>=6.0,<7.0" sphinx7: pip install -U "sphinx>=7.0,<8.0" sphinx8: pip install -U "sphinx>=8.0,<9.0" - sphinxdev: pip install -U "git+https://repo.or.cz/docutils.git#egg=docutils&subdirectory=docutils" - sphinxdev: pip install -U "git+https://github.com/sphinx-doc/sphinx" + devdeps: pip install -U "docutils @ git+https://github.com/docutils/docutils.git\#\&subdirectory=docutils" + devdeps: pip install -U "git+https://github.com/sphinx-doc/sphinx" pip freeze --all --no-input pytest -vvv -r a --pyargs ablog make tests -[testenv:pydata-sphinx-theme] -deps = - git+https://github.com/pydata/pydata-sphinx-theme.git - pytest-cov -extras = - all - docs +[testenv:pydata-sphinx-theme-dev] commands = rm -rf pydata-sphinx-theme || true git clone git@github.com:pydata/pydata-sphinx-theme.git --depth 1 pydata-sphinx-theme @@ -50,33 +41,3 @@ changedir = docs description = Invoke sphinx-build to check linkcheck works commands = sphinx-build --color -W --keep-going -b linkcheck . _build/html {posargs} - -# Requires tox-conda -[testenv:py{310,311,312}-conda] -extras = -deps = -conda_deps = - alabaster - docutils - feedgen - graphviz - invoke - make - myst-parser - nbsphinx - packaging - pandoc - pip - pytest - python-dateutil - setuptools - setuptools-scm - sphinx - sphinx-automodapi - watchdog -conda_channels = conda-forge -install_command = pip install --no-deps --no-build-isolation {opts} {packages} -commands = - conda list - pytest -vvv -r a --pyargs ablog - make tests