Skip to content

Commit 54c85cc

Browse files
committed
Python package now pyproject.toml for PEP 517
1 parent e829300 commit 54c85cc

File tree

2 files changed

+79
-87
lines changed

2 files changed

+79
-87
lines changed

pyproject.toml

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,68 @@
11
[build-system]
22
requires = [
3-
"setuptools>=30.3.0",
4-
"setuptools_scm>=3.3.1"
3+
"setuptools>=30.3.0",
4+
"setuptools_scm[toml]>=6.2",
5+
"wheel"
56
]
7+
build-backend = "setuptools.build_meta"
8+
9+
[project]
10+
name = "arduino-cli-cmake-wrapper"
11+
dynamic = ["version"]
12+
description = "A wrapper for arduino CLI allowing it to integrate with a CMakeSystem"
13+
readme = "README.rst"
14+
requires-python = ">=3.8"
15+
license = {file = "LICENSE"}
16+
keywords = ["fprime", "embedded", "nasa", "arduino", "cmake"]
17+
authors = [
18+
{name = "Sterling Lewis Peet", email = "[email protected]"},
19+
{name = "Michael Starch", email = "[email protected]"},
20+
{name = "Thomas Boyer-Chammard", email = "[email protected]"},
21+
]
22+
23+
classifiers = [
24+
"Development Status :: 5 - Production/Stable",
25+
"Intended Audience :: Developers",
26+
"Operating System :: Unix",
27+
"Operating System :: POSIX",
28+
"Programming Language :: Python",
29+
"Programming Language :: Python :: 3",
30+
"Programming Language :: Python :: 3.8",
31+
"Programming Language :: Python :: 3.9",
32+
"Programming Language :: Python :: 3.10",
33+
"Programming Language :: Python :: 3.11",
34+
"Programming Language :: Python :: 3.12",
35+
"Programming Language :: Python :: Implementation :: CPython",
36+
"Programming Language :: Python :: Implementation :: PyPy",
37+
"License :: OSI Approved :: Apache Software License",
38+
'Topic :: Utilities',
39+
]
40+
41+
dependencies = []
42+
43+
[project.optional-dependencies]
44+
45+
[project.urls]
46+
Documentation = "https://arduino-cli-cmake-wrapper.readthedocs.io/"
47+
Changelog = "https://arduino-cli-cmake-wrapper.readthedocs.io/en/latest/changelog.html"
48+
Issues = "https://github.com/SterlingPeet/arduino-cli-cmake-wrapper/issues"
49+
Repository = "https://github.com/SterlingPeet/arduino-cli-cmake-wrapper"
50+
51+
####
52+
# Entry Points:
53+
#
54+
# Defines the list of entry-level (scripts) that are defined by this package. This allows
55+
# standard use of utilities that ship as part of F prime.
56+
####
57+
[project.scripts]
58+
arduino-cli-wrapper = "arduino_cli_cmake_wrapper.cli:main"
59+
60+
####
61+
# setuptools_scm dynamically generates version number from git, as well as automatically
62+
# include all data files tracked by git (e.g. cookiecutter templates).
63+
# See https://setuptools.pypa.io/en/latest/userguide/datafiles.html
64+
####
65+
[tool.setuptools_scm]
666

767
[tool.docformatter]
868
recursive = true
@@ -64,3 +124,16 @@ forced-separate = ["conftest"]
64124

65125
[tool.ruff.lint.per-file-ignores]
66126
"ci/*" = ["S"]
127+
128+
129+
####
130+
# Additional notes
131+
#
132+
# With regards to the configuration of the older versions of setup.py:
133+
# - package_data: included by default, and setuptools_scm will automatically include all files tracked by git
134+
# - package discovery (src/): setuptools will automatically discover all packages as we use the src-layout
135+
#
136+
# Reference:
137+
# - https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
138+
# - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#src-layout
139+
####

setup.py

