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

Change lakeFS package to lakefs-sdk in place of lakefs-client #107

Merged
merged 11 commits into from
Oct 24, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
services:
lakefs:
image: treeverse/lakefs:0.112.1
image: treeverse/lakefs:1.0.0
ports:
- 8000:8000
env:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ file system's lakeFS API client, and the `context` object contains information a
As an example, the following snippet installs a lakeFS hook that creates a commit on the lakeFS branch after a file upload:

```python
from lakefs_client.client import LakeFSClient
from lakefs_sdk.client import LakeFSClient

from lakefs_spec import LakeFSFileSystem
from lakefs_spec.client_helpers import commit
Expand Down
2 changes: 1 addition & 1 deletion demos/rain_prediction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
"metadata": {},
"outputs": [],
"source": [
"from lakefs_client.client import LakeFSClient\n",
"from lakefs_sdk.client import LakeFSClient\n",
"from lakefs_spec.client_helpers import commit\n",
"from lakefs_spec.hooks import FSEvent, HookContext\n",
"\n",
Expand Down
4 changes: 2 additions & 2 deletions demos/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jedi==0.19.0
joblib==1.3.2
jupyter_client==8.3.1
jupyter_core==5.3.1
lakefs-client==0.113.0.1
lakefs-spec @ git+https://github.com/appliedAI-Initiative/lakefs-spec.git@8bd2477dbb466f85c714a8659bb66cd92c53cbc7
lakefs-sdk==1.0.0
lakefs-spec @ git+https://github.com/appliedAI-Initiative/lakefs-spec.git@main
matplotlib-inline==0.1.6
nest-asyncio==1.5.7
numpy==1.25.2
Expand Down
6 changes: 3 additions & 3 deletions docs/use-cases.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ and (mostly) works as advertised, it has its issues - the developer experience b
typing information, and the woes of reading lots of raw client code, for example when downloading a file to load into a data frame:

```python
from lakefs_client import Configuration
from lakefs_client.client import LakeFSClient
from lakefs_sdk import Configuration
from lakefs_sdk.client import LakeFSClient

# painful!
configuration = Configuration(host="my-host")
Expand Down Expand Up @@ -85,7 +85,7 @@ A concrete example of this is creating lakeFS commits after a successful file up
Commits provide a snapshot of a lakeFS repository, similarly to version control systems like git.

