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

version problem with split #201

Closed
frankgould opened this issue May 29, 2015 · 9 comments
Closed

version problem with split #201

frankgould opened this issue May 29, 2015 · 9 comments
Labels

Comments

@frankgould
Copy link

I have been using buildozer for months and it has run perfectly until this morning and I have no idea how anything changed to cause the build to fail. I've tried restoring back to a previous known success date and reinstalled all the python and buildozer library and local build folders. Below are the results that have been consistent since the beginning of the failures. I have searched everywhere online and could not find anyone else experiencing the same problem. I can provide more details but at this point, I don't know what to share since it's all been rebuilt, or so I thought, and I've tested a simple kivy program to build. Any suggestions will be greatly appreciated. Until then, I am dead in the waters, so to speak, and cannot build my apk.

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/buildozer", line 9, in
load_entry_point('buildozer==0.28dev', 'console_scripts', 'buildozer')()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/buildozer-0.28dev-py2.7.egg/buildozer/scripts/client.py", line 13, in main
Buildozer().run_command(sys.argv[1:])
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/buildozer-0.28dev-py2.7.egg/buildozer/init.py", line 980, in run_command
self.target.run_commands(args)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/buildozer-0.28dev-py2.7.egg/buildozer/target.py", line 85, in run_commands
func(args)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/buildozer-0.28dev-py2.7.egg/buildozer/target.py", line 95, in cmd_debug
self.buildozer.prepare_for_build()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/buildozer-0.28dev-py2.7.egg/buildozer/init.py", line 161, in prepare_for_build
self.target.install_platform()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/buildozer-0.28dev-py2.7.egg/buildozer/targets/android.py", line 424, in install_platform
self._install_android_packages()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/buildozer-0.28dev-py2.7.egg/buildozer/targets/android.py", line 383, in _install_android_packages
ver = self._find_latest_package(packages, 'build-tools-')
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/buildozer-0.28dev-py2.7.egg/buildozer/targets/android.py", line 349, in _find_latest_package
version = self._process_version_string(version_string)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/buildozer-0.28dev-py2.7.egg/buildozer/targets/android.py", line 318, in _process_version_string
version = [int(i) for i in version_string.split(".")]
ValueError: invalid literal for int() with base 10: '0_rc1'

@kived kived added the bug label May 29, 2015
@tshirtman
Copy link
Member

Our fonction that does version comparison in buildozer (to know if updating of dependencies is needed) doesn't like _rc1, in fact, it doesn't like anything that's not a dot or a number, we need a better function that understand the various ways people express versions, and it's actually quite a complicated problem, we had a look at using LooseVersion from distutils, but it's not able to correctly sort that either (it doesn't crash, but returns the wrong result, that is, LooseVersion("23.0.0_rc1") > LooseVersion("23.0.0") == True, clearly an rc is always anterior to its equivalent non-rc release. Since we don't control these versions (it's from the android team at google), we need a robust way to solve this problem.

My ugly workaround currently involves changing _process_version_string in buildozer/targets/android.py to make it ignore '_rc1'.

version = [int(i) for i in version_string.replace('_rc1', '').split(".")]

for reference, python's pep 440 (https://www.python.org/dev/peps/pep-0440/#pre-release-separators) defines valid version schemes in python, and seems to cover this case, the pypa reference implementation (linked at the bottom) should probably be tried first.

https://github.com/pypa/packaging/blob/master/packaging/version.py

@frankgould
Copy link
Author

Thank you! I changed the android.py line to remove _rc1 and it worked. I appreciate your time and quick response. Thank you for being there to help.

@tshirtman tshirtman reopened this May 30, 2015
@tshirtman
Copy link
Member

that way is just a workaround, reopening.

It would be nice if you could test with the branch of the PR just over here (#202) i can't test a full build now for various reasons, but it should solve it in a cleaner way.

@frankgould
Copy link
Author

I'll be more than glad to test it but I'm not sure how I need to set it
up. For instance, do you want me to remove the workaround and replace
the file below with the code from GitHub on the link below the file
name?

https://github.com/pypa/packaging/blob/master/packaging/version.py

284a69c

Sorry, I'm new to this environment and want to make sure I test what you
need testing. Also, names are not clear to me, like pypa and PEP440. I
don't need a definition of them if I don't need to know. Just let me
know how I can help and I'll make it happen.

All the best,
Frank Gould
ViewPix.Net
P.O. Box 608516
Orlando, Florida 32860-8516

------ Original Message ------
From: "Gabriel Pettier" notifications@github.com
To: "kivy/buildozer" buildozer@noreply.github.com
Cc: "frankgould" frank.gould@viewpix.net
Sent: 5/30/2015 5:03:24 PM
Subject: Re: [buildozer] version problem with split (#201)

that way is just a workaround, reopening.

It would be nice if you could test with the branch of the PR just over
here (#202) i can't test a full build now for various reasons, but it
should solve it in a cleaner way.


Reply to this email directly or view it on GitHub.

@tshirtman
Copy link
Member

yeah, you'll need to remove the fix, but you can simply replace the whole file with this version:
https://github.com/kivy/buildozer/blob/fix_201/buildozer/targets/android.py

and add these two files in libs/

https://github.com/kivy/buildozer/blob/fix_201/buildozer/libs/version.py
https://github.com/kivy/buildozer/blob/fix_201/buildozer/libs/_structures.py

@frankgould
Copy link
Author

I did as you suggested and believe it all works. It took me a while to
get the files in the right places with the right code but I finally was
successful in building and testing the app. I'll continue to use it
with the code you provided in case you have any questions. Let me know
if you have any.

Thanks!

All the best,
Frank Gould
ViewPix.Net
P.O. Box 608516
Orlando, Florida 32860-8516

------ Original Message ------
From: "Gabriel Pettier" notifications@github.com
To: "kivy/buildozer" buildozer@noreply.github.com
Cc: "frankgould" frank.gould@viewpix.net
Sent: 5/30/2015 6:18:43 PM
Subject: Re: [buildozer] version problem with split (#201)

yeah, you'll need to remove the fix, but you can simply replace the
whole file with this version:
https://github.com/kivy/buildozer/blob/fix_201/buildozer/targets/android.py

and add these two files in libs/

https://github.com/kivy/buildozer/blob/fix_201/buildozer/libs/version.py
https://github.com/kivy/buildozer/blob/fix_201/buildozer/libs/_structures.py


Reply to this email directly or view it on GitHub.

@tshirtman
Copy link
Member

Thanks a lot for you time testing :)

@frankgould
Copy link
Author

Thank you for the quick and successful solution!

All the best,
Frank Gould
ViewPix.Net
P.O. Box 608516
Orlando, Florida 32860-8516

------ Original Message ------
From: "Gabriel Pettier" notifications@github.com
To: "kivy/buildozer" buildozer@noreply.github.com
Cc: "frankgould" frank.gould@viewpix.net
Sent: 5/31/2015 11:49:35 AM
Subject: Re: [buildozer] version problem with split (#201)
Thanks a lot for you time testing :)


Reply to this email directly or view it on GitHub.

@oukiar
Copy link

oukiar commented Aug 6, 2015

great ! ... this solve my day, of couse, I only update to the latest github version and the apk was successfull generated. (Y) regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants