Accepting request 682869 from home:jayvdb:coala:python3-bears

- Convert to single spec
- Activate test suite
- Change license to Python-2.0 to match sdist
- Update URL to https://bitbucket.org/pypa/distlib
- Remove unnecessary build dependency on python-devel
- Add fdupes
- Remove unnecessary backports with remove-backports.patch
- Update to v0.2.8

OBS-URL: https://build.opensuse.org/request/show/682869
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-distlib?expand=0&rev=1
This commit is contained in:
Tomáš Chvátal 2019-03-08 14:46:09 +00:00 committed by Git OBS Bridge
commit 16b404c14e
6 changed files with 342 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

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

3
distlib-0.2.8.zip Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:57977cd7d9ea27986ec62f425630e4ddb42efe651ff80bc58ed8dbc3c7c21f19
size 561108

162
python-distlib.changes Normal file
View File

@ -0,0 +1,162 @@
-------------------------------------------------------------------
Wed Mar 6 11:12:52 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
- Convert to single spec
- Activate test suite
- Change license to Python-2.0 to match sdist
- Update URL to https://bitbucket.org/pypa/distlib
- Remove unnecessary build dependency on python-devel
- Add fdupes
- Remove unnecessary backports with remove-backports.patch
- Update to v0.2.8
* database
+ Fixed #108: Updated metadata scan to look for the METADATA file as well
as the JSON formats.
* locators
+ Handled wheel tags and platform-dependent downloads correctly
in SimpleScrapingLocator.
* metadata
+ Updated documentation on testing to include information on
setting PYTHONHASHSEED.
* scripts
+ Avoided unnecessary newlines in script preambles, which caused
problems with detecting encoding declarations.
* util
+ Removed existing files (which might have been symlinks) before
overwriting.
- from v0.2.7
* compat
+ cache_from_source is now imported from importlib.util where
available.
* database
+ InstalledDistributions now have a modules attribute which
is a list of top-level modules as read from top_level.txt, if that is in
the distribution info.
* locators
+ Fixed #103: Thanks to Saulius Žemaitaitis for the patch.
* metadata
+ Added support for PEP 566 / Metadata 1.3.
* scripts
+ Updated launcher binaries.
- from v0.2.6
* compat
+ Updated to handle a case where sys.getfilesystemencoding()
returns None.
* database
+ Eliminated a crash in EggInfoDistribution.list_distinfo_files()
which was caused by trying to open a non-existent file.
+ Handled a case where an installed distribution didn't have 'Provides:'
metadata.
* locators
+ SimpleScrapingLocator no longer fails prematurely when scraping
links due to invalid versions.
* markers
+ Improved error messages issued when interpreting markers
* scripts
+ Improved the shebangs written into installed scripts when the interpreter
path is very long or contains spaces (to cater for a limitation in shebang
line parsing on Linux)
+ Updated launcher binaries.
* Numerous test refinements
- from v0.2.5
* general
+ Changed regular expressions to be compatible with 3.6 as regards escape
sequences.
+ Closed some resource leaks related to XML-RPC proxies.
+ Removed Python 2.6 from the support list.
* locators
+ Made downloadability a factor in scoring URLs for preferences.
* markers
+ Replaced the implementation with code which parses requirements in
accordance with PEP 508 and evaluates marker expressions according to
PEP 508.
* util
+ Changed _csv_open to use utf-8 across all platforms on Python 3.x.
* wheel
+ Changed to look for metadata in metadata.json as well as pydist.json.
* version
+ Updated requirement parsing in version matchers to use the new
PEP 508-compliant code.
* Numerous test refinements
- from v0.2.4
* compat
+ Updated to not fail on import if SSL is unavailable.
* index
+ Switch from using gpg in preference to gpg2 for signing. This is
to avoid gpg2's behaviour of prompting for passwords, which interferes
with the tests on some machines.
* locators
+ Changed project name comparisons to follow PEP 503.
+ Added errors queue to Locator.
* manifest
+ Changed match logic to work under Python 3.6, due to differences in
how fnmatch.translate behaves.
* resources
+ Updated finder registry logic to reflect changes in Python 3.6.
* scripts
+ Fixed regular expression in generated script boilerplate.
* util
+ Updated to not fail on import if SSL is unavailable.
+ Added normalize_name for project name comparisons using PEP 503.
* tests
+ Updated to skip certain tests if SSL is unavailable.
+ Numerous other test refinements.
- from v0.2.3
* util
+ Changed get_executable to return Unicode rather than bytes.
+ Fixed #84: Allow + character in output script names.
+ Relaxed too-stringent test looking for application/json in headers.
* wheel
+ sorted the entries in RECORD before writing to file.
* Numerous test refinements.
- from v0.2.2
* database
+ Added support for detecting distributions installed by wheel
versions >= 0.23 (which use metadata.json rather than pydist.json).
* locators
+ Updated default PyPI URL to https://pypi.python.org/pypi
* metadata
+ Updated to use different formatting for description field for V1.1
metadata.
+ Corrected "classifier" to "classifiers" in the mapping for V1.0
metadata.
* scripts
+ Improved support for Jython when quoting executables in output scripts.
* util
+ Made the internal URL used for extended metadata fetches
configurable via a module attribute.
+ Improved entry point parsing to handle leading spaces in
ini-format files.
* docs
+ Numerous documentation updates, not detailed further here.
* tests
+ renamed environment variable SKIP_SLOW to SKIP_ONLINE in tests and
applied to some more tests.
+ Numerous other test refinements.
- from v0.2.1
* locators
+ Return a Distribution instance or None from ``locate()``.
+ Skipped special keys when looking for versions.
+ Improved behaviour of PyPIJSONLocator to be analogous to that of other
locators.
* resource
+ Added resource iterator functionality.
* scripts
+ Updated launchers to decode shebangs using UTF-8. This allows
non-ASCII pathnames to be correctly handled.
+ Ensured that the executable written to shebangs is normcased.
+ Changed ScriptMaker to work better under Jython.
* util
+ Changed the mode setting method to work better under Jython.
+ Changed get_executable() to return a normcased value.
* wheel
+ Handled multiple-architecture wheel filenames correctly.
* docs
+ Numerous documentation updates, not detailed further here.
* Numerous test refinements.
-------------------------------------------------------------------
Sun Jul 5 13:13:42 UTC 2015 - tbechtold@suse.com
- Initial packaging of v0.2.0

