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

Support for lxml #1194

Closed
dip-m opened this issue Apr 19, 2023 · 4 comments
Closed

Support for lxml #1194

dip-m opened this issue Apr 19, 2023 · 4 comments
Labels
android The issue relates to Android mobile support. enhancement New features, or improvements to existing features. iOS The issue relates to Apple iOS mobile support.

Comments

@dip-m
Copy link

dip-m commented Apr 19, 2023

What is the problem or limitation you are having?

I am currently developing an app which integrates ebaysdk as its dependency. This works for the windows MSI but fails when building android with the following error message:

  running build_ext
  building 'lxml.etree' extension
  error: CCompiler.compile: Chaquopy cannot compile native code
  ----------------------------------------
ERROR: Failed to install lxml from https://files.pythonhosted.org/packages/06/5a/e11cad7b79f2cf3dd2ff8f81fa8ca667e7591d3d8451768589996b65dec1/lxml-4.9.2.tar.gz#sha256=2455cfaeb7ac70338b3257f41e21f0724f4b5b0c0e7702da67ee6c3640835b67 (from ebaysdk->-r requirements.txt (line 3)).

Describe the solution you'd like

I understand lxml comes with binaries and is hence not supported by default yet. Can we please have this supported and/or ways to have this sorted?

Describe alternatives you've considered

Instructions to download and sort through the binary dependencies so this dependency can be resolved for android builds would also be great.

Additional context

No response

@dip-m dip-m added the enhancement New features, or improvements to existing features. label Apr 19, 2023
@freakboy3742 freakboy3742 changed the title Support for ebaysdk (lxml) Support for lxml Apr 19, 2023
@freakboy3742 freakboy3742 added iOS The issue relates to Apple iOS mobile support. android The issue relates to Android mobile support. labels Apr 19, 2023
@freakboy3742
Copy link
Member

As described in the FAQ, we maintain independent pip-compatible repositories with pre-built binaries for some packages on PyPI.

lxml is on that list for Android, but not every version of lxml that is on PyPI has a binary android wheel; ebaySDK appears to be requesting v4.9.2, but we only provide v4.4.2 and v4.6.3.

There are two possible workarounds:

  1. Explicitly pin the version of lxml to one that is provided by Beeware. That explicit version pin might be sufficient to work around

  2. Build the wheel yourself. As there's already a recipe for lxml, it may be a relatively straightforward task to update that recipe for 4.9.2; the Chaquopy packaging README gives instructions on how to build a package. Once you have a locally compiled version of the wheel, you can add an explicit reference to that wheel in your requires list.

If you take path (2) and you're successful, it would be worthwhile submitting your changes as a PR; that way we can publish an updated LXML wheel for everyone to use.

@dip-m
Copy link
Author

dip-m commented May 2, 2023 via email

@mhsmith
Copy link
Member

mhsmith commented May 7, 2023

Actually ebaysdk does not require any particular version of lxml, so the problem is more likely to be that we only have Android builds of lxml for Python 3.8 (chaquo/chaquopy#816).

To change your app's Python version, create a new virtual environment with the desired version, install Briefcase into it, then rerun briefcase create android.

@mhsmith
Copy link
Member

mhsmith commented Feb 12, 2024

For updates on Android lxml support, please follow the Chaquopy issue linked in my previous comment.

@mhsmith mhsmith closed this as completed Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android The issue relates to Android mobile support. enhancement New features, or improvements to existing features. iOS The issue relates to Apple iOS mobile support.
Projects
None yet
Development

No branches or pull requests

3 participants