Sync from SUSE:SLFO:Main python-releases revision afe20d25261968a34f4f684592b4e83d

This commit is contained in:
Adrian Schröter 2024-05-03 22:47:29 +02:00
commit 1ef8c91feb
7 changed files with 411 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

149
python-releases.changes Normal file
View File

@ -0,0 +1,149 @@
-------------------------------------------------------------------
Fri May 12 08:15:25 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>
- Delete migrate-to-pytest.patch
- Delete remove-mock.patch
- Add remove-icecream.patch
- Update to 2.1.1:
* [Bug]: Fix up an internal utility which monkeypatches a
Sphinx/docutils internal, so that it accepts arbitrary args/kwargs
instead of exploding on newer Sphinxes.
- 2.0.1:
* [Bug]: Fix up an internal utility which monkeypatches a
Sphinx/docutils internal, so that it accepts arbitrary args/kwargs
instead of exploding on newer Sphinxes.
- 2.1.0:
* [Feature]: Allow controlling the name of your development branch
for source code links (eg “Next 1.x feature release” section
headers) via the new releases_development_branch config option.
* [Feature]: Add a new configuration setting,
releases_supported_versions, allowing you to limit how many “Next
1.x feature release” (or bugfix, etc) sections appear at the top
of your changelog.
- 2.0.0:
* [Bug]: Dont make tmpdirs in releases.util.make_app when being
given explicit directory args.
* [Bug]: Changelog transformation sometimes failed to occur when
running under a single HTML file Sphinx builder (eg singlehtml),
which resulted in unknown node errors. This has been fixed.
* [Support]: Migrated the test suite to use pytest-relaxed (and thus
pytest) instead of spec.
* [Support]: Dropped support for Sphinx <4. We tried to support
1.8+, but too many transitive dependencies have clearly “moved on”
and cause various cells in the test matrix to fail hard.
* [Support]: Dropped support for Python 2.7, Python 3.4, and Python
3.5, to align slightly better with upstream (and ecosystem) EOLs.
* [Support]: The releases_release_uri/releases_issue_uri settings
now allow modern (.format/f-strings) string formatting, in
addition to the old %s-based interpolation.
* [Support]: Administrivia overhaul: enhanced README, packaging
metadata cleaned up/expanded, CI moved to Circle-CI, renamed dev
branch to main, and more besides.
-------------------------------------------------------------------
Fri Apr 21 12:32:52 UTC 2023 - Dirk Müller <dmueller@suse.com>
- add sle15_python_module_pythons (jsc#PED-68)
-------------------------------------------------------------------
Thu Apr 13 22:44:27 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Make calling of %{sle15modernpython} optional.
-------------------------------------------------------------------
Tue Apr 12 02:32:28 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch remove-mock.patch:
* Use stdlib mock, not external mock.
- Drop mock BuildRequires.
-------------------------------------------------------------------
Tue Dec 14 00:08:20 UTC 2021 - Ben Greiner <code@bnavigator.de>
- refresh migrate-to-pytest.patch: remove pytest-relaxed
-------------------------------------------------------------------
Mon Sep 13 06:17:58 UTC 2021 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch migrate-to-pytest.patch:
* Migrate to pytest, lightly rebased from upstream.
-------------------------------------------------------------------
Mon May 25 21:27:01 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- Restore semanticversioning.patch to allow semantic_version >= 2.7
gh#bitprophet/releases#84
gh#bitprophet/releases#86
- remove color printout in tests
-------------------------------------------------------------------
Wed Mar 18 09:08:49 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 1.6.3:
- :support:`87 backported` (via :issue:`88`) Our upper Sphinx version limit was
mostly defensive and at this point is just too old to even build on
ReadTheDocs successfully. Removed it for the time being. Thanks to José
Sánchez-Gallego for the nudge and the patch.
- :support:`84 backported` Pin us to ``semantic-version<2.7`` as they changed
their APIs (...) in that version in a way that breaks us. We do not need
anything they've added recently, so the conservative response is to just pin
until we truly need to upgrade. Thanks to everyone who reported and submitted
workarounds for this.
- Drop merged patch semanticversioning.patch
-------------------------------------------------------------------
Tue Sep 17 10:11:28 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Do not generate test subpackage
-------------------------------------------------------------------
Thu Sep 12 17:30:04 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Add patch to fix build with new semantic versioning:
* semanticversioning.patch
-------------------------------------------------------------------
Wed Aug 29 08:28:17 UTC 2018 - tchvatal@suse.com
- Move the Name definition above lua code to work on 42.3
-------------------------------------------------------------------
Sat Aug 11 14:43:12 UTC 2018 - tchvatal@suse.com
- Enable testsuite in multibuild mode as it creates cycle otherwise
-------------------------------------------------------------------
Sat Aug 11 09:50:05 UTC 2018 - tchvatal@suse.com
- Update to 1.6.1:
* Support sphinx 1.7
-------------------------------------------------------------------
Fri May 18 14:29:58 UTC 2018 - toddrme2178@gmail.com
- Update to 1.5.0
* Allow multiple changelog files -- releases_document_name
may now optionally be a list of strings instead of a single string.
- Update to 1.4.2
* We never pulled our README into our setup.py metadata,
resulting in a rather sparse PyPI page! This has been fixed.
- Update to 1.4.1
* Sphinx 1.7.x changed some semi-public APIs; given this is the
second minor release in a row to do so, we're explicitly bracketing our
``setup.py`` dependencies to Sphinx >= 1.3 and < 1.7. We expect to bump this
up one minor release at a time as we add compatibility back in.
- Update to 1.4.0
* Drop Python 2.6 and 3.3 support, to correspond with earlier
changes in Sphinx and most other public Python projects.
* Identified a handful of issues with our Sphinx pin &
subsequently, internal changes in Sphinx 1.6 which broke (and/or appear to
break, such as noisy warnings) our own behavior. These have (hopefully) all
been fixed.
- Update to 1.3.2
* Update packaging requirements to allow for
sphinx>=1.3,<2.
-------------------------------------------------------------------
Thu Oct 19 01:08:46 UTC 2017 - toddrme2178@gmail.com
- Initial version

96
python-releases.spec Normal file
View File

@ -0,0 +1,96 @@
#
# spec file
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -%{flavor}
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%{?sle15_python_module_pythons}
Name: python-releases%{psuffix}
Version: 2.1.1
Release: 0
Summary: A Sphinx extension for changelog manipulation
License: BSD-2-Clause
URL: https://github.com/bitprophet/releases
Source: https://files.pythonhosted.org/packages/source/r/releases/releases-%{version}.tar.gz
Patch0: semanticversioning.patch
# PATCH-FIX-OPENSUSE remove-icecream.patch to remove icecream dependency
Patch1: remove-icecream.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-Sphinx >= 4
Requires: python-semantic_version
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module Sphinx >= 3}
BuildRequires: %{python_module invocations}
BuildRequires: %{python_module invoke}
BuildRequires: %{python_module pytest-relaxed}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module semantic_version}
%endif
%python_subpackages
%description
Releases is a Python 2+3 compatible `Sphinx <http://sphinx-doc.org>`_ extension
designed to help you keep a source control friendly, merge friendly changelog
file & turn it into useful, human readable HTML output.
Specifically:
* The source format (kept in your Sphinx tree as ``changelog.rst``) is a
stream-like timeline that plays well with source control & only requires one
entry per change (even for changes that exist in multiple release lines).
* The output (when you have the extension installed and run your Sphinx build
command) is a traditional looking changelog page with a section for every
release; multi-release issues are copied automatically into each release.
* By default, feature and support issues are only displayed under feature
releases, and bugs are only displayed under bugfix releases. This can be
overridden on a per-issue basis.
%prep
%autosetup -p1 -n releases-%{version}
%build
%python_build
%install
%if !%{with test}
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%if %{with test}
%check
%pytest tests
%endif
%if !%{with test}
%files %{python_files}
%doc README.rst
%license LICENSE
%{python_sitelib}/releases
%{python_sitelib}/releases-%{version}*-info
%endif
%changelog

