Sync from SUSE:SLFO:Main python-pip-api revision ecb132efeb3d86d2fb539cbd91841b0b

This commit is contained in:
2025-05-13 16:57:11 +02:00
commit 3fe372e2a2
7 changed files with 288 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

BIN
pip-api-0.0.30.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

92
python-pip-api.changes Normal file
View File

@@ -0,0 +1,92 @@
-------------------------------------------------------------------
Fri Nov 24 08:08:45 UTC 2023 - Antonio Larrosa <alarrosa@suse.com>
- Skip more tests that need network access
-------------------------------------------------------------------
Tue Jun 13 08:58:11 UTC 2023 - ecsos <ecsos@opensuse.org>
- Add %{?sle15_python_module_pythons}
- Fix required package versions.
-------------------------------------------------------------------
Fri Jun 2 04:39:22 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
- Skip PEP508 tests since they require the network.
-------------------------------------------------------------------
Tue Feb 7 05:18:53 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 0.0.30:
* Support editable project location (#148)
* Do not treat `--trusted-host` as a requirement (#136)
* Expose whether a requirement is editable (#131)
* Use correct long flag for requirements (#118)
* Support for hashed requirements (#126)
* Drop support for Python 3.6, test against pip==22.0.x (#127)
* Pass PIP_DISABLE_PIP_VERSION_CHECK to all invocations (#114)
* Support the --path parameter when calling pip list (#112)
* Add support for parsing URL requirements (#109)
* Allow installed_distributions to be filtered for global distributions (#103)
* Support Python 3.10
* Allow requirement markers to be parsed (#99)
* Use pip list's JSON output for installed_distributions (#93)
* Drop support for Python 3.5 (#94)
* Add type hints (#97)
* Ensure environment vars are passed to subprocess call (#68)
* Drop support for Python 2.7
* Add experimental PEP 650 support
* Fix issue with handling LegacyVersions (#66)
* Support Python 3.9
- Add patch support-packaging-changes.patch:
* Drop a test parameter that doesn't work with our version of packaging.
- Include non-shipped test data as test-data.tar.gz.
- Switch to GitHub tarball for tests.
- Refresh unvendor.patch
-------------------------------------------------------------------
Mon Mar 16 10:09:16 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
- Update to 0.0.14
* Test against pip 19.2 to 20.0.2
* Support Python 3.8
-------------------------------------------------------------------
Wed Oct 30 13:08:42 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 0.0.13:
- Include six==1.12.0 as a vendored dependency (#42)
- Upgrade vendored packaging==19.2
- Upgrade vendored pyparsing==2.4.2
-------------------------------------------------------------------
Tue Jul 23 11:27:24 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 0.0.12:
* Bugfix with relative paths (#39)
-------------------------------------------------------------------
Fri Jun 7 15:29:45 UTC 2019 - Ondřej Súkup <mimi.vx@gmail.com>
- update to 0.0.10
- add unvendor.patch
-------------------------------------------------------------------
Fri May 17 19:43:12 UTC 2019 - Hardik Italia <hitalia@suse.com>
- Update to 0.0.8:
* Handle editable installs
* Ignore index url parameters in parse_requirements
* Drop support for Python 3.4
* Add support for pip 19.0, 19.0.1, 19.0.2, 19.0.3
-------------------------------------------------------------------
Fri Feb 22 09:31:58 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 0.0.5:
* distribute tests and license
-------------------------------------------------------------------
Wed Feb 20 12:27:19 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Initial commit, needed by pytest-reqs

70
python-pip-api.spec Normal file
View File

@@ -0,0 +1,70 @@
#
# spec file for package python-pip-api
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
Name: python-pip-api
Version: 0.0.30
Release: 0
Summary: The official unofficial pip API
License: Apache-2.0
URL: https://github.com/di/pip-api
Source0: https://github.com/di/pip-api/releases/download/%{version}/pip-api-%{version}.tar.gz
Source1: test-data.tar.gz
# PATCH-FIX-OPENSUSE We do not want a vendored packaging.
Patch0: unvendor.patch
# PATCH-FIX-OPENSUSE Remove a test parameter that is broken with our shipped
# packaging.
Patch1: support-packaging-changes.patch
BuildRequires: %{python_module packaging >= 21.0}
BuildRequires: %{python_module pip >= 22.1}
BuildRequires: %{python_module pretend}
BuildRequires: %{python_module pyparsing >= 2.4.7}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module virtualenv}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-pip
BuildArch: noarch
%python_subpackages
%description
The official unofficial pip API.
%prep
%autosetup -p1 -a 1 -n pip-api-%{version}
rm -Rf ./pip_api/_vendor
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# Broken with current packaging ; requires network
%pytest -k 'not (test_installed_distributions_legacy_version or test_installed_distributions or test_invoke_install or test_invoke_uninstall or test_isolation or test_all_the_right_pips or test_version)'
%files %{python_files}
%doc README.md
%license LICENSE
%{python_sitelib}/pip_api
%{python_sitelib}/pip_api*info
%changelog

View File

@@ -0,0 +1,19 @@
Index: pip-api-0.0.30/tests/test_parse_requirements.py
===================================================================
--- pip-api-0.0.30.orig/tests/test_parse_requirements.py
+++ pip-api-0.0.30/tests/test_parse_requirements.py
@@ -75,14 +75,6 @@ PEP508_PIP_EXAMPLE_WHEEL_FILE = "file://
"",
),
(
- # Version and URL can't be combined so this all gets parsed as a legacy version
- "pip==1.3.1@{url}\n".format(url=PEP508_PIP_EXAMPLE_URL),
- {"pip"},
- None,
- "pip==1.3.1@" + PEP508_PIP_EXAMPLE_URL, # Note no extra space after @
- "==1.3.1@" + PEP508_PIP_EXAMPLE_URL,
- ),
- (
# VCS markers at the beginning of a URL get stripped away
"git+" + PEP508_PIP_EXAMPLE_EGG,
{"pip"},

BIN
test-data.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

78
unvendor.patch Normal file
View File

@@ -0,0 +1,78 @@
Index: pip-api-0.0.30/pip_api/__init__.py
===================================================================
--- pip-api-0.0.30.orig/pip_api/__init__.py
+++ pip-api-0.0.30/pip_api/__init__.py
@@ -1,7 +1,7 @@
import sys
-from pip_api._vendor.packaging import version as packaging_version
-from pip_api._vendor.packaging.version import Version
+from packaging import version as packaging_version
+from packaging.version import Version
# Import this now because we need it below
from pip_api._version import version
Index: pip-api-0.0.30/pip_api/_hash.py
===================================================================
--- pip-api-0.0.30.orig/pip_api/_hash.py
+++ pip-api-0.0.30/pip_api/_hash.py
@@ -1,6 +1,6 @@
import os
-from pip_api._vendor.packaging.version import Version # type: ignore
+from packaging.version import Version # type: ignore
import pip_api
from pip_api._call import call
Index: pip-api-0.0.30/pip_api/_installed_distributions.py
===================================================================
--- pip-api-0.0.30.orig/pip_api/_installed_distributions.py
+++ pip-api-0.0.30/pip_api/_installed_distributions.py
@@ -7,7 +7,7 @@ import pip_api
from pip_api._call import call
from pip_api.exceptions import PipError
-from pip_api._vendor.packaging.version import parse # type: ignore
+from packaging.version import parse # type: ignore
class Distribution:
Index: pip-api-0.0.30/pip_api/_parse_requirements.py
===================================================================
--- pip-api-0.0.30.orig/pip_api/_parse_requirements.py
+++ pip-api-0.0.30/pip_api/_parse_requirements.py
@@ -14,7 +14,7 @@ from typing import Any, Dict, Optional,
from urllib.parse import urljoin, unquote, urlsplit
from urllib.request import pathname2url, url2pathname
-from pip_api._vendor.packaging import requirements, specifiers # type: ignore
+from packaging import requirements, specifiers # type: ignore
from pip_api.exceptions import PipError
Index: pip-api-0.0.30/tests/conftest.py
===================================================================
--- pip-api-0.0.30.orig/tests/conftest.py
+++ pip-api-0.0.30/tests/conftest.py
@@ -6,7 +6,7 @@ import pytest
import pretend
import virtualenv
-from pip_api._vendor.packaging.version import Version
+from packaging.version import Version
import pip_api
Index: pip-api-0.0.30/tests/test_installed_distributions.py
===================================================================
--- pip-api-0.0.30.orig/tests/test_installed_distributions.py
+++ pip-api-0.0.30/tests/test_installed_distributions.py
@@ -2,7 +2,7 @@ import os
import pytest
import pip_api
-from pip_api._vendor.packaging.version import parse
+from packaging.version import parse
from pip_api.exceptions import PipError