Skip to content

Commit c2a3ab6

Browse files
authored
Merge pull request #18 from lsst-sqre/tickets/DM-37493
DM-37493: Add support for httpx
2 parents 1c3725b + 5cb90e9 commit c2a3ab6

20 files changed

+180
-271
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
- "3.8"
4141
- "3.9"
4242
- "3.10"
43+
- "3.11"
4344

4445
steps:
4546
- uses: actions/checkout@v3

.github/workflows/periodic-ci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
- "3.8"
1919
- "3.9"
2020
- "3.10"
21+
- "3.11"
2122

2223
steps:
2324
- uses: actions/checkout@v3

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.3.0
3+
rev: v4.4.0
44
hooks:
55
- id: trailing-whitespace
66
- id: check-yaml
77
- id: check-toml
88

99
- repo: https://github.com/pycqa/isort
10-
rev: 5.10.1
10+
rev: 5.11.4
1111
hooks:
1212
- id: isort
1313
additional_dependencies: [toml]
1414

1515
- repo: https://github.com/psf/black
16-
rev: 22.6.0
16+
rev: 22.12.0
1717
hooks:
1818
- id: black
1919

@@ -25,12 +25,12 @@ repos:
2525
args: [-l, '79', -t, py38]
2626

2727
- repo: https://github.com/pycqa/pydocstyle
28-
rev: 6.1.1
28+
rev: 6.2.2
2929
hooks:
3030
- id: pydocstyle
31-
additional_dependencies: [toml]
31+
additional_dependencies: [tomli]
3232

33-
- repo: https://gitlab.com/pycqa/flake8
34-
rev: 4.0.1
33+
- repo: https://github.com/pycqa/flake8
34+
rev: 6.0.0
3535
hooks:
3636
- id: flake8

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
# Change log
22

