Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project: Switch to pyproject #715

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 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,12 +88,15 @@ 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
pip3 install --upgrade build twine
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not a fan of using the "random version of the day" but these instructions seem to work now and this file is only for MAINTAINERS who are supposed to know what they're doing.

pyproject-build
twine upload -u zephyr-project dist/*

The 'git clean' step is important. We've anecdotally observed broken wheels
being generated from dirty repositories.

Check out [packaging.python.org](https://packaging.python.org/en/latest/tutorials/packaging-projects/#generating-distribution-archives) for more detailed instructions.

Tagging the release
-------------------

Expand Down Expand Up @@ -158,7 +161,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
Loading