steep-match-53634
01/16/2023, 11:15 PMmysqlclient
that requires building a C library, but as Pants kinda pushes you to use pex, I'm ending up with building it not on the system that will actually run the app, and of course I'm getting a 'missing .so' error at run time. How do you solve this problem in a Pants setup? Maybe there's a way to add a dependency on top of existing pex? Or how do I prebulid a proper variant of mysqlclient
and make sure Pants includes it specifically (or platform dependent)? I tried building a pex_binary
with complete_platforms
that include my system's and container system's output of pex3 interpreter inspect --markers --tags
, but it fails with 'No matching distribution' for both.happy-kitchen-89482
01/16/2023, 11:18 PMmysqlclient
and host them on an internal pypi serversteep-match-53634
01/16/2023, 11:49 PMhappy-kitchen-89482
01/17/2023, 2:42 AMsteep-match-53634
01/17/2023, 8:05 AMplatform
nor complete_platforms
isn't available for a python_source
targetshappy-kitchen-89482
01/17/2023, 12:37 PMsteep-match-53634
01/17/2023, 1:48 PMpex_binary
will work, do I have to turn the whole thing into a python package? Using python_distribution
? I thought it's as easy as giving a name to your python_sources
and then just depending on itdocker_environment
doesn't work for me. It seems to just ignore it. I even removed the local_environment
definition so it doesn't have to choose. It's not even trying to pull the image. I tried both in our code and in a pretty much isolated example, with a single source that imports MySQLDb
(provided by mysqlclient
), pex_binary
out of it, and then a docker_image
that depends on the binary and sets the entrypoint + copies the pex. It fails to import inside docker and succeeds if I just run the pex without the container. The workstation is Ubuntu 22.04 and the image is based on python:3.10-busterwitty-crayon-22786
01/17/2023, 5:41 PMpex_binary
as using it? and then ./pants package
was the command you were running?steep-match-53634
01/17/2023, 6:37 PMwitty-crayon-22786
01/17/2023, 6:38 PMsteep-match-53634
01/17/2023, 7:45 PM