Skip to content

Commit

Permalink
ci update (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
nabobalis authored Jun 5, 2024
1 parent 16d7b7e commit 2dc3d21
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 85 deletions.
51 changes: 33 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ $RECYCLE.BIN/
.github_cache
src/ablog/version.py
docs/_build/
docs/api/
docs/.doctrees/
docs/_website/
docs/_latex/
Expand Down
22 changes: 22 additions & 0 deletions ablog-conda-test-env.yml
Original file line number Diff line number Diff line change
@@ -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
13 changes: 1 addition & 12 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"sphinx.ext.extlinks",
"sphinx_automodapi.automodapi",
"ablog",
"alabaster",
"nbsphinx",
"myst_parser",
]
Expand Down Expand Up @@ -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",
Expand All @@ -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),
Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]

Expand All @@ -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]
Expand Down
9 changes: 1 addition & 8 deletions src/ablog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down
49 changes: 5 additions & 44 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 [email protected]:pydata/pydata-sphinx-theme.git --depth 1 pydata-sphinx-theme
Expand All @@ -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

0 comments on commit 2dc3d21

Please sign in to comment.