gotmax23 pushed to ansible-packaging (rawhide). "Flush stdout before
subprocess.run (..more)"
by notificationsï¼ fedoraproject.org
Notification time stamped 2022-09-30 20:36:43 UTC
From e3d150ec904179fd2d529763491692ee3b192c44 Mon Sep 17 00:00:00 2001
From: Maxwell G <gotmax(a)e.email>
Date: Sep 30 2022 20:14:22 +0000
Subject: Flush stdout before subprocess.run
This commit adds sys.stdout.flush() before subprocess.run() in
ansible_collection.py. Without this, the print statements are shown
after the command output when building in mock.
---
diff --git a/ansible_collection.py b/ansible_collection.py
index 17c6777..70093be 100755
--- a/ansible_collection.py
+++ b/ansible_collection.py
@@ -70,6 +70,9 @@ class AnsibleCollection:
)
print(f"Running: {args}")
print()
+ # Without this, the print statements are shown after the command
+ # output when building in mock.
+ sys.stdout.flush()
subprocess.run(args, check=True, cwd=self.collection_srcdir)
print()
@@ -90,6 +93,9 @@ class AnsibleCollection:
args = ("ansible-test", "units", *extra_args)
print(f"Running: {args}")
print()
+ # Without this, the print statements are shown after the command
+ # output when building in mock.
+ sys.stdout.flush()
subprocess.run(args, cwd=temppath, check=True)
https://src.fedoraproject.org/rpms/ansible-packaging/c/e3d150ec904179fd2d...
1Â year, 8Â months
gotmax23 pushed to ansible-packaging (rawhide). "Outsource
%ansible_test_unit logic to helper script (..more)"
by notificationsï¼ fedoraproject.org
Notification time stamped 2022-09-30 20:36:43 UTC
From 78dcf4c992c5c3189675c7f579864c9140cf5898 Mon Sep 17 00:00:00 2001
From: Maxwell G <gotmax(a)e.email>
Date: Sep 26 2022 04:07:27 +0000
Subject: Outsource %ansible_test_unit logic to helper script
We want %ansible_test_unit to retrieve the collection name{,space} from
galaxy.yml. This removes the need for the %collection_name{,space}
macros and utilizes ansible_collection.py's more robust approach to
running the tests.
---
diff --git a/macros.ansible b/macros.ansible
index 856688e..0c81432 100644
--- a/macros.ansible
+++ b/macros.ansible
@@ -13,12 +13,10 @@
--filelist %{ansible_collection_filelist}
}
+%ansible_test_unit() %{shrink:
+%{_rpmconfigdir}/ansible_collection.py test --
+--python-interpreter %{__python3} --local %{?*}
+}
-%ansible_test_unit() %{expand:\\\
-mkdir -p ../ansible_collections/%{collection_namespace}
-cp -a $(pwd) ../ansible_collections/%{collection_namespace}/%{collection_name}
-pushd ../ansible_collections/%{collection_namespace}/%{collection_name}
-ansible-test units --python-interpreter %{__python3} --local %{?*}
-popd}
%ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/
https://src.fedoraproject.org/rpms/ansible-packaging/c/78dcf4c992c5c31896...
1Â year, 8Â months
gotmax23 pushed to ansible-packaging (rawhide). "Add new
%ansible_collection_filelist macro (..more)"
by notificationsï¼ fedoraproject.org
Notification time stamped 2022-09-30 20:36:43 UTC
From b1de39d9c64cabf7c40c29d445e135b0e41a3f0b Mon Sep 17 00:00:00 2001
From: Maxwell G <gotmax(a)e.email>
Date: Sep 26 2022 04:07:27 +0000
Subject: Add new %ansible_collection_filelist macro
%ansible_collection_files cannot be adapted to dynamically determine the
collection namespace. We need to use a file list for that.
%ansible_collection_install writes out a file list to
%ansible_collection_filelist. Packagers would pass
`%{ansible_collection_filelist}` to `%files -f`.
Eventually, I'd like to deprecate %ansible_collection_files. That won't
happen until the new approach has gotten more testing and adoption.
---
diff --git a/macros.ansible b/macros.ansible
index 0c81432..57c89fe 100644
--- a/macros.ansible
+++ b/macros.ansible
@@ -18,5 +18,11 @@
--python-interpreter %{__python3} --local %{?*}
}
+# TODO: Officially deprecate this macro and add the following line to the macro
+# def after the new approach has gotten more testing and adoption:
+# %%{warn: %%{ansible_collection_files} is deprecated. Use %%files -f %%{ansible_collection_filelist} instead.}
+%ansible_collection_files %{shrink:
+%{ansible_collections_dir}/%{collection_namespace}/
+}
-%ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/
+%ansible_collection_filelist %{__ansible_builddir}/ansible_collection_files
https://src.fedoraproject.org/rpms/ansible-packaging/c/b1de39d9c64cabf7c4...
1Â year, 8Â months
gotmax23 pushed to ansible-packaging (rawhide). "Refactor
%ansible_collection_install (..more)"
by notificationsï¼ fedoraproject.org
Notification time stamped 2022-09-30 20:36:43 UTC
From deee147c9518bb49974d96436ca11ce60345be17 Mon Sep 17 00:00:00 2001
From: Maxwell G <gotmax(a)e.email>
Date: Sep 26 2022 04:07:26 +0000
Subject: Refactor %ansible_collection_install
This change removes %ansible_collection_install's dependence on the
%collection_namespace and %collection_name macros. Now, the macro uses
the new helper script which extracts this information from galaxy.yml.
Parsing the galaxy.yml instead of using %{version} to determine the
collection version also lends another benefit: it allows us to package
pre-releases. Previously, discrepancies between %{version} and the
upstream version (eg. "3.0.0~rc1" vs "3.0.0-rc1") broke the macro.
---
diff --git a/macros.ansible b/macros.ansible
index 5e2bc06..856688e 100644
--- a/macros.ansible
+++ b/macros.ansible
@@ -1,9 +1,18 @@
+# Stores ephemeral data that's created by %%ansible_collection_install
+# and used by other macros.
+%__ansible_builddir %{_builddir}/%{?buildsubdir:%{buildsubdir}/}.ansible-packaging
+
%ansible_roles_dir %{_datadir}/ansible/roles
%ansible_collections_dir %{_datadir}/ansible/collections/ansible_collections
%ansible_collection_build() ansible-galaxy collection build
-%ansible_collection_install() ansible-galaxy collection install -n -p %{buildroot}%{_datadir}/ansible/collections %{collection_namespace}-%{collection_name}-%{version}.tar.gz
+%ansible_collection_install() %{shrink:
+%{_rpmconfigdir}/ansible_collection.py install
+--collections-dir %{buildroot}%{ansible_collections_dir}
+--filelist %{ansible_collection_filelist}
+}
+
%ansible_test_unit() %{expand:\\\
mkdir -p ../ansible_collections/%{collection_namespace}
https://src.fedoraproject.org/rpms/ansible-packaging/c/deee147c9518bb4997...
1Â year, 8Â months
gotmax23 pushed to ansible-packaging (rawhide). "Add
%ansible_roles_dir and %ansible_collections_dir (..more)"
by notificationsï¼ fedoraproject.org
Notification time stamped 2022-09-30 20:36:43 UTC
From 2f4f3dbe16c97231a99c1f0b7305846609058c93 Mon Sep 17 00:00:00 2001
From: Maxwell G <gotmax(a)e.email>
Date: Sep 23 2022 23:00:58 +0000
Subject: Add %ansible_roles_dir and %ansible_collections_dir
We expect collections to use %ansible_collection_install and
%ansible_collection_file{s,list}. I'm mainly defining
%ansible_collection_dir for use in our macros.
There are a couple packaged roles in Fedora that can use
%ansible_roles_dir. This can also be used if we decide to implement
macros for packaging roles.
---
diff --git a/macros.ansible b/macros.ansible
index abab21d..5e2bc06 100644
--- a/macros.ansible
+++ b/macros.ansible
@@ -1,3 +1,6 @@
+%ansible_roles_dir %{_datadir}/ansible/roles
+%ansible_collections_dir %{_datadir}/ansible/collections/ansible_collections
+
%ansible_collection_build() ansible-galaxy collection build
%ansible_collection_install() ansible-galaxy collection install -n -p %{buildroot}%{_datadir}/ansible/collections %{collection_namespace}-%{collection_name}-%{version}.tar.gz
https://src.fedoraproject.org/rpms/ansible-packaging/c/2f4f3dbe16c97231a9...
1Â year, 8Â months
gotmax23 pushed to ansible-packaging (rawhide). "Add
ansible_collection.py helper script (..more)"
by notificationsï¼ fedoraproject.org
Notification time stamped 2022-09-30 20:36:43 UTC
From bc337bd8e48760c9670613391c7f0145542cded5 Mon Sep 17 00:00:00 2001
From: Maxwell G <gotmax(a)e.email>
Date: Sep 26 2022 04:07:26 +0000
Subject: Add ansible_collection.py helper script
The %collection_namespace and %collection_name macros are clunky. This
script preforms two tasks:
- install: extract the namespace, name, and version from galaxy.yml,
run `ansible-galaxy install`, and write a filelist for use with
%files -f.
- test: create a temporary build directory with the required
directory structure for ansible-test to work and run `ansible-test
units`.
---
diff --git a/ansible-packaging.spec b/ansible-packaging.spec
index 50e256d..4e2478c 100644
--- a/ansible-packaging.spec
+++ b/ansible-packaging.spec
@@ -9,7 +9,12 @@ Source0: ansible-generator
Source1: ansible.attr
Source2: macros.ansible
Source3: macros.ansible-srpm
-Source4: COPYING
+Source4: ansible_collection.py
+
+Source100: COPYING
+
+# Needed for ansible_collection.py
+Requires: %{py3_dist pyyaml}
# Require ansible-core for building. Collections still have a boolean runtime
# dependency on either ansible 2.9 OR ansible-core.
@@ -67,9 +72,10 @@ cp -a %{sources} .
%install
install -Dpm0644 -t %{buildroot}%{_fileattrsdir} ansible.attr
-install -Dpm0644 -t %{buildroot}%{_rpmmacrodir} macros.ansible
-install -Dpm0644 -t %{buildroot}%{_rpmmacrodir} macros.ansible-srpm
+install -Dpm0644 -t %{buildroot}%{_rpmmacrodir} macros.ansible
+install -Dpm0644 -t %{buildroot}%{_rpmmacrodir} macros.ansible-srpm
install -Dpm0755 -t %{buildroot}%{_rpmconfigdir} ansible-generator
+install -Dpm0755 -t %{buildroot}%{_rpmconfigdir} ansible_collection.py
%files
@@ -77,6 +83,7 @@ install -Dpm0755 -t %{buildroot}%{_rpmconfigdir} ansible-generator
%{_fileattrsdir}/ansible.attr
%{_rpmmacrodir}/macros.ansible
%{_rpmconfigdir}/ansible-generator
+%{_rpmconfigdir}/ansible_collection.py
%files -n ansible-srpm-macros
diff --git a/ansible_collection.py b/ansible_collection.py
new file mode 100755
index 0000000..18f04a9
--- /dev/null
+++ b/ansible_collection.py
@@ -0,0 +1,138 @@
+#!/usr/bin/python3
+# SPDX-License-Identifier: GPL-3.0-or-later
+# SPDX-FileCopyrightText 2022 Maxwell G <gotmax(a)e.email>
+
+"""
+This script uses Ansible Collection metadata from galaxy.yml to figure out the
+namespace, name, and version of the collection being packaged.
+
+``ansible_collection.py install`` (used by %ansible_collecton_install) uses
+this information to find and install the collection artifact that was just
+built with %ansible_collection_build. It also generates a files list for use
+with `%files -f`.
+
+``ansible_collection.py test`` (used by %ansible_test_unit) parses galaxy.yml
+to determine the collection namespace and name that's needed to create the
+directory structure that ansible-test expects. After creating a temporary build
+directory with the needed structure, the script runs ansible-test units with
+the provided arguments.
+"""
+
+import argparse
+import shutil
+import subprocess
+import sys
+from pathlib import Path
+from tempfile import TemporaryDirectory
+from typing import Any, Dict, Optional, Sequence, Union
+
+from yaml import CSafeLoader, load
+
+
+class CollectionError(Exception):
+ pass
+
+
+class AnsibleCollection:
+ def __init__(self, collection_srcdir: Optional[Path] = None) -> None:
+ self.collection_srcdir = collection_srcdir or Path.cwd()
+ self.data = self._load_data()
+ self.namespace = self.data["namespace"]
+ self.name = self.data["name"]
+ self.version = self.data["version"]
+
+ def _load_data(self) -> Dict[str, Any]:
+ path = self.collection_srcdir / "galaxy.yml"
+ if not path.exists():
+ raise CollectionError(f"{path} does not exist!")
+ print(f"Loading collection metadata from {path}")
+
+ with open(path, encoding="utf-8") as file:
+ return load(file, Loader=CSafeLoader)
+
+ def install(self, destdir: Union[str, Path]) -> None:
+ args = (
+ "ansible-galaxy",
+ "collection",
+ "install",
+ "-n",
+ "-p",
+ str(destdir),
+ f"{self.namespace}-{self.name}-{self.version}.tar.gz",
+ )
+ print(f"Running: {args}")
+ print()
+ subprocess.run(args, check=True, cwd=self.collection_srcdir)
+
+ def write_filelist(self, filelist: Path) -> None:
+ filelist.parent.mkdir(parents=True, exist_ok=True)
+ contents = "%{ansible_collections_dir}/" + self.namespace
+ print(f"Writing filelist to {filelist}")
+ with open(filelist, "w", encoding="utf-8") as file:
+ file.write(contents)
+
+ def unit_test(self, extra_args: Sequence) -> None:
+ with TemporaryDirectory() as temp:
+ temppath = Path(temp) / "ansible_collections" / self.namespace / self.name
+ shutil.copytree(
+ self.collection_srcdir,
+ temppath,
+ )
+ args = ("ansible-test", "units", *extra_args)
+ print(f"Running: {args}")
+ print()
+ subprocess.run(args, cwd=temppath, check=True)
+
+
+def parseargs() -> argparse.Namespace:
+ parser = argparse.ArgumentParser(
+ "Install and test Ansible Collections in an rpmbuild environment"
+ )
+ subparsers = parser.add_subparsers(dest="action")
+ install_parser = subparsers.add_parser(
+ "install",
+ help="Run ansible-galaxy collection install and write filelist",
+ )
+ install_parser.add_argument(
+ "--collections-dir",
+ required=True,
+ help="Collection destination directory",
+ type=Path,
+ )
+ install_parser.add_argument(
+ "--filelist",
+ type=Path,
+ required=True,
+ help="%%{ansible_collection_filelist}",
+ )
+
+ test_parser = subparsers.add_parser(
+ "test",
+ help="Run ansible-test unit after creating the necessary directory structure",
+ )
+ test_parser.add_argument(
+ "extra_args", nargs="*", help="Extra arguments to pass to ansible-test"
+ )
+ args = parser.parse_args()
+ # add_subparsers does not support required on Python 3.6
+ if not args.action:
+ parser.print_usage()
+ sys.exit(2)
+ return args
+
+
+def main():
+ args = parseargs()
+ collection = AnsibleCollection()
+ if args.action == "install":
+ collection.install(args.collections_dir)
+ collection.write_filelist(args.filelist)
+ elif args.action == "test":
+ collection.unit_test(args.extra_args)
+
+
+if __name__ == "__main__":
+ try:
+ main()
+ except CollectionError as err:
+ sys.exit(err)
https://src.fedoraproject.org/rpms/ansible-packaging/c/bc337bd8e48760c967...
1Â year, 8Â months
mikelo2 pushed to google-api-python-client (f36). "Update to 2.63.0 -
Closes rhbz#2130929"
by notificationsï¼ fedoraproject.org
Notification time stamped 2022-09-30 20:35:36 UTC
From 7712fb5bc86254cbbc1c4315d37508e1d30fe70a Mon Sep 17 00:00:00 2001
From: Mikel Olasagasti Uranga <mikel(a)olasagasti.info>
Date: Sep 30 2022 20:32:34 +0000
Subject: Update to 2.63.0 - Closes rhbz#2130929
---
diff --git a/.gitignore b/.gitignore
index b87e739..55f0cde 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,3 +41,4 @@
/google-api-python-client-2.59.0.tar.gz
/google-api-python-client-2.60.0.tar.gz
/google-api-python-client-2.62.0.tar.gz
+/google-api-python-client-2.63.0.tar.gz
diff --git a/google-api-python-client.spec b/google-api-python-client.spec
index 113741f..5912066 100644
--- a/google-api-python-client.spec
+++ b/google-api-python-client.spec
@@ -4,7 +4,7 @@
Name: google-api-python-client
Summary: %{sum}
Epoch: 2
-Version: 2.62.0
+Version: 2.63.0
Release: %autorelease
License: ASL 2.0
diff --git a/sources b/sources
index 7829f0e..c8961b7 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (google-api-python-client-2.62.0.tar.gz) = 4348bce74db02f74bd386d0276de2e2ec0126e7c1b79bea962056612f868d2b2306c51663ca293672db750460bd3722a66fb22139d14f30adcd3e0d455a2118a
+SHA512 (google-api-python-client-2.63.0.tar.gz) = a8253904fc9db8687be7a04356e9e11202073ce05c77f770d51ed973e0c87db32c4b39750e1a48d813186530dfeae0f76452df7241686d6a64afbdff35626387
https://src.fedoraproject.org/rpms/google-api-python-client/c/7712fb5bc86...
1Â year, 8Â months
chedi pushed to python-molecule-docker (rawhide). "update to version
2.1.0 (#2131265)"
by notificationsï¼ fedoraproject.org
Notification time stamped 2022-09-30 20:35:34 UTC
From f3139eba4e7d5c9ac16aa78e4146947d3e9c207a Mon Sep 17 00:00:00 2001
From: chedi toueiti <chedi.toueiti(a)gmail.com>
Date: Sep 30 2022 20:34:20 +0000
Subject: update to version 2.1.0 (#2131265)
---
diff --git a/.gitignore b/.gitignore
index 9bd18bc..fda6f9e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
/molecule-docker-1.0.2.tar.gz
/molecule-docker-1.1.0.tar.gz
/molecule-docker-2.0.0.tar.gz
+/molecule-docker-2.1.0.tar.gz
diff --git a/python-molecule-docker.spec b/python-molecule-docker.spec
index 83d2393..6156f5c 100644
--- a/python-molecule-docker.spec
+++ b/python-molecule-docker.spec
@@ -8,7 +8,7 @@ provisioning test resources.
}
Name: %{pkgname}
-Version: 2.0.0
+Version: 2.1.0
%forgemeta
Release: %autorelease
Summary: Molecule Docker plugin
diff --git a/sources b/sources
index 55bd48c..b3e983f 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (molecule-docker-2.0.0.tar.gz) = adc3367b58110da78876522865b268de866b5f0fead6de31c79c61357a83b1dc927190a2016ee7cc608c318c65e5e287ec2edd5278c15e622e06f6a14dac5b60
+SHA512 (molecule-docker-2.1.0.tar.gz) = 3c3dc493eb183ab3acc01738d8fd2260718a44f2c1a15073dac7b9da0899a3672fc5f2bfae98aa27ea2472170ec83d049bf15943fdbccf6dc1e4efd39d833450
https://src.fedoraproject.org/rpms/python-molecule-docker/c/f3139eba4e7d5...
1Â year, 8Â months
mikelo2 pushed to google-api-python-client (f37). "Update to 2.63.0 -
Closes rhbz#2130929"
by notificationsï¼ fedoraproject.org
Notification time stamped 2022-09-30 20:35:18 UTC
From 7712fb5bc86254cbbc1c4315d37508e1d30fe70a Mon Sep 17 00:00:00 2001
From: Mikel Olasagasti Uranga <mikel(a)olasagasti.info>
Date: Sep 30 2022 20:32:34 +0000
Subject: Update to 2.63.0 - Closes rhbz#2130929
---
diff --git a/.gitignore b/.gitignore
index b87e739..55f0cde 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,3 +41,4 @@
/google-api-python-client-2.59.0.tar.gz
/google-api-python-client-2.60.0.tar.gz
/google-api-python-client-2.62.0.tar.gz
+/google-api-python-client-2.63.0.tar.gz
diff --git a/google-api-python-client.spec b/google-api-python-client.spec
index 113741f..5912066 100644
--- a/google-api-python-client.spec
+++ b/google-api-python-client.spec
@@ -4,7 +4,7 @@
Name: google-api-python-client
Summary: %{sum}
Epoch: 2
-Version: 2.62.0
+Version: 2.63.0
Release: %autorelease
License: ASL 2.0
diff --git a/sources b/sources
index 7829f0e..c8961b7 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (google-api-python-client-2.62.0.tar.gz) = 4348bce74db02f74bd386d0276de2e2ec0126e7c1b79bea962056612f868d2b2306c51663ca293672db750460bd3722a66fb22139d14f30adcd3e0d455a2118a
+SHA512 (google-api-python-client-2.63.0.tar.gz) = a8253904fc9db8687be7a04356e9e11202073ce05c77f770d51ed973e0c87db32c4b39750e1a48d813186530dfeae0f76452df7241686d6a64afbdff35626387
https://src.fedoraproject.org/rpms/google-api-python-client/c/7712fb5bc86...
1Â year, 8Â months
atim pushed to video-downloader (f37). "chore(update): 0.10.6"
by notificationsï¼ fedoraproject.org
Notification time stamped 2022-09-30 20:35:02 UTC
From 78d6c35f8228fd09d0b2cff1f7c3d6e76f56af44 Mon Sep 17 00:00:00 2001
From: Artem Polishchuk <ego.cordatus(a)gmail.com>
Date: Sep 30 2022 20:29:12 +0000
Subject: chore(update): 0.10.6
---
diff --git a/.gitignore b/.gitignore
index 2d5618c..0cb3b8b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -57,3 +57,4 @@
/video-downloader-0.10.3.tar.gz
/video-downloader-0.10.4.tar.gz
/video-downloader-0.10.5.tar.gz
+/video-downloader-0.10.6.tar.gz
diff --git a/sources b/sources
index 660e5bb..8a89909 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (video-downloader-0.10.5.tar.gz) = c825182113ca0928b9e78f067ee32b823ffef646632bd39a232e89cfe9bdefdc1d7234a17f6a779dd5cec82598edec0d878ed6ae65b74eca83b8995566b5f7ab
+SHA512 (video-downloader-0.10.6.tar.gz) = a33d66411b5cdbbf16af59f3a94b8e6971dd0ad76af03eddba0685084d8b04dc64c6ec9570af49aebda54782c84aab98c7c6a20db1ea724367a1b5ab299231a8
diff --git a/video-downloader.spec b/video-downloader.spec
index e4ec24e..a97704e 100644
--- a/video-downloader.spec
+++ b/video-downloader.spec
@@ -1,7 +1,7 @@
%global uuid com.github.unrud.VideoDownloader
Name: video-downloader
-Version: 0.10.5
+Version: 0.10.6
Release: %autorelease
Summary: Download videos from websites like YouTube and many others
https://src.fedoraproject.org/rpms/video-downloader/c/78d6c35f8228fd09d0b...
1Â year, 8Â months