A workspace package that can be checked against its minimum dependencies.
| 116 | |
| 117 | @dataclass(frozen=True) |
| 118 | class Package: |
| 119 | """A workspace package that can be checked against its minimum dependencies.""" |
| 120 | |
| 121 | name: str |
| 122 | """The package directory name (e.g. ``reflex-base``), used as the CLI identifier.""" |
| 123 | |
| 124 | project_dir: Path |
| 125 | """Directory containing the package's ``pyproject.toml`` (the editable install target).""" |
| 126 | |
| 127 | source_dir: Path |
| 128 | """Directory of importable source that pyright should type-check.""" |
| 129 | |
| 130 | extras: tuple[str, ...] |
| 131 | """Names of optional-dependency groups to install alongside the package.""" |
| 132 | |
| 133 | local_dev_sources: tuple[Path, ...] = () |
| 134 | """Project dirs of sibling workspace packages this package pins to a ``*.dev`` release. |
| 135 | |
| 136 | These are installed editable from the local checkout (rather than PyPI) in both |
| 137 | resolutions, because the pinned development version is not published. |
| 138 | """ |
| 139 | |
| 140 | def install_target(self) -> str: |
| 141 | """Build the editable install target, including any extras. |
| 142 | |
| 143 | Returns: |
| 144 | The path passed to ``uv pip install -e``, with ``[extra,...]`` appended. |
| 145 | """ |
| 146 | target = str(self.project_dir) |
| 147 | if self.extras: |
| 148 | target += "[" + ",".join(self.extras) + "]" |
| 149 | return target |
| 150 | |
| 151 | |
| 152 | def _load_pyproject(path: Path) -> dict: |