@martinffx/atelier 2.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +94 -253
- package/package.json +1 -1
- package/skills/{spec-orchestrator → atelier-orchestrator}/SKILL.md +3 -3
- package/skills/atelier-setup/SKILL.md +80 -0
- package/skills/code-review/references/reviewers.md +3 -3
- package/skills/code-review/references/rq.md +6 -6
- package/skills/spec-brainstorm/SKILL.md +5 -5
- package/skills/spec-implement/SKILL.md +2 -3
- package/skills/spec-plan/SKILL.md +21 -29
- package/skills/spec-plan/references/plan_template.md +77 -0
- package/skills/python-architecture/SKILL.md +0 -148
- package/skills/python-architecture/references/data-modeling.md +0 -558
- package/skills/python-architecture/references/ddd.md +0 -569
- package/skills/python-architecture/references/functional-core.md +0 -337
- package/skills/python-build-tools/SKILL.md +0 -153
- package/skills/python-build-tools/references/basedpyright.md +0 -321
- package/skills/python-build-tools/references/ruff.md +0 -225
- package/skills/python-build-tools/references/uv.md +0 -257
- package/skills/python-fastapi/SKILL.md +0 -184
- package/skills/python-fastapi/references/api-design.md +0 -563
- package/skills/python-fastapi/references/dependencies.md +0 -479
- package/skills/python-fastapi/references/middleware.md +0 -475
- package/skills/python-fastapi/references/validation.md +0 -497
- package/skills/python-modern-python/SKILL.md +0 -201
- package/skills/python-modern-python/references/async.md +0 -76
- package/skills/python-modern-python/references/pattern-matching.md +0 -89
- package/skills/python-modern-python/references/typing.md +0 -96
- package/skills/python-monorepo/SKILL.md +0 -146
- package/skills/python-monorepo/references/docker.md +0 -515
- package/skills/python-monorepo/references/namespace-packages.md +0 -426
- package/skills/python-monorepo/references/workspace-config.md +0 -341
- package/skills/python-sqlalchemy/SKILL.md +0 -119
- package/skills/python-sqlalchemy/references/async.md +0 -51
- package/skills/python-sqlalchemy/references/models.md +0 -67
- package/skills/python-sqlalchemy/references/queries.md +0 -57
- package/skills/python-temporal/SKILL.md +0 -128
- package/skills/python-temporal/references/patterns.md +0 -87
- package/skills/python-temporal/references/testing.md +0 -54
- package/skills/python-testing/SKILL.md +0 -161
- package/skills/python-testing/references/boundaries.md +0 -449
- package/skills/python-testing/references/mocking.md +0 -449
- package/skills/python-testing/references/pytest.md +0 -524
- package/skills/typescript-api-design/SKILL.md +0 -396
- package/skills/typescript-api-design/references/error-responses.md +0 -469
- package/skills/typescript-build-tools/SKILL.md +0 -447
- package/skills/typescript-build-tools/references/biome.md +0 -436
- package/skills/typescript-build-tools/references/bun.md +0 -432
- package/skills/typescript-build-tools/references/turborepo.md +0 -426
- package/skills/typescript-build-tools/references/vitest.md +0 -518
- package/skills/typescript-drizzle-orm/SKILL.md +0 -398
- package/skills/typescript-drizzle-orm/references/cloudflare.md +0 -392
- package/skills/typescript-drizzle-orm/references/entity-pattern.md +0 -412
- package/skills/typescript-drizzle-orm/references/postgresql.md +0 -191
- package/skills/typescript-drizzle-orm/references/repository-pattern.md +0 -479
- package/skills/typescript-drizzle-orm/references/sqlite.md +0 -291
- package/skills/typescript-dynamodb-toolbox/SKILL.md +0 -370
- package/skills/typescript-dynamodb-toolbox/references/entity-layer.md +0 -574
- package/skills/typescript-dynamodb-toolbox/references/error-handling.md +0 -495
- package/skills/typescript-dynamodb-toolbox/references/modeling.md +0 -332
- package/skills/typescript-dynamodb-toolbox/references/repository-layer.md +0 -631
- package/skills/typescript-dynamodb-toolbox/references/testing.md +0 -718
- package/skills/typescript-dynamodb-toolbox/references/transactions.md +0 -423
- package/skills/typescript-effect-ts/SKILL.md +0 -341
- package/skills/typescript-effect-ts/references/core.md +0 -412
- package/skills/typescript-effect-ts/references/error-handling.md +0 -468
- package/skills/typescript-effect-ts/references/resources.md +0 -476
- package/skills/typescript-effect-ts/references/schema.md +0 -536
- package/skills/typescript-effect-ts/references/services.md +0 -461
- package/skills/typescript-fastify/SKILL.md +0 -405
- package/skills/typescript-fastify/references/plugins.md +0 -329
- package/skills/typescript-fastify/references/typeid.md +0 -315
- package/skills/typescript-functional-patterns/SKILL.md +0 -402
- package/skills/typescript-functional-patterns/references/adts.md +0 -497
- package/skills/typescript-functional-patterns/references/branded-types.md +0 -542
- package/skills/typescript-functional-patterns/references/migration-guide.md +0 -695
- package/skills/typescript-functional-patterns/references/option-result.md +0 -585
- package/skills/typescript-testing/SKILL.md +0 -353
- package/skills/typescript-testing/references/mocking.md +0 -675
- package/skills/typescript-testing/references/msw.md +0 -852
- package/skills/typescript-testing/references/snapshot-testing.md +0 -774
|
@@ -1,426 +0,0 @@
|
|
|
1
|
-
# Namespace Packages (PEP 420)
|
|
2
|
-
|
|
3
|
-
Namespace packages allow multiple packages to share a common namespace, useful for organizing related libraries in monorepos.
|
|
4
|
-
|
|
5
|
-
## What is a Namespace Package?
|
|
6
|
-
|
|
7
|
-
A namespace package is a package that:
|
|
8
|
-
- Has no `__init__.py` file at the namespace level
|
|
9
|
-
- Can be split across multiple distributions
|
|
10
|
-
- Allows import from common namespace
|
|
11
|
-
|
|
12
|
-
**Traditional package:**
|
|
13
|
-
```
|
|
14
|
-
my_package/
|
|
15
|
-
├── __init__.py # Makes it a package
|
|
16
|
-
└── module.py
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
**Namespace package:**
|
|
20
|
-
```
|
|
21
|
-
my_namespace/ # No __init__.py!
|
|
22
|
-
└── subpackage/
|
|
23
|
-
├── __init__.py
|
|
24
|
-
└── module.py
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Use Case in Monorepos
|
|
28
|
-
|
|
29
|
-
Group related packages under shared namespace:
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
packages/
|
|
33
|
-
├── my-company-core/
|
|
34
|
-
│ └── src/
|
|
35
|
-
│ └── my_company/ # No __init__.py
|
|
36
|
-
│ └── core/
|
|
37
|
-
│ └── __init__.py
|
|
38
|
-
├── my-company-utils/
|
|
39
|
-
│ └── src/
|
|
40
|
-
│ └── my_company/ # No __init__.py
|
|
41
|
-
│ └── utils/
|
|
42
|
-
│ └── __init__.py
|
|
43
|
-
└── my-company-db/
|
|
44
|
-
└── src/
|
|
45
|
-
└── my_company/ # No __init__.py
|
|
46
|
-
└── db/
|
|
47
|
-
└── __init__.py
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
**Result:**
|
|
51
|
-
```python
|
|
52
|
-
from my_company.core import User
|
|
53
|
-
from my_company.utils import setup_logging
|
|
54
|
-
from my_company.db import Session
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
All under `my_company.*` namespace!
|
|
58
|
-
|
|
59
|
-
## Package Configuration
|
|
60
|
-
|
|
61
|
-
**packages/my-company-core/pyproject.toml:**
|
|
62
|
-
|
|
63
|
-
```toml
|
|
64
|
-
[project]
|
|
65
|
-
name = "my-company-core" # Package distribution name (with dash)
|
|
66
|
-
version = "0.1.0"
|
|
67
|
-
requires-python = ">=3.12"
|
|
68
|
-
|
|
69
|
-
[build-system]
|
|
70
|
-
requires = ["hatchling"]
|
|
71
|
-
build-backend = "hatchling.build"
|
|
72
|
-
|
|
73
|
-
[tool.hatch.build.targets.wheel]
|
|
74
|
-
packages = ["src/my_company"] # Include entire namespace
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
**packages/my-company-utils/pyproject.toml:**
|
|
78
|
-
|
|
79
|
-
```toml
|
|
80
|
-
[project]
|
|
81
|
-
name = "my-company-utils" # Different distribution name
|
|
82
|
-
version = "0.1.0"
|
|
83
|
-
requires-python = ">=3.12"
|
|
84
|
-
dependencies = [
|
|
85
|
-
"my-company-core", # Can depend on other namespace packages
|
|
86
|
-
]
|
|
87
|
-
|
|
88
|
-
[build-system]
|
|
89
|
-
requires = ["hatchling"]
|
|
90
|
-
build-backend = "hatchling.build"
|
|
91
|
-
|
|
92
|
-
[tool.hatch.build.targets.wheel]
|
|
93
|
-
packages = ["src/my_company"] # Same namespace
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
**Key points:**
|
|
97
|
-
- Distribution name: `my-company-core` (with dash)
|
|
98
|
-
- Import name: `my_company.core` (with underscore)
|
|
99
|
-
- Namespace: `my_company` (no `__init__.py`)
|
|
100
|
-
- Subpackage: `core` (has `__init__.py`)
|
|
101
|
-
|
|
102
|
-
## Directory Structure
|
|
103
|
-
|
|
104
|
-
### Correct (Namespace Package)
|
|
105
|
-
|
|
106
|
-
```
|
|
107
|
-
packages/my-company-core/
|
|
108
|
-
├── pyproject.toml
|
|
109
|
-
└── src/
|
|
110
|
-
└── my_company/ # No __init__.py (namespace)
|
|
111
|
-
└── core/ # Has __init__.py (actual package)
|
|
112
|
-
├── __init__.py
|
|
113
|
-
├── entities.py
|
|
114
|
-
└── services.py
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### Incorrect (Not a Namespace)
|
|
118
|
-
|
|
119
|
-
```
|
|
120
|
-
packages/my-company-core/
|
|
121
|
-
├── pyproject.toml
|
|
122
|
-
└── src/
|
|
123
|
-
└── my_company/
|
|
124
|
-
├── __init__.py # ❌ This prevents namespace sharing
|
|
125
|
-
└── core/
|
|
126
|
-
├── __init__.py
|
|
127
|
-
└── entities.py
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
## Complete Example
|
|
131
|
-
|
|
132
|
-
### Setup
|
|
133
|
-
|
|
134
|
-
```
|
|
135
|
-
my-monorepo/
|
|
136
|
-
├── pyproject.toml (workspace)
|
|
137
|
-
└── packages/
|
|
138
|
-
├── acme-auth/
|
|
139
|
-
│ ├── pyproject.toml
|
|
140
|
-
│ └── src/
|
|
141
|
-
│ └── acme/
|
|
142
|
-
│ └── auth/
|
|
143
|
-
│ ├── __init__.py
|
|
144
|
-
│ └── user.py
|
|
145
|
-
├── acme-api/
|
|
146
|
-
│ ├── pyproject.toml
|
|
147
|
-
│ └── src/
|
|
148
|
-
│ └── acme/
|
|
149
|
-
│ └── api/
|
|
150
|
-
│ ├── __init__.py
|
|
151
|
-
│ └── routes.py
|
|
152
|
-
└── acme-db/
|
|
153
|
-
├── pyproject.toml
|
|
154
|
-
└── src/
|
|
155
|
-
└── acme/
|
|
156
|
-
└── db/
|
|
157
|
-
├── __init__.py
|
|
158
|
-
└── repository.py
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
### packages/acme-auth/pyproject.toml
|
|
162
|
-
|
|
163
|
-
```toml
|
|
164
|
-
[project]
|
|
165
|
-
name = "acme-auth"
|
|
166
|
-
version = "0.1.0"
|
|
167
|
-
|
|
168
|
-
[build-system]
|
|
169
|
-
requires = ["hatchling"]
|
|
170
|
-
build-backend = "hatchling.build"
|
|
171
|
-
|
|
172
|
-
[tool.hatch.build.targets.wheel]
|
|
173
|
-
packages = ["src/acme"]
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
### packages/acme-api/pyproject.toml
|
|
177
|
-
|
|
178
|
-
```toml
|
|
179
|
-
[project]
|
|
180
|
-
name = "acme-api"
|
|
181
|
-
version = "0.1.0"
|
|
182
|
-
dependencies = [
|
|
183
|
-
"acme-auth", # Depends on namespace sibling
|
|
184
|
-
"fastapi>=0.100.0",
|
|
185
|
-
]
|
|
186
|
-
|
|
187
|
-
[build-system]
|
|
188
|
-
requires = ["hatchling"]
|
|
189
|
-
build-backend = "hatchling.build"
|
|
190
|
-
|
|
191
|
-
[tool.hatch.build.targets.wheel]
|
|
192
|
-
packages = ["src/acme"]
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
### packages/acme-db/pyproject.toml
|
|
196
|
-
|
|
197
|
-
```toml
|
|
198
|
-
[project]
|
|
199
|
-
name = "acme-db"
|
|
200
|
-
version = "0.1.0"
|
|
201
|
-
dependencies = [
|
|
202
|
-
"acme-auth", # Depends on namespace sibling
|
|
203
|
-
"sqlalchemy>=2.0.0",
|
|
204
|
-
]
|
|
205
|
-
|
|
206
|
-
[build-system]
|
|
207
|
-
requires = ["hatchling"]
|
|
208
|
-
build-backend = "hatchling.build"
|
|
209
|
-
|
|
210
|
-
[tool.hatch.build.targets.wheel]
|
|
211
|
-
packages = ["src/acme"]
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
### Usage in Application
|
|
215
|
-
|
|
216
|
-
```python
|
|
217
|
-
# Import from namespace packages
|
|
218
|
-
from acme.auth.user import User, authenticate
|
|
219
|
-
from acme.api.routes import router
|
|
220
|
-
from acme.db.repository import UserRepository
|
|
221
|
-
|
|
222
|
-
# All under acme.* namespace!
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
## Naming Conventions
|
|
226
|
-
|
|
227
|
-
**Distribution name** (in `name = "..."`):
|
|
228
|
-
- Use dashes: `my-company-core`
|
|
229
|
-
- PyPI package name
|
|
230
|
-
- What you install: `pip install my-company-core`
|
|
231
|
-
|
|
232
|
-
**Import name** (in code):
|
|
233
|
-
- Use underscores: `my_company.core`
|
|
234
|
-
- Python module name
|
|
235
|
-
- What you import: `from my_company.core import ...`
|
|
236
|
-
|
|
237
|
-
**Examples:**
|
|
238
|
-
|
|
239
|
-
| Distribution Name | Import Path | Namespace | Subpackage |
|
|
240
|
-
|------------------|-------------|-----------|------------|
|
|
241
|
-
| `acme-auth` | `acme.auth` | `acme` | `auth` |
|
|
242
|
-
| `acme-api` | `acme.api` | `acme` | `api` |
|
|
243
|
-
| `my-company-core` | `my_company.core` | `my_company` | `core` |
|
|
244
|
-
| `my-company-utils` | `my_company.utils` | `my_company` | `utils` |
|
|
245
|
-
|
|
246
|
-
## Workspace Integration
|
|
247
|
-
|
|
248
|
-
**Root pyproject.toml:**
|
|
249
|
-
|
|
250
|
-
```toml
|
|
251
|
-
[tool.uv.workspace]
|
|
252
|
-
members = [
|
|
253
|
-
"packages/acme-*", # All acme namespace packages
|
|
254
|
-
]
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
**Install all namespace packages:**
|
|
258
|
-
|
|
259
|
-
```bash
|
|
260
|
-
uv sync
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
**Result:**
|
|
264
|
-
- All `acme-*` packages installed
|
|
265
|
-
- Can import from `acme.*` namespace
|
|
266
|
-
- Single lock file for all packages
|
|
267
|
-
|
|
268
|
-
## Type Checking with Namespace Packages
|
|
269
|
-
|
|
270
|
-
basedpyright/mypy work automatically with namespace packages:
|
|
271
|
-
|
|
272
|
-
**pyproject.toml (root):**
|
|
273
|
-
|
|
274
|
-
```toml
|
|
275
|
-
[tool.basedpyright]
|
|
276
|
-
typeCheckingMode = "strict"
|
|
277
|
-
include = ["packages/*/src"] # Include all package source
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
No special configuration needed - namespace imports work:
|
|
281
|
-
|
|
282
|
-
```python
|
|
283
|
-
from acme.auth import User # Type checking works
|
|
284
|
-
from acme.api import router # Autocomplete works
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
## Testing with Namespace Packages
|
|
288
|
-
|
|
289
|
-
Tests can import from namespace:
|
|
290
|
-
|
|
291
|
-
```
|
|
292
|
-
packages/acme-auth/
|
|
293
|
-
├── src/
|
|
294
|
-
│ └── acme/
|
|
295
|
-
│ └── auth/
|
|
296
|
-
│ └── user.py
|
|
297
|
-
└── tests/
|
|
298
|
-
└── test_user.py
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
**tests/test_user.py:**
|
|
302
|
-
|
|
303
|
-
```python
|
|
304
|
-
from acme.auth.user import User, authenticate
|
|
305
|
-
|
|
306
|
-
def test_authenticate():
|
|
307
|
-
user = User(email="test@example.com")
|
|
308
|
-
assert authenticate(user, "password")
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
**Run tests:**
|
|
312
|
-
|
|
313
|
-
```bash
|
|
314
|
-
# From root
|
|
315
|
-
uv run pytest packages/acme-auth/tests
|
|
316
|
-
|
|
317
|
-
# Or specific test
|
|
318
|
-
uv run pytest packages/acme-auth/tests/test_user.py
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
## Publishing Namespace Packages
|
|
322
|
-
|
|
323
|
-
Each namespace package is published independently:
|
|
324
|
-
|
|
325
|
-
```bash
|
|
326
|
-
# Build individual packages
|
|
327
|
-
cd packages/acme-auth
|
|
328
|
-
uv build
|
|
329
|
-
|
|
330
|
-
cd ../acme-api
|
|
331
|
-
uv build
|
|
332
|
-
|
|
333
|
-
# Publish to PyPI
|
|
334
|
-
uv publish dist/acme_auth-0.1.0-py3-none-any.whl
|
|
335
|
-
uv publish dist/acme_api-0.1.0-py3-none-any.whl
|
|
336
|
-
```
|
|
337
|
-
|
|
338
|
-
**Users can install subsets:**
|
|
339
|
-
|
|
340
|
-
```bash
|
|
341
|
-
# Install only auth
|
|
342
|
-
pip install acme-auth
|
|
343
|
-
|
|
344
|
-
# Install auth and API
|
|
345
|
-
pip install acme-auth acme-api
|
|
346
|
-
|
|
347
|
-
# Install all
|
|
348
|
-
pip install acme-auth acme-api acme-db
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
## Advantages
|
|
352
|
-
|
|
353
|
-
1. **Logical grouping**: Related packages under common namespace
|
|
354
|
-
2. **Independent versioning**: Each package has its own version
|
|
355
|
-
3. **Selective installation**: Install only what you need
|
|
356
|
-
4. **Clear organization**: Company/project name as namespace
|
|
357
|
-
5. **No conflicts**: Namespace prevents name collisions
|
|
358
|
-
|
|
359
|
-
## When to Use Namespace Packages
|
|
360
|
-
|
|
361
|
-
✅ **Use when:**
|
|
362
|
-
- Multiple related packages in monorepo
|
|
363
|
-
- Want logical grouping under company/project name
|
|
364
|
-
- Packages may be installed independently
|
|
365
|
-
- Building SDK with multiple modules
|
|
366
|
-
|
|
367
|
-
❌ **Don't use when:**
|
|
368
|
-
- Single package project
|
|
369
|
-
- No need for namespace grouping
|
|
370
|
-
- All code deployed together (use regular packages)
|
|
371
|
-
|
|
372
|
-
## Common Pitfalls
|
|
373
|
-
|
|
374
|
-
### ❌ Adding __init__.py to namespace
|
|
375
|
-
|
|
376
|
-
```
|
|
377
|
-
acme/
|
|
378
|
-
├── __init__.py # ❌ This breaks namespace sharing!
|
|
379
|
-
└── auth/
|
|
380
|
-
└── __init__.py
|
|
381
|
-
```
|
|
382
|
-
|
|
383
|
-
This makes `acme` a regular package, not a namespace.
|
|
384
|
-
|
|
385
|
-
### ❌ Incorrect package configuration
|
|
386
|
-
|
|
387
|
-
```toml
|
|
388
|
-
[tool.hatch.build.targets.wheel]
|
|
389
|
-
packages = ["src/acme/auth"] # ❌ Too specific
|
|
390
|
-
```
|
|
391
|
-
|
|
392
|
-
Should be:
|
|
393
|
-
```toml
|
|
394
|
-
[tool.hatch.build.targets.wheel]
|
|
395
|
-
packages = ["src/acme"] # ✅ Include entire namespace
|
|
396
|
-
```
|
|
397
|
-
|
|
398
|
-
### ❌ Mixing namespace and regular packages
|
|
399
|
-
|
|
400
|
-
Don't mix namespace packages with regular packages under same namespace:
|
|
401
|
-
|
|
402
|
-
```
|
|
403
|
-
# ❌ Bad
|
|
404
|
-
acme-auth/src/acme/auth/ # Namespace package
|
|
405
|
-
acme-api/src/acme/__init__.py # Regular package - breaks everything
|
|
406
|
-
```
|
|
407
|
-
|
|
408
|
-
## Summary
|
|
409
|
-
|
|
410
|
-
**Namespace packages:**
|
|
411
|
-
- No `__init__.py` at namespace level
|
|
412
|
-
- Multiple packages share common namespace
|
|
413
|
-
- PEP 420 standard
|
|
414
|
-
- Perfect for monorepos
|
|
415
|
-
|
|
416
|
-
**Configuration:**
|
|
417
|
-
- Distribution name: `my-company-core` (dashes)
|
|
418
|
-
- Import path: `my_company.core` (underscores)
|
|
419
|
-
- `packages = ["src/my_company"]` in pyproject.toml
|
|
420
|
-
- No `__init__.py` in namespace directory
|
|
421
|
-
|
|
422
|
-
**Benefits:**
|
|
423
|
-
- Logical organization
|
|
424
|
-
- Independent versioning
|
|
425
|
-
- Selective installation
|
|
426
|
-
- Clear naming
|