Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[repo-helper] Configuration Update #48

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/conda_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ jobs:
- name: Setup Python 🐍
uses: "actions/setup-python@v5"
with:
python-version: "3.8"
python-version: "3.11"

- name: Setup Conda
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v2.1.1
with:
activate-environment: env
conda-build-version: 3.28.4
python-version: "3.8"
miniconda-version: py311_24.1.2-0
python-version: "3.11"
miniforge-variant: Mambaforge

- name: Install dependencies 🔧
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/python_ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,15 @@ jobs:
- name: Setup Python 🐍
uses: "actions/setup-python@v5"
with:
python-version: 3.8
python-version: 3.11

- name: Setup Conda
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v2.1.1
with:
activate-environment: env
conda-build-version: 3.28.4
python-version: "3.8"
miniconda-version: py311_24.1.2-0
python-version: "3.11"
miniforge-variant: Mambaforge

- name: Install dependencies 🔧
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ci:

repos:
- repo: https://github.com/repo-helper/pyproject-parser
rev: v0.11.0
rev: v0.11.1
hooks:
- id: reformat-pyproject

Expand Down Expand Up @@ -42,7 +42,7 @@ repos:
exclude: ^(doc-source/conf|__pkginfo__|setup|tests/.*)\.py$
- id: bind-requirements

- repo: https://github.com/domdfcoding/flake8-dunder-all
- repo: https://github.com/python-formate/flake8-dunder-all
rev: v0.4.1
hooks:
- id: ensure-dunder-all
Expand Down Expand Up @@ -86,7 +86,7 @@ repos:
- id: formate
exclude: ^(doc-source/conf|__pkginfo__|setup)\.(_)?py$

- repo: https://github.com/domdfcoding/dep_checker
- repo: https://github.com/python-coincidence/dep_checker
rev: v0.8.0
hooks:
- id: dep_checker
Expand Down
17 changes: 16 additions & 1 deletion doc-source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,28 @@
}


# Fix for pathlib issue with sphinxemoji on Python 3.9 and Sphinx 4.x
def copy_asset_files(app, exc):
# 3rd party
from domdf_python_tools.compat import importlib_resources
from sphinx.util.fileutil import copy_asset

if exc:
return

asset_files = ["twemoji.js", "twemoji.css"]
for path in asset_files:
path_str = os.fspath(importlib_resources.files("sphinxemoji") / path)
copy_asset(path_str, os.path.join(app.outdir, "_static"))


def setup(app):
# 3rd party
from sphinx_toolbox.latex import better_header_layout
from sphinxemoji import sphinxemoji

app.connect("config-inited", lambda app, config: better_header_layout(config))
app.connect("build-finished", sphinxemoji.copy_asset_files)
app.connect("build-finished", copy_asset_files)
app.add_js_file("https://unpkg.com/twemoji@latest/dist/twemoji.min.js")
app.add_js_file("twemoji.js")
app.add_css_file("twemoji.css")
Expand Down
8 changes: 6 additions & 2 deletions doc-source/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ sphinx-copybutton>=0.5.2
sphinx-debuginfo>=0.2.2
sphinx-licenseinfo>=0.3.1
sphinx-notfound-page>=0.7.1
sphinx-prompt>=1.1.0
sphinx-pyproject>=0.1.0
sphinx-tabs>=1.1.13
sphinx-toolbox>=3.5.0
sphinxcontrib-applehelp==1.0.4
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.1
sphinxcontrib-httpdomain>=1.7.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
sphinxemoji>=0.1.6
toctree-plus>=0.6.1
26 changes: 21 additions & 5 deletions tests/test_pcdl.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 3rd party
# stdlib
import sys

# 3rd party
import pytest
from _pytest.fixtures import FixtureRequest
from betamax import Betamax # type: ignore
Expand Down Expand Up @@ -252,10 +254,24 @@ def pcdl_cassette(request: FixtureRequest):
("Styrene", "100-42-5"),
]

@pytest.mark.parametrize("python_version", [
pytest.param("<=3.8", marks=pytest.mark.skipif(sys.version_info >= (3, 9), reason="Output changes after Python 3.8")),
pytest.param(">=3.9", marks=pytest.mark.skipif(sys.version_info < (3, 9), reason="Output changes after Python 3.8")),
])

@pytest.mark.parametrize(
"python_version",
[
pytest.param(
"<=3.8",
marks=pytest.mark.skipif(
sys.version_info >= (3, 9), reason="Output changes after Python 3.8"
)
),
pytest.param(
">=3.9",
marks=pytest.mark.skipif(
sys.version_info < (3, 9), reason="Output changes after Python 3.8"
)
),
]
)
@pytest.mark.usefixtures("pcdl_cassette", "python_version")
def test_make_pcdl_csv(
tmp_pathplus: PathPlus,
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# * testenv
# * testenv:.package
# * testenv:py313-dev
# * testenv:py313
# * testenv:py312-dev
# * testenv:py312
# * testenv:docs
Expand Down Expand Up @@ -51,6 +52,7 @@ setenv =
PIP_DISABLE_PIP_VERSION_CHECK=1

[testenv:py312-dev]
download = True
setenv =
PYTHONDEVMODE=1
PIP_DISABLE_PIP_VERSION_CHECK=1
Expand Down
Loading