diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d3e950c..c11ff61 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,14 +16,13 @@ jobs: with: python-version: '3.12' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine + - name: check GITHUB_REF matches package version + uses: samuelcolvin/check-python-version@v4.1 + with: + version_file_path: centrifuge/__init__.py - - name: Build package - run: | - python setup.py sdist bdist_wheel + - name: Build distribution + run: python -m build - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/centrifuge/__init__.py b/centrifuge/__init__.py index 2c39b31..dfe3ce3 100644 --- a/centrifuge/__init__.py +++ b/centrifuge/__init__.py @@ -12,6 +12,9 @@ HistoryResult, PresenceResult, PresenceStatsResult, RpcResult +__version__ = "0.3.0b0" + + __all__ = [ Client, Subscription, ClientState, SubscriptionState, diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..aa50d62 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,46 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "centrifuge-python" +description = "WebSocket SDK for Centrifugo (and any Centrifuge-based server) on top of Python asyncio library" +readme = "README.md" +requires-python = ">=3.8" +license = "MIT" +authors = [ + { name = "Alexander Emelin (Centrifugal Labs LTD)", email = "" }, +] +keywords = [ + "Centrifugo", + "Centrifuge", + "WebSocket", + "Pub/Sub", + "Realtime", +] +classifiers = [ + "License :: OSI Approved :: MIT License", + "Development Status :: 4 - Beta", + "Operating System :: OS Independent", + "Intended Audience :: Developers", + "Intended Audience :: Information Technology", + "Framework :: AsyncIO", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3 :: Only", + "Topic :: System :: Networking", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Internet", + "Typing :: Typed", +] +dependencies = [ + "websockets>=11.0.3,<12.0.0", + "protobuf>=4.23.4,<5.0.0", +] + +dynamic = ["version"] diff --git a/setup.py b/setup.py deleted file mode 100644 index eea37ef..0000000 --- a/setup.py +++ /dev/null @@ -1,32 +0,0 @@ -from setuptools import setup, find_packages -from os.path import join, dirname - -setup( - name='centrifuge-python', - version='0.3.0b0', - description="Websocket real-time SDK for Centrifugo on top of asyncio library", - install_requires=[ - "websockets>=11.0.3,<12.0.0", - "protobuf>=4.23.4,<5.0.0", - ], - packages=find_packages(), - long_description=open(join(dirname(__file__), 'README.md')).read(), - url='https://github.com/centrifugal/centrifuge-python', - download_url='https://github.com/centrifugal/centrifuge-python', - author="Alexander Emelin (Centrifugal Labs LTD)", - license='MIT', - classifiers=[ - 'Development Status :: 4 - Beta', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: MIT License', - 'Topic :: Internet :: WWW/HTTP', - 'Topic :: Software Development', - 'Topic :: System :: Networking', - ] -)