forked from pool/python-requirements-parser
Accepting request 794157 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/794157 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-requirements-parser?expand=0&rev=7
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
From fd172ae6faf56f3d221666fb336e84df01d8b943 Mon Sep 17 00:00:00 2001
|
||||
From: Antonio Larrosa <alarrosa@suse.com>
|
||||
Date: Wed, 15 Apr 2020 11:40:47 +0200
|
||||
Subject: [PATCH] Don't fail with valid options in requirements.txt files
|
||||
|
||||
When parsing requirements.txt files, a number of options can be used
|
||||
that shouldn't make the parser fail. The list of options can
|
||||
be seen at:
|
||||
|
||||
https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format
|
||||
---
|
||||
requirements/parser.py | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
|
||||
diff --git a/requirements/parser.py b/requirements/parser.py
|
||||
index 024c905..1bb66f5 100644
|
||||
--- a/requirements/parser.py
|
||||
+++ b/requirements/parser.py
|
||||
@@ -46,5 +46,20 @@ def parse(reqstr):
|
||||
elif line.startswith('-Z') or line.startswith('--always-unzip'):
|
||||
warnings.warn('Unused option --always-unzip. Skipping.')
|
||||
continue
|
||||
+ elif line.startswith('-c') or line.startswith('--constraint'):
|
||||
+ warnings.warn('--constraint option not supported. Skipping.')
|
||||
+ continue
|
||||
+ elif line.startswith('--no-binary') or line.startswith('--only-binary'):
|
||||
+ warnings.warn('--no-binary and --only-binary options not supported. Skipping.')
|
||||
+ continue
|
||||
+ elif line.startswith('--require-hashes'):
|
||||
+ warnings.warn('Unused option --require-hashes. Skipping.')
|
||||
+ continue
|
||||
+ elif line.startswith('--pre'):
|
||||
+ warnings.warn('Unused option --pre. Skipping.')
|
||||
+ continue
|
||||
+ elif line.startswith('--trusted-host'):
|
||||
+ warnings.warn('Unused option --trusted-host. Skipping.')
|
||||
+ continue
|
||||
else:
|
||||
yield Requirement.parse(line)
|
@@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Apr 15 08:39:06 UTC 2020 - Antonio Larrosa <alarrosa@suse.com>
|
||||
|
||||
- Add patch to not fail parsing requirements files with valid
|
||||
options like --only-binary or --trusted-host:
|
||||
* 0001-Dont-fail-with-valid-options-in-requirements_txt-files.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Dec 12 02:47:24 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-requirements-parser
|
||||
#
|
||||
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2020 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -23,8 +23,10 @@ Release: 0
|
||||
Summary: Pip requirement file parser
|
||||
License: BSD-2-Clause
|
||||
Group: Development/Languages/Python
|
||||
Url: https://github.com/davidfischer/requirements-parser
|
||||
URL: https://github.com/davidfischer/requirements-parser
|
||||
Source: https://github.com/davidfischer/requirements-parser/archive/v%{version}.tar.gz#/requirements-parser-%{version}.tar.gz
|
||||
# PATCH-FIX-UPSTREAM 0001-Dont-fail-with-valid-options-in-requirements_txt-files.patch alarrosa@suse.com -- https://github.com/davidfischer/requirements-parser/pull/47
|
||||
Patch0: 0001-Dont-fail-with-valid-options-in-requirements_txt-files.patch
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: python-rpm-macros
|
||||
# SECTION test requirements
|
||||
@@ -40,6 +42,7 @@ A Pip requirement file parser.
|
||||
|
||||
%prep
|
||||
%setup -q -n requirements-parser-%{version}
|
||||
%patch0 -p1
|
||||
|
||||
%build
|
||||
%python_build
|
||||
|
Reference in New Issue
Block a user