pypa / hatch

Modern, extensible Python project management
https://hatch.pypa.io/latest/
MIT License
6.06k stars 306 forks source link

With rye {root:uri}/../../packages/ seems to traverse more than 2 folders up #1570

Open ShravanSunder opened 5 months ago

ShravanSunder commented 5 months ago

i'm trying to use rye sync with a python monorepo and root:uri

the resolution of folders doesn't seem to work. for example

    "askluna-dotenv @ {root:uri}/../../packages/dotenv" => error: Distribution not found at: file:///Users/shravansunder/Documents/dev/project-dev/askluna-project/packages/dotenv
error: could not write production lockfile for workspace

    "askluna-dotenv @ {root:uri}/../packages/dotenv" =>error: Distribution not found at: file:///Users/shravansunder/Documents/dev/project-dev/askluna-project/askluna/apps/packages/dotenv

So for some reason, ../../ seems to traverse by more than 2 folders up instead of exactly 2 folders. And ../ only traverses 1 folder up

related to https://github.com/astral-sh/uv/issues/4321

ofek commented 5 months ago

Does the parent modifier work for you? https://hatch.pypa.io/latest/config/context/#global-fields

ShravanSunder commented 5 months ago

its very interesting. i'm not sure which part of the rye tool chain has an impact

So i partly have a solution, but i find this preplexing.

maybe related issues:

ofek commented 4 months ago

Anything to do here or can this be closed?

ShravanSunder commented 4 months ago

Well I’m unsure if this uri feature works as I mentioned above, however perhaps I just don’t understand the behaviour. You can close it if you like.

ofek commented 4 months ago

Does it work for you outside of Rye?

ShravanSunder commented 4 months ago

i actually don't use hatch aside from rye. feel free to close it if you'd like!