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 <[email protected]>
Signed-off-by: Jan Kiszka <[email protected]>
  • Loading branch information
michaeladler authored and jan-kiszka committed Feb 12, 2025
1 parent 8a2296b commit 2694ad6
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 67 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
76 changes: 73 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,80 @@
# 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 = "[email protected]" },
]
requires-python = ">=3.9"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3 :: Only",
"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 = [
"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
72 changes: 9 additions & 63 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,75 +23,21 @@
Setup script for kas, a setup tool for bitbake based projects
"""

from os import path
from setuptools import setup, find_packages
import sys

from kas import __version__
from setuptools import setup

sys.path.append('.')

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

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='[email protected]',

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

license='MIT',
def get_version():
from kas import __version__
return __version__

# 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.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'
],

# At least python 3.9 is needed by now:
python_requires='>=3.9',
setup(
version=get_version(),
)

0 comments on commit 2694ad6

Please sign in to comment.