Discover workspaces without using them in resolution (#3585)

Add minimal support for workspace discovery, only used for determining
paths in the bluejay commands.

We can now discover the workspace structure, namely that the
`pyproject.toml` of a package belongs to a workspace `pyproject.toml`
with members and exclusion. The globbing logic is inspired by cargo. We
don't resolve `workspace = true` metadata declarations yet.
This commit is contained in:
konsti
2024-05-21 19:17:26 +02:00
committed by GitHub
parent 5205165d42
commit 2ffd453003
43 changed files with 1007 additions and 151 deletions
@@ -0,0 +1,11 @@
from albatross import fly
try:
from bird_feeder import use
raise RuntimeError("bird-feeder installed")
except ModuleNotFoundError:
pass
fly()
print("Success")
@@ -0,0 +1,10 @@
from bird_feeder import use
try:
from albatross import fly
raise RuntimeError("albatross installed")
except ModuleNotFoundError:
pass
print("Success")
@@ -0,0 +1,8 @@
[project]
name = "bird-feeder"
version = "1.0.0"
dependencies = ["anyio>=4.3.0,<5"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
@@ -0,0 +1,5 @@
import anyio
def use():
print("squirrel")
@@ -0,0 +1,8 @@
[project]
name = "albatross"
version = "0.1.0"
dependencies = ["tqdm>=4,<5"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
@@ -0,0 +1,9 @@
import tqdm
def fly():
pass
if __name__ == '__main__':
print("Caw")