Bug 868266 - Review Request: python-pyglet - A cross-platform windowing and multimedia library for Python
Review Request: python-pyglet - A cross-platform windowing and multimedia lib...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: Package Review (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jerry James
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-19 07:29 EDT by Petr Viktorin
Modified: 2015-07-08 11:54 EDT (History)
7 users (show)

See Also:
Fixed In Version: python-pyglet-1.2-0.5.alpha1.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-26 22:10:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
loganjerry: fedora‑review+
limburgher: fedora‑cvs+


Attachments (Terms of Use)

  None (edit)
Description Petr Viktorin 2012-10-19 07:29:33 EDT
Spec URL: http://fedorapeople.org/~pviktori/rpms/pyglet.spec
SRPM URL: http://fedorapeople.org/~pviktori/rpms/pyglet-1.2-0.1.alpha1.fc16.src.rpm
Fedora Account System Username: pviktori
Description:
This library provides an object-oriented programming interface for developing
games and other visually-rich applications with Python.
pyglet has virtually no external dependencies. For most applications and game
requirements, pyglet needs nothing else besides Python, simplifying
distribution and installation. It also handles multiple windows and
fully aware of multi-monitor setups.

pyglet might be seen as an alternative to PyGame.

-------------------------------------------------

Previous submissions (2008):
https://bugzilla.redhat.com/show_bug.cgi?id=472673
https://bugzilla.redhat.com/show_bug.cgi?id=468298

This is an alpha version, released after more than 2 years of development with
no releases. I don't think it's worth it to package the old "stable" version.

The upstream package includes non-free example/test files. I've removed them.
There is also a patent-encumbered image codec for Microsoft DirectDraw
Surface (.dss) files. It is removed as well.
Script for the removals is included in the SRPM.

Pyglet's PNG codec is based on an old copy of pypng, modified to fit pyglet.
The pypng upstream seems to have been inactive around the time of fork, but
then got a new maintainer, moved to Github, and has changed substantially
(https://github.com/drj11/pypng).
The pypng docs (http://packages.python.org/pypng/ca.html) still say that you
can "just copy the code/png.py file" to include it.
Obviously it would be better to consolidate the changes in the two upstreams
and package pypng as well, but sadly that's much more work than I can
take on now.

Pyglet has a "soft dependency" on AVBin to support audio/video (mp3,
mpeg,...). That part obviously doesn't have much chance into getting into
Fedora, but pyglet itself works fine without it.

Pylint warnings:
explicit-lib-dependency libGL, libX11 (used dynamically through ctypes)
spelling-error %description -l en_US multi ("multi-monitor setups")
invalid-url Source0: pyglet-1.2alpha1-repacked.tar.gz (legal issues)
Comment 1 Petr Viktorin 2012-10-19 07:31:56 EDT
Koji build: http://koji.fedoraproject.org/koji/taskinfo?taskID=4606622
Comment 2 Jerry James 2013-03-04 15:04:28 EST
I'll take this review.  My initial attempt at using fedora-review is failing for reasons I don't understand.  The initial build succeeds, but then it does this:

Installing built package(s)
Mock command returned error code 1
Cannot run mock --shell rpmbuild -bp: INFO: mock.py version 1.1.29 starting...
Start: init plugins
INFO: selinux enabled
Finish: init plugins
Start: run
Start: lock buildroot
Start: device setup
Finish: device setup
Start: shell
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.pAn4Ho
+ umask 022
+ cd /builddir/build/BUILD
+ cd /builddir/build/BUILD
+ rm -rf pyglet-1.2alpha1
+ /usr/bin/gzip -dc /builddir/build/SOURCES/pyglet-1.2alpha1-repacked.tar.gz
+ /usr/bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd pyglet-1.2alpha1
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ find . -name '*.py'
+ xargs dos2unix
xargs: dos2unix: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.pAn4Ho (%prep)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.pAn4Ho (%prep)
Finish: shell
Finish: lock buildroot

... which makes no sense at all, since the spec file BuildRequires: dos2unix.  I'll see if I can figure out what is going on.
Comment 3 Jerry James 2013-03-04 15:30:43 EST
FWIW, dos2unix isn't necessary anyway.  You're already using sed on all of the source files, so you might as well make it do the extra work.  I replaced the two lines in %prep starting with "find" with this:

# Get rid of hashbang lines. This is a library, it has no executable scripts.
# Also remove Windows newlines
find . -name '*.py' | xargs sed -i -e 's|#!/usr/bin/\(env \)\?python||;s/\r//'

and now fedora-review likes it.  I don't know that there is anything wrong with the original; it is probably a bug in mock.  But this lets me move forward with the review (and the dos2unix BR can be removed).
Comment 4 Jerry James 2013-03-05 14:24:36 EST
I don't think pypng should be bundled.  The pure Python version runs several times more slowly than the version that uses a C interface.  I took a look at how hard it would be to package, and it doesn't look too bad.  Here's how I did it:

http://jjames.fedorapeople.org/pypng/

If you want to own that package, feel free to take what I did and replace my changelog entry in the spec file with your own.  Seriously.  If you don't want to own it, let me know; I may be willing.
Comment 5 Petr Viktorin 2013-03-07 13:05:58 EST
Thanks for reviewing!

Packaging pypng is one thing, but pyglet's copy changed since it was forked, and the upstream (with a new maintainer) has also changed extensively. I'll try to see if I can make them work together.

I'll also try to get PyPNG upstream to include a proper license, as it seems only png.py has license text; then I'll request a review.
Comment 6 Jerry James 2013-03-11 23:18:10 EDT
Ah, I didn't realize we are dealing with a forked pypng here.  Are the changes such that pypng upstream might possibly be interested in them?
Comment 7 Petr Viktorin 2013-03-13 13:06:44 EDT
Not likely, the fork uses pyglet's modules.
Looking at them again, though, they are mostly efforts to port to Python 3. Given that pypng upstream supports Python 3, it might be possible to use the upstream version after all.

I'll test while waiting on pypng to clear the licensing.
Comment 8 Miroslav Lichvar 2013-03-29 12:18:59 EDT
I'm looking at the older reviews and there was a problem with patented S3TC. Is that no longer a problem in the package reviewed here?

https://bugzilla.redhat.com/show_bug.cgi?id=468298#c18
Comment 9 Petr Viktorin 2013-03-29 13:51:38 EDT
No, it's removed from the trarball, disabling support for DirectX texture files.

More details are in the SRPM, or look here:
curl http://fedorapeople.org/~pviktori/rpms/pyglet-get-tarball.sh
Comment 10 Petr Viktorin 2013-04-16 13:30:38 EDT
Unfortunately, upstream pypng is not usable with pyglet, there are API changes.

A viable workaround is to remove the pypng plugin, and depend on python-imaging to provide the PNG support. It's faster, it supports more formats, but it's an additional (and less portable) dependency.
I've updated the package to do that.

Here are the updated files:
Spec URL: http://fedorapeople.org/~pviktori/rpms/pyglet.spec
SRPM URL: http://fedorapeople.org/~pviktori/rpms/pyglet-1.2-0.2.alpha1.fc18.src.rpm

Rawhide scratch build: http://koji.fedoraproject.org/koji/taskinfo?taskID=5259868
Comment 11 Jerry James 2013-04-16 17:31:09 EDT
Hmmm, but python-imaging has been dropped from F-19 and Rawhide in favor of python-pillow.  Can pyglet be made to work with python-pillow, and does it have the same advantages?
Comment 12 Petr Viktorin 2013-05-02 12:44:04 EDT
Yes. Here are updated files:

Spec URL: http://fedorapeople.org/~pviktori/rpms/pyglet.spec
SRPM URL: http://fedorapeople.org/~pviktori/rpms/pyglet-1.2-0.3.alpha1.fc18.src.rpm
Comment 13 Jerry James 2013-05-02 13:06:10 EDT
The only issue that I see is the license tag.  Shouldn't it be just "BSD" now that pypng is not bundled?  Also, this is not required, but have you considered also building a python3 version?  The package seems to support that.

Package Review
==============

Key:
[x] = Pass
[!] = Fail
[-] = Not applicable
[?] = Not evaluated
[ ] = Manual review needed



===== MUST items =====

Generic:
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[x]: Package contains desktop file if it is a GUI application.
[x]: Development files must be in a -devel package
[x]: Package requires other packages for directories it uses.
[x]: Package uses nothing in %doc for runtime.
[x]: Package is not known to require ExcludeArch.
[x]: Package complies to the Packaging Guidelines
[!]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses found:
     "BSD (3 clause)", "BSD (3 clause) MIT/X11 (BSD like)", "Unknown or
     generated". 3 files have unknown license. Detailed output of licensecheck
     in /home/jamesjer/868266-pyglet/licensecheck.txt
[x]: Package consistently uses macro is (instead of hard-coded directory
     names).
[x]: If the package is under multiple licenses, the licensing breakdown must
     be documented in the spec.
[x]: Package is named according to the Package Naming Guidelines.
[x]: Package does not generate any conflict.
[x]: Package obeys FHS, except libexecdir and /usr/target.
[x]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[x]: Package must own all directories that it creates.
[x]: Package does not own files or directories owned by other packages.
[x]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[x]: Package contains systemd file(s) if in need.
[x]: Large documentation must go in a -doc subpackage.
     Note: Documentation size is 40960 bytes in 5 files.
[x]: All build dependencies are listed in BuildRequires, except for any that
     are listed in the exceptions section of Packaging Guidelines.
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: Each %files section contains %defattr if rpm < 4.4
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Fully versioned dependency in subpackages, if present.
[x]: Spec file lacks Packager, Vendor, PreReq tags.
[x]: If (and only if) the source package includes the text of the license(s)
     in its own file, then that file, containing the text of the license(s)
     for the package is included in %doc.
[x]: Package use %makeinstall only when make install' ' DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: Package do not use a name that already exist
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as provided
     in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local
[x]: Package successfully compiles and builds into binary rpms on at least one
     supported primary architecture.
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).

Python:
[x]: Python eggs must not download any dependencies during the build process.
[x]: A package which is used by another package via an egg interface should
     provide egg info.
[x]: Package meets the Packaging Guidelines::Python
[x]: Package contains BR: python2-devel or python3-devel
[x]: Binary eggs must be removed in %prep

===== SHOULD items =====

Generic:
[x]: If the source package does not include license text(s) as a separate file
     from upstream, the packager SHOULD query upstream to include it.
[x]: Final provides and requires are sane (see attachments).
[x]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[x]: SourceX tarball generation or download is documented.
     Note: Package contains tarball without URL, check comments
[x]: Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[!]: %check is present and all tests pass.
     Upstream does not provide any tests
[x]: Packages should try to preserve timestamps of original installed files.
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: Dist tag is present.
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: SourceX is a working URL.
[x]: Spec use %global instead of %define.

===== EXTRA items =====

Generic:
[x]: Large data in /usr/share should live in a noarch subpackage if package is
     arched.
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: pyglet-1.2-0.3.alpha1.fc20.noarch.rpm
pyglet.noarch: E: explicit-lib-dependency libGL
pyglet.noarch: E: explicit-lib-dependency libX11
pyglet.noarch: W: spelling-error %description -l en_US multi -> mulch, mufti
1 packages and 0 specfiles checked; 2 errors, 1 warnings.




Rpmlint (installed packages)
----------------------------
# rpmlint pyglet
pyglet.noarch: E: explicit-lib-dependency libGL
pyglet.noarch: E: explicit-lib-dependency libX11
pyglet.noarch: W: spelling-error %description -l en_US multi -> mulch, mufti
1 packages and 0 specfiles checked; 2 errors, 1 warnings.
# echo 'rpmlint-done:'



Requires
--------
pyglet (rpmlib, GLIBC filtered):
    libGL
    libX11
    python
    python(abi)
    python-pillow(x86-64)



Provides
--------
pyglet:
    pyglet



Generated by fedora-review 0.4.0 (660ce56) last change: 2013-01-29
Buildroot used: fedora-rawhide-x86_64
Command line :/usr/bin/fedora-review -b 868266 -m fedora-rawhide-x86_64
Comment 14 Miro Hrončok 2013-05-29 19:35:08 EDT
According to pyglet website, "These packages [1.2alpha1] are provided for testing purposes, and are not suitable for production use." I'd rather see stable 1.1.4 in stable Fedora releases. That is the version on pypi and most likely the version most apps would use nowadays.

For example my package printrun enables some features, when pyglet is present and it counts on stable version of pyglet, pyglet 1.2alpha1 simply breaks it (as it brings some backward incompatible changes) and I would need to patch printrun to not use pyglet based features even if pyglet is present.

I'm currently working with printrun upstream on supporting pyglet 1.2, but it doesn't change my opinion on this. Does pyglet have long pauses in releases? Yes it does. But is that a reason to bring possible unstable and untested versions? I don't think so.
Comment 15 Petr Viktorin 2013-05-30 11:14:35 EDT
Originally (after a discussion on a packaging workshop) I went to package the latest & greatest. But if printrun needs the 1.2 version I guess it would make sense to package that.

I should find some time for it next week.
Comment 16 Miro Hrončok 2013-05-30 16:52:18 EDT
Actually, we might not understand each other, printrun needs pyglet 1.1.4 (as a optional dependency).
Comment 17 Petr Viktorin 2013-06-07 06:49:55 EDT
I've fixed the license, and added a Python 3 build. For this I needed to rename the package to python-pyglet & python3-pyglet.

Unfortunately the Python 3 support is not really ready upstream, so I disabled it for now. In the next version should work.

Spec URL: http://fedorapeople.org/~pviktori/rpms/python-pyglet.spec
SRPM URL: http://fedorapeople.org/~pviktori/rpms/python-pyglet-1.2-0.4.alpha1.fc19.src.rpm
Koji rawhide build (includes the Python 3 package): http://koji.fedoraproject.org/koji/taskinfo?taskID=5479283

Miro:
According to the mailing list announcement (http://groups.google.com/group/pyglet-users/msg/b848b4e1fb2a059c?hl=en), the reason for not putting this on pip was to not “break people using "pip install" or similar tools”. Since pyglet-1.1.4 is not packaged for Fedora, pyglet-1.2 can't really break existing packages.
Hopefully printrun upstream can support pyglet-1.2 soon.
Comment 18 Miro Hrončok 2013-06-07 06:58:01 EDT
Taking it into account.
Comment 19 Jerry James 2013-06-07 10:54:11 EDT
OK, license appears correct and I don't see any other issues.  I hope that printrun can be adapted to this version, too.  Thanks for attempting python3 support, Petr.  This package is APPROVED.
Comment 20 Fedora Update System 2013-06-07 17:34:59 EDT
printrun-0.0-24.20130123git71e5da0.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/printrun-0.0-24.20130123git71e5da0.fc19
Comment 21 Fedora Update System 2013-06-07 17:35:32 EDT
printrun-0.0-24.20130123git71e5da0.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/printrun-0.0-24.20130123git71e5da0.fc18
Comment 22 Fedora Update System 2013-06-07 17:36:05 EDT
printrun-0.0-24.20130123git71e5da0.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/printrun-0.0-24.20130123git71e5da0.fc17
Comment 23 Fedora Update System 2013-06-07 22:56:05 EDT
Package printrun-0.0-24.20130123git71e5da0.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing printrun-0.0-24.20130123git71e5da0.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-10337/printrun-0.0-24.20130123git71e5da0.fc19
then log in and leave karma (feedback).
Comment 24 Miro Hrončok 2013-06-08 05:43:44 EDT
(Sorry for messing up with the bug status)
Comment 25 Petr Viktorin 2013-06-10 12:35:06 EDT
New Package SCM Request
=======================
Package Name: python-pyglet 
Short Description: A cross-platform windowing and multimedia library for Python
Owners: pviktori
Branches: f18 f19
InitialCC:
Comment 26 Gwyn Ciesla 2013-06-10 12:53:53 EDT
WARNING: Requested package name python-pyglet doesn't match bug summary
pyglet, please correct.
Comment 27 Petr Viktorin 2013-06-11 13:09:16 EDT
New Package SCM Request
=======================
Package Name: python-pyglet 
Short Description: A cross-platform windowing and multimedia library for Python
Owners: pviktori
Branches: f18 f19
InitialCC:
Comment 28 Gwyn Ciesla 2013-06-11 13:19:12 EDT
Git done (by process-git-requests).
Comment 29 Fedora Update System 2013-06-17 00:31:19 EDT
printrun-0.0-24.20130123git71e5da0.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 30 Fedora Update System 2013-06-17 12:11:56 EDT
python-pyglet-1.2-0.5.alpha1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/python-pyglet-1.2-0.5.alpha1.fc19
Comment 31 Fedora Update System 2013-06-17 12:23:02 EDT
python-pyglet-1.2-0.5.alpha1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/python-pyglet-1.2-0.5.alpha1.fc18
Comment 32 Fedora Update System 2013-06-17 21:32:12 EDT
python-pyglet-1.2-0.5.alpha1.fc18 has been pushed to the Fedora 18 testing repository.
Comment 33 Fedora Update System 2013-06-17 21:34:56 EDT
printrun-0.0-24.20130123git71e5da0.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 34 Fedora Update System 2013-06-17 21:37:48 EDT
printrun-0.0-24.20130123git71e5da0.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 35 Fedora Update System 2013-06-26 22:10:09 EDT
python-pyglet-1.2-0.5.alpha1.fc18 has been pushed to the Fedora 18 stable repository.
Comment 36 Fedora Update System 2013-06-29 14:22:01 EDT
python-pyglet-1.2-0.5.alpha1.fc19 has been pushed to the Fedora 19 stable repository.
Comment 37 Andrej 2013-08-03 02:22:48 EDT
There is a problem with F18 package of python-pyglet[*]:

Python-sympy needs png decoder in python-pyglest which is removed according to python-pyglest specs:

(...)
# Remove the bundled pypng library python-pillow provides the same functionality)
rm pyglet/image/codecs/png.py
rm pyglet/image/codecs/pypng.py
(...)

but python-pillow is never submitted in Fedora 18 repos, so png decoder doesn't work in F18 version of pyglet. Tnx.


[*] I don't know if this is a good place to put it or should I open a new bug report.
Comment 38 Christopher Meng 2013-08-03 02:27:05 EDT
It's closed, you'd better create a new bug.

IMO this package shouldn't have this branch if things are really being as you've said.
Comment 39 Andrej 2013-08-03 02:54:37 EDT
Tnx Christopher for a really fast response. I'll still wait for Petr's answer before I open a new bug because he is a primary maintainter so he will probably need to fix it.

In the context of facts that in few months F18 will be EOL so this bug would be obsolete and this troublesome feature of SymPy is rearly used, I don't think I should open a new bug report only for the sake of formality. Let it be here only for a record but you guys can freely decide otherwise :-)
Comment 40 Petr Viktorin 2013-08-12 04:36:42 EDT
Sorry for the late response, I was on vacation last week.

Looks like I didn't test enough on f18. The fix should be easy (use python-imaging instead of Pillow on f18) but testing it will take longer.
I'll open a new bug if you don't beat me to it.
Comment 41 Petr Viktorin 2013-08-17 13:35:48 EDT
I've tested on f18 and checked that PNG images are loaded fine. On a typical desktop, the GDKPixbuf2ImageDecoder will probably get selected, but the PILImageDecoder also works. It uses python-imaging (PIL), which got replaced by python-pillow in f19. The Pyglet package does depend on python-imaging in f18.
The PNG decoder is missing, as expected.

If python-sympy really needs the PNG decoder and can't use another one that loads PNGs, then I'm sorry -- I'm not putting the bundled fork of pypng back.
The right way would be to fix Pyglet to use upstream pypng, and package pypng for Fedora (https://bugzilla.redhat.com/show_bug.cgi?id=810376). Unfortunately I don't have resources to do that any time soon.

Please open a new bug, e-mail me privately, for any further discussion.
Comment 42 Orion Poplawski 2015-07-06 17:33:44 EDT
We need this in EPEL7 for sympy.  Petr - would you be willing to maintain it there?
Comment 43 Petr Viktorin 2015-07-07 07:17:50 EDT
Well, I wouldn't mind a co-maintainer :)
But, all that'll be needed is to make with_python3 conditional, and some testing. When I have a bit of time I'll go spin up an EL7 machine and do it.


If anyone wants to help: build the package, and run events & graphics from [0] with it installed. That should test it enough.

https://bitbucket.org/pyglet/pyglet/src/cd6753287628056278d566b1cc556a41c66cf1b5/examples/?at=default
Comment 44 Orion Poplawski 2015-07-07 19:10:30 EDT
I'd be happy to comaintain.  FAS - orion

Why the use of %py_byte_compile?  I've never seen that in a package before.  Macro doesn't seem to exist on EL7.

So, with:

diff --git a/python-pyglet.spec b/python-pyglet.spec
index b08a2c4..ede83af 100644
--- a/python-pyglet.spec
+++ b/python-pyglet.spec
@@ -1,4 +1,6 @@
+%if 0%{?fedora}
 %global with_python3 1
+%endif

 %global srcname pyglet
 %global srcversion 1.2.1
@@ -102,12 +104,12 @@ popd

 %install
 %{__python} setup.py install --skip-build --root %{buildroot}
-%py_byte_compile %{__python} %{buildroot}%{python_sitelib}/%{srcname}
+%{__python} %{buildroot}%{python_sitelib}/%{srcname}

 %if 0%{?with_python3}
 pushd %{py3dir}
 %{__python3} setup.py install --skip-build --root %{buildroot}
-%py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/%{srcname}
+%{__python3} %{buildroot}%{python3_sitelib}/%{srcname}
 popd
 %endif


I end up with:

+ /usr/bin/python /builddir/build/BUILDROOT/python-pyglet-1.2.1-1.el7.x86_64/usr/lib/python2.7/site-packages/pyglet
/usr/bin/python: can't find '__main__' module in '/builddir/build/BUILDROOT/python-pyglet-1.2.1-1.el7.x86_64/usr/lib/python2.7/site-packages/pyglet'

Perhaps the %py_byte_compile was supposed to set that up?
Comment 45 Petr Viktorin 2015-07-08 04:07:42 EDT
%py_byte_compile compiles the sources to bytecode.

It's a macro from python3-devel, so it won't be on EL7, but it's given in Fedora package guidelines (https://fedoraproject.org/wiki/Packaging:Python#Macros)

You can use code like this:

%if 0%{?with_python3}
%py_byte_compile %{__python2} %{buildroot}%{python_sitelib}/%{srcname}
%else
# py_byte_compile is only defined in python3-devel
%{__python2} -m compileall %{buildroot}%{python_sitelib}/%{srcname}
%endif
Comment 46 Miro Hrončok 2015-07-08 05:36:12 EDT
You don't need to call %py_byte_compile on things in %{python_sitelib} or %{python3_sitelib}.

See https://fedoraproject.org/wiki/Packaging:Python#Bytecompiling_with_the_correct_python_version for reference.
Comment 47 Orion Poplawski 2015-07-08 11:14:07 EDT
Package Change Request
======================
Package Name: python-pyglet
New Branches: epel7
Owners: pviktori orion
InitialCC:
Comment 48 Gwyn Ciesla 2015-07-08 11:42:39 EDT
Git done (by process-git-requests).
Comment 49 Petr Viktorin 2015-07-08 11:49:19 EDT
Thanks Jon!

And thanks Orion for your work! I gave you commit access to all branches, but I'd like to test the change before pushing to Fedora if you don't mind.
Comment 50 Orion Poplawski 2015-07-08 11:54:59 EDT
Petr - I'll push my changes to the EPEL7 branch first.  Should be fine to push to Fedora, but I'll let you do that.

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