https://pantsbuild.org/ logo
#general
Title
# general
c

careful-address-89803

07/01/2022, 5:26 AM
hey folks, I'm having a weirdness with lockfiles. when trying to install
msal-extensions
, it has a dependency on portalocker, which has a dependency on
pywin32
on windows. If I have
msal-extensions
listed directly in a
python_requirment
, it thinks that it always needs
pywin32
. But if instead I copy the dependencies that it requests, it correctly identifies that it only needs
pywin32
on windows. Details and repro in thread
1
doesn't work:
Copy code
python_requirement(
name="a",
requirements=[
		"msal-extensions"
    ],
resolve="a",
)
works (except I don't get `msal-extensions`:
Copy code
python_requirement(
name="a",
requirements=[
        'msal>=0.4.1,<2.0.0',
        "portalocker<3,>=1.0;python_version>='3.5' and platform_system!='Windows'",
        "portalocker<2,>=1.0;python_version=='2.7' and platform_system!='Windows'",
        "portalocker<3,>=1.6;python_version>='3.5' and platform_system=='Windows'",
        "portalocker<2,>=1.6;python_version=='2.7' and platform_system=='Windows'",
        "pathlib2;python_version<'3.0'",
    ],
resolve="a",
)
If I merge
msal-extensions
with its dependencies, it also doesn't work. This is the situation on pants 2.11 and on the latest. in the lockfile, with poetry generator, working looks like:
pywin32==304; python_version >= "3.5" and platform_system == "Windows"
, and not working looks like
pywin32==304 \
. Any help is appreciated
hmactually, I might be misunderstanding how lockfiles work with Pants. Should I expect the lockfiles generated by the poetry lockfile generator to be installable with pip? nevermind, even pants is having trouble running tests now
turns out it's a poetry thing! https://github.com/python-poetry/poetry/issues/3511 just gotta figure out how to specify a more recent version of poetry
Copy code
[poetry]
version = "poetry>=1.1.13"
ezpz, build succeeds
4 Views