Hey friends, on a bit of a yak shaving adventure. ...
# general
b
Hey friends, on a bit of a yak shaving adventure. Pex doesn't seem to respect Ye Olde setup.py
setup_requires
, and some internal sdists rely on that to specify they need Cython to build. However, the latest versions of pex do have a handy
--extra-pip-requirement
flag to let me force Cython into its buildtime venv. I've made use of
__defaults__
to get this passed down to pex via pex_binary's extra_build_args opt. Something like...
Copy code
__defaults__(
    extend=True,
    all=dict(
        extra_build_args=[
            "--extra-pip-requirement=Cython==3.0.11",
        ],
    )
)
This has every pex_binary I've defined myself building and working as expected. However, it doesn't seem to be applying to what I assume is an implicit pex target: the
mypy
one used as part of
pants check ::
- which will resolve some of these oddball sdists. This fails with an error I expect to see if Cython isn't available at build time. Am I just mistyping the
__defaults__
incantation here? Or is there something else I'm missing?
b
Sorry for the trouble. Running
pants check ::
won't build the `pex_binary`s, it'll be handling the source code as python_sources/distributions more directly... so it's expected that that default won't improve the behaviour of
pants check ::
. I'm not exactly sure of the best way to handle this though.
b
I'm going down the path of just removing or PEP-518-ifying the oddball dependencies themselves at the moment. I'm not sure there really is a cleaner solution, to be honest.