From 12ad4dcbf905fb06eab80e5822c7ebb25fa4249c Mon Sep 17 00:00:00 2001 From: Jeff Laflamme Date: Wed, 16 Jul 2025 08:59:12 +0700 Subject: [PATCH 1/4] add uvx executable support (pyproject) --- README.md | 8 +++++++- bitchat.py | 8 ++++++-- pyproject.toml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 pyproject.toml diff --git a/README.md b/README.md index b67aee8..df3d8e4 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,10 @@ A Python implementation of the BitChat decentralized, peer-to-peer, encrypted ch This project is a rewrite of the original Rust-based `bitchat-terminal`. -pip install bleak>=0.22.3 cryptography>=44.0.0 lz4>=4.3.3 aioconsole>=0.8.1 pybloom-live>=4.0.0 \ No newline at end of file +## Installation + +### Using uvx +```bash +uvx bitchat +``` + diff --git a/bitchat.py b/bitchat.py index dc9a061..61fc95d 100644 --- a/bitchat.py +++ b/bitchat.py @@ -2034,8 +2034,12 @@ async def main(): client = BitchatClient() await client.run() -if __name__ == "__main__": +def cli_main(): + """Entry point for CLI execution""" try: asyncio.run(main()) except KeyboardInterrupt: - print("\n[+] Exiting...") \ No newline at end of file + print("\n[+] Exiting...") + +if __name__ == "__main__": + cli_main() \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b510cbb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,47 @@ +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "bitchat" +version = "1.0.0" +description = "Bluetooth Low Energy (BLE) mesh chat application" +readme = "README.md" +requires-python = ">=3.8" +license = {text = "MIT"} +authors = [ + {name = "BitChat Developer"} +] +keywords = ["bluetooth", "ble", "chat", "mesh", "communication"] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: End Users/Desktop", + "License :: OSI Approved :: MIT License", + "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", + "Topic :: Communications :: Chat", + "Topic :: System :: Networking", +] +dependencies = [ + "bleak", + "aioconsole", + "pybloom-live", + "cryptography", + "lz4", +] + +[project.scripts] +bitchat = "bitchat:cli_main" + +[tool.setuptools] +py-modules = ["bitchat", "encryption", "compression", "fragmentation", "terminal_ux", "persistence"] + +[project.urls] +Homepage = "https://github.com/user/bitchat-python" +Repository = "https://github.com/user/bitchat-python" +Issues = "https://github.com/user/bitchat-python/issues" + From c58606afe714e126d028e58999d6b24eb918f8bf Mon Sep 17 00:00:00 2001 From: Jeff Laflamme Date: Thu, 17 Jul 2025 16:48:42 +0700 Subject: [PATCH 2/4] Removed redundants already implemented in #7 --- README.md | 2 +- bitchat.py | 8 ++------ pyproject.toml | 9 +++++---- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index df3d8e4..d620c01 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,6 @@ This project is a rewrite of the original Rust-based `bitchat-terminal`. ### Using uvx ```bash -uvx bitchat +uvx bitchat-python ``` diff --git a/bitchat.py b/bitchat.py index 61fc95d..dc9a061 100644 --- a/bitchat.py +++ b/bitchat.py @@ -2034,12 +2034,8 @@ async def main(): client = BitchatClient() await client.run() -def cli_main(): - """Entry point for CLI execution""" +if __name__ == "__main__": try: asyncio.run(main()) except KeyboardInterrupt: - print("\n[+] Exiting...") - -if __name__ == "__main__": - cli_main() \ No newline at end of file + print("\n[+] Exiting...") \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b510cbb..c784a27 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,6 +23,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Communications :: Chat", "Topic :: System :: Networking", ] @@ -35,13 +36,13 @@ dependencies = [ ] [project.scripts] -bitchat = "bitchat:cli_main" +bitchat = "bitchat" [tool.setuptools] py-modules = ["bitchat", "encryption", "compression", "fragmentation", "terminal_ux", "persistence"] [project.urls] -Homepage = "https://github.com/user/bitchat-python" -Repository = "https://github.com/user/bitchat-python" -Issues = "https://github.com/user/bitchat-python/issues" +Homepage = "https://github.com/kaganisildak/bitchat-python" +Repository = "https://github.com/kaganisildak/bitchat-python" +Issues = "https://github.com/kaganisildak/bitchat-python/issues" From 5666cbf7563f57fb133cf99cd7c5abc613bf090b Mon Sep 17 00:00:00 2001 From: Jeff Laflamme Date: Thu, 17 Jul 2025 17:01:36 +0700 Subject: [PATCH 3/4] Removed dependencies on pypi for UVX (install via github) --- README.md | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d620c01..e6e6849 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,6 @@ This project is a rewrite of the original Rust-based `bitchat-terminal`. ### Using uvx ```bash -uvx bitchat-python +uvx --from git+https://github.com/kaganisildak/bitchat-python bitchat ``` diff --git a/pyproject.toml b/pyproject.toml index c784a27..d271f7e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ readme = "README.md" requires-python = ">=3.8" license = {text = "MIT"} authors = [ - {name = "BitChat Developer"} + {name = "Kağan IŞILDAK"} ] keywords = ["bluetooth", "ble", "chat", "mesh", "communication"] classifiers = [ From a4a5db8aea4f8f781780a103bbd551fdd71bac4c Mon Sep 17 00:00:00 2001 From: Jeff Laflamme Date: Wed, 30 Jul 2025 17:25:23 +0700 Subject: [PATCH 4/4] As the PR are not accepted, let's amend and make it run for some --- README.md | 2 +- bitchat.py | 8 ++++++-- pyproject.toml | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e6e6849..2ce4776 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,6 @@ This project is a rewrite of the original Rust-based `bitchat-terminal`. ### Using uvx ```bash -uvx --from git+https://github.com/kaganisildak/bitchat-python bitchat +uvx --from git+https://github.com/jflaflamme/bitchat-python bitchat-python ``` diff --git a/bitchat.py b/bitchat.py index dc9a061..1b84f8b 100644 --- a/bitchat.py +++ b/bitchat.py @@ -2034,8 +2034,12 @@ async def main(): client = BitchatClient() await client.run() -if __name__ == "__main__": +def run(): + """Entry point for console scripts""" try: asyncio.run(main()) except KeyboardInterrupt: - print("\n[+] Exiting...") \ No newline at end of file + print("\n[+] Exiting...") + +if __name__ == "__main__": + run() \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index d271f7e..eb2ce5c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ dependencies = [ ] [project.scripts] -bitchat = "bitchat" +bitchat-python = "bitchat:run" [tool.setuptools] py-modules = ["bitchat", "encryption", "compression", "fragmentation", "terminal_ux", "persistence"]