Dear python-devel,
I'm playing with packaging of my little project[1] and I'm a bit
puzzled about the following issue.
When I go into git repo of my project and run unittests directly:
~~~
cd ~/projects/pylatest
python2 setup.py test
python3 setup.py test
~~~
Or via tox (which is configured to run both python2.7 and python3.4), it all
works fine and both python2 and python3 test runs reports success.
I have the following section in my specfile[3], which executes the tests
during the build (this is suggested by Packaging:Python guidelines):
~~~
%check
%{__python2} setup.py test
%{__python3} setup.py test
~~~
But when the tests are executed via rpmbuild, python2 test run reports a
pass, while python3 run fails[2]. This happens both on my local machine and
in copr.
At this point it's clear that I'm doing something wrong and would need
to inspect and fix this failure in pylatest, but I'm concerned about
something else in this email:
1) How come that running tests directly gives different outcome compared to
test run executed during rpm build? Note that this seems not to be
caused by different python version as it also happens on my local machine (so
python version is the same).
2) Is this an expected behaviour? What do I miss then? If not, is this
interesting enough to check this issue deeper?
[1] https://github.com/marbu/pylatest
[2] https://copr-be.cloud.fedoraproject.org/results/marbu/pylatest-fedora/fed...
[3] https://github.com/marbu/specfiles/blob/1911be24ff130bf7d614694de5ae340b8...
--
Martin Bukatovic

Dear fedora-python-devel,
I noticed a problem with pyp2rpm tool: it's a great tool, but it's
hardly visible and new python packager can easily miss it. The fact that
both Packaging:Python and SIGs/Python wikipages doesn't properly mention
it doesn't really help as well. No fried of mine who recently started
working on packaging his project is aware of this tool and I find out
about it only because I had weird newcomer's kind of questions on this
mailing list and people here were kind enough to point out that I should
check it first.
Initially I tried to kind of fix this issue by adding a line
about this tool into SIGs/Python page some time ago:
https://fedoraproject.org/w/index.php?title=SIGs%2FPython&diff=418064&old...
The problem is that this doesn't really solve anything. Now I rather
feel that more changes are required.
My current idea how to maintain rpm packages for my own python project
is summed up here:
https://fedoraproject.org/wiki/User:Marbu/PythonPackaging
Note that this is not a suggestion how the better description should
look like. I link it here so that you can point out which part you
disagree with (I'm not even a python sig member after all), so that
we can catch possible disagreements as soon as possible. My suggestions
below assumes that this makes sense. Keep in mind that I have hardly
any real experience with python rpm packaging.
So what exactly I have in mind? Compare this page:
https://fedoraproject.org/wiki/Packaging:Python
with:
https://en.opensuse.org/openSUSE:Packaging_Python
The difference includes:
* fedora Packaging:Python page is a packaging policy, which doesn't
mention pyp2rpm at all
* openSUSE:Packaging_Python page is more like a step by step intro,
which includes a clean example how to use SUSE's py2pack tool
See also:
https://fedoraproject.org/wiki/Packaging:Haskell
which clearly points out to cabal-rpm tool right in the beginning.
So my suggestions are:
1) Since the Packaging:Python page is the most visible, I would include
quick intro about pyp2rpm as the first section here.
2) Mention Python SIG page here as well.
3) A beginner friendly howto with more details could be maintained
separately linked from (or included in) revamped Python SIG page's
"Packaging Quickstart" section.
Moreover: I think that it would make sense to link older versions of the
guidelines which are valid for epel 6 and 7 like ruby does here:
https://fedoraproject.org/wiki/Packaging:Ruby
I could help me with this feature request:
https://github.com/fedora-python/pyp2rpm/issues/25
Thanks for the feedback.
--
Martin Bukatovic