Skip to content

Commit

Permalink
project: Switch to pyproject
Browse files Browse the repository at this point in the history
Starting with PEP 621, `pyproject.toml` is the standard way of
specifying project metadata.

Also switch to using the version from `pyproject.toml` instead of having
a west.version python module. Adjust documentation for the same.

Update MAINTAINERS.rst to use build for dist building.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
  • Loading branch information
Ayush1325 committed Aug 30, 2024
1 parent 45762a0 commit 4e0e058
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 58 deletions.
9 changes: 5 additions & 4 deletions MAINTAINERS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -88,7 +88,8 @@ Building and uploading the release wheels
You need the zephyr-project PyPI credentials for the 'twine upload' command. ::

git clean -ffdx
python3 setup.py sdist bdist_wheel
python3 -m pip install --upgrade build twine
python3 -m build
twine upload -u zephyr-project dist/*

The 'git clean' step is important. We've anecdotally observed broken wheels
Expand Down Expand Up @@ -158,7 +159,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
Expand Down
46 changes: 46 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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
53 changes: 0 additions & 53 deletions setup.py

This file was deleted.

4 changes: 3 additions & 1 deletion src/west/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
#
Expand Down

0 comments on commit 4e0e058

Please sign in to comment.