```python
from lakefs_client.client import LakeFSClient
from lakefs_sdk.client import LakeFSClient

from lakefs_spec import LakeFSFileSystem
from lakefs_spec.client_helpers import commit
Expand Down
2 changes: 1 addition & 1 deletion hack/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: "3"

services:
lakefs:
image: treeverse/lakefs:0.112.1
image: treeverse/lakefs:1.0.0
ports:
- 8000:8000
environment:
Expand Down
2 changes: 1 addition & 1 deletion hack/lakefs-s3-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
- ./config/s3.json:/etc/seaweedfs/s3.json

lakefs:
image: treeverse/lakefs:0.112.1
image: treeverse/lakefs:1.0.0
network_mode: host
depends_on:
- seaweedfs
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ classifiers = [
"Typing :: Typed",
]

dependencies = ["fsspec>=2023.6.0", "lakefs-client>=0.105.0"]
dependencies = ["fsspec>=2023.6.0", "lakefs-sdk>=1.0.0"]

dynamic = ["version"]

Expand Down
26 changes: 18 additions & 8 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,27 @@
#
# pip-compile --extra=dev --output-file=requirements-dev.txt pyproject.toml
#
aenum==3.1.15
# via lakefs-sdk
build==1.0.3
# via lakefs-spec (pyproject.toml)
cfgv==3.4.0
# via pre-commit
coverage[toml]==7.3.2
# via pytest-cov
# via
# coverage
# pytest-cov
distlib==0.3.7
# via virtualenv
filelock==3.12.4
# via virtualenv
fsspec==2023.9.2
fsspec==2023.10.0
# via lakefs-spec (pyproject.toml)
identify==2.5.30
# via pre-commit
iniconfig==2.0.0
# via pytest
lakefs-client==1.0.0
lakefs-sdk==1.0.0
# via lakefs-spec (pyproject.toml)
nodeenv==1.8.0
# via pre-commit
Expand All @@ -35,6 +39,8 @@ pluggy==1.3.0
# via pytest
pre-commit==3.5.0
# via lakefs-spec (pyproject.toml)
pydantic==1.10.13
# via lakefs-sdk
pyproject-hooks==1.0.0
# via build
pytest==7.4.2
Expand All @@ -44,20 +50,24 @@ pytest==7.4.2
pytest-cov==4.1.0
# via lakefs-spec (pyproject.toml)
python-dateutil==2.8.2
# via lakefs-client
# via lakefs-sdk
pyyaml==6.0.1
# via
# lakefs-spec (pyproject.toml)
# pre-commit
setuptools-scm[toml]==8.0.4
# via lakefs-spec (pyproject.toml)
# via
# lakefs-spec (pyproject.toml)
# setuptools-scm
six==1.16.0
# via python-dateutil
typing-extensions==4.8.0
# via setuptools-scm
# via
# pydantic
# setuptools-scm
urllib3==2.0.7
# via lakefs-client
virtualenv==20.24.5
# via lakefs-sdk
virtualenv==20.24.6
# via pre-commit

# The following packages are considered to be unsafe in a requirements file:
Expand Down
22 changes: 14 additions & 8 deletions requirements-docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
# pip-compile --extra=docs --output-file=requirements-docs.txt pyproject.toml
#
aenum==3.1.15
# via lakefs-sdk
anyio==4.0.0
# via jupyter-server
argon2-cffi==23.1.0
Expand All @@ -29,15 +31,15 @@ backcall==0.2.0
# via ipython
beautifulsoup4==4.12.2
# via nbconvert
black==23.10.0
black==23.10.1
# via lakefs-spec (pyproject.toml)
bleach==6.1.0
# via nbconvert
certifi==2023.7.22
# via requests
cffi==1.16.0
# via argon2-cffi-bindings
charset-normalizer==3.3.0
charset-normalizer==3.3.1
# via requests
click==8.1.7
# via
Expand All @@ -63,11 +65,11 @@ fastjsonschema==2.18.1
# via nbformat
fqdn==1.5.1
# via jsonschema
fsspec==2023.9.2
fsspec==2023.10.0
# via lakefs-spec (pyproject.toml)
ghp-import==2.1.0
# via mkdocs
gitdb==4.0.10
gitdb==4.0.11
# via gitpython
gitpython==3.1.40
# via
Expand Down Expand Up @@ -166,7 +168,7 @@ jupyterlab-server==2.25.0
# notebook
jupyterlab-widgets==3.0.9
# via ipywidgets
lakefs-client==1.0.0
lakefs-sdk==1.0.0
# via lakefs-spec (pyproject.toml)
markdown==3.5
# via
Expand Down Expand Up @@ -299,6 +301,8 @@ pure-eval==0.2.2
# via stack-data
pycparser==2.21
# via cffi
pydantic==1.10.13
# via lakefs-sdk
pygments==2.16.1
# via
# ipython
Expand All @@ -315,7 +319,7 @@ python-dateutil==2.8.2
# arrow
# ghp-import
# jupyter-client
# lakefs-client
# lakefs-sdk
python-json-logger==2.0.7
# via jupyter-events
pytz==2023.3.post1
Expand All @@ -338,7 +342,7 @@ pyzmq==25.1.1
# qtconsole
qtconsole==5.4.4
# via jupyter
qtpy==2.4.0
qtpy==2.4.1
# via qtconsole
referencing==0.30.2
# via
Expand Down Expand Up @@ -412,11 +416,13 @@ traitlets==5.11.2
# qtconsole
types-python-dateutil==2.8.19.14
# via arrow
typing-extensions==4.8.0
# via pydantic
uri-template==1.3.0
# via jsonschema
urllib3==2.0.7
# via
# lakefs-client
# lakefs-sdk
# requests
verspec==0.1.0
# via mike
Expand Down
14 changes: 10 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@
#
# pip-compile --strip-extras pyproject.toml
#
fsspec==2023.9.2
aenum==3.1.15
# via lakefs-sdk
fsspec==2023.10.0
# via lakefs-spec (pyproject.toml)
lakefs-client==1.0.0
lakefs-sdk==1.0.0
# via lakefs-spec (pyproject.toml)
pydantic==1.10.13
# via lakefs-sdk
python-dateutil==2.8.2
# via lakefs-client
# via lakefs-sdk
six==1.16.0
# via python-dateutil
typing-extensions==4.8.0
# via pydantic
urllib3==2.0.7
# via lakefs-client
# via lakefs-sdk
6 changes: 3 additions & 3 deletions src/lakefs_spec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from importlib.metadata import PackageNotFoundError, version

from lakefs_client import __version__ as __lakefs_client_version__
from lakefs_sdk import __version__ as __lakefs_sdk_version__

from .spec import LakeFSFile, LakeFSFileSystem

Expand All @@ -12,5 +12,5 @@
# package is not installed
pass

lakefs_client_version = tuple(int(v) for v in __lakefs_client_version__.split("."))
del __lakefs_client_version__
lakefs_sdk_version = tuple(int(v) for v in __lakefs_sdk_version__.split("."))
del __lakefs_sdk_version__
10 changes: 4 additions & 6 deletions src/lakefs_spec/client_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

import logging

from lakefs_client.client import LakeFSClient
from lakefs_client.exceptions import NotFoundException
from lakefs_client.model.commit_creation import CommitCreation
from lakefs_client.model.revert_creation import RevertCreation
from lakefs_client.model.tag_creation import TagCreation
from lakefs_sdk.client import LakeFSClient
from lakefs_sdk.exceptions import NotFoundException
from lakefs_sdk.models import CommitCreation, RevertCreation, TagCreation

logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
Expand All @@ -31,7 +29,7 @@ def commit(


def create_tag(client: LakeFSClient, repository: str, ref: str, tag: str) -> None:
tag_creation = TagCreation(tag, ref=ref)
tag_creation = TagCreation(id=tag, ref=ref)
client.tags_api.create_tag(repository=repository, tag_creation=tag_creation)


Expand Down
2 changes: 1 addition & 1 deletion src/lakefs_spec/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import functools
import json

from lakefs_client import ApiException
from lakefs_sdk import ApiException

HTTP_CODE_TO_ERROR: dict[int, type[OSError]] = {
401: PermissionError,
Expand Down
2 changes: 1 addition & 1 deletion src/lakefs_spec/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class StrEnum(str, Enum):

from typing import Callable, NamedTuple

from lakefs_client.client import LakeFSClient
from lakefs_sdk.client import LakeFSClient

from lakefs_spec.util import parse

Expand Down
Loading