Symlink the Python 3 bytecode for six (rbhz 1519147)

This commit is contained in:
Jeremy Cline 2017-12-01 11:59:56 -05:00
commit 92407fc699
No known key found for this signature in database
GPG key ID: 9223308FA9B246DB

View file

@ -2,7 +2,7 @@
Name: python-%{srcname}
Version: 1.20
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Python HTTP library with thread-safe connection pooling and file post
License: MIT
@ -102,30 +102,23 @@ ln -s ../../backports/ssl_match_hostname %{buildroot}/%{python2_sitelib}/urllib3
# Unbundle the Python 3 build
rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py*
rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/six*
rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname/
mkdir -p %{buildroot}/%{python3_sitelib}/urllib3/packages/
ln -s ../../six.py %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py
ln -s ../../../__pycache__/six.cpython-%{python3_version_nodots}.opt-1.pyc %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/
ln -s ../../../__pycache__/six.cpython-%{python3_version_nodots}.pyc %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/
# urllib3 requires Python 3.5 to use the standard library's match_hostname,
# which we ship in Fedora 26, so we can safely replace the bundled version with
# this stub which imports the necessary objects.
cp %{SOURCE1} %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname.py
# Copy in six.py just for the test suite.
cp %{python2_sitelib}/six.* %{buildroot}/%{python2_sitelib}/.
cp %{python3_sitelib}/six.* %{buildroot}/%{python3_sitelib}/.
%check
nosetests
nosetests-%{python3_version}
# And after its done, remove our copied in bits
rm -rf %{buildroot}/%{python2_sitelib}/six*
rm -rf %{buildroot}/%{python2_sitelib}/backports*
rm -rf %{buildroot}/%{python3_sitelib}/six*
rm -rf %{buildroot}/%{python3_sitelib}/__pycache__*
%files -n python2-%{srcname}
%license LICENSE.txt
@ -142,6 +135,9 @@ rm -rf %{buildroot}/%{python3_sitelib}/__pycache__*
%changelog
* Fri Dec 01 2017 Jeremy Cline <jeremy@jcline.org> - 1.20-2
- Symlink the Python 3 bytecode for six (rbhz 1519147)
* Thu Feb 09 2017 Jeremy Cline <jeremy@jcline.org> - 1.20-1
- Update to 1.20 (#1414775)