diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 050a43f..a62f32f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,13 +27,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Update pip - run: python3 -m pip install --no-cache --upgrade pip setuptools wheel - - - name: Install dependencies - run: pip3 install . + run: python3 -m pip install --no-cache --upgrade pip pipx - name: Build package - run: python3 setup.py bdist_wheel + run: pipx run build --wheel - uses: actions/upload-artifact@master with: @@ -78,6 +75,8 @@ jobs: with: name: package path: ./dist + - name: Upgrade pip + run: pip install -U pip - name: Install package run: python3 -m pip install dist/* @@ -86,7 +85,7 @@ jobs: run: pip3 install .[test,lint] - name: Lint main - run: pylint ./pkg/ + run: pylint ./reduct - name: Lint tests run: pylint ./tests diff --git a/.gitignore b/.gitignore index 4401859..9fccd96 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ build/ -pkg/reduct/VERSION +reduct/VERSION *.egg-info .venv .gitignore diff --git a/CHANGELOG.md b/CHANGELOG.md index 16be18c..983b095 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed: -- Update documentation after rebranding, [PR-59](https://github.com/reductstore/reduct-py/pull/59) +- Update documentation after rebranding, [PR-59](https://github.com/reductstore/reduct-py/pull/59) +- Migrate to pyproject.toml, [PR-61](https://github.com/reductstore/reduct-py/pull/61) ## [1.1.0] - 2022-11-29 diff --git a/README.md b/README.md index 94f3d8b..5a8a59d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![PyPI - Downloads](https://img.shields.io/pypi/dm/reduct-py)](https://pypi.org/project/reduct-py/) [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/reductstore/reduct-py/ci.yml?branch=main)](https://github.com/reductstore/reduct-py/actions) -This package provides an asynchronous HTTP client for interacting with the [ReductStore](https://www.reduct.store) service. It is written in Python +This package provides an asynchronous HTTP client for interacting with the [ReductStore](https://www.reduct.store) service. ## Features diff --git a/mkdocs.yml b/mkdocs.yml index 8426648..11be971 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,4 +1,5 @@ site_name: ReductStore Client SDK for Python +site_description: The ReductStore Client SDK for Python is a Python client for ReductStore, a time series database for blob data site_url: "https://py.reduct.store" docs_dir: . nav: @@ -16,7 +17,7 @@ nav: repo_name: reductstore/reduct-py repo_url: https://github.com/reductstore/reduct-py -edit_uri: edit/main/docs +edit_uri: edit/main/ # Configuration diff --git a/pyproject.toml b/pyproject.toml index 7831e84..ac86404 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,66 @@ +[build-system] +requires = ["setuptools>=40.8.0", "wheel"] + +[project] + +name = "reduct-py" +version = "1.1.0" +description = "ReductStore Client SDK for Python" +requires-python = ">=3.7" +readme = "README.md" +license = { file = "LICENSE" } +keywords = ["sdk", "reductstore", "api client", "database", "time series database"] +authors = [ + { name = "Alexey Timin", email = "atimin@gmail.com" }, + { name = "Ciaran Moyne" } +] +maintainers = [ + { email = "atimin@gmail.com", name = "Alexey Timin" } +] + +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python :: 3 :: Only", + "Framework :: aiohttp", + "Intended Audience :: Information Technology", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Operating System :: OS Independent", + "Topic :: Database :: Front-Ends", + "License :: OSI Approved :: MIT License", +] + +dependencies = ["aiohttp~=3.8", "pydantic~=1.9", "deprecation~=2.1"] + +[project.optional-dependencies] +test = [ + "pytest~=7.1", + "pytest-mock~=3.10", + "pytest-asyncio~=0.18" +] + +lint = ["pylint~=2.14"] +format = ["black~=22.6"] +docs = [ + "mkdocs~=1.3", + "mkdocs-material~=8.3", + "plantuml-markdown~=3.5", + "mkdocs-same-dir~=0.1", + "mkdocstrings[python]~=0.19" +] + +[project.urls] +ReductStore = "https://www.reduct.store" +Documentation = "https://py.reduct.store/" +Source = "https://github.com/reductstore/reduct-py" +Changelog = "https://github.com/reductstore/reduct-py/blob/main/CHANGELOG.md" +Twitter = "https://twitter.com/ReductStore" +Blog = "https://dev.to/reductstore" + + [tool.pytest.ini_options] asyncio_mode = "strict" + +[tool.pylint] +max-line-length = 88 +extension-pkg-whitelist = "pydantic" \ No newline at end of file diff --git a/pkg/reduct/__init__.py b/reduct/__init__.py similarity index 100% rename from pkg/reduct/__init__.py rename to reduct/__init__.py diff --git a/pkg/reduct/bucket.py b/reduct/bucket.py similarity index 100% rename from pkg/reduct/bucket.py rename to reduct/bucket.py diff --git a/pkg/reduct/client.py b/reduct/client.py similarity index 100% rename from pkg/reduct/client.py rename to reduct/client.py diff --git a/pkg/reduct/error.py b/reduct/error.py similarity index 100% rename from pkg/reduct/error.py rename to reduct/error.py diff --git a/pkg/reduct/http.py b/reduct/http.py similarity index 100% rename from pkg/reduct/http.py rename to reduct/http.py diff --git a/setup.py b/setup.py deleted file mode 100644 index 3542f49..0000000 --- a/setup.py +++ /dev/null @@ -1,74 +0,0 @@ -# Python implementation of Reduct Storage HTTP API -# (c) 2022 Alexey Timin - -""" Setup script -""" -from pathlib import Path - -from setuptools import setup, find_packages - -PACKAGE_NAME = "reduct-py" -MAJOR_VERSION = 1 -MINOR_VERSION = 1 -PATCH_VERSION = 0 - -HERE = Path(__file__).parent.resolve() - - -def update_package_version(path: Path, version: str): - """Overwrite/create __init__.py file and fill __version__""" - with open(path / "VERSION", "w") as version_file: - version_file.write(f"{version}\n") - - -def build_version(): - """Build dynamic version and update version in package""" - version = f"{MAJOR_VERSION}.{MINOR_VERSION}.{PATCH_VERSION}" - - update_package_version(HERE / "pkg" / "reduct", version=version) - - return version - - -def get_long_description(base_path: Path): - """Get long package description""" - return (base_path / "README.md").read_text(encoding="utf-8") - - -setup( - name=PACKAGE_NAME, - version=build_version(), - description="ReductStore Client SDK for Python", - long_description=get_long_description(HERE), - long_description_content_type="text/markdown", - url="https://github.com/reductstore/reduct-py", - author="Alexey Timin, Ciaran Moyne", - author_email="atimin@gmai.com", - package_dir={"": "pkg"}, - package_data={"": ["VERSION"]}, - packages=find_packages(where="pkg"), - python_requires=">=3.7", - install_requires=["aiohttp~=3.8", "pydantic~=1.9", "deprecation~=2.1"], - extras_require={ - "test": ["pytest~=7.1", "pytest-asyncio~=0.18"], - "lint": [ - "pylint~=2.14", - ], - "format": ["black~=22.6"], - "docs": [ - "mkdocs~=1.3", - "mkdocs-material~=8.3", - "plantuml-markdown~=3.5", - "mkdocs-same-dir~=0.1", - "mkdocstrings[python]~=0.19", - ], - }, - project_urls={ - "ReductStore": "https://www.reduct.store", - "Documentation": "https://py.reduct.store/", - "Source": "https://github.com/reductstore/reduct-py", - "Changelog": "https://github.com/reductstore/reduct-py/blob/main/CHANGELOG.md", - "Twitter": "https://twitter.com/ReductStore", - "Blog": "https://dev.to/reductstore", - }, -)