diff --git a/Makefile b/Makefile index 646c68e..522bb42 100644 --- a/Makefile +++ b/Makefile @@ -90,9 +90,9 @@ mypy: $(venv) build: $(venv) $(python) -m build -.PHONY: doc ## Build documentation -doc: $(venv) - $(python) -m sphinx -b html -a docs $(DOCS_BUILDDIR) +.PHONY: docs ## Build documentation +docs: $(venv) + $(python) -m sphinx -W -n -b html -a docs $(DOCS_BUILDDIR) .PHONY: serve ## Serve documentation at http://127.0.0.1:8000 serve: $(venv) diff --git a/docs/conf.py b/docs/conf.py index 3da42be..9804bc1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -3,6 +3,7 @@ Documentation: https://www.sphinx-doc.org/en/master/usage/configuration.html """ + import importlib.metadata import sys from pathlib import Path diff --git a/docs/reference.rst b/docs/reference.rst index 6b4fbcc..b8c32bf 100644 --- a/docs/reference.rst +++ b/docs/reference.rst @@ -107,6 +107,7 @@ Exceptions .. autoexception:: pyforce.AuthenticationError .. autoexception:: pyforce.ConnectionExpiredError .. autoexception:: pyforce.CommandExecutionError +.. autoexception:: pyforce.ChangeUnknownError Other ----- @@ -119,3 +120,15 @@ Other .. autoenum:: pyforce.MarshalCode :members: + +.. autoenum:: pyforce.MessageLevel + :members: + +.. class:: pyforce.utils.PerforceDateTime + + Alias of `datetime.datetime` + +.. class:: pyforce.utils.PerforceTimestamp + + Alias of `datetime.datetime` + diff --git a/pyproject.toml b/pyproject.toml index 50764a2..53113c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ Changelog = "https://github.com/tahv/pyforce/blob/main/CHANGELOG.md" tests = ["pytest", "coverage"] style = ["ruff"] mypy = ["mypy", "pytest"] -doc = [ +docs = [ "sphinx", "sphinx-autobuild", "furo", @@ -42,7 +42,7 @@ doc = [ "autodoc_pydantic", "enum_tools[sphinx]", ] -dev = ["pyforce-p4[tests,style,mypy,doc]"] +dev = ["pyforce-p4[tests,style,mypy,docs]"] [tool.hatch.version] source = "vcs" diff --git a/src/pyforce/models.py b/src/pyforce/models.py index 357a77a..21ba6e3 100644 --- a/src/pyforce/models.py +++ b/src/pyforce/models.py @@ -2,9 +2,9 @@ from __future__ import annotations +import pathlib import shlex from dataclasses import dataclass -from pathlib import Path # noqa: TCH003 from typing import Any, Iterable, List, Literal, Mapping, NamedTuple, Union, cast from pydantic import ( @@ -186,7 +186,7 @@ class Client(PyforceModel): owner: str = Field(alias="Owner") """The name of the user who owns the workspace.""" - root: Path = Field(alias="Root") + root: pathlib.Path = Field(alias="Root") """Workspace root directory on the local host All the file in `views` are relative to this directory. diff --git a/src/pyforce/utils.py b/src/pyforce/utils.py index 6419ea2..2f9a432 100644 --- a/src/pyforce/utils.py +++ b/src/pyforce/utils.py @@ -25,6 +25,7 @@ class StrEnum(str, Enum): "Connection", "MessageSeverity", "MarshalCode", + "MessageLevel", ] log: Final = logging.getLogger("pyforce")