Bug 1314537 - python-importanize - requires both python2 and python3
Summary: python-importanize - requires both python2 and python3
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-importanize
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Sundeep Anand
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3
TreeView+ depends on / blocked
 
Reported: 2016-03-03 21:03 UTC by William Moreno
Modified: 2016-04-22 01:26 UTC (History)
2 users (show)

Fixed In Version: python-importanize-0.4.1-5.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-22 01:26:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description William Moreno 2016-03-03 21:03:02 UTC
Hi, there is a issue in the spec with a colition in %{_bindir}

You have:

%install
%py2_install
rm -fr %{buildroot}%{python2_sitelib}/tests
%py3_install
rm -fr %{buildroot}%{python3_sitelib}/tests

And then in both packages:

%{_bindir}/%{pypi_name}

You should update your spec to something like:

%install
%py2_install
mv %{buildroot}/%{_bindir}/%{pypi_name} %{buildroot}/%{_bindir}/%{pypi_name}-py2 

And then in the python2 subpackage:
%{_bindir}/%{pypi_name}-py2

By the way, you must provide a python2 subpackage and use the python-provides macro.

See:
https://fedoraproject.org/wiki/Packaging:Python#Avoiding_collisions_between_the_python_2_and_python_3_stacks

Comment 1 Petr Viktorin (pviktori) 2016-03-04 09:53:19 UTC
Actually, the guidelines specify how the scripts should be named, so that users can use a sane "default" but also explicitly request a specific version:
https://fedoraproject.org/wiki/Packaging:Python#Naming

There are two cases:
1) If the script works the same under both python2 and python3, only the python3 scripts can be packaged

2) Otherwise, there should be /usr/bin/script, /usr/bin/script-2, /usr/bin/script-2.7 for Python 2, and /usr/bin/script-3, /usr/bin/script-3.5 for Python 3.
You can do that like this:

%py3_install
mv %{buildroot}/%{_bindir}/%{pypi_name} %{buildroot}/%{_bindir}/%{pypi_name}-3 
ln -s %{buildroot}/%{_bindir}/%{pypi_name}-3 %{buildroot}/%{_bindir}/%{pypi_name}-%{python3_version}

%py2_install
ln -s %{buildroot}/%{_bindir}/%{pypi_name} %{buildroot}/%{_bindir}/%{pypi_name}-%2
ln -s %{buildroot}/%{_bindir}/%{pypi_name} %{buildroot}/%{_bindir}/%{pypi_name}-%{python2_version}

Comment 2 Sundeep Anand 2016-03-04 12:09:22 UTC
Thanks!
Have updated SPEC - as of now kept /usr/bin/script and /usr/bin/script-3
Working around error: Symlink points to BuildRoot

Koji Scratch build:
http://koji.fedoraproject.org/koji/taskinfo?taskID=13225981

Comment 3 Fedora Update System 2016-03-04 12:18:05 UTC
python-importanize-0.4.1-4.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-d662304333

Comment 4 Petr Viktorin (pviktori) 2016-03-04 12:25:37 UTC
Right, sorry! The symlink targets don't need a directory.

ln -s %{pypi_name}-3 %{buildroot}/%{_bindir}/%{pypi_name}-%{python3_version}

Comment 5 Fedora Update System 2016-03-05 02:22:40 UTC
python-importanize-0.4.1-4.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-d662304333

Comment 7 Fedora Update System 2016-03-14 10:09:18 UTC
python-importanize-0.4.1-5.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-25398488a9

Comment 8 Fedora Update System 2016-03-16 15:24:03 UTC
python-importanize-0.4.1-5.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-25398488a9

Comment 9 Fedora Update System 2016-04-22 01:26:15 UTC
python-importanize-0.4.1-5.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.