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

Add configuration file for RTFD #237

Merged
merged 4 commits into from
Nov 26, 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
32 changes: 32 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2

# needed for uap-core to get initialised properly
submodules:
include: all

build:
os: ubuntu-24.04
tools:
python: "3.12"
jobs:
post_checkout:
# rtfd doesn't retrieve tags by default, but we need them for `git
# describe` in order to build the parser builtins
# FIXME: remove once upb is published and can be installed from pypi)
- git fetch --unshallow --tags || true

python:
install:
- method: pip
path: .
extra_requirements:
- yaml
- regex
- re2

sphinx:
configuration: doc/conf.py
fail_on_warning: true
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ Build Status
------------

.. image:: https://github.com/ua-parser/uap-python/actions/workflows/ci.yml/badge.svg
:target: https://github.com/ua-parser/uap-python/actions/workflows/ci.yml?query=branch%3Amaster
:alt: CI on the master branch

.. image:: https://readthedocs.org/projects/uap-python/badge/?version=latest
:target: https://readthedocs.org/project/uap-python/en/latest/
:alt: Documentation Status

Installing
----------

Expand Down
12 changes: 6 additions & 6 deletions doc/advanced/caches.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ exercises the caches themselves and barely looks at the data.
----------------------------

``bench`` is much more expensive in both CPU and wallclock as it
actually runs the base resolvers, combined with various caches of
various sizes. For usability, it can report its data (the average
parse time per input entry) in both human-readable text with one
result per line and CSV with resolver configurations as the columns
and cache sizes as the rows.
actually runs the resolvers on the sample file, combined with various
caches of various sizes. For usability, it can report its data (the
average parse time per input entry) in both human-readable text with
one result per line and CSV with resolver configurations as the
columns and cache sizes as the rows.

``hitrates`` is generally sufficient as generally speaking for the
same base resolver performances tend to more or less follo hit rates:
same base resolver performances tend to more or less follow hit rates:
a cache hit is close to free compared to a cache miss. Although this
is truer for the basic resolver (for which misses tend to be very
expensive). ``bench`` is mostly useful to validate or tie-break
Expand Down
9 changes: 5 additions & 4 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ from user agent strings.

.. warning:: Only available if |re2|_ is installed.

.. class::ua_parser.regex.Resolver(Matchers)
.. class:: ua_parser.regex.Resolver(Matchers)

An advanced resolver based on |regex|_ and a bespoke implementation
of regex prefiltering, by the sibling project `ua-rust
<https://github.com/ua-parser/uap-rust`_.
An advanced resolver based on `Rust's regex
<https://github.com/rust-lang/regex>`_ and a bespoke implementation
of regex prefiltering, by the sibling project `uap-rust
<https://github.com/ua-parser/uap-rust>`_.

Sufficiently fast that a cache may not be necessary, and may even
be detrimental at smaller cache sizes
Expand Down