Skip to content

Commit d42c007

Browse files
authored
add pyproject.toml (#252)
ref nRF24/RF24#1000
1 parent 2f5aea2 commit d42c007

File tree

3 files changed

+44
-24
lines changed

3 files changed

+44
-24
lines changed

pyRF24Mesh/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Individual python wrapper
2+
3+
> [!warning]
4+
> This python wrapper for the RF24Mesh C++ library was not intended
5+
> for distribution on pypi.org. Any such attempts to publish this package
6+
> is unauthorized and unofficial.
7+
8+
## Use pyRF24 instead
9+
10+
We recommend using the newer [pyRF24](https://github.com/nRF24/pyRF24) package
11+
[available from pypi](https://pypi.org/project/pyrf24/) because
12+
13+
1. it is [practically drop-in compatible](https://nrf24.github.io/pyRF24/#migrating-to-pyrf24)
14+
2. easier to install or get updates with popular package managers like pip
15+
3. does not require the C++ libraries to be installed -- it uses its own isolated binaries
16+
4. includes wrappers for RF24, RF24Network, RF24Mesh libraries
17+
5. includes a new [fake BLE implementation](https://nrf24.github.io/pyRF24/ble_api.html)
18+
6. has its own [dedicated documentation](https://nRF24.github.io/pyRF24)
19+
7. is compatible with python's builtin `help()`
20+
8. includes typing stub files for type checking tools like mypy
21+
22+
The only reason that you should need to keep using these older individual python
23+
wrappers is if you must use python v3.6 or older.
24+
25+
You **cannot** use these individual wrappers in combination with the pyRF24 package.

pyRF24Mesh/pyproject.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[build-system]
2+
requires = ["setuptools>=61"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "RF24Mesh"
7+
classifiers = [
8+
"Programming Language :: Python :: 2",
9+
"Programming Language :: Python :: 3",
10+
"Programming Language :: C++",
11+
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
12+
]
13+
license = {text = "GNU General Public License v2 (GPLv2)"}
14+
readme = {file = "README.md", content-type = "text/markdown"}
15+
dynamic = ["version"] # version is set in setup.py

pyRF24Mesh/setup.py

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
#!/usr/bin/env python
2-
32
import os
43
from setuptools import setup, Extension
54
from sys import version_info
65

7-
if version_info >= (3,):
8-
BOOST_LIB = "boost_python3"
9-
else:
10-
BOOST_LIB = "boost_python"
6+
BOOST_LIB = "boost_python" + (
7+
"" if version_info < (3,) else "%d%d" % (version_info.major, version_info.minor)
8+
)
119

12-
# NOTE can't access "../../LICENSE.inc" from working dir because
10+
# NOTE can't access "../../library.properties" from working dir because
1311
# it's relative. Brute force absolute path dynamically.
1412
git_dir = os.path.split(os.path.abspath(os.getcwd()))[0]
1513

@@ -20,26 +18,8 @@
2018
if line.startswith("version"):
2119
version = line.split("=")[1]
2220

23-
24-
long_description = """
25-
.. warning:: This python wrapper for the RF24Mesh C++ library was not intended
26-
for distribution on pypi.org. If you're reading this, then this package
27-
is likely unauthorized or unofficial.
28-
"""
29-
3021
setup(
31-
name="RF24Mesh",
3222
version=version,
33-
license="GPLv2",
34-
license_files=(os.path.join(git_dir, "LICENSE"),),
35-
long_description=long_description,
36-
long_description_content_type="text/x-rst",
37-
classifiers=[
38-
"Programming Language :: Python :: 2",
39-
"Programming Language :: Python :: 3",
40-
"Programming Language :: C++",
41-
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
42-
],
4323
ext_modules=[
4424
Extension(
4525
"RF24Mesh",

0 commit comments

Comments
 (0)