Skip to content

Commit a2f3c43

Browse files
committed
fix: rename codegen output dir from apple/generated to apple_generated
The old `apple/generated/` directory shadowed the `apple` pip package in downstream repos (Python namespace package conflict). Using `apple_generated/` avoids the collision. Bump version to 0.2.3.
1 parent c5cbf74 commit a2f3c43

13 files changed

Lines changed: 21 additions & 21 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ jobs:
3535
with:
3636
go-version-file: go.mod
3737
- name: Run codegen
38-
run: go run ./cmd/pineapple-codegen -output apple/generated -doc-dir doc/operators -operators-dir operators
38+
run: go run ./cmd/pineapple-codegen -output apple_generated -doc-dir doc/operators -operators-dir operators
3939
- name: Check no diff
4040
run: git diff --exit-code

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
with:
3737
go-version-file: go.mod
3838
- name: Run codegen
39-
run: go run ./cmd/pineapple-codegen -output apple/generated -doc-dir doc/operators -operators-dir operators
39+
run: go run ./cmd/pineapple-codegen -output apple_generated -doc-dir doc/operators -operators-dir operators
4040
- name: Check no diff
4141
run: git diff --exit-code
4242

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,14 @@ package myop
254254
```bash
255255
# 生成 Python DSL 绑定 + 算子文档
256256
go run ./cmd/pineapple-codegen \
257-
-output apple/generated \
257+
-output apple_generated \
258258
-doc-dir doc/operators \
259259
-operators-dir operators
260260
```
261261

262262
这将自动生成:
263-
- `apple/generated/operators.py` — 带类型提示的 Python 算子类
264-
- `apple/generated/__init__.py` — 导出列表
263+
- `apple_generated/operators.py` — 带类型提示的 Python 算子类
264+
- `apple_generated/__init__.py` — 导出列表
265265
- `doc/operators/<name>.md` — 每个算子的文档
266266
- `doc/operators/README.md` — 按分类索引
267267

@@ -603,7 +603,7 @@ import (
603603
)
604604

605605
func main() {
606-
output := flag.String("output", "apple/generated", "Python output dir")
606+
output := flag.String("output", "apple_generated", "Python output dir")
607607
docDir := flag.String("doc-dir", "", "Doc output dir")
608608
opsDir := flag.String("operators-dir", "operators", "Go operators source")
609609
flag.Parse()

apple/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.2.2"
1+
__version__ = "0.2.3"

cmd/pineapple-codegen/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// Usage:
55
//
6-
// go run ./cmd/pineapple-codegen -output apple/generated
6+
// go run ./cmd/pineapple-codegen -output apple_generated
77
package main
88

99
import (
@@ -17,7 +17,7 @@ import (
1717
)
1818

1919
func main() {
20-
output := flag.String("output", "apple/generated", "Output directory for generated Python files")
20+
output := flag.String("output", "apple_generated", "Output directory for generated Python files")
2121
docDir := flag.String("doc-dir", "", "Output directory for generated operator docs (empty to skip)")
2222
opsDir := flag.String("operators-dir", "operators", "Directory containing Go operator source files")
2323
flag.Parse()

design_doc/12_distribution.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
| Codegen 库 | `pkg/codegen`| 可复用的 Python binding 生成器 |
1010
| Python DSL | pip package `pineapple-apple`(核心包,不含 `generated/`| 编译器、Flow 抽象、验证器 |
1111

12-
`apple/generated/` 是按算子集合生成的产物,每个部署不同,不打入 pip 包。第三方通过 `pip install pineapple-apple` 获得核心 DSL 能力,然后运行自己的 codegen wrapper 生成包含自定义算子的 Python 绑定。
12+
`apple_generated/` 是按算子集合生成的产物,每个部署不同,不打入 pip 包。第三方通过 `pip install pineapple-apple` 获得核心 DSL 能力,然后运行自己的 codegen wrapper 生成包含自定义算子的 Python 绑定。
1313

1414
## 第三方安装步骤
1515

@@ -28,10 +28,10 @@ pip install pineapple-apple
2828

2929
# 构建并运行自定义 codegen(生成含内置 + 自定义算子的 Python 绑定)
3030
go build -o my-codegen ./cmd/my-codegen
31-
./my-codegen -output apple/generated -doc-dir doc/operators -operators-dir operators
31+
./my-codegen -output apple_generated -doc-dir doc/operators -operators-dir operators
3232
```
3333

34-
第三方的 `apple/generated/` 包含内置算子和自定义算子的完整 binding,放在项目本地,不依赖 pip 包分发。
34+
第三方的 `apple_generated/` 包含内置算子和自定义算子的完整 binding,放在项目本地,不依赖 pip 包分发。
3535

3636
## 第三方扩展模式
3737

@@ -132,7 +132,7 @@ import (
132132
)
133133

134134
func main() {
135-
output := flag.String("output", "apple/generated", "Python output dir")
135+
output := flag.String("output", "apple_generated", "Python output dir")
136136
docDir := flag.String("doc-dir", "", "Doc output dir")
137137
opsDir := flag.String("operators-dir", "operators", "Go operators source")
138138
flag.Parse()

doc/reports/codegen_report.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The `pineapple-codegen` tool bridges the Go operator registry and the Apple Pyth
77
## Architecture
88

99
```
10-
go run ./cmd/pineapple-codegen -output apple/generated
10+
go run ./cmd/pineapple-codegen -output apple_generated
1111
1212
├── imports _ "github.com/Liam0205/pineapple/operators" (triggers init())
1313
├── calls registry.All() to get sorted schemas
@@ -30,8 +30,8 @@ go run ./cmd/pineapple-codegen -output apple/generated
3030

3131
| File | Content |
3232
|------|---------|
33-
| `apple/generated/operators.py` | Python classes for all 8 registered operators |
34-
| `apple/generated/__init__.py` | Re-exports all operator classes |
33+
| `apple_generated/operators.py` | Python classes for all 8 registered operators |
34+
| `apple_generated/__init__.py` | Re-exports all operator classes |
3535

3636
## Type Mapping
3737

pkg/codegen/codegen.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717

1818
// Config holds the code-generation settings.
1919
type Config struct {
20-
OutputDir string // Python output directory (e.g. "apple/generated")
20+
OutputDir string // Python output directory (e.g. "apple_generated")
2121
DocDir string // Markdown doc output directory; empty to skip
2222
OpsDir string // Go operator source directory for doc-comment parsing
2323
}

0 commit comments

Comments
 (0)