hey guys, I'm trying to setup a python library mon...
# general
b
hey guys, I'm trying to setup a python library monorepo where I publish out packages that depend on each other, something like: • utils • package1 (depends on utils) • package2 (depends on utils and package1) The problem I am trying to solve is loose version pinning for 1st party dependencies, currently it seems like pants pins the 1st party dependency version to an EXACT version. Example: • utils 0.1.0 • package1 0.1.0 • package2 0.1.0 If I bump utils to 0.1.1 I cannot install it together with package1 0.1.0 as package1 is pinned to utils=0.1.0. Basically I want to set the version requirement in package1 to utils=^0.1.0, in package2 to package1=^0.1.0 etc Has anyone encountered trying to do this? I think I should be able to override the requirements with a plugin but asking first to see if theres an easier solution
h
To clarify, Pants is building distributions (wheels) and you want the wheel metadata to be looser?
And currently Pants is generating setup.py for you, so it's generating the requirement metadata?
b
exactly, building wheels with all default configs generating metadata
h
Specifically the "CHANGING THE VERSIONING SCHEME FOR FIRST-PARTY DEPENDENCIES" bit
b
oh this looks exactly what I'm looking for, will try it out! would be nice to have the option to set
^=
instead of
~=
but I guess I can stick to strict semver for my internal packages 🙂
h
What is the difference between the two? You could add another value to that option if you like.
b
~=2.0.0
means
>=2.0.0,<2.1.0
- minor version pin, while
^=2.0.0
means
>=2.0.0,<3.0.0
major version pin
I just verified and I had them mixed up myself,
~=
is exactly what I'm looking for