From 693941353908c6a9cc1b327ac684557fbb751feb Mon Sep 17 00:00:00 2001 From: or-else Date: Wed, 15 Oct 2025 17:09:59 +0300 Subject: [PATCH] transitioned py_grpc build from setup.py to pyproject.toml --- INSTALL.md | 6 +++--- README.md | 2 +- build-py-grpc.sh | 2 +- py_grpc/pyproject.toml | 48 ++++++++++++++++++++++++++++++++++++++++++ py_grpc/setup.py | 39 ---------------------------------- 5 files changed, 53 insertions(+), 44 deletions(-) create mode 100644 py_grpc/pyproject.toml delete mode 100644 py_grpc/setup.py diff --git a/INSTALL.md b/INSTALL.md index f4083471..d433e185 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -33,10 +33,10 @@ See [instructions](./docker/README.md) 2. OPTIONAL only if you intend to modify the code: Install [protobuf](https://developers.google.com/protocol-buffers/) and [gRPC](https://grpc.io/docs/languages/go/quickstart/) including [code generator](https://developers.google.com/protocol-buffers/docs/reference/go-generated) for Go. 3. Make sure one of the following databases is installed and running: - * MySQL 5.7 or above configured with `InnoDB` engine. MySQL 5.6 or below **will not work**. + * MySQL 5.7 or above configured with `InnoDB` engine (8.x preferred). MySQL 5.6 or below **will not work**. * PostgreSQL 13 or above. PostgreSQL 12 or below **will not work**. - * MongoDB 4.4 or above. MongoDB 4.2 and below **will not work**. - * RethinkDB (deprecated, support will be dropped in 2027). + * MongoDB 4.4 or above (8.x preferred). MongoDB 4.2 and below **will not work**. + * RethinkDB (deprecated, support will be dropped in 2027 unless RethinkDB team resumes development). 4. Fetch, build Tinode server and tinode-db database initializer: - **MySQL**: diff --git a/README.md b/README.md index 0bcbdeaa..de27031c 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ When you register a new account you are asked for an email address to send valid * Server-generated presence notifications for people, group chats. * Forwarding and replying to messages. * Editing sent messages. - * Pinned messages. + * Pinned chats and messages. * Administration: * Granular access control with permissions for various actions. * Support for custom authentication backends. diff --git a/build-py-grpc.sh b/build-py-grpc.sh index 4285224a..b966e256 100755 --- a/build-py-grpc.sh +++ b/build-py-grpc.sh @@ -13,7 +13,7 @@ pushd ../py_grpc > /dev/null python3 version.py # Generate tinode-grpc package -python3 setup.py -q sdist bdist_wheel +python3 -m build > /dev/null popd > /dev/null popd > /dev/null diff --git a/py_grpc/pyproject.toml b/py_grpc/pyproject.toml new file mode 100644 index 00000000..640b8322 --- /dev/null +++ b/py_grpc/pyproject.toml @@ -0,0 +1,48 @@ +[build-system] +requires = ["setuptools>=45", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "tinode_grpc" +description = "Tinode gRPC bindings." +authors = [ + {name = "Tinode Authors", email = "info@tinode.co"}, +] +license = "Apache-2.0" +readme = "README.md" +keywords = ["chat", "messaging", "messenger", "im", "tinode"] +classifiers = [ + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent", + "Topic :: Communications :: Chat", + "Intended Audience :: Developers", +] +dependencies = [ + "protobuf>=3.6.1", + "grpcio>=1.19.0", +] +dynamic = ["version"] + +[project.urls] +Homepage = "https://github.com/tinode/chat" +Repository = "https://github.com/tinode/chat" +Issues = "https://github.com/tinode/chat/issues" + +[tool.setuptools] +packages = ["tinode_grpc"] + +[tool.setuptools.package-data] +"*" = ["GIT_VERSION", "*.pyi"] + +# Alternative version handling if you want to keep reading from GIT_VERSION file +[tool.setuptools.dynamic] +version = {file = "tinode_grpc/GIT_VERSION"} diff --git a/py_grpc/setup.py b/py_grpc/setup.py deleted file mode 100644 index 30c6abaa..00000000 --- a/py_grpc/setup.py +++ /dev/null @@ -1,39 +0,0 @@ -# Script for packaging generated model_pb2*.py into tinode_grpc module. -import setuptools -from pkg_resources import resource_string - -with open('README.md', 'r') as readme_file: - long_description = readme_file.read() - -with open("tinode_grpc/GIT_VERSION", "r") as version_file: - git_version = version_file.read().strip() -# git_version = resource_string(__name__, 'tinode_grpc/GIT_VERSION').decode('ascii') - -setuptools.setup( - name="tinode_grpc", - version=git_version, - author="Tinode Authors", - author_email="info@tinode.co", - description="Tinode gRPC bindings.", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/tinode/chat", - packages=setuptools.find_packages(), - install_requires=['protobuf>=3.6.1', 'grpcio>=1.19.0'], - license="Apache 2.0", - keywords="chat messaging messenger im tinode", - package_data={ - "": ["GIT_VERSION", "*.pyi"], - }, - classifiers=[ - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "License :: OSI Approved :: Apache Software License", - "Operating System :: OS Independent", - "Topic :: Communications :: Chat", - "Intended Audience :: Developers", - ], -)