From 66b207b09ab16e63bb41fd9c9dc602c312552002 Mon Sep 17 00:00:00 2001 From: laughingman7743 Date: Sat, 27 Sep 2025 17:54:46 +0900 Subject: [PATCH 1/2] docs: Change Sphinx theme from Alabaster to Furo and fix version handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add furo theme dependency to dev requirements in pyproject.toml - Update html_theme in docs/conf.py from "alabaster" to "furo" - Fix get_version() function to properly read version from _version.py - Provides modern, accessible documentation styling with correct version display 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- docs/conf.py | 18 +++++++++----- pyproject.toml | 1 + uv.lock | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 6 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index d162c4b9..177ae465 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -7,11 +7,17 @@ def get_version(): - version_file = Path(".").absolute().parent / "pyathena" / "__init__.py" - with version_file.open() as f: - for line in f: - if line.startswith("__version__"): - return line.strip().split('"')[1] + try: + # Try to import from _version.py (generated by setuptools-scm) + from pyathena._version import __version__ + return __version__ + except ImportError: + try: + # Fallback to importlib.metadata + from importlib.metadata import version + return version("PyAthena") + except Exception: + return "unknown" # -- Project information ----------------------------------------------------- @@ -78,5 +84,5 @@ def get_version(): # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output -html_theme = "alabaster" +html_theme = "furo" html_static_path = ["_static"] diff --git a/pyproject.toml b/pyproject.toml index a1076eed..82d16ada 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,6 +59,7 @@ dev = [ "pytest-xdist", "pytest-dependency", "sphinx", + "furo", "types-python-dateutil", ] diff --git a/uv.lock b/uv.lock index ebd12bd9..d9cb72fc 100644 --- a/uv.lock +++ b/uv.lock @@ -7,6 +7,18 @@ resolution-markers = [ "python_full_version >= '3.12'", ] +[[package]] +name = "accessible-pygments" +version = "0.0.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/bc/c1/bbac6a50d02774f91572938964c582fff4270eee73ab822a4aeea4d8b11b/accessible_pygments-0.0.5.tar.gz", hash = "sha256:40918d3e6a2b619ad424cb91e556bd3bd8865443d9f22f1dcdf79e33c8046872", size = 1377899 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8d/3f/95338030883d8c8b91223b4e21744b04d11b161a3ef117295d8241f50ab4/accessible_pygments-0.0.5-py3-none-any.whl", hash = "sha256:88ae3211e68a1d0b011504b2ffc1691feafce124b845bd072ab6f9f66f34d4b7", size = 1395903 }, +] + [[package]] name = "alabaster" version = "0.7.16" @@ -25,6 +37,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ed/20/bc79bc575ba2e2a7f70e8a1155618bb1301eaa5132a8271373a6903f73f8/babel-2.16.0-py3-none-any.whl", hash = "sha256:368b5b98b37c06b7daf6696391c3240c938b37767d4584413e8438c5c435fa8b", size = 9587599 }, ] +[[package]] +name = "beautifulsoup4" +version = "4.13.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "soupsieve" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/85/2e/3e5079847e653b1f6dc647aa24549d68c6addb4c595cc0d902d1b19308ad/beautifulsoup4-4.13.5.tar.gz", hash = "sha256:5e70131382930e7c3de33450a2f54a63d5e4b19386eab43a5b34d594268f3695", size = 622954 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/eb/f4151e0c7377a6e08a38108609ba5cede57986802757848688aeedd1b9e8/beautifulsoup4-4.13.5-py3-none-any.whl", hash = "sha256:642085eaa22233aceadff9c69651bc51e8bf3f874fb6d7104ece2beb24b47c4a", size = 105113 }, +] + [[package]] name = "boto3" version = "1.35.90" @@ -393,6 +418,22 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/de/86/5486b0188d08aa643e127774a99bac51ffa6cf343e3deb0583956dca5b22/fsspec-2024.12.0-py3-none-any.whl", hash = "sha256:b520aed47ad9804237ff878b504267a3b0b441e97508bd6d2d8774e3db85cee2", size = 183862 }, ] +[[package]] +name = "furo" +version = "2025.9.25" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "accessible-pygments" }, + { name = "beautifulsoup4" }, + { name = "pygments" }, + { name = "sphinx" }, + { name = "sphinx-basic-ng" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/4e/29/ff3b83a1ffce74676043ab3e7540d398e0b1ce7660917a00d7c4958b93da/furo-2025.9.25.tar.gz", hash = "sha256:3eac05582768fdbbc2bdfa1cdbcdd5d33cfc8b4bd2051729ff4e026a1d7e0a98", size = 1662007 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ba/69/964b55f389c289e16ba2a5dfe587c3c462aac09e24123f09ddf703889584/furo-2025.9.25-py3-none-any.whl", hash = "sha256:2937f68e823b8e37b410c972c371bc2b1d88026709534927158e0cb3fac95afe", size = 340409 }, +] + [[package]] name = "greenlet" version = "3.1.1" @@ -832,6 +873,7 @@ sqlalchemy = [ [package.dev-dependencies] dev = [ { name = "fastparquet" }, + { name = "furo" }, { name = "jinja2" }, { name = "mypy" }, { name = "numpy" }, @@ -862,6 +904,7 @@ requires-dist = [ [package.metadata.requires-dev] dev = [ { name = "fastparquet", specifier = ">=0.4.0" }, + { name = "furo" }, { name = "jinja2", specifier = ">=3.1.0" }, { name = "mypy", specifier = ">=0.900" }, { name = "numpy", specifier = ">=1.26.0" }, @@ -1013,6 +1056,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ed/dc/c02e01294f7265e63a7315fe086dd1df7dacb9f840a804da846b96d01b96/snowballstemmer-2.2.0-py2.py3-none-any.whl", hash = "sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a", size = 93002 }, ] +[[package]] +name = "soupsieve" +version = "2.8" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6d/e6/21ccce3262dd4889aa3332e5a119a3491a95e8f60939870a3a035aabac0d/soupsieve-2.8.tar.gz", hash = "sha256:e2dd4a40a628cb5f28f6d4b0db8800b8f581b65bb380b97de22ba5ca8d72572f", size = 103472 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/14/a0/bb38d3b76b8cae341dad93a2dd83ab7462e6dbcdd84d43f54ee60a8dc167/soupsieve-2.8-py3-none-any.whl", hash = "sha256:0cc76456a30e20f5d7f2e14a98a4ae2ee4e5abdc7c5ea0aafe795f344bc7984c", size = 36679 }, +] + [[package]] name = "sphinx" version = "7.4.7" @@ -1042,6 +1094,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/0d/ef/153f6803c5d5f8917dbb7f7fcf6d34a871ede3296fa89c2c703f5f8a6c8e/sphinx-7.4.7-py3-none-any.whl", hash = "sha256:c2419e2135d11f1951cd994d6eb18a1835bd8fdd8429f9ca375dc1f3281bd239", size = 3401624 }, ] +[[package]] +name = "sphinx-basic-ng" +version = "1.0.0b2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "sphinx" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/98/0b/a866924ded68efec7a1759587a4e478aec7559d8165fac8b2ad1c0e774d6/sphinx_basic_ng-1.0.0b2.tar.gz", hash = "sha256:9ec55a47c90c8c002b5960c57492ec3021f5193cb26cebc2dc4ea226848651c9", size = 20736 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3c/dd/018ce05c532a22007ac58d4f45232514cd9d6dd0ee1dc374e309db830983/sphinx_basic_ng-1.0.0b2-py3-none-any.whl", hash = "sha256:eb09aedbabfb650607e9b4b68c9d240b90b1e1be221d6ad71d61c52e29f7932b", size = 22496 }, +] + [[package]] name = "sphinxcontrib-applehelp" version = "2.0.0" From 3e52552532527549b02be97e42679328a6d9746d Mon Sep 17 00:00:00 2001 From: laughingman7743 Date: Sat, 27 Sep 2025 18:18:13 +0900 Subject: [PATCH 2/2] docs: Add custom CSS for left-aligned tables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Create docs/_static/custom.css to left-align table cells and headers - Update docs/conf.py to include custom CSS file - Improves table readability by using left alignment instead of center 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- docs/_static/custom.css | 11 +++++++++++ docs/conf.py | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 docs/_static/custom.css diff --git a/docs/_static/custom.css b/docs/_static/custom.css new file mode 100644 index 00000000..a93010cb --- /dev/null +++ b/docs/_static/custom.css @@ -0,0 +1,11 @@ +/* Set table cells to left alignment */ +table.docutils th, +table.docutils td { + text-align: left !important; +} + +/* Align table itself to the left */ +table.docutils { + margin-left: 0; + margin-right: auto; +} \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 177ae465..74ea5b00 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -86,3 +86,6 @@ def get_version(): html_theme = "furo" html_static_path = ["_static"] +html_css_files = [ + "custom.css", +]