Skip to content

Commit

Permalink
Python package now pyproject.toml for PEP 517
Browse files Browse the repository at this point in the history
  • Loading branch information
LeStarch committed Oct 29, 2024
1 parent e829300 commit 54c85cc
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 87 deletions.
77 changes: 75 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,68 @@
[build-system]
requires = [
"setuptools>=30.3.0",
"setuptools_scm>=3.3.1"
"setuptools>=30.3.0",
"setuptools_scm[toml]>=6.2",
"wheel"
]
build-backend = "setuptools.build_meta"

[project]
name = "arduino-cli-cmake-wrapper"
dynamic = ["version"]
description = "A wrapper for arduino CLI allowing it to integrate with a CMakeSystem"
readme = "README.rst"
requires-python = ">=3.8"
license = {file = "LICENSE"}
keywords = ["fprime", "embedded", "nasa", "arduino", "cmake"]
authors = [
{name = "Sterling Lewis Peet", email = "sterling.peet@gatech.edu"},
{name = "Michael Starch", email = "Michael.D.Starch@jpl.nasa.gov"},
{name = "Thomas Boyer-Chammard", email = "Thomas.Boyer.Chammard@jpl.nasa.gov"},
]

classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Operating System :: Unix",
"Operating System :: POSIX",
"Programming Language :: Python",
"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",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"License :: OSI Approved :: Apache Software License",
'Topic :: Utilities',
]

dependencies = []

[project.optional-dependencies]

[project.urls]
Documentation = "https://arduino-cli-cmake-wrapper.readthedocs.io/"
Changelog = "https://arduino-cli-cmake-wrapper.readthedocs.io/en/latest/changelog.html"
Issues = "https://github.com/SterlingPeet/arduino-cli-cmake-wrapper/issues"
Repository = "https://github.com/SterlingPeet/arduino-cli-cmake-wrapper"

####
# Entry Points:
#
# Defines the list of entry-level (scripts) that are defined by this package. This allows
# standard use of utilities that ship as part of F prime.
####
[project.scripts]
arduino-cli-wrapper = "arduino_cli_cmake_wrapper.cli:main"

####
# setuptools_scm dynamically generates version number from git, as well as automatically
# include all data files tracked by git (e.g. cookiecutter templates).
# See https://setuptools.pypa.io/en/latest/userguide/datafiles.html
####
[tool.setuptools_scm]

[tool.docformatter]
recursive = true
Expand Down Expand Up @@ -64,3 +124,16 @@ forced-separate = ["conftest"]

[tool.ruff.lint.per-file-ignores]
"ci/*" = ["S"]


####
# Additional notes
#
# With regards to the configuration of the older versions of setup.py:
# - package_data: included by default, and setuptools_scm will automatically include all files tracked by git
# - package discovery (src/): setuptools will automatically discover all packages as we use the src-layout
#
# Reference:
# - https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
# - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#src-layout
####
89 changes: 4 additions & 85 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,87 +1,6 @@
#!/usr/bin/env python
"""Setup script to install the ``arduino-cli-cmake-wrapper`` package."""

import re
from pathlib import Path

from setuptools import find_packages
# setup.py is kept to support legacy builds
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
from setuptools import setup


def read(*names, **kwargs):
"""Read file and return contents as a string."""
with Path(__file__).parent.joinpath(*names).open(
encoding=kwargs.get('encoding', 'utf8')
) as fh:
return fh.read()


setup(
name='arduino-cli-cmake-wrapper',
use_scm_version={
'local_scheme': 'dirty-tag',
'write_to': 'src/arduino_cli_cmake_wrapper/_version.py',
'fallback_version': '0.0.0',
},
license='Apache-2.0',
description='Arduino Cmake toolchain leveraging ``arduino-cli`` via python wrapper script',
long_description='{}\n{}'.format(
re.compile('^.. start-badges.*^.. end-badges', re.M | re.S).sub(
'', read('README.rst')
),
re.sub(':[a-z]+:`~?(.*?)`', r'``\1``', read('CHANGELOG.rst')),
),
author='Sterling Lewis Peet',
author_email='sterling.peet@gatech.edu',
url='https://github.com/SterlingPeet/arduino-cli-cmake-wrapper',
packages=find_packages('src'),
package_dir={'': 'src'},
py_modules=[path.stem for path in Path('src').glob('*.py')],
include_package_data=True,
zip_safe=False,
classifiers=[
# complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: Unix',
'Operating System :: POSIX',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'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',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Utilities',
],
project_urls={
'Documentation': 'https://arduino-cli-cmake-wrapper.readthedocs.io/',
'Changelog': 'https://arduino-cli-cmake-wrapper.readthedocs.io/en/latest/changelog.html',
'Issue Tracker': 'https://github.com/SterlingPeet/arduino-cli-cmake-wrapper/issues',
},
keywords=[
# eg: 'keyword1', 'keyword2', 'keyword3',
],
python_requires='>=3.7',
install_requires=[
# eg: 'aspectlib==1.1.1', 'six>=1.7',
],
extras_require={
# eg:
# "rst": ["docutils>=0.11"],
# ":python_version=='3.8'": ["backports.zoneinfo"],
},
setup_requires=[
'setuptools_scm>=3.3.1',
],
entry_points={
'console_scripts': [
'arduino-cli-wrapper = arduino_cli_cmake_wrapper.cli:main',
]
},
)
# Configuration is in pyproject.toml
setup()

0 comments on commit 54c85cc

Please sign in to comment.