diff --git a/.gitignore b/.gitignore index 912e46f..525a125 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ /rosdistro-0.8.1.tar.gz /rosdistro-0.8.2.tar.gz /rosdistro-0.8.3.tar.gz +/rosdistro-0.9.0.tar.gz diff --git a/40695e0dae1ede0271bf3ff38c0f1739dac33a8b.patch b/40695e0dae1ede0271bf3ff38c0f1739dac33a8b.patch deleted file mode 100644 index 7c4f4f5..0000000 --- a/40695e0dae1ede0271bf3ff38c0f1739dac33a8b.patch +++ /dev/null @@ -1,275 +0,0 @@ -From 40695e0dae1ede0271bf3ff38c0f1739dac33a8b Mon Sep 17 00:00:00 2001 -From: Scott K Logan -Date: Wed, 27 Oct 2021 17:23:54 -0700 -Subject: [PATCH] Use yaml.safe_load (#162) - -Bare calls to yaml.load have been deprecated for some time now, and -recent versions of PyYAML do not allow it at all. ---- - scripts/rosdistro_convert | 10 +++++----- - scripts/rosdistro_migrate_to_rep_141 | 12 ++++++------ - scripts/rosdistro_migrate_to_rep_143 | 2 +- - src/rosdistro/develdistro.py | 2 +- - src/rosdistro/legacy.py | 2 +- - src/rosdistro/rosdistro.py | 4 ++-- - test/test_distribution.py | 2 +- - test/test_doc.py | 2 +- - test/test_doc_build.py | 2 +- - test/test_release.py | 2 +- - test/test_release_build.py | 2 +- - test/test_source.py | 2 +- - test/test_source_build.py | 2 +- - 13 files changed, 23 insertions(+), 23 deletions(-) - -diff --git a/scripts/rosdistro_convert b/scripts/rosdistro_convert -index ccd07c1d..b7782296 100755 ---- a/scripts/rosdistro_convert -+++ b/scripts/rosdistro_convert -@@ -58,7 +58,7 @@ def get_targets(): - url = BASE_SRC_URL + '/releases/targets.yaml' - print('Load "%s"' % url) - yaml_str = load_url(url) -- data = yaml.load(yaml_str) -+ data = yaml.safe_load(yaml_str) - targets = {} - for d in data: - targets[d.keys()[0]] = d.values()[0] -@@ -69,13 +69,13 @@ def convert_release(dist_name, targets): - url = BASE_SRC_URL + '/releases/%s.yaml' % dist_name - print('Load "%s"' % url) - yaml_str = load_url(url) -- input_ = yaml.load(yaml_str) -+ input_ = yaml.safe_load(yaml_str) - - # improve conversion performance by reusing results from last run - last_dist = None - if os.path.exists(dist_name + '/release.yaml'): - with open(dist_name + '/release.yaml', 'r') as f: -- last_data = yaml.load(f.read()) -+ last_data = yaml.safe_load(f.read()) - last_dist = ReleaseFile(dist_name, last_data) - - output = {} -@@ -162,7 +162,7 @@ def convert_source(dist_name): - url = BASE_SRC_URL + '/releases/%s-devel.yaml' % dist_name - print('Load "%s"' % url) - yaml_str = load_url(url) -- input_ = yaml.load(yaml_str) -+ input_ = yaml.safe_load(yaml_str) - - output = {} - output['type'] = 'source' -@@ -207,7 +207,7 @@ def convert_doc(dist_name): - if filename.endswith('.rosinstall'): - name = os.path.splitext(os.path.basename(filename))[0] - with open(os.path.join(doc_base, filename)) as f: -- data = yaml.load(f) -+ data = yaml.safe_load(f) - if name.endswith('_depends'): - rosinstall_depends[name] = data - else: -diff --git a/scripts/rosdistro_migrate_to_rep_141 b/scripts/rosdistro_migrate_to_rep_141 -index 01b74c37..8f552309 100755 ---- a/scripts/rosdistro_migrate_to_rep_141 -+++ b/scripts/rosdistro_migrate_to_rep_141 -@@ -18,7 +18,7 @@ import yaml - - - def migrate(index_yaml): -- data = yaml.load(open(index_yaml, 'r')) -+ data = yaml.safe_load(open(index_yaml, 'r')) - assert data['type'] == 'index' - assert data['version'] == 1 - data['version'] = 2 -@@ -75,7 +75,7 @@ def generate_repos_url(repos_url, doc_url, release_url, source_url): - data['repositories'] = {} - - # migrate release stuff -- release_data = yaml.load(open(release_url, 'r')) -+ release_data = yaml.safe_load(open(release_url, 'r')) - assert release_data['type'] == 'release' - assert release_data['version'] == 1 - -@@ -100,7 +100,7 @@ def generate_repos_url(repos_url, doc_url, release_url, source_url): - data['repositories'][repo_name] = repo_data - - # migrate doc stuff -- doc_data = yaml.load(open(doc_url, 'r')) -+ doc_data = yaml.safe_load(open(doc_url, 'r')) - assert doc_data['type'] == 'doc' - assert doc_data['version'] == 1 - -@@ -111,7 +111,7 @@ def generate_repos_url(repos_url, doc_url, release_url, source_url): - data['repositories'][repo_name]['doc'] = get_dict_parts(doc_repo_data, ['type', 'url', 'version']) - - # migrate source stuff -- source_data = yaml.load(open(source_url, 'r')) -+ source_data = yaml.safe_load(open(source_url, 'r')) - assert source_data['type'] == 'source' - assert source_data['version'] == 1 - -@@ -137,10 +137,10 @@ def update_cache(index_yaml, distro_name, cache_url, cache_file, distribution_fi - if not isinstance(yaml_str, str): - yaml_str = yaml_str.decode('utf-8') - f.close() -- cache_data = yaml.load(yaml_str) -+ cache_data = yaml.safe_load(yaml_str) - - del cache_data['release_file'] -- distribution_data = yaml.load(open(os.path.join(base, distribution_file), 'r')) -+ distribution_data = yaml.safe_load(open(os.path.join(base, distribution_file), 'r')) - cache_data['distribution_file'] = distribution_data - - cache_data['release_package_xmls'] = cache_data['package_xmls'] -diff --git a/scripts/rosdistro_migrate_to_rep_143 b/scripts/rosdistro_migrate_to_rep_143 -index e7b07ce5..f5596ceb 100755 ---- a/scripts/rosdistro_migrate_to_rep_143 -+++ b/scripts/rosdistro_migrate_to_rep_143 -@@ -10,7 +10,7 @@ import yaml - - - def migrate(index_yaml): -- data = yaml.load(open(index_yaml, 'r')) -+ data = yaml.safe_load(open(index_yaml, 'r')) - assert data['type'] == 'index' - assert data['version'] == 2 - data['version'] = 3 -diff --git a/src/rosdistro/develdistro.py b/src/rosdistro/develdistro.py -index 43828d3c..4c388eae 100644 ---- a/src/rosdistro/develdistro.py -+++ b/src/rosdistro/develdistro.py -@@ -8,7 +8,7 @@ - class DevelDistro: - def __init__(self, name): - url = urlopen('https://raw.github.com/ros/rosdistro/master/releases/{0}-devel.yaml'.format(name)) -- distro = yaml.load(url.read())['repositories'] -+ distro = yaml.safe_load(url.read())['repositories'] - self.repositories = {} - for name, data in distro.iteritems(): - repo = DevelDistroRepo(name, data) -diff --git a/src/rosdistro/legacy.py b/src/rosdistro/legacy.py -index 33f70da1..15027e77 100644 ---- a/src/rosdistro/legacy.py -+++ b/src/rosdistro/legacy.py -@@ -122,7 +122,7 @@ def get_release_cache(index, dist_name): - f.close() - else: - raise NotImplementedError('The url of the cache must end with either ".yaml" or ".yaml.gz"') -- data = yaml.load(yaml_str) -+ data = yaml.safe_load(yaml_str) - return ReleaseCache(dist_name, data) - - -diff --git a/src/rosdistro/rosdistro.py b/src/rosdistro/rosdistro.py -index 4033ac25..9d3884c3 100644 ---- a/src/rosdistro/rosdistro.py -+++ b/src/rosdistro/rosdistro.py -@@ -161,7 +161,7 @@ def __init__(self, name): - - # parse ros distro file - distro_url = urlopen('https://raw.github.com/ros/rosdistro/master/releases/%s.yaml' % name) -- distro = yaml.load(distro_url.read())['repositories'] -+ distro = yaml.safe_load(distro_url.read())['repositories'] - - # loop over all repo's - for repo_name, data in distro.iteritems(): -@@ -338,7 +338,7 @@ def _read_server_cache(self): - - tar = tarfile.open(fh.name, 'r') - data = tar.extractfile(self.file_name) -- deps = yaml.load(data.read()) -+ deps = yaml.safe_load(data.read()) - if not deps \ - or 'cache_version' not in deps \ - or deps['cache_version'] != CACHE_VERSION \ -diff --git a/test/test_distribution.py b/test/test_distribution.py -index 30e457ed..1ea37aa4 100644 ---- a/test/test_distribution.py -+++ b/test/test_distribution.py -@@ -12,7 +12,7 @@ - def test_distribution_file(): - url = 'file://' + FILES_DIR + '/foo/distribution.yaml' - yaml_str = load_url(url) -- data = yaml.load(yaml_str) -+ data = yaml.safe_load(yaml_str) - dist_file = DistributionFile('foo', data) - _validate_dist_file(dist_file) - -diff --git a/test/test_doc.py b/test/test_doc.py -index 517e4fc0..5dd04cc6 100644 ---- a/test/test_doc.py -+++ b/test/test_doc.py -@@ -12,7 +12,7 @@ - def test_doc_file(): - url = 'file://' + FILES_DIR + '/foo/distribution.yaml' - yaml_str = load_url(url) -- data = yaml.load(yaml_str) -+ data = yaml.safe_load(yaml_str) - doc_file = DocFile('foo', data) - _validate_doc_file(doc_file) - -diff --git a/test/test_doc_build.py b/test/test_doc_build.py -index b7072e1d..4265975d 100644 ---- a/test/test_doc_build.py -+++ b/test/test_doc_build.py -@@ -12,7 +12,7 @@ - def test_doc_build_file(): - url = 'file://' + FILES_DIR + '/foo/doc-build.yaml' - yaml_str = load_url(url) -- data = yaml.load(yaml_str) -+ data = yaml.safe_load(yaml_str) - DocBuildFile('foo', data) - - -diff --git a/test/test_release.py b/test/test_release.py -index 00837660..11421758 100644 ---- a/test/test_release.py -+++ b/test/test_release.py -@@ -12,7 +12,7 @@ - def test_release_file(): - url = 'file://' + FILES_DIR + '/foo/distribution.yaml' - yaml_str = load_url(url) -- data = yaml.load(yaml_str) -+ data = yaml.safe_load(yaml_str) - rel_file = ReleaseFile('foo', data) - _validate_rel_file(rel_file) - -diff --git a/test/test_release_build.py b/test/test_release_build.py -index ee0b5e44..b53676c6 100644 ---- a/test/test_release_build.py -+++ b/test/test_release_build.py -@@ -12,7 +12,7 @@ - def test_release_build_file(): - url = 'file://' + FILES_DIR + '/foo/release-build.yaml' - yaml_str = load_url(url) -- data = yaml.load(yaml_str) -+ data = yaml.safe_load(yaml_str) - ReleaseBuildFile('foo', data) - - -diff --git a/test/test_source.py b/test/test_source.py -index e8ba55e3..6c15757e 100644 ---- a/test/test_source.py -+++ b/test/test_source.py -@@ -12,7 +12,7 @@ - def test_source_file(): - url = 'file://' + FILES_DIR + '/foo/distribution.yaml' - yaml_str = load_url(url) -- data = yaml.load(yaml_str) -+ data = yaml.safe_load(yaml_str) - src_file = SourceFile('foo', data) - _validate_src_file(src_file) - -diff --git a/test/test_source_build.py b/test/test_source_build.py -index fdd23d4d..ac2ed720 100644 ---- a/test/test_source_build.py -+++ b/test/test_source_build.py -@@ -12,7 +12,7 @@ - def test_source_build_file(): - url = 'file://' + FILES_DIR + '/foo/source-build.yaml' - yaml_str = load_url(url) -- data = yaml.load(yaml_str) -+ data = yaml.safe_load(yaml_str) - SourceBuildFile('foo', data) - - diff --git a/python-rosdistro.rpmlintrc b/python-rosdistro.rpmlintrc index 1a68d10..8fd64ab 100644 --- a/python-rosdistro.rpmlintrc +++ b/python-rosdistro.rpmlintrc @@ -1,8 +1 @@ -# KNOWN BUGS -addFilter(r'(file-not-utf8|wrong-file-end-of-line-encoding) /usr/share/doc/python-rosdistro-doc/html/objects.inv( |$)') - -# FALSE POSITIVES -addFilter(r': obsolete-not-provided python\d*-rosdistro') - -# MANUAL PAGES addFilter(r'no-manual-page-for-binary (python\d*-)?rosdistro_.*') diff --git a/python-rosdistro.spec b/python-rosdistro.spec index 15753bd..5dc86b8 100644 --- a/python-rosdistro.spec +++ b/python-rosdistro.spec @@ -1,18 +1,14 @@ %global srcname rosdistro Name: python-%{srcname} -Version: 0.8.3 -Release: 5%{?dist} +Version: 0.9.0 +Release: 1%{?dist} Summary: File format for managing ROS Distributions License: BSD and MIT URL: http://www.ros.org/wiki/rosdistro Source0: https://github.com/ros-infrastructure/%{srcname}/archive/%{version}/%{srcname}-%{version}.tar.gz -# Apply upstream patch to use yaml safe_load -# https://github.com/ros-infrastructure/rosdistro/commit/40695e0dae1ede0271bf3ff38c0f1739dac33a8b.patch -Patch0: 40695e0dae1ede0271bf3ff38c0f1739dac33a8b.patch - BuildArch: noarch %description @@ -31,7 +27,7 @@ local cache file, to speed up performance for the next query. %package doc Summary: HTML documentation for '%{name}' -BuildRequires: make +BuildRequires: make BuildRequires: python%{python3_pkgversion}-catkin-sphinx BuildRequires: python%{python3_pkgversion}-sphinx @@ -44,7 +40,7 @@ Summary: %{summary} BuildRequires: git BuildRequires: python%{python3_pkgversion}-catkin_pkg BuildRequires: python%{python3_pkgversion}-devel -BuildRequires: python%{python3_pkgversion}-nose +BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-PyYAML BuildRequires: python%{python3_pkgversion}-rospkg BuildRequires: python%{python3_pkgversion}-setuptools @@ -79,6 +75,9 @@ local cache file, to speed up performance for the next query. %prep %autosetup -p1 -n %{srcname}-%{version} +# Drop unsupported syntax in older setuptools +sed -i "s/mock; python_version < '3.3'//" setup.py + %build %py3_build @@ -101,9 +100,8 @@ popd %check PYTHONPATH=%{buildroot}%{python3_sitelib} \ - %{__python3} -m nose \ - -e test_get_index_from_http_with_query_parameters \ - -e test_manifest_providers* \ + %{__python3} -m pytest \ + -k 'not test_manifest_providers' \ test @@ -129,6 +127,10 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} \ %changelog +* Fri Jun 10 2022 Scott K Logan - 0.9.0-1 +- Update to 0.9.0 (rhbz#2095797) +- Re-enable test_get_index_from_http_with_query_parameters + * Sat Feb 12 2022 Rich Mattes - 0.8.3-5 - Apply upstream patch to use yaml safe_load (rhbz#2046910) diff --git a/sources b/sources index 22e9a65..b3be187 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rosdistro-0.8.3.tar.gz) = 19e248497b4001c522a84a52d768bc9f20a08020c88574d1a8345cf2173dc2aadd8a1480d4fddf2285ac579ee69dd0b6d4b930333cd6a9cbe32708efed2e5747 +SHA512 (rosdistro-0.9.0.tar.gz) = f3212c8dbceb2862ad8680da537cfdddb347fc302929afa0b0a8601dfa56fd328406eeb9a0d44aba2afa3c1c53fa934dc7721fc3fb2b2c9b0d3f2b9444e78174