Skip to content

Commit

Permalink
packaging: upgrade to pyproject.toml
Browse files Browse the repository at this point in the history
Replace setup.py with pyproject.toml, aligning with PEP 518
recommendations for declarative packaging configuration. This enables
modern build tools (e.g., uv, poetry) for local dev environments.

Signed-off-by: Michael Adler <michael.adler@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
  • Loading branch information
michaeladler authored and jan-kiszka committed Jan 23, 2025
1 parent d2cac88 commit 0f22bde
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 69 deletions.
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# The following folders are excluded to prevent setuptools' package
# auto-discovery from adding the *.py files in these folders to the sdist
# tarball
exclude scripts
exclude docs
80 changes: 77 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,84 @@
# kas - setup tool for bitbake based projects
#
# Copyright (c) Siemens AG, 2021-2025
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

[build-system]
requires = ["setuptools>=40.5.0", "wheel"]
build-backend = "setuptools.build_meta"

requires = [ "setuptools>=40.5", "wheel" ]

[project]
name = "kas"
description = "Setup tool for bitbake based projects"
readme = "README.rst"
keywords = [ "OpenEmbedded bitbake development" ]
license = { text = "MIT" }
maintainers = [
{ name = "Jan Kiszka", email = "jan.kiszka@siemens.com" },
]
requires-python = ">=3.6"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"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 :: 3.13",
"Topic :: Software Development :: Build Tools",
]
dynamic = [ "version" ]
dependencies = [
"cached-property>=1,<2; python_version<'3.8'",
"distro>=1,<2",
"gitpython>=3.1,<4",
"jsonschema>=2.5,<5",
"kconfiglib>=14.1,<15",
"pyyaml>=3,<7",
]

urls.Documentation = "https://kas.readthedocs.io/"
urls.Homepage = "https://github.com/siemens/kas"
urls.Repository = "https://github.com/siemens/kas.git"
scripts.kas = "kas.kas:main"

[tool.poetry]
version = "1.0"

[tool.setuptools]
package-data = { "kas" = [ "*.json" ] }
script-files = [ "kas-container" ]

[tool.setuptools.packages.find]
namespaces = false

[tool.pytest.ini_options]
markers = [
"online: tests requiring internet access"
"online: tests requiring internet access",
]
filterwarnings = [
"error"
"error",
]
2 changes: 1 addition & 1 deletion scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ git commit -m "Release $NEW_VERSION"
git tag -s -m "Release $NEW_VERSION" "$NEW_VERSION"
git push --follow-tags

python3 setup.py sdist
python3 -m build --sdist
twine upload -s -r pypi "dist/kas-$NEW_VERSION.tar.gz"

authors=$(git shortlog -s "$OLD_VERSION".."$NEW_VERSION" | cut -c8- | paste -s -d, - | sed -e 's/,/, /g')
Expand Down
69 changes: 4 additions & 65 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,79 +23,18 @@
Setup script for kas, a setup tool for bitbake based projects
"""

from os import path
from setuptools import setup, find_packages
import sys
sys.path.append('.')

from setuptools import setup

from kas import __version__

__license__ = 'MIT'
__copyright__ = 'Copyright (c) Siemens AG, 2017-2019'

HERE = path.abspath(path.dirname(__file__))
with open(path.join(HERE, 'README.rst')) as f:
LONG_DESCRIPTION = f.read()


setup(
name='kas',
version=__version__,

scripts=['kas-container'],

description='Setup tool for bitbake based projects',
long_description=LONG_DESCRIPTION,

maintainer='Jan Kiszka',
maintainer_email='jan.kiszka@siemens.com',

url='https://github.com/siemens/kas',
download_url=('https://github.com/siemens/'
f'kas/archive/{__version__}.tar.gz'),

license='MIT',

# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
'Development Status :: 5 - Production/Stable',

# Indicate who your project is intended for
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',

# Pick your license as you wish (should match "license" above)
'License :: OSI Approved :: MIT License',

'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'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 :: 3.13',
],
keywords='OpenEmbedded bitbake development',

packages=find_packages(),

package_data={'kas': ['*.json']},

entry_points={
'console_scripts': [
'kas=kas.kas:main',
],
},

install_requires=[
'PyYAML>=3.0,<7',
'distro>=1.0.0,<2',
'jsonschema>=2.5.0,<5',
'kconfiglib>=14.1.0,<15',
'GitPython>=3.1.0,<4',
"cached-property>=1.0,<2; python_version<'3.8'"
],

# At least python 3.6 is needed by now:
python_requires='>=3.6',
)

0 comments on commit 0f22bde

Please # to comment.