Skip to content

Commit

Permalink
Expose current and released versions in metadata script
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeldycke committed Jan 6, 2024
1 parent 13d889d commit 4c1b0f9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@
blacken_docs_params=--target-version py37 --target-version py38
ruff_py_version=py37
mypy_params=--python-version 3.7
current_version=2.0.1
released_version=2.0.0
is_sphinx=true
active_autodoc=true
release_notes=[🐍 Available on PyPi](https://pypi.org/project/click-extra/2.21.3).
new_commits_matrix={'commit': ['346ce664f055fbd042a25ee0b7e96702e95',
'6f27db47612aaee06fdf08744b09a9f5f6c2'],
'include': [{'commit': '346ce664f055fbd042a25ee0b7e96702e95',
'short_sha': '346ce66',
'current_version': '1.2.3'},
'current_version': '2.0.1'},
{'commit': '6f27db47612aaee06fdf08744b09a9f5f6c2',
'short_sha': '6f27db4',
'current_version': '2.0.0'}]}
Expand Down Expand Up @@ -174,7 +176,7 @@ def commit_matrix(commits: Iterable[Commit] | None) -> TMatrix | None:
"""Pre-compute a matrix of commits.
The list of commits is augmented with long and short SHA values, as well as
current version.
current version. Most recent commit is first, oldest is last.
Returns a ready-to-use matrix structure:
Expand All @@ -188,7 +190,7 @@ def commit_matrix(commits: Iterable[Commit] | None) -> TMatrix | None:
{
"commit": "346ce664f055fbd042a25ee0b7e96702e95",
"short_sha": "346ce66",
"current_version": "1.2.3",
"current_version": "2.0.1",
},
{
"commit": "6f27db47612aaee06fdf08744b09a9f5f6c2",
Expand Down Expand Up @@ -516,7 +518,10 @@ def get_current_version() -> str:

@cached_property
def current_version(self) -> str | None:
"""Returns the current version."""
"""Returns the current version.
I.e. the version of the most recent commit.
"""
version = None
if self.new_commits_matrix:
details = self.new_commits_matrix.get("include")
Expand Down Expand Up @@ -897,6 +902,8 @@ def save_metadata(self) -> None:
"blacken_docs_params": (self.blacken_docs_params, False),
"ruff_py_version": (self.ruff_py_version, False),
"mypy_params": (self.mypy_params, False),
"current_version": (self.current_version, False),
"released_version": (self.released_version, False),
"is_sphinx": (self.is_sphinx, False),
"active_autodoc": (self.active_autodoc, False),
"release_notes": (self.release_notes, False),
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
This version is not released yet and is under active development.
```

- Expose current and released version in metadata script.
- Fix fetching of changelog entry for release notes.

## [2.24.0 (2024-01-06)](https://github.com/kdeldycke/workflows/compare/v2.23.0...v2.24.0)
Expand Down

0 comments on commit 4c1b0f9

Please sign in to comment.