diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..a9b020f5 --- /dev/null +++ b/MANIFEST.in @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 86daa0ad..2a395c44 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = "jan.kiszka@siemens.com" }, +] +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", ] diff --git a/scripts/release.sh b/scripts/release.sh index 20708ba2..de60063a 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -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') diff --git a/setup.py b/setup.py index 0639b7e6..8052e58b 100644 --- a/setup.py +++ b/setup.py @@ -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='jan.kiszka@siemens.com', - - 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(), )