From 104d2a1d0a35b15673d97c23b47ee241c6e4f16e Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Mon, 9 Sep 2024 05:03:08 -0700 Subject: [PATCH] add pyproject.toml ref nRF24/RF24#1000 --- pyRF24Mesh/README.md | 25 +++++++++++++++++++++++++ pyRF24Mesh/pyproject.toml | 15 +++++++++++++++ pyRF24Mesh/setup.py | 28 ++++------------------------ 3 files changed, 44 insertions(+), 24 deletions(-) create mode 100644 pyRF24Mesh/README.md create mode 100644 pyRF24Mesh/pyproject.toml diff --git a/pyRF24Mesh/README.md b/pyRF24Mesh/README.md new file mode 100644 index 0000000..0b33b09 --- /dev/null +++ b/pyRF24Mesh/README.md @@ -0,0 +1,25 @@ +# Individual python wrapper + +> [!warning] +> This python wrapper for the RF24Mesh C++ library was not intended +> for distribution on pypi.org. Any such attempts to publish this package +> is unauthorized and unofficial. + +## Use pyRF24 instead + +We recommend using the newer [pyRF24](https://github.com/nRF24/pyRF24) package +[available from pypi](https://pypi.org/project/pyrf24/) because + +1. it is [practically drop-in compatible](https://nrf24.github.io/pyRF24/#migrating-to-pyrf24) +2. easier to install or get updates with popular package managers like pip +3. does not require the C++ libraries to be installed -- it uses its own isolated binaries +4. includes wrappers for RF24, RF24Network, RF24Mesh libraries +5. includes a new [fake BLE implementation](https://nrf24.github.io/pyRF24/ble_api.html) +6. has its own [dedicated documentation](https://nRF24.github.io/pyRF24) +7. is compatible with python's builtin `help()` +8. includes typing stub files for type checking tools like mypy + +The only reason that you should need to keep using these older individual python +wrappers is if you must use python v3.6 or older. + +You **cannot** use these individual wrappers in combination with the pyRF24 package. diff --git a/pyRF24Mesh/pyproject.toml b/pyRF24Mesh/pyproject.toml new file mode 100644 index 0000000..2a5e7db --- /dev/null +++ b/pyRF24Mesh/pyproject.toml @@ -0,0 +1,15 @@ +[build-system] +requires = ["setuptools>=61"] +build-backend = "setuptools.build_meta" + +[project] +name = "RF24Mesh" +classifiers = [ + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 3", + "Programming Language :: C++", + "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", +] +license = {text = "GNU General Public License v2 (GPLv2)"} +readme = {file = "README.md", content-type = "text/markdown"} +dynamic = ["version"] # version is set in setup.py diff --git a/pyRF24Mesh/setup.py b/pyRF24Mesh/setup.py index ce1c037..bc37c35 100755 --- a/pyRF24Mesh/setup.py +++ b/pyRF24Mesh/setup.py @@ -1,15 +1,13 @@ #!/usr/bin/env python - import os from setuptools import setup, Extension from sys import version_info -if version_info >= (3,): - BOOST_LIB = "boost_python3" -else: - BOOST_LIB = "boost_python" +BOOST_LIB = "boost_python" + ( + "" if version_info < (3,) else "%d%d" % (version_info.major, version_info.minor) +) -# NOTE can't access "../../LICENSE.inc" from working dir because +# NOTE can't access "../../library.properties" from working dir because # it's relative. Brute force absolute path dynamically. git_dir = os.path.split(os.path.abspath(os.getcwd()))[0] @@ -20,26 +18,8 @@ if line.startswith("version"): version = line.split("=")[1] - -long_description = """ -.. warning:: This python wrapper for the RF24Mesh C++ library was not intended - for distribution on pypi.org. If you're reading this, then this package - is likely unauthorized or unofficial. -""" - setup( - name="RF24Mesh", version=version, - license="GPLv2", - license_files=(os.path.join(git_dir, "LICENSE"),), - long_description=long_description, - long_description_content_type="text/x-rst", - classifiers=[ - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 3", - "Programming Language :: C++", - "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", - ], ext_modules=[ Extension( "RF24Mesh",