14
0

Accepting request 686039 from devel:languages:python

- Fix hardcoded versions
- Add patch to build with new PyYAML 5:
  * yaml5.patch

OBS-URL: https://build.opensuse.org/request/show/686039
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-vim-vint?expand=0&rev=2
This commit is contained in:
2019-03-19 09:00:18 +00:00
committed by Git OBS Bridge
3 changed files with 49 additions and 11 deletions

View File

@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Mar 18 10:59:30 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Fix hardcoded versions
- Add patch to build with new PyYAML 5:
* yaml5.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Feb 13 06:23:38 UTC 2019 - John Vandenberg <jayvdb@gmail.com> Wed Feb 13 06:23:38 UTC 2019 - John Vandenberg <jayvdb@gmail.com>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-vim-vint # spec file for package python-vim-vint
# #
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -12,35 +12,37 @@
# license that conforms to the Open Source Definition (Version 1.9) # license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative. # published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/ # Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-vim-vint Name: python-vim-vint
Version: 0.3.19 Version: 0.3.19
Release: 0 Release: 0
License: MIT
Summary: Lint tool for Vim script Language Summary: Lint tool for Vim script Language
Url: https://github.com/Kuniwak/vint License: MIT
Group: Development/Languages/Python Group: Development/Languages/Python
Url: https://github.com/Kuniwak/vint
Source: https://github.com/Kuniwak/vint/archive/v0.3.19.tar.gz Source: https://github.com/Kuniwak/vint/archive/v0.3.19.tar.gz
Patch0: test-sys-executable.patch Patch0: test-sys-executable.patch
BuildRequires: %{python_module setuptools} Patch1: yaml5.patch
BuildRequires: fdupes BuildRequires: %{python_module PyYAML >= 3.11}
BuildRequires: python-rpm-macros
BuildRequires: %{python_module ansicolor >= 0.2.4} BuildRequires: %{python_module ansicolor >= 0.2.4}
BuildRequires: %{python_module chardet >= 2.3.0} BuildRequires: %{python_module chardet >= 2.3.0}
BuildRequires: %{python_module PyYAML >= 3.11}
BuildRequires: %{python_module coverage >= 3.7.1} BuildRequires: %{python_module coverage >= 3.7.1}
BuildRequires: %{python_module pathlib} BuildRequires: %{python_module pathlib}
BuildRequires: %{python_module pytest >= 2.6.4} BuildRequires: %{python_module pytest >= 2.6.4}
BuildRequires: %{python_module pytest-cov >= 1.8.1} BuildRequires: %{python_module pytest-cov >= 1.8.1}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-enum34 >= 1.0.4 BuildRequires: python-enum34 >= 1.0.4
BuildRequires: python2-mock >= 1.0.1 BuildRequires: python-rpm-macros
BuildRequires: python-typing >= 3.6.2 BuildRequires: python-typing >= 3.6.2
BuildRequires: python2-mock >= 1.0.1
Requires: python-PyYAML >= 3.11
Requires: python-ansicolor >= 0.2.4 Requires: python-ansicolor >= 0.2.4
Requires: python-chardet >= 2.3.0 Requires: python-chardet >= 2.3.0
Requires: python-PyYAML >= 3.11
%ifpython2 %ifpython2
Requires: python-enum34 >= 1.0.4 Requires: python-enum34 >= 1.0.4
Requires: python-pathlib >= 1.0.1 Requires: python-pathlib >= 1.0.1
@@ -56,7 +58,12 @@ A lint tool for the Vim script Language.
%prep %prep
%setup -q -n vint-%{version} %setup -q -n vint-%{version}
%patch0 -p1 %patch0 -p1
sed -i 's/==/>=/g' setup.py test-requirements.txt %patch1 -p1
sed -e 's/==/>=/g' \
-e 's/\~=/>=/g' \
-i setup.py \
-i test-requirements.txt \
-i requirements.txt
sed -i -e '/^#!\//, 1d' vint/_bundles/vimlparser.py sed -i -e '/^#!\//, 1d' vint/_bundles/vimlparser.py
%build %build

24
yaml5.patch Normal file
View File

@@ -0,0 +1,24 @@
From 219b733e1be2beb2f714088d3916fdb065f9abdc Mon Sep 17 00:00:00 2001
From: Daniel Hahler <github@thequod.de>
Date: Tue, 29 Jan 2019 10:50:03 +0100
Subject: [PATCH] Use yaml.safe_load (#298)
Ref: https://github.com/Kuniwak/vint/issues/279#issuecomment-458106093
---
vint/linting/config/config_file_source.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/vint/linting/config/config_file_source.py b/vint/linting/config/config_file_source.py
index 210932c8..989e123a 100644
--- a/vint/linting/config/config_file_source.py
+++ b/vint/linting/config/config_file_source.py
@@ -13,7 +13,8 @@ def __init__(self, env):
config_file_path = self.get_file_path(env)
with config_file_path.open() as file_obj:
- self._config_dict = self.convert_config_dict(yaml.load(file_obj))
+ config_yaml = yaml.safe_load(file_obj)
+ self._config_dict = self.convert_config_dict(config_yaml)
def convert_config_dict(self, yaml_dict):