Bug 1399565 - pyflakes: Missing "python2-<module>" provides
Summary: pyflakes: Missing "python2-<module>" provides
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: pyflakes
Version: 26
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ville Skyttä
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-29 10:18 UTC by Charalampos Stratakis
Modified: 2017-08-06 11:21 UTC (History)
3 users (show)

Fixed In Version: pyflakes-1.5.0-4.fc27
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-06 11:21:32 UTC
Type: Bug


Attachments (Terms of Use)
Modernize SPEC and fix the python2 namespaces. (2.53 KB, patch)
2016-11-30 15:31 UTC, Charalampos Stratakis
ville.skytta: review-
Details | Diff

Description Charalampos Stratakis 2016-11-29 10:18:35 UTC
This package does not provide "python2-<module>".

As per Python packaging guidelines [0], when there are two versions of
module "foo", the two packages must provide:
"python3-foo" for Python 3
"python2-foo" for Python 2
"python-foo" for the system default Python (currently 2, but this might
change in the future)

Please use the %python_provide macro [1] to specify the correct provides.

It's fine to do this in Rawhide only.


If anything is unclear, or if you need any kind of assistance with this
issue, you can ask on IRC (#fedora-python on Freenode), or reply here.
We'll be happy to help!


[0] https://fedoraproject.org/wiki/Packaging:Python
[1]
https://fedoraproject.org/wiki/Packaging:Python#The_.25python_provide_macro

Comment 1 Ville Skyttä 2016-11-29 20:36:37 UTC
(In reply to Charalampos Stratakis from comment #0)
> Please use the %python_provide macro [1] to specify the correct provides.

It is already being used:
http://pkgs.fedoraproject.org/cgit/rpms/pyflakes.git/tree/pyflakes.spec#n19
> %{?python_provide:%python_provide python2-%{name}}

The expanded Provides doesn't seem to make it to the built packages though. Any ideas why?

Comment 2 Charalampos Stratakis 2016-11-30 15:30:42 UTC
(In reply to Ville Skyttä from comment #1)
> (In reply to Charalampos Stratakis from comment #0)
> > Please use the %python_provide macro [1] to specify the correct provides.
> 
> It is already being used:
> http://pkgs.fedoraproject.org/cgit/rpms/pyflakes.git/tree/pyflakes.spec#n19
> > %{?python_provide:%python_provide python2-%{name}}
> 
> The expanded Provides doesn't seem to make it to the built packages though.
> Any ideas why?

The macro is supposed to expand by being used with a python2-<foo> subpackage, thus making the python-<foo> namespace a virtual provides. As it seems now it provides a virtual "python-<foo>" name.

As it is now the SPEC file of pyflakes, the virtual provides of the python2-<foo> and python-<foo> need to either explicitly be declared with:

Provides: python-pyflakes = %{version}-%{release}
Provides: python2-pyflakes = %{version}-%{release}
And then omitting the macro.

I would recommend though, as pyflakes has both python2 and python3 support, to make the package compliant with the more recent packaging as well as naming [1] guidelines.

[1] https://fedoraproject.org/wiki/Packaging:Naming?rd=Packaging:NamingGuidelines#Python_modules

Attaching a patch for that.

Already tested it from copr and users who have already installed the package can do a dnf update and python2-pyflakes will replace the pyflakes rpm (and also virtually provides the python and python2 namespace).

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

Output of rpm -qp --provides on python2-pyflakes-1.3.0-3.fc26.noarch.rpm:

pyflakes = 1.3.0-3.fc26
python-pyflakes = 1.3.0-3.fc26
python2-pyflakes = 1.3.0-3.fc26
python2.7dist(pyflakes) = 1.3.0
python2dist(pyflakes) = 1.3.0

Comment 3 Charalampos Stratakis 2016-11-30 15:31:22 UTC
Created attachment 1226380 [details]
Modernize SPEC and fix the python2 namespaces.

Comment 4 Ville Skyttä 2016-12-08 20:37:49 UTC
Comment on attachment 1226380 [details]
Modernize SPEC and fix the python2 namespaces.

Patch looks otherwise ok on surface, but breaks EL6 build; python2-setuptools doesn't exist for it.

https://kojipkgs.fedoraproject.org//work/tasks/421/16800421/root.log

Comment 5 Fedora End Of Life 2017-02-28 10:41:12 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 6 Ville Skyttä 2017-08-06 11:21:32 UTC
The Provides was added in 1.5.0-4. Other modernization maybe follows as part of the ongoing effort on Python 3 as default currently being discussed on fedora-devel.


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