diff --git a/MAINTAINERS.rst b/MAINTAINERS.rst index a79fce1a..e8ef6e09 100644 --- a/MAINTAINERS.rst +++ b/MAINTAINERS.rst @@ -66,8 +66,8 @@ Pre-release test plan 7. Assuming that all went well (if it didn't, go fix it and repeat): - - update __version__ to 'X.Y.Z' (i.e. drop the 'aN' suffix that denotes - alpha N) + - update version in pyproject.toml to 'X.Y.Z' (i.e. drop the 'aN' suffix + that denotes alpha N) - tag the release on GitHub (see "Tagging the release" for a procedure) @@ -158,7 +158,7 @@ Summary of what happens: 3. In vX.Y-branch, in src/west/version.py, set __version__ to X.Y.0a1. Push this to origin/vX.Y-branch. You don't need a PR for this. -4. In the main branch, set __version__ to X.Y.99. +4. In the main branch, set version in pyproject.toml to X.Y.99. Push this to origin/main. You don't need a PR for this. 5. Create an annotated tag vX.Y.99 which points to the main branch commit you diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..03a2053c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,46 @@ +[build-system] +requires = ["setuptools>=61.2"] +build-backend = "setuptools.build_meta" + +[project] +name = "west" +version = "1.2.99" +authors = [{name = "Zephyr Project", email = "devel@lists.zephyrproject.org"}] +description = "Zephyr RTOS Project meta-tool" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: Apache Software License", + "Operating System :: POSIX :: Linux", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows", +] +requires-python = ">=3.8" +dependencies = [ + "colorama", + "PyYAML>=5.1", + "pykwalify", + "setuptools", + "packaging", +] + +[project.license] +file = "LICENSE" + +[project.readme] +file = "README.rst" +content-type = "text/x-rst" + +[project.urls] +Homepage = "https://github.com/zephyrproject-rtos/west" + +[project.scripts] +west = "west.app.main:main" + +[tool.setuptools] +package-dir = {"" = "src"} +zip-safe = false +include-package-data = true + +[tool.setuptools.packages.find] +where = ["src"] +namespaces = false diff --git a/setup.py b/setup.py deleted file mode 100644 index 1d68190d..00000000 --- a/setup.py +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2018 Open Source Foundries Limited. -# Copyright (c) 2020, Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 - -import os - -import setuptools - -SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) -os.chdir(SCRIPT_DIR) - -with open('README.rst', 'r') as f: - long_description = f.read() - -with open('src/west/version.py', 'r') as f: - __version__ = None - exec(f.read()) - assert __version__ is not None - -version = os.environ.get('WEST_VERSION', __version__) - -setuptools.setup( - name='west', - version=version, - author='Zephyr Project', - author_email='devel@lists.zephyrproject.org', - description='Zephyr RTOS Project meta-tool', - long_description=long_description, - # http://docutils.sourceforge.net/FAQ.html#what-s-the-official-mime-type-for-restructuredtext-data - long_description_content_type="text/x-rst", - url='https://github.com/zephyrproject-rtos/west', - packages=setuptools.find_packages(where='src'), - package_dir={'': 'src'}, - include_package_data=True, - classifiers=[ - 'Programming Language :: Python :: 3', - 'License :: OSI Approved :: Apache Software License', - 'Operating System :: POSIX :: Linux', - 'Operating System :: MacOS :: MacOS X', - 'Operating System :: Microsoft :: Windows', - ], - install_requires=[ - 'colorama', - 'PyYAML>=5.1', - 'pykwalify', - 'setuptools', - 'packaging', - ], - python_requires='>=3.8', - entry_points={'console_scripts': ('west = west.app.main:main',)}, - zip_safe=False -) diff --git a/src/west/version.py b/src/west/version.py index 4a167787..b6ddd081 100644 --- a/src/west/version.py +++ b/src/west/version.py @@ -5,7 +5,9 @@ # This is the Python 3 version of option 3 in: # https://packaging.python.org/guides/single-sourcing-package-version/#single-sourcing-the-version -__version__ = '1.2.99' +import importlib.metadata + +__version__ = importlib.metadata.version("west") # # MAINTAINERS: #