BIN
releases-2.1.1.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

10
remove-icecream.patch Normal file
View File

@ -0,0 +1,10 @@
Index: releases-2.1.1/tests/conftest.py
===================================================================
--- releases-2.1.1.orig/tests/conftest.py
+++ releases-2.1.1/tests/conftest.py
@@ -1,5 +0,0 @@
-from icecream import ic, install as install_ic
-
-
-install_ic()
-ic.configureOutput(includeContext=True)

127
semanticversioning.patch Normal file
View File

@ -0,0 +1,127 @@
From 8787236dffb7383427b3e1448ece9a5b3eaf5257 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rapha=C3=ABl=20Barrois?= <raphael.barrois@polytechnique.org>
Date: Sun, 8 Sep 2019 00:18:00 +0200
Subject: [PATCH] Fix usage of semanticversion to intended API.
The recent versions of python-semanticversion made changes to private
APIs, removing the interaction between `Version(x, partial=True)` and
`Spec()` (`partial=True` was designed for implementing the `Spec` class
only)
The code used these classes to exclude ranges of version whose major
component didn't match a bugfix/issue range; the code went akin to:
Version('1', partial=True) in Spec('>=1.0')
This no longer works; this patch changes that behaviour to exclude
families where no actual release matches the bugfix/issue range - this
should be more accurate.
The patch also uses `Version.coerce`, the intended API to manage
non semver-compliant version strings.
The patch has been tested with both python-semanticversion==2.6.0 and
python-semanticversion==2.8.1; it can be included to an upgraded version
of `releases` even if users haven't yet upgraded python-semanticversion.
---
releases/__init__.py | 2 +-
releases/models.py | 54 ++++++++++++++++++++++++--------------------
2 files changed, 30 insertions(+), 26 deletions(-)
Index: releases-2.1.1/releases/__init__.py
===================================================================
--- releases-2.1.1.orig/releases/__init__.py
+++ releases-2.1.1/releases/__init__.py
@@ -425,7 +425,7 @@ def handle_upcoming_major_release(entrie
# to the line manager!
for obj in next_releases:
# TODO: update when Release gets tied closer w/ Version
- version = Version(obj.number)
+ version = Version.coerce(obj.number)
if version.minor == 0 and version.patch == 0:
manager.add_family(obj.family)
Index: releases-2.1.1/releases/models.py
===================================================================
--- releases-2.1.1.orig/releases/models.py
+++ releases-2.1.1/releases/models.py
@@ -2,16 +2,7 @@ from functools import reduce
from operator import xor
from docutils import nodes
-from semantic_version import Version as StrictVersion, Spec
-
-
-class Version(StrictVersion):
- """
- Version subclass toggling ``partial=True`` by default.
- """
-
- def __init__(self, version_string, partial=True):
- super().__init__(version_string, partial)
+from semantic_version import Version, Spec
# Issue type list (keys) + color values
@@ -119,7 +110,7 @@ class Issue(nodes.Element):
buckets = self.minor_releases(manager)
if buckets:
specstr = ">={}".format(max(buckets))
- return Spec(specstr) if specstr else Spec()
+ return Spec(specstr) if specstr else Spec('*')
def add_to_manager(self, manager):
"""
@@ -127,27 +118,37 @@ class Issue(nodes.Element):
"""
# Derive version spec allowing us to filter against major/minor buckets
spec = self.spec or self.default_spec(manager)
- # Only look in appropriate major version/family; if self is an issue
- # declared as living in e.g. >=2, this means we don't even bother
- # looking in the 1.x family.
- families = [Version(str(x)) for x in manager]
- versions = list(spec.filter(families))
- for version in versions:
- family = version.major
- # Within each family, we further limit which bugfix lines match up
- # to what self cares about (ignoring 'unreleased' until later)
- candidates = [
- Version(x)
+
+ # Browse through families, adding us to every line we match.
+ for family in manager:
+ # Map changelog keys to Version objects, keeping a link
+ # to the original text
+ versions = {
+ Version.coerce(x): x
for x in manager[family]
if not x.startswith("unreleased")
- ]
- # Select matching release lines (& stringify)
+ }
+
+ # Bail out if no listed version (included pending feature/bugfix)
+ # match self.spec: if self is an issue for >=2, don't look
+ # at the 1.x family. If self is an issue for >=1.0, include it
+ # in the 1.x family even if no 1.0 release exists yet.
+ candidates = list(spec.filter(versions))
+ # Also compare the first release in the family, for cases
+ # where no release has been performed yet.
+ if not candidates and Version.coerce(str(family)) not in spec:
+ continue
+
+ # `buckets` has the list of line families
buckets = []
- bugfix_buckets = [str(x) for x in spec.filter(candidates)]
+ bugfix_buckets = candidates
# Add back in unreleased_* as appropriate
# TODO: probably leverage Issue subclasses for this eventually?
if self.is_buglike:
- buckets.extend(bugfix_buckets)
+ # Convert back Version() to line
+ buckets.extend([
+ versions[bucket] for bucket in bugfix_buckets
+ ])
# Don't put into JUST unreleased_bugfix; it implies that this
# major release/family hasn't actually seen any releases yet
# and only exists for features to go into.