From 1eea2da2767bf23797b7ce3cdcba13ed00fea1a9 Mon Sep 17 00:00:00 2001 From: Christian Ledermann Date: Wed, 6 Nov 2024 13:04:22 +0000 Subject: [PATCH] Update pre-commit configuration, enhance documentation, and refine module exports --- .pre-commit-config.yaml | 15 +++++------ README.rst | 4 ++- docs/configuration.rst | 4 ++- docs/fastkml.rst | 60 ++++++++++++++++++++++------------------- docs/modules.rst | 1 - fastkml/about.py | 3 +++ fastkml/utils.py | 2 +- pyproject.toml | 6 +++++ 8 files changed, 55 insertions(+), 40 deletions(-) delete mode 100644 docs/modules.rst diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b2fcf01b..5473af11 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,11 @@ --- +default_language_version: + python: python3.12 repos: + - repo: https://github.com/pre-commit-ci/pre-commit-ci-config + rev: v1.6.1 + hooks: + - id: check-pre-commit-ci-config - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: @@ -36,18 +42,11 @@ repos: rev: v0.3.1 hooks: - id: absolufy-imports - - repo: https://github.com/psf/black - rev: 24.10.0 - hooks: - - id: black - - repo: https://github.com/pycqa/isort - rev: 5.13.2 - hooks: - - id: isort - repo: https://github.com/astral-sh/ruff-pre-commit rev: 'v0.7.2' hooks: - id: ruff + - id: ruff-format - repo: https://github.com/PyCQA/flake8 rev: 7.1.1 hooks: diff --git a/README.rst b/README.rst index 7412e8ef..b52bcde9 100644 --- a/README.rst +++ b/README.rst @@ -108,7 +108,9 @@ Requirements Optional --------- -* lxml_:: +* lxml_: + +.. code-block:: bash pip install --pre "fastkml[lxml]" diff --git a/docs/configuration.rst b/docs/configuration.rst index a0dbf585..a006a548 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -11,7 +11,9 @@ as its parser, but you can change this by setting the implementation. E.g. if you have lxml installed, but you want to use the -standard ``xml.etree.ElementTree``, you can do this:: +standard ``xml.etree.ElementTree``, you can do this: + +.. code-block:: pycon >>> import fastkml.config >>> import xml.etree.ElementTree diff --git a/docs/fastkml.rst b/docs/fastkml.rst index 67c325ed..e752b965 100644 --- a/docs/fastkml.rst +++ b/docs/fastkml.rst @@ -2,15 +2,10 @@ Reference Guide =============== -.. toctree:: - :maxdepth: 4 - - - .. automodule:: fastkml -fastkml.about module +fastkml.about -------------------- .. automodule:: fastkml.about @@ -18,7 +13,7 @@ fastkml.about module :undoc-members: :show-inheritance: -fastkml.atom module +fastkml.atom ------------------- .. automodule:: fastkml.atom @@ -26,7 +21,7 @@ fastkml.atom module :undoc-members: :show-inheritance: -fastkml.base module +fastkml.base ------------------- .. automodule:: fastkml.base @@ -34,7 +29,7 @@ fastkml.base module :undoc-members: :show-inheritance: -fastkml.config module +fastkml.config --------------------- .. automodule:: fastkml.config @@ -42,7 +37,7 @@ fastkml.config module :undoc-members: :show-inheritance: -fastkml.containers module +fastkml.containers ------------------------- .. automodule:: fastkml.containers @@ -50,7 +45,7 @@ fastkml.containers module :undoc-members: :show-inheritance: -fastkml.data module +fastkml.data ------------------- .. automodule:: fastkml.data @@ -58,7 +53,7 @@ fastkml.data module :undoc-members: :show-inheritance: -fastkml.enums module +fastkml.enums -------------------- .. automodule:: fastkml.enums @@ -66,7 +61,7 @@ fastkml.enums module :undoc-members: :show-inheritance: -fastkml.exceptions module +fastkml.exceptions ------------------------- .. automodule:: fastkml.exceptions @@ -74,7 +69,7 @@ fastkml.exceptions module :undoc-members: :show-inheritance: -fastkml.features module +fastkml.features ----------------------- .. automodule:: fastkml.features @@ -82,7 +77,7 @@ fastkml.features module :undoc-members: :show-inheritance: -fastkml.geometry module +fastkml.geometry ----------------------- .. automodule:: fastkml.geometry @@ -90,7 +85,7 @@ fastkml.geometry module :undoc-members: :show-inheritance: -fastkml.gx module +fastkml.gx ----------------- .. automodule:: fastkml.gx @@ -98,7 +93,7 @@ fastkml.gx module :undoc-members: :show-inheritance: -fastkml.helpers module +fastkml.helpers ---------------------- .. automodule:: fastkml.helpers @@ -106,7 +101,7 @@ fastkml.helpers module :undoc-members: :show-inheritance: -fastkml.kml module +fastkml.kml ------------------ .. automodule:: fastkml.kml @@ -114,7 +109,7 @@ fastkml.kml module :undoc-members: :show-inheritance: -fastkml.kml\_base module +fastkml.kml\_base ------------------------ .. automodule:: fastkml.kml_base @@ -122,7 +117,7 @@ fastkml.kml\_base module :undoc-members: :show-inheritance: -fastkml.links module +fastkml.links -------------------- .. automodule:: fastkml.links @@ -130,7 +125,7 @@ fastkml.links module :undoc-members: :show-inheritance: -fastkml.mixins module +fastkml.mixins --------------------- .. automodule:: fastkml.mixins @@ -138,7 +133,7 @@ fastkml.mixins module :undoc-members: :show-inheritance: -fastkml.overlays module +fastkml.overlays ----------------------- .. automodule:: fastkml.overlays @@ -146,7 +141,7 @@ fastkml.overlays module :undoc-members: :show-inheritance: -fastkml.registry module +fastkml.registry ----------------------- .. automodule:: fastkml.registry @@ -154,7 +149,7 @@ fastkml.registry module :undoc-members: :show-inheritance: -fastkml.styles module +fastkml.styles --------------------- .. automodule:: fastkml.styles @@ -162,7 +157,7 @@ fastkml.styles module :undoc-members: :show-inheritance: -fastkml.times module +fastkml.times -------------------- .. automodule:: fastkml.times @@ -170,7 +165,7 @@ fastkml.times module :undoc-members: :show-inheritance: -fastkml.types module +fastkml.types -------------------- .. automodule:: fastkml.types @@ -178,7 +173,7 @@ fastkml.types module :undoc-members: :show-inheritance: -fastkml.utils module +fastkml.utils -------------------- .. automodule:: fastkml.utils @@ -186,7 +181,16 @@ fastkml.utils module :undoc-members: :show-inheritance: -fastkml.views module +fastkml.validator +-------------------- + +.. automodule:: fastkml.validator + :members: + :undoc-members: + :show-inheritance: + + +fastkml.views -------------------- .. automodule:: fastkml.views diff --git a/docs/modules.rst b/docs/modules.rst deleted file mode 100644 index d3cafeb8..00000000 --- a/docs/modules.rst +++ /dev/null @@ -1 +0,0 @@ - fastkml diff --git a/fastkml/about.py b/fastkml/about.py index a38dcd65..c99d0c99 100644 --- a/fastkml/about.py +++ b/fastkml/about.py @@ -18,4 +18,7 @@ The only purpose of this module is to provide a version number for the package. """ + __version__ = "1.0.0b2" + +__all__ = ["__version__"] diff --git a/fastkml/utils.py b/fastkml/utils.py index 2851cb5c..7616c610 100644 --- a/fastkml/utils.py +++ b/fastkml/utils.py @@ -7,7 +7,7 @@ from typing import Type from typing import Union -__all__ = ["find_all", "has_attribute_values"] +__all__ = ["find", "find_all", "has_attribute_values"] def has_attribute_values(obj: object, **kwargs: Any) -> bool: diff --git a/pyproject.toml b/pyproject.toml index dc3c71e3..f45254c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -179,6 +179,12 @@ include = [ "fastkml", ] +[tool.rstcheck] +ignore_directives = [ + "automodule", +] +report_level = "WARNING" + [tool.ruff] fix = true target-version = "py38"