Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python-qrcode: add Python3 #8337

Merged
merged 1 commit into from Jul 11, 2019
Merged

python-qrcode: add Python3 #8337

merged 1 commit into from Jul 11, 2019

Conversation

BKPepe
Copy link
Member

@BKPepe BKPepe commented Mar 3, 2019

Maintainer: @cotequeiroz
Compile tested: mvebu (cortex-a9_vfpv3) , Turris Omnia, OpenWrt master
Run tested: mvebu (cortex-a9_vfpv3) , Turris Omnia, OpenWrt SNAPSHOT, r9420-c17a68c

Description:

  • update to version 6.1
  • add Python3 variant together with source packages
  • better looking URL
  • resorted a little bit Makefile

@BKPepe
Copy link
Member Author

BKPepe commented Mar 3, 2019

Wow, I'm curious how this could even work, because there are missing dependencies.
Running OpenWrt SNAPSHOT, r9420-c17a68c on Turris Omnia.

According to README from pypi.org, which is same in repository of python-qrcode on Github.

You need pillow for a standard installation, which isn't packaged for Python3, yet. I will look at it and until I do it, this PR will remain as draft.

root@OpenWrt:~# python
Python 2.7.15 (default, Mar 02 2019, 09:09:01) 
[GCC 7.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import qrcode
>>> img = qrcode.make('Some data here')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/qrcode/main.py", line 11, in make
  File "/usr/lib/python2.7/site-packages/qrcode/main.py", line 289, in make_image
  File "/usr/lib/python2.7/site-packages/qrcode/image/pil.py", line 8, in <module>
ImportError: No module named Image

There are also a two issues. First one, again according to README you can use qr binary.

root@OpenWrt:~# qr "Some text" > test.png
Traceback (most recent call last):
  File "/usr/bin/qr", line 6, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources

Once, I have installed python-setuptools, it works.

Installing python-setuptools (39.0.1-2) to root...
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a9_vfpv3/packages/python-setuptools_39.0.1-2_arm_cortex-a9_vfpv3.ipk
Configuring python-setuptools.
root@OpenWrt:~# qr "Some text" > test.png
root@OpenWrt:~# 

The QR code (test.png) is created. :-)

The last one is caused by me as python-qrcode and python3-qrcode provides the same binary.

Collected errors:
 * check_data_file_clashes: Package python3-qrcode wants to install file /usr/bin/qr
	But that file is already provided by package  * python-qrcode
 * opkg_install_cmd: Cannot install package python3-qrcode.

@cotequeiroz
Copy link
Member

I thought I had updated my Makefiles a while back, but I think this one was left behind. I was trying to update them all to python3, but this one had dependencies that were not met.

The reason I added this package was because it is a dependency to the seafile packages. I haven't tested it outside of that, so it may need some work.

If you want to take over as maintainer, please go ahead.

@cotequeiroz
Copy link
Member

I've opened a #8446 with just the version bump, in case this takes a while.
If your only outstanding issue issue is the qr utility, you can (there are other ways):

  • save one of them to /bin/qr, and the other in /usr/bin/qr (probably the easiest, although less elegant)
  • build separate packages: qrcode-python-util, and qrcode-python3-util, and use PROVIDES, and CONFLICTS, like ucert and ucert-full are done in package/system/ucert/Makefile.

@BKPepe
Copy link
Member Author

BKPepe commented Mar 21, 2019

That was too fast and I didn't have any chance to left my comment in your pull request. If you'd ask, I could separate this pull request or edit it to just bump it the version. Because now, we did the same thing. I'm not stuck with qr binary as you would think and I want to do it as it should be.

I'm still dealing with setup.py in Pillow as it is a dependency for python-qrcode. The Python2 variant of pillow is passing as it should, but setup.py for Pillow is written so horrible that takes time for me and for now I cannot compile it as it is for Python3. I'm thinking of a few ways how to do it.

Yeah, it should be faster, but while at it, I'm learning new things and I like challenges. :-)

@cotequeiroz
Copy link
Member

Sorry if I trumped you, it was not my intent. I just felt we should not leave the package in tree missing the dependencies, and while at it, I did the version bump as well.
Cheers

@BKPepe BKPepe changed the title python-qrcode: add Python3 and update to 6.1 python-qrcode: add Python3 Apr 18, 2019
@BKPepe
Copy link
Member Author

BKPepe commented Apr 18, 2019

A few days ago, I had been finally able to compile Pillow for Python 3. Hopefully today or tomorrow, I will prepare the pull request and once it would be merged, this will be ready for review.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
@neheb
Copy link
Contributor

neheb commented Jul 9, 2019

I assume this is ready?

@cotequeiroz
Copy link
Member

Not yet. It needs python3-pillow first.

@BKPepe BKPepe merged commit 5fc56ba into openwrt:master Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants