Skip to content

Commit bd10078

Browse files
committed
Add README on how to generate docs (smithy-lang#471)
Co-authored-by: Nate Prewitt <[email protected]> # Conflicts: # codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/SetupGenerator.java
1 parent a7a1aaa commit bd10078

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/SetupGenerator.java

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ private static void writePyproject(
118118
writers.useFileWriter("pyproject.toml", "", writer -> {
119119
writer.pushState(new PyprojectSection(dependencies));
120120
writer.write("""
121+
[build-system]
122+
requires = ["setuptools", "setuptools-scm", "wheel"]
123+
build-backend = "setuptools.build_meta"
124+
121125
[project]
122126
name = $1S
123127
version = $2S
@@ -141,7 +145,7 @@ private static void writePyproject(
141145
""", settings.moduleName(), settings.moduleVersion(), settings.moduleDescription());
142146

143147
Optional.ofNullable(dependencies.get(PythonDependency.Type.DEPENDENCY.getType())).ifPresent(deps -> {
144-
writer.openBlock("dependencies = [", "]\n", () -> writeDependencyList(writer, deps.values()));
148+
writer.openBlock("dependencies = [", "]", () -> writeDependencyList(writer, deps.values()));
145149
});
146150

147151
Optional<Collection<SymbolDependency>> testDeps =
@@ -157,24 +161,17 @@ private static void writePyproject(
157161
}
158162

159163
testDeps.ifPresent(deps -> {
160-
writer.openBlock("tests = [", "]\n", () -> writeDependencyList(writer, deps));
164+
writer.openBlock("tests = [", "]", () -> writeDependencyList(writer, deps));
161165
});
162166

163167
docsDeps.ifPresent(deps -> {
164-
writer.openBlock("docs = [", "]\n", () -> writeDependencyList(writer, deps));
168+
writer.openBlock("docs = [", "]", () -> writeDependencyList(writer, deps));
165169
});
166170

167171
// TODO: remove the pyright global suppressions after the serde redo is done
168172
writer.write("""
169-
[build-system]
170-
requires = ["hatchling"]
171-
build-backend = "hatchling.build"
172-
173-
[tool.hatch.build.targets.bdist]
174-
exclude = [
175-
"tests",
176-
"docs",
177-
]
173+
[tool.setuptools.packages.find]
174+
exclude=["tests*"]
178175
179176
[tool.pyright]
180177
typeCheckingMode = "strict"
@@ -468,9 +465,9 @@ private static void writeDocsReadme(
468465
following:
469466
470467
```
471-
$ uv pip install ".[docs]"
472-
$ cd docs
473-
$ make html
468+
$$ uv pip install ".[docs]"
469+
$$ cd docs
470+
$$ make html
474471
```
475472
""");
476473
});

0 commit comments

Comments
 (0)