livery.workshop._new_project¶
livery.workshop._new_project ¶
fm new.project: birth, end to end, one idempotent verb.
Seed the contract, write the project's seeds, lock and sync, deliver
the extension content, generate the CI files, initialise git, then the
forge half: create the repository, assert its configuration, push,
and open the unarmed setup pull request. Every step detects done
and walks past it, so re-running is the recovery procedure and a
kill between any two steps costs nothing. --local is everything
that stays on the machine and nothing that leaves it.
The task lives above any repository, so the workspace it makes never
needed one. The workspace's extensions are the stock list
(birth_extensions) unless --extensions names them, and the
birth writes them as their canonical list.
Functions:
| Name | Description |
|---|---|
birth_extensions |
The extensions a birth lists, from the running App's builtin providers. |
canonical_extensions |
names as the canonical list a birth writes. |
new_project |
Create a workspace in an empty or new folder, end to end, as one verb. |
Attributes:
| Name | Type | Description |
|---|---|---|
PUBLISHED_INDEX |
|
|
STOCK |
|
STOCK
module-attribute
¶
birth_extensions ¶
The extensions a birth lists, from the running App's builtin providers.
Footman's own providers and the base are never listed. A stock App
(the base among its builtins) lists the stock list (STOCK), and
a branded App its own extensions beside them, all as their
canonical list (canonical_extensions). A brand's extension
takes another's file or step by requiring it and declaring the
replacement, never by where it is listed.
Source code in packages/workshop/src/livery/workshop/_new_project.py
canonical_extensions ¶
names as the canonical list a birth writes.
The minimal list of their set in composition order, as the installed declarations compose it: an extension another one requires is left out, and a name no installed distribution declares requires nothing.
Raises:
| Type | Description |
|---|---|
Failed
|
when the set's declared order has no start, naming the cycle. |
Source code in packages/workshop/src/livery/workshop/_new_project.py
new_project ¶
new_project(folder: Annotated[Arg[str], doc('where the project is born, an empty or new folder; this one by default')] = '', name: Annotated[str, doc("the workspace's name, also the repository's; the folder's by default")] = '', forge: Annotated[str, doc('github, gitea, or gitlab; github by default')] = '', owner: Annotated[str, doc('the owner or organisation the repository lives under')] = '', url: Annotated[str, doc('the forge server (empty for github.com and gitlab.com)')] = '', description: Annotated[str, doc('one sentence for the virtual root')] = '', author: Annotated[str, doc("the authors entry's name (default: git config)")] = '', email: Annotated[str, doc("the authors entry's email (default: git config)")] = '', namespace: Annotated[str, doc('dotted namespace packages live in')] = '', extension: Annotated[str, doc("also scaffold this named extension package, with its branded App, and self-host it: the workspace becomes the extension's home")] = '', local: Annotated[bool, doc('everything that stays on the machine, nothing that leaves it')] = False, extensions: Annotated[str, doc("the extensions the workspace lists, comma-separated, each by name, written as their canonical list; the stock list by default, which names python for the workspace's own tests")] = '', resume: Annotated[bool, hidden] = False) -> None
Create a workspace in an empty or new folder, end to end, as one verb.
The birth seeds the contract, whose [workspace] extensions is
the stock list or the one --extensions names, written as its
canonical list: no extension another one requires, in composition
order. The stock list names python: the workspace's own tests hold
the root's set, and run while it holds python. It writes the
project's files, locks and syncs its environment, then hands the
rest to the runner that environment holds, run as
new.project --resume inside the project. There the project's
own extensions are mounted, so its
tools, its composed and generated files and its forge half come
from them at the versions it locked. A folder that holds a project
refuses, naming --resume, which finishes that project's birth:
every step of it detects done and walks past it, so it is also
the recovery after a birth that stopped part way. Headless runs
never hang; a missing required answer is a refusal listing what to
pass.
Source code in packages/workshop/src/livery/workshop/_new_project.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 | |