diff --git a/.github/workflows/publish-python-wrapper-client.yaml b/.github/workflows/publish-python-wrapper-client.yaml index 81a7bec5376..75f82e6f5c9 100644 --- a/.github/workflows/publish-python-wrapper-client.yaml +++ b/.github/workflows/publish-python-wrapper-client.yaml @@ -10,13 +10,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Extract docs version - working-directory: ./clients/python-wrapper/ - shell: bash - run: | - echo "tag=$(python setup.py --version)" >> $GITHUB_OUTPUT - id: docver - - name: Set up Python 3.9 uses: actions/setup-python@v4 with: @@ -50,4 +43,3 @@ jobs: password: ${{ secrets.PYPI_API_TOKEN }} packages-dir: clients/python-wrapper/dist/ verbose: true - \ No newline at end of file diff --git a/Makefile b/Makefile index 105fcac2697..f622fba265d 100644 --- a/Makefile +++ b/Makefile @@ -288,7 +288,7 @@ python-wrapper-lint: python-wrapper-gen-docs: 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) + sphinx-build -b html -W clients/python-wrapper/docs clients/python-wrapper/_site/$$(PYTHONPATH=clients/python-wrapper python -c "import lakefs; print(lakefs.__version__)") $(UI_DIR)/node_modules: cd $(UI_DIR) && $(NPM) install diff --git a/clients/python-wrapper/lakefs/__init__.py b/clients/python-wrapper/lakefs/__init__.py index 8d6bcab44fa..08b4a29af82 100644 --- a/clients/python-wrapper/lakefs/__init__.py +++ b/clients/python-wrapper/lakefs/__init__.py @@ -18,6 +18,7 @@ from lakefs.object import StoredObject, WriteableObject, ObjectReader from lakefs.branch import LakeFSDeprecationWarning +__version__ = "0.14.0" def repository(repository_id: str, *args, **kwargs) -> Repository: """ diff --git a/clients/python-wrapper/pyproject.toml b/clients/python-wrapper/pyproject.toml new file mode 100644 index 00000000000..8c6bde1b646 --- /dev/null +++ b/clients/python-wrapper/pyproject.toml @@ -0,0 +1,53 @@ +[build-system] +requires = ["setuptools>=77"] +build-backend = "setuptools.build_meta" + +[project] +name = "lakefs" +description = "lakeFS Python SDK Wrapper" +keywords = ["OpenAPI", "OpenAPI-Generator", "lakeFS API", "Python Wrapper"] +requires-python = ">=3.9" +readme = "README.md" +license = "Apache-2.0" +authors = [ + { name = "Treeverse", email = "services@treeverse.io" }, +] +dependencies = [ + "lakefs-sdk>=1.50,< 2", + "pyyaml~=6.0.1", +] +classifiers = [ + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Software Development :: Version Control", + "Topic :: Utilities", + "Typing :: Typed", +] +dynamic = ["version"] + +[project.optional-dependencies] +all = [ "boto3 >= 1.26.0" ] +aws-iam = [ "boto3 >= 1.26.0" ] + +[dependency-groups] +test = [ + "pytest ~= 7.4.3", + "pytest-datafiles ~= 3.0.0", + "pandas >= 2.1.4,<3", + "pyarrow >= 14.0.1,<20", + "pillow >= 10.3.0,<12" +] + +[project.urls] +Homepage = "https://github.com/treeverse/lakeFS/tree/master/clients/python-wrapper" + +[tool.setuptools.dynamic] +version = { attr = "lakefs.__version__" } + +[tool.setuptools.packages.find] +include = ["lakectl", "lakefs"] + +[tool.setuptools.package-data] +lakefs = ["py.typed"] diff --git a/clients/python-wrapper/setup.py b/clients/python-wrapper/setup.py deleted file mode 100644 index 58829726432..00000000000 --- a/clients/python-wrapper/setup.py +++ /dev/null @@ -1,49 +0,0 @@ -from setuptools import setup, find_packages - -NAME = "lakefs" -VERSION = "0.14.0" -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -PYTHON_REQUIRES = ">=3.9" -REQUIRES = [ - "lakefs-sdk >= 1.50, < 2", - "pyyaml ~= 6.0.1", -] -TEST_REQUIRES = [ - "pytest ~= 7.4.3", - "pytest-datafiles ~= 3.0.0", - "pandas >= 2.1.4,<3", - "pyarrow >= 14.0.1,<20", - "pillow >= 10.3.0,<12" -] - -with open('README.md') as f: - long_description = f.read() -setup( - name=NAME, - version=VERSION, - description="lakeFS Python SDK Wrapper", - author="Treeverse", - author_email="services@treeverse.io", - url="https://github.com/treeverse/lakeFS/tree/master/clients/python-wrapper", - keywords=["OpenAPI", "OpenAPI-Generator", "lakeFS API", "Python Wrapper"], - python_requires=">=3.9", - install_requires=REQUIRES, - tests_require=TEST_REQUIRES, - packages=find_packages(exclude=["tests"]), - include_package_data=True, - license="Apache 2.0", - long_description=long_description, - long_description_content_type='text/markdown', - extras_require={ - # Install using: `pip install "lakefs--py3-none-any.whl[all,aws-iam]"` - "all": ["boto3 >= 1.26.0"], - "aws-iam": ["boto3 >= 1.26.0"], - }, - package_data={"lakefs": ["py.typed"]}, -)