Skip to content

Commit

Permalink
add pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Sep 9, 2024
1 parent 2f5aea2 commit 104d2a1
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 24 deletions.
25 changes: 25 additions & 0 deletions pyRF24Mesh/README.md
Original file line number Diff line number Diff line change
@@ -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.
15 changes: 15 additions & 0 deletions pyRF24Mesh/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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
28 changes: 4 additions & 24 deletions pyRF24Mesh/setup.py
Original file line number Diff line number Diff line change
@@ -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]

Expand All @@ -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",
Expand Down

0 comments on commit 104d2a1

Please sign in to comment.