You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2023/08/07 04:56:19 UTC

[buildstream] branch tristan/release-versioning created (now 74fe9f41e)

This is an automated email from the ASF dual-hosted git repository.

tvb pushed a change to branch tristan/release-versioning
in repository https://gitbox.apache.org/repos/asf/buildstream.git


      at 74fe9f41e setup.py: Remove custom version handling logic.

This branch includes the following new commits:

     new 452865483 badges: Adapt to standard semver regarding badges
     new 74fe9f41e setup.py: Remove custom version handling logic.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[buildstream] 01/02: badges: Adapt to standard semver regarding badges

Posted by tv...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch tristan/release-versioning
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 4528654833433ee9b3aedeafb712496a32e26fcb
Author: Tristan van Berkom <tr...@codethink.co.uk>
AuthorDate: Mon Aug 7 13:09:44 2023 +0900

    badges: Adapt to standard semver regarding badges
    
    Now we respect standard semver when making releases, and the
    release badges include odd number minor points, while the snapshot
    badges are now removed.
---
 README.rst    |  3 ---
 doc/Makefile  |  6 ++----
 doc/badges.py | 31 +++++++------------------------
 3 files changed, 9 insertions(+), 31 deletions(-)

diff --git a/README.rst b/README.rst
index c342d73c0..41c113cab 100644
--- a/README.rst
+++ b/README.rst
@@ -17,9 +17,6 @@ About
 .. image:: https://docs.buildstream.build/master/_static/release.svg
    :target: https://docs.buildstream.build/master/_static/release.html
 
-.. image:: https://docs.buildstream.build/master/_static/snapshot.svg
-   :target: https://docs.buildstream.build/master/_static/snapshot.html
-
 .. image:: https://img.shields.io/github/workflow/status/apache/buildstream/Merge%20actions
    :alt: GitHub Workflow Status
    :target: https://github.com/apache/buildstream/actions/workflows/merge.yml
diff --git a/doc/Makefile b/doc/Makefile
index d71be8e55..afb7799c5 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -133,10 +133,8 @@ badges-clean:
 
 badges:
 	mkdir -p source/badges
-	$(CURDIR)/badges.py > source/badges/snapshot.svg
-	$(CURDIR)/badges.py --release > source/badges/release.svg
-	$(CURDIR)/badges.py --redirect > source/badges/snapshot.html
-	$(CURDIR)/badges.py --redirect --release > source/badges/release.html
+	$(CURDIR)/badges.py > source/badges/release.svg
+	$(CURDIR)/badges.py --redirect > source/badges/release.html
 
 
 ############################################################
diff --git a/doc/badges.py b/doc/badges.py
index e05268967..587aa81d8 100755
--- a/doc/badges.py
+++ b/doc/badges.py
@@ -65,8 +65,7 @@ BADGE_TEMPLATE = """
 """
 
 # The redirect template is for a static html page hosted in the
-# latest docs which always redirects you to the latest snapshot
-# or release on github.
+# latest docs which always redirects you to the latest release on github.
 #
 REDIRECT_TEMPLATE = """
 <!DOCTYPE html>
@@ -83,7 +82,6 @@ REDIRECT_TEMPLATE = """
 
 URL_FORMAT = 'https://github.com/apache/buildstream/releases/tag/{version}'
 RELEASE_COLOR = '#0040FF'
-SNAPSHOT_COLOR = '#FF8000'
 VERSION_TAG_MATCH = r'([0-9]*)\.([0-9]*)\.([0-9]*)'
 
 
@@ -107,7 +105,7 @@ def parse_tag(tag):
 # Call out to git and guess the latest version,
 # this will just return (0, 0, 0) in case of any error.
 #
-def guess_version(release):
+def guess_version():
     try:
         tags_output = subprocess.check_output(['git', 'tag'])
     except subprocess.CalledProcessError:
@@ -118,38 +116,23 @@ def guess_version(release):
     all_tags = tags_output.splitlines()
     all_versions = [parse_tag(tag) for tag in all_tags]
 
-    # Filter the list by the minor point version, if
-    # we are checking for the latest "release" version, then
-    # only pickup even number minor points.
-    #
-    filtered_versions = [
-        version for version in all_versions
-        if (version[1] % 2) == (not release)
-    ]
-
     # Make sure they are sorted, and take the last one
-    sorted_versions = sorted(filtered_versions)
+    sorted_versions = sorted(all_versions)
     latest_version = sorted_versions[-1]
 
     return latest_version
 
 
 @click.command(short_help="Generate the version badges")
-@click.option('--release', is_flag=True, default=False,
-              help="Whether to generate the badge for the release version")
 @click.option('--redirect', is_flag=True, default=False,
               help="Whether to generate the redirect html file")
-def generate_badges(release, redirect):
+def generate_badges(redirect):
     """Generate the version badge svg files
     """
-    major, minor, micro = guess_version(release)
+    major, minor, micro = guess_version()
 
-    if release:
-        badge_name = 'release'
-        color = RELEASE_COLOR
-    else:
-        badge_name = 'snapshot'
-        color = SNAPSHOT_COLOR
+    badge_name = 'release'
+    color = RELEASE_COLOR
 
     version = '{major}.{minor}.{micro}'.format(major=major, minor=minor, micro=micro)
     url_target = URL_FORMAT.format(version=version)


[buildstream] 02/02: setup.py: Remove custom version handling logic.

Posted by tv...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch tristan/release-versioning
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 74fe9f41e2f92dc75a145c31be95900d5be479b1
Author: Tristan van Berkom <tr...@codethink.co.uk>
AuthorDate: Mon Aug 7 13:49:18 2023 +0900

    setup.py: Remove custom version handling logic.
    
    This was actually already disabled when updating to newer versioneer
    in commit feb494093cbdcf29def02074ec707404d112235a, but is now further
    obsoleted because BuildStream is now dropping the GNOME style version
    notation and now follows semver more strictly.
---
 setup.py | 38 --------------------------------------
 1 file changed, 38 deletions(-)

diff --git a/setup.py b/setup.py
index 017b046f3..646134976 100755
--- a/setup.py
+++ b/setup.py
@@ -32,44 +32,6 @@ import packaging.version
 sys.path.append(os.path.dirname(__file__))
 import versioneer  # pylint: disable=wrong-import-position
 
-
-def mark_unstable_version(version_string):
-    # When publishing to PyPI we must be sure that unstable releases are
-    # marked as such, so `pip install` doesn't install them by default.
-
-    v = packaging.version.parse(version_string)
-
-    # BuildStream version scheme: if MINOR version is odd, then
-    # this is an unstable release.
-    is_unstable_release = v.minor % 2 != 0
-
-    # Python PEP440 version scheme: use an explicit postfix to mark development
-    # and prereleases.
-    if is_unstable_release:
-        if v.local or v.is_devrelease or v.is_prerelease:
-            # PyPI will ignore these without us marking them.
-            return version_string
-        else:
-            return version_string + ".dev0"
-
-    return version_string
-
-
-# Extend versioneer to support our custom version style.
-_render = versioneer.render
-
-
-def render_version(pieces, style):
-    if style == "pep440_buildstream":
-        result = _render(pieces, "pep440")
-        result["version"] = mark_unstable_version(result["version"])
-    else:
-        result = _render(pieces, style)
-    return result
-
-
-versioneer.render = render_version
-
 version = versioneer.get_version()
 
 if version.startswith("0+untagged"):