From 48eba951c810bba3de71bfb0cbe1f631bac19063 Mon Sep 17 00:00:00 2001 From: Nir Ozery Date: Fri, 1 Dec 2023 10:29:02 +0000 Subject: [PATCH] Python Wrapper: Documentation alignment --- Makefile | 4 ++-- clients/python-wrapper/docs/lakefs.rst | 6 +++--- clients/python-wrapper/lakefs/branch.py | 1 + clients/python-wrapper/lakefs/object.py | 10 +++++----- clients/python-wrapper/setup.py | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index d396a0a2ccf..dc07931db98 100644 --- a/Makefile +++ b/Makefile @@ -300,8 +300,8 @@ python-wrapper-lint: $(DOCKER) run --user $(UID_GID) --rm -v $(shell pwd):/mnt -e HOME=/tmp/ -w /mnt/clients/python-wrapper $(PYTHON_IMAGE) /bin/bash -c "./pylint.sh" python-wrapper-gen-docs: - sphinx-build -b html clients/python-wrapper/docs clients/python-wrapper/_site/ - sphinx-build -b html clients/python-wrapper/docs clients/python-wrapper/_site/$$(python clients/python-wrapper/setup.py --version) + sphinx-build -b html -W clients/python-wrapper/docs clients/python-wrapper/_site/ + sphinx-build -b html -W clients/python-wrapper/docs clients/python-wrapper/_site/$$(python clients/python-wrapper/setup.py --version) $(UI_DIR)/node_modules: cd $(UI_DIR) && $(NPM) install diff --git a/clients/python-wrapper/docs/lakefs.rst b/clients/python-wrapper/docs/lakefs.rst index 09b168fe51e..df999d43025 100644 --- a/clients/python-wrapper/docs/lakefs.rst +++ b/clients/python-wrapper/docs/lakefs.rst @@ -8,17 +8,17 @@ Submodules :maxdepth: 4 lakefs.branch - lakefs.branch_manager lakefs.client lakefs.config lakefs.exceptions + lakefs.import_manager + lakefs.models + lakefs.namedtuple lakefs.object - lakefs.object_io lakefs.object_manager lakefs.reference lakefs.repository lakefs.tag - lakefs.tag_manager Module contents --------------- diff --git a/clients/python-wrapper/lakefs/branch.py b/clients/python-wrapper/lakefs/branch.py index ff43b1abff5..b82ac744539 100644 --- a/clients/python-wrapper/lakefs/branch.py +++ b/clients/python-wrapper/lakefs/branch.py @@ -1,6 +1,7 @@ """ Module containing lakeFS branch implementation """ + from __future__ import annotations from typing import Optional, Generator, Iterable, Literal diff --git a/clients/python-wrapper/lakefs/object.py b/clients/python-wrapper/lakefs/object.py index adb44e9e43e..a955ffd97aa 100644 --- a/clients/python-wrapper/lakefs/object.py +++ b/clients/python-wrapper/lakefs/object.py @@ -236,7 +236,7 @@ def seek(self, offset: int, whence: int = 0) -> int: other values are os.SEEK_CUR or 1 (seek relative to the current position) and os.SEEK_END or 2 (seek relative to the file’s end) os.SEEK_END is not supported - :raises OSError if calculated new position is negative + :raises: OSError if calculated new position is negative """ if whence == os.SEEK_SET: pos = offset @@ -255,9 +255,9 @@ def read(self, n: int = None) -> str | bytes: Read object data :param n: How many bytes to read. If read_bytes is None, will read from current position to end. - If current position + read_bytes > object size. + If current position + read_bytes > object size. :return: The bytes read - :raises + :raises: EOFError if current position is after object size OSError if read_bytes is non-positive ObjectNotFoundException if repo id, reference id or object path does not exist @@ -626,11 +626,11 @@ def upload(self, 'w' - Create a new object or truncate if exists 'wb' - Create or truncate in binary mode :param pre_sign: (Optional) Explicitly state whether to use pre_sign mode when uploading the object. - If None, will be taken from pre_sign property. + If None, will be taken from pre_sign property. :param content_type: (Optional) Explicitly set the object Content-Type :param metadata: (Optional) User metadata :return: The Stat object representing the newly created object - :raises + :raises: ObjectExistsException if object exists and mode is exclusive ('x') ObjectNotFoundException if repo id, reference id or object path does not exist PermissionException if user is not authorized to perform this operation, or operation is forbidden diff --git a/clients/python-wrapper/setup.py b/clients/python-wrapper/setup.py index edb26d2b123..376ef36a19c 100644 --- a/clients/python-wrapper/setup.py +++ b/clients/python-wrapper/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages NAME = "lakefs" -VERSION = "0.1.0-beta.1" +VERSION = "0.1.0-beta.2" # To install the library, run the following # # python setup.py install