77
python-distlib.spec Normal file
View File

@ -0,0 +1,77 @@
#
# spec file for package python-distlib
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-distlib
Version: 0.2.8
Release: 0
License: Python-2.0
Summary: Distribution utilities
Url: https://bitbucket.org/pypa/distlib
Group: Development/Languages/Python
Source: https://files.pythonhosted.org/packages/source/d/distlib/distlib-%{version}.zip
Patch0: remove-backports.patch
BuildRequires: python-rpm-macros
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module pytest}
BuildRequires: fdupes
BuildRequires: unzip
BuildArch: noarch
%python_subpackages
%description
Python distribution utilities.
%prep
%setup -q -n distlib-%{version}
%patch0 -p1
rm -r tests/unittest2
# tarfile backport is broken
rm distlib/_backport/tarfile.py
# sysconfig backport is unnecessary and untested
rm distlib/_backport/sysconfig.*
# These test modules require internet access and are unnecessary
rm tests/test_locators.py tests/test_sysconfig.py
# Unused
rm distlib/_backport/misc.*
# However, the tests for shutil fail when not using using provided backport
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
export LANG=en_US.UTF-8
# These two tests need internet access
%python_exec -m pytest -k 'not (test_search or test_package_data)'
%files %{python_files}
%doc CHANGES.rst README.rst
%license LICENSE.txt
%{python_sitelib}/*
%changelog

76
remove-backports.patch Normal file
View File

@ -0,0 +1,76 @@
diff -ur distlib-0.2.8-orig/distlib/_backport/shutil.py distlib-0.2.8/distlib/_backport/shutil.py
--- distlib-0.2.8-orig/distlib/_backport/shutil.py 2019-03-08 21:07:05.882089921 +0700
+++ distlib-0.2.8/distlib/_backport/shutil.py 2019-03-08 21:07:30.806286099 +0700
@@ -16,7 +16,7 @@
import fnmatch
import collections
import errno
-from . import tarfile
+import tarfile
try:
import bz2
diff -ur distlib-0.2.8-orig/distlib/compat.py distlib-0.2.8/distlib/compat.py
--- distlib-0.2.8-orig/distlib/compat.py 2019-03-08 21:07:05.882089921 +0700
+++ distlib-0.2.8/distlib/compat.py 2019-03-08 21:08:56.770962447 +0700
@@ -311,10 +311,7 @@
return 'IronPython'
return 'CPython'
-try:
- import sysconfig
-except ImportError: # pragma: no cover
- from ._backport import sysconfig
+import sysconfig
try:
callable = callable
diff -ur distlib-0.2.8-orig/setup.py distlib-0.2.8/setup.py
--- distlib-0.2.8-orig/setup.py 2019-03-08 21:07:05.894090015 +0700
+++ distlib-0.2.8/setup.py 2019-03-08 21:07:30.794286005 +0700
@@ -6,7 +6,6 @@
#
import distutils.core
-from distutils.sysconfig import get_python_lib
from os.path import join, dirname, abspath
import re
import sys
@@ -68,7 +67,6 @@
'distlib._backport',
],
package_data={
- 'distlib._backport': ['sysconfig.cfg'],
'distlib': ['t32.exe', 't64.exe', 'w32.exe', 'w64.exe'],
},
cmdclass={
diff -ur distlib-0.2.8-orig/tests/distlib_tests.py distlib-0.2.8/tests/distlib_tests.py
--- distlib-0.2.8-orig/tests/distlib_tests.py 2019-03-08 21:07:05.890089984 +0700
+++ distlib-0.2.8/tests/distlib_tests.py 2019-03-08 21:07:30.782285911 +0700
@@ -10,7 +10,6 @@
from test_database import (DataFilesTestCase, TestDatabase, TestDistribution,
TestEggInfoDistribution, DepGraphTestCase)
from test_index import PackageIndexTestCase
-from test_locators import LocatorTestCase
from test_manifest import ManifestTestCase
from test_markers import MarkersTestCase
from test_metadata import MetadataTestCase, LegacyMetadataTestCase
@@ -23,6 +22,5 @@
if _ver == (2, 6):
from test_shutil import TestCopyFile, TestMove, TestShutil
- from test_sysconfig import TestSysConfig, MakefileTests
from test_util import (UtilTestCase, ProgressTestCase, FileOpsTestCase,
GlobTestCase)
diff -ur distlib-0.2.8-orig/tests/test_shutil.py distlib-0.2.8/tests/test_shutil.py
--- distlib-0.2.8-orig/tests/test_shutil.py 2019-03-08 21:07:05.890089984 +0700
+++ distlib-0.2.8/tests/test_shutil.py 2019-03-08 21:07:30.818286194 +0700
@@ -20,7 +20,7 @@
from compat import unittest
-from distlib._backport import shutil, tarfile
+from distlib._backport import shutil; import tarfile
from distlib._backport.shutil import (
_make_tarball, _make_zipfile, make_archive, unpack_archive,
register_archive_format, unregister_archive_format, get_archive_formats,