Skip to content

Commit cd95b3c

Browse files
authored
Move build-system to hatchling for generated clients (#475)
1 parent b99df33 commit cd95b3c

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

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

+11-9
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,6 @@ 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-
125121
[project]
126122
name = $1S
127123
version = $2S
@@ -145,7 +141,7 @@ private static void writePyproject(
145141
""", settings.moduleName(), settings.moduleVersion(), settings.moduleDescription());
146142

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

151147
Optional<Collection<SymbolDependency>> testDeps =
@@ -161,17 +157,23 @@ private static void writePyproject(
161157
}
162158

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

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

171167
// TODO: remove the pyright global suppressions after the serde redo is done
172168
writer.write("""
173-
[tool.setuptools.packages.find]
174-
exclude=["tests*"]
169+
[build-system]
170+
requires = ["hatchling"]
171+
build-backend = "hatchling.build"
172+
173+
[tool.hatch.build]
174+
exclude = [
175+
"tests",
176+
]
175177
176178
[tool.pyright]
177179
typeCheckingMode = "strict"

0 commit comments

Comments
 (0)