From 3689d7c580a71fe3b3729b24465c300a30bc54ef Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Sat, 6 Jan 2024 15:15:02 -0800 Subject: [PATCH] Fix all warnings found by new CI --- conftest.py | 5 +++-- docs/conf.py | 12 ++---------- setup.cfg | 2 ++ 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/conftest.py b/conftest.py index 7d87f262..8a58b65c 100644 --- a/conftest.py +++ b/conftest.py @@ -1,7 +1,8 @@ +from pathlib import Path + import docutils import pytest import sphinx -from sphinx.testing.path import path # Load app, status and warning fixtures. pytest_plugins = ["sphinx.testing.fixtures"] @@ -18,7 +19,7 @@ def pytest_report_header(config): @pytest.fixture(scope="session") def rootdir(): - return path(__file__).parent.abspath() / "roots" + return Path(__file__).parent.absolute() / "roots" @pytest.fixture(scope="function", autouse=True) diff --git a/docs/conf.py b/docs/conf.py index 4c837c07..f94a0355 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,7 +1,7 @@ import re from pathlib import Path -from pkg_resources import get_distribution +from packaging.version import parse as _parse from sphinx import addnodes import ablog @@ -22,11 +22,7 @@ "myst_parser", ] -versionmod = get_distribution("ablog") -version = ".".join(versionmod.version.split(".")[:3]) -release = versionmod.version.split("+")[0] -is_development = ".dev" in release - +version = _parse(ablog.__version__) project = "ABlog" copyright = "2014-2022, ABlog Team" master_doc = "index" @@ -35,13 +31,11 @@ ".md": "markdown", } exclude_patterns = ["_build", "docs/manual/.ipynb_checkpoints"] - html_title = "ABlog" html_use_index = True html_domain_indices = False html_show_sourcelink = True html_favicon = "_static/ablog.ico" - blog_title = "ABlog" blog_baseurl = "https://ablog.readthedocs.io/" blog_locations = { @@ -74,7 +68,6 @@ 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_sidebars = { @@ -98,7 +91,6 @@ "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/setup.cfg b/setup.cfg index e9e42006..d8f208b5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -58,6 +58,8 @@ filterwarnings = always::pytest.PytestConfigWarning # Sphinx and other packages raise these ignore:'imghdr' is deprecated and slated for removal in Python 3.13:DeprecationWarning + # python-datetuil + ignore:datetime.datetime.utcfromtimestamp:DeprecationWarning [pycodestyle] max_line_length = 120