Lines changed: 4 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,6 @@
1-
#!/usr/bin/env python
2-
"""Setup script to install the ``arduino-cli-cmake-wrapper`` package."""
3-
4-
import re
5-
from pathlib import Path
6-
7-
from setuptools import find_packages
1+
# setup.py is kept to support legacy builds
2+
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
83
from setuptools import setup
94

10-
11-
def read(*names, **kwargs):
12-
"""Read file and return contents as a string."""
13-
with Path(__file__).parent.joinpath(*names).open(
14-
encoding=kwargs.get('encoding', 'utf8')
15-
) as fh:
16-
return fh.read()
17-
18-
19-
setup(
20-
name='arduino-cli-cmake-wrapper',
21-
use_scm_version={
22-
'local_scheme': 'dirty-tag',
23-
'write_to': 'src/arduino_cli_cmake_wrapper/_version.py',
24-
'fallback_version': '0.0.0',
25-
},
26-
license='Apache-2.0',
27-
description='Arduino Cmake toolchain leveraging ``arduino-cli`` via python wrapper script',
28-
long_description='{}\n{}'.format(
29-
re.compile('^.. start-badges.*^.. end-badges', re.M | re.S).sub(
30-
'', read('README.rst')
31-
),
32-
re.sub(':[a-z]+:`~?(.*?)`', r'``\1``', read('CHANGELOG.rst')),
33-
),
34-
author='Sterling Lewis Peet',
35-
author_email='[email protected]',
36-
url='https://github.com/SterlingPeet/arduino-cli-cmake-wrapper',
37-
packages=find_packages('src'),
38-
package_dir={'': 'src'},
39-
py_modules=[path.stem for path in Path('src').glob('*.py')],
40-
include_package_data=True,
41-
zip_safe=False,
42-
classifiers=[
43-
# complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers
44-
'Development Status :: 5 - Production/Stable',
45-
'Intended Audience :: Developers',
46-
'License :: OSI Approved :: Apache Software License',
47-
'Operating System :: Unix',
48-
'Operating System :: POSIX',
49-
'Operating System :: Microsoft :: Windows',
50-
'Programming Language :: Python',
51-
'Programming Language :: Python :: 3',
52-
'Programming Language :: Python :: 3 :: Only',
53-
'Programming Language :: Python :: 3.8',
54-
'Programming Language :: Python :: 3.9',
55-
'Programming Language :: Python :: 3.10',
56-
'Programming Language :: Python :: 3.11',
57-
'Programming Language :: Python :: 3.12',
58-
'Programming Language :: Python :: Implementation :: CPython',
59-
'Programming Language :: Python :: Implementation :: PyPy',
60-
'Topic :: Utilities',
61-
],
62-
project_urls={
63-
'Documentation': 'https://arduino-cli-cmake-wrapper.readthedocs.io/',
64-
'Changelog': 'https://arduino-cli-cmake-wrapper.readthedocs.io/en/latest/changelog.html',
65-
'Issue Tracker': 'https://github.com/SterlingPeet/arduino-cli-cmake-wrapper/issues',
66-
},
67-
keywords=[
68-
# eg: 'keyword1', 'keyword2', 'keyword3',
69-
],
70-
python_requires='>=3.7',
71-
install_requires=[
72-
# eg: 'aspectlib==1.1.1', 'six>=1.7',
73-
],
74-
extras_require={
75-
# eg:
76-
# "rst": ["docutils>=0.11"],
77-
# ":python_version=='3.8'": ["backports.zoneinfo"],
78-
},
79-
setup_requires=[
80-
'setuptools_scm>=3.3.1',
81-
],
82-
entry_points={
83-
'console_scripts': [
84-
'arduino-cli-wrapper = arduino_cli_cmake_wrapper.cli:main',
85-
]
86-
},
87-
)
5+
# Configuration is in pyproject.toml
6+
setup()

0 commit comments

Comments
 (0)