3+
## Unreleased
4+
5+
New features:
6+
7+
- New [HTTPX](https://www.python-httpx.org) support with `kafkit.registry.httpx.RegistryApi`, in addition to the existing aiohttp support.
8+
- Documentation is now built with the new Rubin Observatory user guide theme and Sphinx configuration.
9+
310
## 0.2.1 (2022-07-15)
411

5-
A `py.typed` file is now included to advertise typo annotations in Kafkit.
12+
A `py.typed` file is now included to advertise type annotations in Kafkit.
613

714
## 0.2.0 (2022-07-15)
815

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ help:
55

66
.PHONY: init
77
init:
8-
pip install -e ".[dev]"
8+
pip install -e ".[aiohttp,httpx,dev]"
99
pip install tox pre-commit
1010
pre-commit install
1111
rm -rf .tox

docs/_rst_epilog.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
.. _aiohttp: https://aiohttp.readthedocs.io/en/stable/
3+
.. _aiokafka: https://aiokafka.readthedocs.io/en/stable/
4+
.. _Confluent Schema Registry: https://docs.confluent.io/current/schema-registry/docs/index.html
5+
.. _Confluent Wire Format: https://docs.confluent.io/current/schema-registry/docs/serializer-formatter.html#wire-format
6+
.. _HTTPX: https://www.python-httpx.org
7+
.. _mypy: http://www.mypy-lang.org
8+
.. _pre-commit: https://pre-commit.com
9+
.. _pytest: https://docs.pytest.org/en/latest/
10+
.. _Schema Evolution and Compatibility: https://docs.confluent.io/current/schema-registry/avro.html
11+
.. _Strimzi: https://strimzi.io
12+
.. _tox: https://tox.readthedocs.io/en/latest/

docs/api.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ Kafkit API reference
88
.. automodapi:: kafkit.registry.aiohttp
99
:no-inheritance-diagram:
1010

11+
.. automodapi:: kafkit.registry.httpx
12+
:no-inheritance-diagram:
13+
1114
.. automodapi:: kafkit.registry.manager
1215
:no-inheritance-diagram:
1316

docs/conf.py

Lines changed: 1 addition & 208 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,5 @@
1-
import os
1+
from documenteer.conf.guide import *
22

3-
import lsst_sphinx_bootstrap_theme
4-
5-
import kafkit
6-
7-
# Common links and substitutions =============================================
8-
9-
rst_epilog = """
10-
11-
.. _aiohttp: https://aiohttp.readthedocs.io/en/stable/
12-
.. _aiokafka: https://aiokafka.readthedocs.io/en/stable/
13-
.. _Confluent Schema Registry: https://docs.confluent.io/current/schema-registry/docs/index.html
14-
.. _Confluent Wire Format: https://docs.confluent.io/current/schema-registry/docs/serializer-formatter.html#wire-format
15-
.. _mypy: http://www.mypy-lang.org
16-
.. _pre-commit: https://pre-commit.com
17-
.. _pytest: https://docs.pytest.org/en/latest/
18-
.. _Schema Evolution and Compatibility: https://docs.confluent.io/current/schema-registry/avro.html
19-
.. _Strimzi: https://strimzi.io
20-
.. _tox: https://tox.readthedocs.io/en/latest/
21-
"""
22-
23-
# Extensions =================================================================
24-
25-
extensions = [
26-
"myst_parser",
27-
"sphinx.ext.autodoc",
28-
"sphinx.ext.napoleon",
29-
"sphinx.ext.doctest",
30-
"sphinx.ext.intersphinx",
31-
"sphinx.ext.todo",
32-
"sphinx-prompt",
33-
"sphinx_automodapi.automodapi",
34-
"sphinx_automodapi.smart_resolver",
35-
"documenteer.sphinxext",
36-
]
37-
38-
# General configuration ======================================================
39-
40-
source_suffix = {
41-
".rst": "restructuredtext",
42-
".txt": "markdown",
43-
".md": "markdown",
44-
}
45-
46-
# The root toctree document.
47-
root_doc = "index"
48-
49-
# General information about the project.
50-
project = "Kafkit"
51-
copyright = (
52-
"2019-2022 "
53-
"Association of Universities for Research in Astronomy, Inc. (AURA)"
54-
)
55-
author = "LSST Data Management"
56-
57-
version = kafkit.__version__
58-
release = version
59-
60-
# List of patterns, relative to source directory, that match files and
61-
# directories to ignore when looking for source files.
62-
exclude_patterns = ["_build", "README.rst"]
63-
64-
# The name of the Pygments (syntax highlighting) style to use.
65-
pygments_style = "sphinx"
66-
67-
# The reST default role cross-links Python (used for this markup: `text`)
68-
default_role = "py:obj"
69-
70-
nitpick_ignore = [
71-
# Ignore missing cross-references for modules that don't provide
72-
# intersphinx. The documentation itself should use double-quotes instead
73-
# of single-quotes to not generate a reference, but automatic references
74-
# are generated from the type signatures and can't be avoided.
75-
("py:obj", "aiokafka.AIOKafkaProducer.send_and_wait"),
76-
]
77-
78-
# Intersphinx ================================================================
79-
80-
intersphinx_mapping = {
81-
"python": ("https://docs.python.org/3/", None),
82-
"aiohttp": ("https://aiohttp.readthedocs.io/en/stable/", None),
83-
"aiokafka": ("https://aiokafka.readthedocs.io/en/stable/", None),
84-
"fastavro": ("https://fastavro.readthedocs.io/en/latest/", None),
85-
}
86-
87-
intersphinx_timeout = 10.0 # seconds
88-
intersphinx_cache_limit = 5 # days
89-
90-
# Linkcheck builder ==========================================================
91-
92-
linkcheck_retries = 2
93-
94-
linkcheck_ignore = [
95-
r"^https://jira.lsstcorp.org/browse/",
96-
r"^http://registry:8081",
97-
]
983

994
linkcheck_anchors_ignore = [
1005
r"^!",
@@ -104,122 +9,10 @@
1049
r"errors",
10510
]
10611

107-
linkcheck_timeout = 15
108-
109-
# HTML builder ===============================================================
110-
111-
templates_path = [
112-
"_templates",
113-
lsst_sphinx_bootstrap_theme.get_html_templates_path(),
114-
]
115-
116-
html_theme = "lsst_sphinx_bootstrap_theme"
117-
html_theme_path = [lsst_sphinx_bootstrap_theme.get_html_theme_path()]
118-
119-
html_context = {}
120-
121-
# Theme options are theme-specific and customize the look and feel of a theme
122-
# further. For a list of options available for each theme, see the
123-
# documentation.
124-
html_theme_options = {"logotext": project}
125-
126-
# The name for this set of Sphinx documents. If None, it defaults to
127-
# "<project> v<release> documentation".
128-
html_title = f"{project} v{version}"
129-
130-
# A shorter title for the navigation bar. Default is the same as html_title.
131-
html_short_title = project
132-
133-
# Add any paths that contain custom static files (such as style sheets) here,
134-
# relative to this directory. They are copied after the builtin static files,
135-
# so a file named "default.css" will overwrite the builtin "default.css".
136-
html_static_path = []
137-
138-
# If true, links to the reST sources are added to the pages.
139-
html_show_sourcelink = False
140-
141-
# Do not copy reST source for each page into the build
142-
html_copy_source = False
143-
144-
# If false, no module index is generated.
145-
html_domain_indices = True
146-
147-
# If false, no index is generated.
148-
html_use_index = True
149-
150-
# API Reference ==============================================================
151-
152-
napoleon_google_docstring = False
153-
napoleon_numpy_docstring = True
154-
napoleon_include_init_with_doc = False
155-
napoleon_include_private_with_doc = False
156-
napoleon_include_special_with_doc = True
157-
napoleon_use_admonition_for_examples = False
158-
napoleon_use_admonition_for_notes = False
159-
napoleon_use_admonition_for_references = False
160-
napoleon_use_ivar = False
161-
napoleon_use_keyword = True
162-
napoleon_use_param = True
163-
napoleon_use_rtype = True
164-
16512
napoleon_type_aliases = {
16613
# resolves confusion between sans-io version of impl specific version
16714
"RegistryApi": "kafkit.registry.sansio.RegistryApi",
16815
# Napoleon doesn't resolve whats under TYPE_CHECKING
16916
"ClientSession": "aiohttp.ClientSession",
17017
"optional": "typing.Optional",
17118
}
172-
173-
autosummary_generate = True
174-
175-
automodapi_toctreedirnm = "api"
176-
automodsumm_inherited_members = True
177-
178-
# Docstrings for classes and methods are inherited from parents.
179-
autodoc_inherit_docstrings = True
180-
181-
# Class documentation should only contain the class docstring and
182-
# ignore the __init__ docstring, account to LSST coding standards.
183-
autoclass_content = "class"
184-
185-
# Default flags for automodapi directives. Special members are dunder
186-
# methods.
187-
autodoc_default_options = {
188-
"show-inheritance": True,
189-
"special-members": True,
190-
}
191-
192-
# Render inheritance diagrams in SVG
193-
graphviz_output_format = "svg"
194-
195-
graphviz_dot_args = [
196-
"-Nfontsize=10",
197-
"-Nfontname=Helvetica Neue, Helvetica, Arial, sans-serif",
198-
"-Efontsize=10",
199-
"-Efontname=Helvetica Neue, Helvetica, Arial, sans-serif",
200-
"-Gfontsize=10",
201-
"-Gfontname=Helvetica Neue, Helvetica, Arial, sans-serif",
202-
]
203-
204-
# TODO extension =============================================================
205-
206-
todo_include_todos = False
207-
208-
# My-ST (Markdown) ===========================================================
209-
# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html
210-
211-
myst_enable_extensions = [
212-
"amsmath",
213-
"dollarmath",
214-
"colon_fence",
215-
"deflist",
216-
"fieldlist",
217-
"html_admonition",
218-
"html_image",
219-
"linkify",
220-
"replacements",
221-
"smartquotes",
222-
"strikethrough",
223-
"substitution",
224-
"tasklist",
225-
]

docs/documenteer.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[project]
2+
title = "Kafkit"
3+
copyright = "2019-2023 Association of Universities for Research in Astronomy, Inc. (AURA)"
4+
5+
[project.python]
6+
package = "kafkit"
7+
8+
[sphinx]
9+
rst_epilog_file = "_rst_epilog.rst"
10+
nitpick_ignore = [
11+
[
12+
"py:obj",
13+
"aiokafka.AIOKafkaProducer.send_and_wait",
14+
],
15+
[
16+
"py:class",
17+
"httpx.AsyncClient",
18+
],
19+
]
20+
21+
[sphinx.intersphinx.projects]
22+
python = "https://docs.python.org/3/"
23+
aiohttp = "https://aiohttp.readthedocs.io/en/stable/"
24+
aiokafka = "https://aiokafka.readthedocs.io/en/stable/"
25+
fastavro = "https://fastavro.readthedocs.io/en/latest/"
26+
27+
[sphinx.linkcheck]
28+
ignore = ['^https://jira.lsstcorp.org/browse/', '^http://registry:8081']

docs/guide/index.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
##########
2+
User guide
3+
##########
4+
5+
.. toctree::
6+
:maxdepth: 2
7+
8+
recordnameschemamanager-howto
9+
strimzi-ssl-howto

0 commit comments

Comments
 (0)