Resolves: #1946984 - Update modulemd-tools to 0.8-1
Source: https://src.fedoraproject.org/rpms/modulemd-tools.git#370d42f8618456ce760223efc0ed2c2d842103d3
This commit is contained in:
parent
5534461d8a
commit
b0ea222e56
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,3 +4,5 @@
|
|||||||
/modulemd-tools-0.4.tar.gz
|
/modulemd-tools-0.4.tar.gz
|
||||||
/modulemd-tools-0.5.tar.gz
|
/modulemd-tools-0.5.tar.gz
|
||||||
/modulemd-tools-0.6.tar.gz
|
/modulemd-tools-0.6.tar.gz
|
||||||
|
/modulemd-tools-0.7.tar.gz
|
||||||
|
/modulemd-tools-0.8.tar.gz
|
||||||
|
@ -1,130 +0,0 @@
|
|||||||
From 07847343ebab93d6a5b5f5311ed50f8525d43594 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jakub Kadlcik <frostyx@email.cz>
|
|
||||||
Date: Wed, 13 Jan 2021 01:37:35 +0100
|
|
||||||
Subject: [PATCH 1/2] modulemd_tools: quote stream fields in test suite
|
|
||||||
|
|
||||||
Somewhere between `python3-libmodulemd-2.11.1` and `python3-libmodulemd-2.9.3`
|
|
||||||
the `Modulemd.ModuleStream.read_string` or `Modulemd.ModuleStream.upgrade`
|
|
||||||
output changed and is now quoted, which breaks our tests:
|
|
||||||
|
|
||||||
- stream: "devel"
|
|
||||||
? - -
|
|
||||||
+ stream: devel
|
|
||||||
|
|
||||||
I can see those functions are deprecated now, so we will migrate to something
|
|
||||||
newer soon. This is just a temporary fix.
|
|
||||||
---
|
|
||||||
modulemd_tools/tests/test_yaml.py | 16 ++++++++--------
|
|
||||||
1 file changed, 8 insertions(+), 8 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/modulemd_tools/tests/test_yaml.py b/modulemd_tools/tests/test_yaml.py
|
|
||||||
index 551b97d876d2e439a70492f5dec65622b8258880..ed5520cc86ded2e67994aa79ef8eeace9e7432ae 100644
|
|
||||||
--- a/modulemd_tools/tests/test_yaml.py
|
|
||||||
+++ b/modulemd_tools/tests/test_yaml.py
|
|
||||||
@@ -380,11 +380,11 @@ class TestYaml(unittest.TestCase):
|
|
||||||
yaml1 = """---
|
|
||||||
document: modulemd
|
|
||||||
version: 2
|
|
||||||
data:
|
|
||||||
name: foo
|
|
||||||
- stream: devel
|
|
||||||
+ stream: "devel"
|
|
||||||
version: 123
|
|
||||||
context: f32
|
|
||||||
summary: Summary and stuff
|
|
||||||
description: >-
|
|
||||||
This module has been generated using dir2module tool
|
|
||||||
@@ -413,11 +413,11 @@ data:
|
|
||||||
yaml2_invalid = """
|
|
||||||
---
|
|
||||||
document: modulemd
|
|
||||||
version: 2
|
|
||||||
data:
|
|
||||||
- stream: devel
|
|
||||||
+ stream: "devel"
|
|
||||||
version: 123
|
|
||||||
context: f32
|
|
||||||
summary: Summary and stuff
|
|
||||||
description: >-
|
|
||||||
This module has been generated using dir2module tool
|
|
||||||
@@ -444,11 +444,11 @@ yaml3_no_deps = """
|
|
||||||
---
|
|
||||||
document: modulemd
|
|
||||||
version: 2
|
|
||||||
data:
|
|
||||||
name: foo
|
|
||||||
- stream: devel
|
|
||||||
+ stream: "devel"
|
|
||||||
version: 123
|
|
||||||
context: f32
|
|
||||||
summary: Summary and stuff
|
|
||||||
description: >-
|
|
||||||
This module has been generated using dir2module tool
|
|
||||||
@@ -514,11 +514,11 @@ yaml5_multiple_streams = """
|
|
||||||
---
|
|
||||||
document: modulemd
|
|
||||||
version: 2
|
|
||||||
data:
|
|
||||||
name: foo
|
|
||||||
- stream: master
|
|
||||||
+ stream: "master"
|
|
||||||
version: 1
|
|
||||||
summary: A test module in all its beautiful beauty
|
|
||||||
description: >-
|
|
||||||
Some description
|
|
||||||
license:
|
|
||||||
@@ -528,11 +528,11 @@ data:
|
|
||||||
---
|
|
||||||
document: modulemd
|
|
||||||
version: 2
|
|
||||||
data:
|
|
||||||
name: foo
|
|
||||||
- stream: stable
|
|
||||||
+ stream: "stable"
|
|
||||||
version: 123
|
|
||||||
context: f32
|
|
||||||
summary: Summary and stuff
|
|
||||||
description: >-
|
|
||||||
This module has been generated using dir2module tool
|
|
||||||
@@ -548,11 +548,11 @@ yaml5_multiple_modules = """
|
|
||||||
---
|
|
||||||
document: modulemd
|
|
||||||
version: 2
|
|
||||||
data:
|
|
||||||
name: foo
|
|
||||||
- stream: master
|
|
||||||
+ stream: "master"
|
|
||||||
version: 1
|
|
||||||
summary: A test module in all its beautiful beauty
|
|
||||||
description: >-
|
|
||||||
Some description
|
|
||||||
license:
|
|
||||||
@@ -562,11 +562,11 @@ data:
|
|
||||||
---
|
|
||||||
document: modulemd
|
|
||||||
version: 2
|
|
||||||
data:
|
|
||||||
name: bar
|
|
||||||
- stream: stable
|
|
||||||
+ stream: "stable"
|
|
||||||
version: 123
|
|
||||||
context: f32
|
|
||||||
summary: Summary and stuff
|
|
||||||
description: >-
|
|
||||||
This module has been generated using dir2module tool
|
|
||||||
@@ -582,11 +582,11 @@ yaml6_multiple_pairs_of_deps = """
|
|
||||||
---
|
|
||||||
document: modulemd
|
|
||||||
version: 2
|
|
||||||
data:
|
|
||||||
name: foo
|
|
||||||
- stream: master
|
|
||||||
+ stream: "master"
|
|
||||||
version: 1
|
|
||||||
summary: A test module in all its beautiful beauty
|
|
||||||
description: >-
|
|
||||||
Some description
|
|
||||||
license:
|
|
||||||
--
|
|
||||||
2.29.2
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
|||||||
From b6557cd10bdae6a839c56ef455020e82eb0e5988 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jakub Kadlcik <frostyx@email.cz>
|
|
||||||
Date: Wed, 13 Jan 2021 15:06:16 +0100
|
|
||||||
Subject: [PATCH 2/2] modulemd_tools: temporarily skip some tests on EPEL8
|
|
||||||
|
|
||||||
---
|
|
||||||
modulemd_tools/tests/test_yaml.py | 18 ++++++++++++++++++
|
|
||||||
1 file changed, 18 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/modulemd_tools/tests/test_yaml.py b/modulemd_tools/tests/test_yaml.py
|
|
||||||
index ed5520cc86ded2e67994aa79ef8eeace9e7432ae..b079f65304cadb229fc475d8314f2c6233a7137a 100644
|
|
||||||
--- a/modulemd_tools/tests/test_yaml.py
|
|
||||||
+++ b/modulemd_tools/tests/test_yaml.py
|
|
||||||
@@ -1,13 +1,29 @@
|
|
||||||
import os
|
|
||||||
import unittest
|
|
||||||
from unittest import mock
|
|
||||||
from parameterized import parameterized
|
|
||||||
import yaml
|
|
||||||
+from distutils.version import LooseVersion
|
|
||||||
from modulemd_tools.yaml import (is_valid, validate, create, update, dump,
|
|
||||||
upgrade, _yaml2stream, _stream2yaml)
|
|
||||||
|
|
||||||
+import gi
|
|
||||||
+gi.require_version("Modulemd", "2.0")
|
|
||||||
+from gi.repository import Modulemd
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+def old_libmodulemd():
|
|
||||||
+ """
|
|
||||||
+ Reading YAML string via `Modulemd.ModuleStream.read_string` and dumping it
|
|
||||||
+ again encapsulates its value in double-quotes, and it messes up with some of
|
|
||||||
+ our tests (since the older version does exactly the opposite). Let's just
|
|
||||||
+ skip those few test on EPEL8 until it receives an update.
|
|
||||||
+ See also `080e2bb`
|
|
||||||
+ """
|
|
||||||
+ return LooseVersion(Modulemd.get_version()) < LooseVersion("2.11.1")
|
|
||||||
+
|
|
||||||
|
|
||||||
class TestYaml(unittest.TestCase):
|
|
||||||
|
|
||||||
def test_is_valid(self):
|
|
||||||
self.assertTrue(is_valid(yaml1))
|
|
||||||
@@ -298,10 +314,11 @@ class TestYaml(unittest.TestCase):
|
|
||||||
self.assertEqual(mod_stream.get_mdversion(), 2)
|
|
||||||
self.assertEqual(mod_stream.get_module_name(), "")
|
|
||||||
self.assertEqual(mod_stream.get_summary(),
|
|
||||||
"A test module in all its beautiful beauty")
|
|
||||||
|
|
||||||
+ @unittest.skipIf(old_libmodulemd(), "Old modulemd drops stream value quotes")
|
|
||||||
def test_upgrade_to_same_version(self):
|
|
||||||
result = upgrade(yaml1, 2)
|
|
||||||
self.assertEqual(result, yaml1)
|
|
||||||
|
|
||||||
def test_upgrade_cannot_downgrade(self):
|
|
||||||
@@ -364,10 +381,11 @@ class TestYaml(unittest.TestCase):
|
|
||||||
with self.assertRaises(ValueError) as context:
|
|
||||||
_yaml2stream(yaml5_multiple_modules)
|
|
||||||
self.assertIn("YAML contained more than a single subdocument",
|
|
||||||
str(context.exception))
|
|
||||||
|
|
||||||
+ @unittest.skipIf(old_libmodulemd(), "Old modulemd drops stream value quotes")
|
|
||||||
def test_stream2yaml(self):
|
|
||||||
mod_stream = _yaml2stream(yaml1)
|
|
||||||
self.assertEqual(_stream2yaml(mod_stream), yaml1)
|
|
||||||
|
|
||||||
mod_stream.set_summary(None)
|
|
||||||
--
|
|
||||||
2.29.2
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
Name: modulemd-tools
|
Name: modulemd-tools
|
||||||
Version: 0.6
|
Version: 0.8
|
||||||
Release: 3%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: Collection of tools for parsing and generating modulemd YAML files
|
Summary: Collection of tools for parsing and generating modulemd YAML files
|
||||||
License: MIT
|
License: MIT
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
@ -12,34 +12,24 @@ BuildRequires: createrepo_c
|
|||||||
BuildRequires: argparse-manpage
|
BuildRequires: argparse-manpage
|
||||||
BuildRequires: python3-devel
|
BuildRequires: python3-devel
|
||||||
BuildRequires: python3-setuptools
|
BuildRequires: python3-setuptools
|
||||||
BuildRequires: python3-gobject-base
|
|
||||||
BuildRequires: python3-libmodulemd >= 2.9.3
|
BuildRequires: python3-libmodulemd >= 2.9.3
|
||||||
BuildRequires: python3-click
|
BuildRequires: python3-click
|
||||||
%if ! 0%{?rhel}
|
|
||||||
BuildRequires: python3-click-man
|
BuildRequires: python3-click-man
|
||||||
%endif
|
|
||||||
BuildRequires: python3-dnf
|
BuildRequires: python3-dnf
|
||||||
BuildRequires: python3-hawkey
|
BuildRequires: python3-hawkey
|
||||||
BuildRequires: python3-createrepo_c
|
BuildRequires: python3-createrepo_c
|
||||||
BuildRequires: python3-pyyaml
|
BuildRequires: python3-pyyaml
|
||||||
BuildRequires: python3-parameterized
|
BuildRequires: python3-pytest
|
||||||
|
|
||||||
Requires: libmodulemd >= 2
|
|
||||||
Requires: createrepo_c
|
Requires: createrepo_c
|
||||||
Requires: python3-click
|
Requires: python3-click
|
||||||
Requires: python3-dnf
|
Requires: python3-dnf
|
||||||
Requires: python3-hawkey
|
Requires: python3-hawkey
|
||||||
Requires: python3-createrepo_c
|
Requires: python3-createrepo_c
|
||||||
Requires: python3-pyyaml
|
Requires: python3-pyyaml
|
||||||
Requires: python3-gobject-base
|
|
||||||
Requires: python3-libmodulemd >= 2.9.3
|
Requires: python3-libmodulemd >= 2.9.3
|
||||||
|
|
||||||
|
|
||||||
# Upstream patches to fix compilation against libmodulemd 2.12
|
|
||||||
Patch0001: 0001-modulemd_tools-quote-stream-fields-in-test-suite.patch
|
|
||||||
Patch0002: 0002-modulemd_tools-temporarily-skip-some-tests-on-EPEL8.patch
|
|
||||||
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Tools provided by this package:
|
Tools provided by this package:
|
||||||
|
|
||||||
@ -63,7 +53,7 @@ modulemd-generate-macros - Generate module-build-macros SRPM package, which is
|
|||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p1
|
%setup -q
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
@ -71,11 +61,23 @@ cd repo2module
|
|||||||
%py3_build
|
%py3_build
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# There is a missing python3-click-man package for EPEL8 and therefore we cannot
|
cd dir2module
|
||||||
# generate the manpages on the fly. They are temporarily commited into git repo.
|
%py3_build
|
||||||
# Once RHBZ 1900423 gets resolved, just uncomment the following line. Please see
|
cd ..
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1900423
|
|
||||||
# PYTHONPATH=./modulemd_tools ./man/generate-manpages.sh
|
cd createrepo_mod
|
||||||
|
%py3_build
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd modulemd-merge
|
||||||
|
%py3_build
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd modulemd_tools
|
||||||
|
%py3_build
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
PYTHONPATH=./modulemd_tools ./man/generate-manpages.sh
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
@ -83,22 +85,51 @@ cd repo2module
|
|||||||
%py3_install
|
%py3_install
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
cp dir2module/dir2module.py %{buildroot}%{_bindir}/dir2module
|
cd dir2module
|
||||||
cp createrepo_mod/createrepo_mod.py %{buildroot}%{_bindir}/createrepo_mod
|
%py3_install
|
||||||
cp modulemd-merge/modulemd-merge.py %{buildroot}%{_bindir}/modulemd-merge
|
cd ..
|
||||||
|
|
||||||
|
cd createrepo_mod
|
||||||
|
%py3_install
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd modulemd-merge
|
||||||
|
%py3_install
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd modulemd_tools
|
||||||
|
%py3_install
|
||||||
|
cd ..
|
||||||
|
|
||||||
cp modulemd-generate-macros/modulemd-generate-macros.py \
|
cp modulemd-generate-macros/modulemd-generate-macros.py \
|
||||||
%{buildroot}%{_bindir}/modulemd-generate-macros
|
%{buildroot}%{_bindir}/modulemd-generate-macros
|
||||||
|
|
||||||
cp -r modulemd_tools/modulemd_tools %{buildroot}%{python3_sitelib}/modulemd_tools
|
|
||||||
|
|
||||||
install -d %{buildroot}%{_mandir}/man1
|
install -d %{buildroot}%{_mandir}/man1
|
||||||
cp man/*.1 %{buildroot}%{_mandir}/man1/
|
cp man/*.1 %{buildroot}%{_mandir}/man1/
|
||||||
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
%{python3} repo2module/setup.py test
|
export PATH={buildroot}%{_bindir}:$PATH
|
||||||
|
|
||||||
|
cd repo2module
|
||||||
|
%{python3} -m pytest -vv
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd dir2module
|
||||||
|
%{python3} -m pytest -vv
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd createrepo_mod
|
||||||
|
%{python3} -m pytest -vv
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd modulemd-merge
|
||||||
|
%{python3} -m pytest -vv -s
|
||||||
|
cd ..
|
||||||
|
|
||||||
cd modulemd_tools
|
cd modulemd_tools
|
||||||
%{python3} -m unittest
|
%{python3} -m pytest -vv
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
@ -106,12 +137,19 @@ cd modulemd_tools
|
|||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{python3_sitelib}/repo2module
|
%{python3_sitelib}/repo2module
|
||||||
%{python3_sitelib}/repo2module-*.egg-info/
|
%{python3_sitelib}/repo2module-*.egg-info/
|
||||||
|
%{python3_sitelib}/dir2module
|
||||||
|
%{python3_sitelib}/dir2module-*.egg-info/
|
||||||
|
%{python3_sitelib}/createrepo_mod
|
||||||
|
%{python3_sitelib}/createrepo_mod-*.egg-info/
|
||||||
|
%{python3_sitelib}/modulemd_merge
|
||||||
|
%{python3_sitelib}/modulemd_merge-*.egg-info/
|
||||||
|
%{python3_sitelib}/modulemd_tools
|
||||||
|
%{python3_sitelib}/modulemd_tools-*.egg-info/
|
||||||
%{_bindir}/repo2module
|
%{_bindir}/repo2module
|
||||||
%{_bindir}/dir2module
|
%{_bindir}/dir2module
|
||||||
%{_bindir}/createrepo_mod
|
%{_bindir}/createrepo_mod
|
||||||
%{_bindir}/modulemd-merge
|
%{_bindir}/modulemd-merge
|
||||||
%{_bindir}/modulemd-generate-macros
|
%{_bindir}/modulemd-generate-macros
|
||||||
%{python3_sitelib}/modulemd_tools
|
|
||||||
|
|
||||||
%{_mandir}/man1/repo2module.1*
|
%{_mandir}/man1/repo2module.1*
|
||||||
%{_mandir}/man1/dir2module.1*
|
%{_mandir}/man1/dir2module.1*
|
||||||
@ -121,11 +159,19 @@ cd modulemd_tools
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.6-3
|
* Tue Apr 06 2021 Jakub Kadlcik <frostyx@email.cz> 0.8-1
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
- modulemd_tools: drop python3-parameterized dependency (frostyx@email.cz)
|
||||||
|
- Package modulemd_tools helper lib (fvalder@redhat.com)
|
||||||
|
- Add modulemd-merge tests (fvalder@redhat.com)
|
||||||
|
- Add createrepo_mod tests (fvalder@redhat.com)
|
||||||
|
- Replace master in fedora releaser to rawhide (frostyx@email.cz)
|
||||||
|
|
||||||
* Fri Jan 22 2021 Stephen Gallagher <sgallagh@redhat.com> 0.6-2
|
* Tue Feb 09 2021 Jakub Kadlcik <frostyx@email.cz> 0.7-1
|
||||||
- Fix build against libmodulemd-2.12
|
- Generate manpages on the fly
|
||||||
|
- Automated test builds incl. Docker/Travis
|
||||||
|
- Fix PEP8 in all tools
|
||||||
|
- modulemd_tools: temporarily skip some tests on EPEL8 or Fedora
|
||||||
|
- Drop libmodulemd dependency in favor of python3-libmodulemd
|
||||||
|
|
||||||
* Sun Nov 22 2020 Jakub Kadlcik <frostyx@email.cz> 0.6-1
|
* Sun Nov 22 2020 Jakub Kadlcik <frostyx@email.cz> 0.6-1
|
||||||
- Generate manpages for all tools in this repository
|
- Generate manpages for all tools in this repository
|
||||||
|
2
sources
2
sources
@ -1 +1 @@
|
|||||||
SHA512 (modulemd-tools-0.6.tar.gz) = 260c817fff9e58591f72b8ea700abe0b6462e2e5e0ae4e08db4dc4861a00f77100fae9f50f1a375bea29fab75d6298a874ae503526442617f4e00d7e90d368d4
|
SHA512 (modulemd-tools-0.8.tar.gz) = f1a8229008b07b8c62312cf5610f75c5a964df1d78efe08a75f2d822762cf65d76dca210988ece11d16a7705cc451a06c85be25b38cc6a601ddac62abe5249c9
|
||||||
|
Loading…
Reference in New Issue
Block a user