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

chore: apply misc tweaks to cythonization and documentation #2431

Merged
merged 1 commit into from
Feb 8, 2025
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
20 changes: 15 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
import os
import sys

try:
import falconry_pygments_theme
except ImportError:
# NOTE(vytas): If one is packaging Falcon documentation, it might be
# impractical to spend time and effort on our Pygments styles.
falconry_pygments_theme = None

sys.path.insert(0, os.path.abspath('..'))

import falcon # noqa: E402
Expand Down Expand Up @@ -116,9 +123,15 @@
# Theme options are theme-specific and customize the look and feel further.
# https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/index.html

_falconry_styles = falconry_pygments_theme is not None

html_theme_options = {
'pygments_light_style': 'falconry-light',
'pygments_dark_style': 'falconry-dark',
# NOTE(vytas): If our Pygments styles are unavailable, fall back to the
# visually closest Gruvbox styles.
# NB that Gruvbox does not meet the WCAG 2.1 AA requirements for contrast.
'pygments_light_style': 'falconry-light' if _falconry_styles else 'gruvbox-light',
'pygments_dark_style': 'falconry-dark' if _falconry_styles else 'gruvbox-dark',

'header_links_before_dropdown': 4,
'external_links': [
{
Expand Down Expand Up @@ -148,11 +161,8 @@
'icon': 'fa-custom fa-falcon',
},
],
# NOTE(vytas): Use only light theme for now.
# Add `theme-switcher` below to resurrect the dark option.
'logo': {
'text': 'Falcon',
# "image_dark": "_static/img/logo.svg",
},
'navbar_end': ['theme-switcher', 'navbar-icon-links'],
'footer_start': ['copyright'],
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,15 @@ def list_modules(dirname, pattern):
'falcon.hooks',
'falcon.inspect',
'falcon.responders',
'falcon.typing',
'falcon._typing',
'falcon.util.reader',
'falcon.util.sync',
'falcon.util.time',
]

cython_package_names = ('falcon.cyutil',)
# NOTE(vytas): Now that all our codebase is Python 3.7+, specify the
# NOTE(vytas): Now that all our codebase is Python 3.8+, specify the
# Python 3 language level for Cython as well to avoid any surprises.
cython_directives = {'language_level': '3', 'annotation_typing': False}

Expand Down