Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[components] project_name -> code_location_name in scaffolded pyproject.toml #27480

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def test_project_scaffold_command_succeeds():
origins = get_origins_from_toml("my_dagster_project/pyproject.toml")
assert len(origins) == 1
assert origins[0].loadable_target_origin.module_name == "my_dagster_project.definitions"
assert origins[0].location_name == "my_dagster_project"


def test_project_scaffold_command_excludes_succeeds():
Expand Down
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