Skip to content

Commit

Permalink
[components] project_name -> code_location_name in scaffolded pyproje…
Browse files Browse the repository at this point in the history
…ct.toml
  • Loading branch information
smackesey committed Feb 1, 2025
1 parent 94e2d67 commit 47f927a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ build-backend = "setuptools.build_meta"
[tool.dagster]
module_name = "{{ project_name }}.definitions"
project_name = "{{ project_name }}"
code_location_name = "{{ project_name }}"
[tool.setuptools.packages.find]
exclude=["{{ project_name }}_tests"]
exclude=["{{ project_name }}_tests"]
1 change: 1 addition & 0 deletions python_modules/libraries/dagster-dg/dagster_dg/scaffold.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def scaffold_code_location(
),
dependencies=dependencies,
dev_dependencies=dev_dependencies,
code_location_name=path.name,
uv_sources=uv_sources,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ build-backend = "setuptools.build_meta"
[tool.dagster]
module_name = "{{ project_name }}.definitions"
project_name = "{{ project_name }}"
code_location_name = "{{ code_location_name }}"
[tool.dg]
is_code_location = true
Expand Down
1 change: 0 additions & 1 deletion python_modules/libraries/dagster-dg/dagster_dg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ def scaffold_subtree(
f.write(
template.render(
repo_name=project_name, # deprecated
code_location_name=project_name,
dagster_version=dagster_version,
project_name=project_name,
**other_template_vars,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ def test_code_location_scaffold_inside_deployment_success(monkeypatch) -> None:
assert Path("code_locations/foo-bar/foo_bar_tests").exists()
assert Path("code_locations/foo-bar/pyproject.toml").exists()

# Check TOML content
toml = tomli.loads(Path("code_locations/foo-bar/pyproject.toml").read_text())
assert toml["tool"]["dagster"]["module_name"] == "foo_bar.definitions"
assert toml["tool"]["dagster"]["code_location_name"] == "foo-bar"

# Check venv created
assert Path("code_locations/foo-bar/.venv").exists()
assert Path("code_locations/foo-bar/uv.lock").exists()
Expand Down

0 comments on commit 47f927a

Please sign in to comment.