From 5dcabd029c404af467c90097592820c044e7ce7f Mon Sep 17 00:00:00 2001 From: Aleksey Timin Date: Thu, 22 Dec 2022 12:21:56 +0100 Subject: [PATCH 1/9] move to pyproject.toml --- README.md | 2 +- mkdocs.yml | 3 +- pyproject.toml | 64 +++++++++++++++++++++++++++++++++++++++++++ setup.py | 74 -------------------------------------------------- 4 files changed, 67 insertions(+), 76 deletions(-) delete mode 100644 setup.py 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/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", - }, -) From f32183e2d245548bac74b86d717c6856c66032d2 Mon Sep 17 00:00:00 2001 From: Aleksey Timin Date: Thu, 22 Dec 2022 13:10:21 +0100 Subject: [PATCH 2/9] update CHANGELOG --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From e630031e346520c169d1061a66a03a4f9f6141fd Mon Sep 17 00:00:00 2001 From: Aleksey Timin Date: Thu, 22 Dec 2022 13:20:09 +0100 Subject: [PATCH 3/9] use build utility --- .github/workflows/ci.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 050a43f..2218aaa 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 --sdist - uses: actions/upload-artifact@master with: From 76fda28c617a10eef813d18484b12dd8ff511d51 Mon Sep 17 00:00:00 2001 From: Aleksey Timin Date: Thu, 22 Dec 2022 13:23:19 +0100 Subject: [PATCH 4/9] build only wheel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2218aaa..c252cab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: run: python3 -m pip install --no-cache --upgrade pip pipx - name: Build package - run: pipx run build --wheel --sdist + run: pipx run build --wheel - uses: actions/upload-artifact@master with: From 98756093bd18213781f7d9b37dd660cb6b030c95 Mon Sep 17 00:00:00 2001 From: Aleksey Timin Date: Thu, 22 Dec 2022 13:32:51 +0100 Subject: [PATCH 5/9] fix package dir --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index ac86404..d712372 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,6 +32,9 @@ classifiers = [ dependencies = ["aiohttp~=3.8", "pydantic~=1.9", "deprecation~=2.1"] +[options] +package_dir = "./pkg" + [project.optional-dependencies] test = [ "pytest~=7.1", From 9f9b3d2ced631c205ea328199ad66daa93146cb7 Mon Sep 17 00:00:00 2001 From: Aleksey Timin Date: Thu, 22 Dec 2022 13:36:47 +0100 Subject: [PATCH 6/9] keep modul in projet root --- .gitignore | 2 +- pyproject.toml | 5 +---- {pkg/reduct => reduct}/__init__.py | 0 {pkg/reduct => reduct}/bucket.py | 0 {pkg/reduct => reduct}/client.py | 0 {pkg/reduct => reduct}/error.py | 0 {pkg/reduct => reduct}/http.py | 0 7 files changed, 2 insertions(+), 5 deletions(-) rename {pkg/reduct => reduct}/__init__.py (100%) rename {pkg/reduct => reduct}/bucket.py (100%) rename {pkg/reduct => reduct}/client.py (100%) rename {pkg/reduct => reduct}/error.py (100%) rename {pkg/reduct => reduct}/http.py (100%) 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/pyproject.toml b/pyproject.toml index d712372..4d5e7d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=40.8.0", "wheel"] +requires = ["wheel"] [project] @@ -32,9 +32,6 @@ classifiers = [ dependencies = ["aiohttp~=3.8", "pydantic~=1.9", "deprecation~=2.1"] -[options] -package_dir = "./pkg" - [project.optional-dependencies] test = [ "pytest~=7.1", 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 From 7890976a44c3b94193a9b771bc9b95dda1a52eae Mon Sep 17 00:00:00 2001 From: Aleksey Timin Date: Thu, 22 Dec 2022 13:38:17 +0100 Subject: [PATCH 7/9] return setuptools --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4d5e7d4..ac86404 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["wheel"] +requires = ["setuptools>=40.8.0", "wheel"] [project] From fbd1bdc206c5325b039e2b8fe0c694a35fc91516 Mon Sep 17 00:00:00 2001 From: Aleksey Timin Date: Thu, 22 Dec 2022 13:40:08 +0100 Subject: [PATCH 8/9] fix pylint --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c252cab..2475b79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,7 +83,7 @@ jobs: run: pip3 install .[test,lint] - name: Lint main - run: pylint ./pkg/ + run: pylint ./reduct - name: Lint tests run: pylint ./tests From 9ef2a28f23b7fefa68bdb9850259c43cea142614 Mon Sep 17 00:00:00 2001 From: Aleksey Timin Date: Thu, 22 Dec 2022 13:45:24 +0100 Subject: [PATCH 9/9] upgrade pip --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2475b79..a62f32f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,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/*