transitioned py_grpc build from setup.py to pyproject.toml

This commit is contained in:
or-else
2025-10-15 17:09:59 +03:00
parent 552fc47ded
commit 6939413539
5 changed files with 53 additions and 44 deletions
+3 -3
View File
@@ -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**:
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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
+48
View File
@@ -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"}
-39
View File
@@ -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",
],
)