On Wed, Jun 21, 2017 at 12:27:47PM +1000, Nick Coghlan wrote:
On 20 June 2017 at 12:44, Nick Coghlan <ncoghlan(a)gmail.com>
wrote:
> On 20 June 2017 at 02:49, Przemek Klosowski <przemek.klosowski(a)nist.gov>
wrote:
>> It seems to me that there are two kinds of Python packages affected by this
>> issue: some track the evolution of the ecosystem and make sure they work
>> with both Python 2 and 3, while the others assume a specific environment,
>> and expect the user to conform to that. What I dislike about this proposal
>> is that it imposes on the first kind: their package name needs to change,
>> presumably to 'pyton3-xxx' even though the package might work with
python2
>> as well. This sounds like penalizing the good behavior.
>
> It's also an annoyingly difficult policy to comply with for anyone
> attempting to maintain RHEL/CentOS/EPEL compatible packages that will
> use Py2 in those contexts and Py3 in Fedora.
It was pointed out to me that my description of this problem wasn't
entirely clear, so here's a more concrete example that hopefully
clarifies the problem I see with the current policy wording.
Specifically, the issue I see is that given the current policy
wording, dependency declarations like the following would *not* be
policy compliant for Python packages in Fedora 27+, even though
they're entirely unambiguous about the Python version they expect to
get:
```
%if 0%{?el7} || 0%{?fedora} < 27
BuildRequires: python2-devel
%else
BuildRequires: python3-devel
%endif
BuildRequires: python-builddep1
BuildRequires: python-builddep2
Requires: python-runtimedep1
Requires: python-runtimedep2
```
There are two downsides to this kind of declaration:
- python2-runtimedep[12] will be used until the switch to python3 as
default is made, which might be very long. Instead, we would prefer
packages to use python3-runtimedep[12] to gradually push out python2.
- when the switch finally comes, such packages will suddenly switch
all at once, and such flag days are generally painful.
So instead, I think it'd preferable to introduce a global macro
%python_preferred_suffix (or a better name), that would evaluate
to '3' on all Fedora, and '' on EPEL [*]. The deps would then look as:
BuildRequires: python%{python_preferred_suffix}-builddep1
BuildRequires: python%{python_preferred_suffix}-builddep2
Requires: python%{python_preferred_suffix}-runtimedep1
Requires: python%{python_preferred_suffix}-runtimedep2
This would keep things unambiguous, but brief.
Zbyszek
[*] "preferred" in this case would be '3' if python3 deps are widely
available and expected to be used, and '' or '2' otherwise.