Skip to content

Commit 2694ad6

Browse files
michaeladlerjan-kiszka
authored andcommitted
packaging: upgrade to pyproject.toml
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]>
1 parent 8a2296b commit 2694ad6

File tree

4 files changed

+88
-67
lines changed

4 files changed

+88
-67
lines changed

MANIFEST.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# The following folders are excluded to prevent setuptools' package
2+
# auto-discovery from adding the *.py files in these folders to the sdist
3+
# tarball
4+
exclude scripts
5+
exclude docs

pyproject.toml

Lines changed: 73 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,80 @@
1+
# kas - setup tool for bitbake based projects
2+
#
3+
# Copyright (c) Siemens AG, 2021-2025
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be
13+
# included in all copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
# SOFTWARE.
22+
123
[build-system]
2-
requires = ["setuptools>=40.5.0", "wheel"]
24+
build-backend = "setuptools.build_meta"
25+
26+
requires = [ "setuptools>=40.5", "wheel" ]
27+
28+
[project]
29+
name = "kas"
30+
description = "Setup tool for bitbake based projects"
31+
readme = "README.rst"
32+
keywords = [ "OpenEmbedded bitbake development" ]
33+
license = { text = "MIT" }
34+
maintainers = [
35+
{ name = "Jan Kiszka", email = "[email protected]" },
36+
]
37+
requires-python = ">=3.9"
38+
classifiers = [
39+
"Development Status :: 5 - Production/Stable",
40+
"Intended Audience :: Developers",
41+
"License :: OSI Approved :: MIT License",
42+
"Programming Language :: Python :: 3 :: Only",
43+
"Programming Language :: Python :: 3.9",
44+
"Programming Language :: Python :: 3.10",
45+
"Programming Language :: Python :: 3.11",
46+
"Programming Language :: Python :: 3.12",
47+
"Programming Language :: Python :: 3.13",
48+
"Topic :: Software Development :: Build Tools",
49+
]
50+
dynamic = [ "version" ]
51+
dependencies = [
52+
"distro>=1,<2",
53+
"gitpython>=3.1,<4",
54+
"jsonschema>=2.5,<5",
55+
"kconfiglib>=14.1,<15",
56+
"pyyaml>=3,<7",
57+
]
58+
59+
urls.Documentation = "https://kas.readthedocs.io/"
60+
urls.Homepage = "https://github.com/siemens/kas"
61+
urls.Repository = "https://github.com/siemens/kas.git"
62+
scripts.kas = "kas.kas:main"
63+
64+
[tool.poetry]
65+
version = "1.0"
66+
67+
[tool.setuptools]
68+
package-data = { "kas" = [ "*.json" ] }
69+
script-files = [ "kas-container" ]
70+
71+
[tool.setuptools.packages.find]
72+
namespaces = false
373

474
[tool.pytest.ini_options]
575
markers = [
6-
"online: tests requiring internet access"
76+
"online: tests requiring internet access",
777
]
878
filterwarnings = [
9-
"error"
79+
"error",
1080
]

scripts/release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ git commit -m "Release $NEW_VERSION"
4141
git tag -s -m "Release $NEW_VERSION" "$NEW_VERSION"
4242
git push --follow-tags
4343

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

4747
authors=$(git shortlog -s "$OLD_VERSION".."$NEW_VERSION" | cut -c8- | paste -s -d, - | sed -e 's/,/, /g')

setup.py

Lines changed: 9 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -23,75 +23,21 @@
2323
Setup script for kas, a setup tool for bitbake based projects
2424
"""
2525

26-
from os import path
27-
from setuptools import setup, find_packages
26+
import sys
2827

29-
from kas import __version__
28+
from setuptools import setup
29+
30+
sys.path.append('.')
3031

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

34-
HERE = path.abspath(path.dirname(__file__))
35-
with open(path.join(HERE, 'README.rst')) as f:
36-
LONG_DESCRIPTION = f.read()
37-
38-
39-
setup(
40-
name='kas',
41-
version=__version__,
42-
43-
scripts=['kas-container'],
44-
45-
description='Setup tool for bitbake based projects',
46-
long_description=LONG_DESCRIPTION,
47-
48-
maintainer='Jan Kiszka',
49-
maintainer_email='[email protected]',
50-
51-
url='https://github.com/siemens/kas',
52-
download_url=('https://github.com/siemens/'
53-
f'kas/archive/{__version__}.tar.gz'),
5435

55-
license='MIT',
36+
def get_version():
37+
from kas import __version__
38+
return __version__
5639

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

61-
# Indicate who your project is intended for
62-
'Intended Audience :: Developers',
63-
'Topic :: Software Development :: Build Tools',
64-
65-
# Pick your license as you wish (should match "license" above)
66-
'License :: OSI Approved :: MIT License',
67-
68-
'Programming Language :: Python :: 3',
69-
'Programming Language :: Python :: 3.9',
70-
'Programming Language :: Python :: 3.10',
71-
'Programming Language :: Python :: 3.11',
72-
'Programming Language :: Python :: 3.12',
73-
'Programming Language :: Python :: 3.13',
74-
],
75-
keywords='OpenEmbedded bitbake development',
76-
77-
packages=find_packages(),
78-
79-
package_data={'kas': ['*.json']},
80-
81-
entry_points={
82-
'console_scripts': [
83-
'kas=kas.kas:main',
84-
],
85-
},
86-
87-
install_requires=[
88-
'PyYAML>=3.0,<7',
89-
'distro>=1.0.0,<2',
90-
'jsonschema>=2.5.0,<5',
91-
'kconfiglib>=14.1.0,<15',
92-
'GitPython>=3.1.0,<4'
93-
],
94-
95-
# At least python 3.9 is needed by now:
96-
python_requires='>=3.9',
41+
setup(
42+
version=get_version(),
9743
)

0 commit comments

Comments
 (0)