Skip to content

[dg] Make init command work with a dirname arg (BUILD-893) (BUILD-919) #29121

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

Merged
merged 2 commits into from
Apr 9, 2025

Conversation

smackesey
Copy link
Collaborator

@smackesey smackesey commented Apr 8, 2025

Summary & Motivation

Change the dg init command in a few ways:

  • a DIRNAME argument is added
  • --workspace-name option is removed, replaced by --workspace flag
  • DIRNAME may be set to . to create (either workspace or project) in the current directory
  • default workspace prompt is now (.)

Examples:

  • dg init: creates a project, prompts for project name
  • dg init .: scaffold a new project in the CWD
  • dg init helloworld: scaffold a new project in new dir helloworld
  • dg init -workspace dagster-workspace: scaffold a new workspace in new dir dagster-workspace, prompt for project name
  • dg init --workspace .: scaffold a new workspace in the CWD, prompt for project anme
  • dg init --workspace --project-name helloworld .: scaffold a new workspace in the CWD, create project named helloworld

How I Tested These Changes

Modified init unit tests.

Changelog

The arguments/options of the dg init command have changed. You may pass . as an argument to initialize a project/workspace in the CWD. See dg init --help for more details.

Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@smackesey smackesey marked this pull request as ready for review April 8, 2025 21:44
@smackesey smackesey changed the title [dg] Make init command work with a dirname arg [dg] Make init command work with a dirname arg (BUILD-893) (BUILD-919) Apr 8, 2025
@smackesey smackesey requested a review from schrockn April 8, 2025 21:45
@smackesey smackesey force-pushed the sean/dg/init-improvements branch from 2a73b54 to 3ed5e46 Compare April 8, 2025 21:57
Copy link

github-actions bot commented Apr 8, 2025

Deploy preview for dagster-docs ready!

Preview available at https://dagster-docs-klce2t26w-elementl.vercel.app
https://sean-dg-init-improvements.archive.dagster-docs.io

Direct link to changed pages:

dg init
Scaffold a new project in a new directory `<project_name>`. Prompts for `<project_name>`.
dg init .
Scaffold a new project in the CWD.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assume project name is taken from the name of the last component of the CWD?

Copy link
Collaborator Author

@smackesey smackesey Apr 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, will add to the description

Copy link
Member

@schrockn schrockn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent.

Do docs in the same PR to simplify pick process or in follow up?

@smackesey smackesey force-pushed the sean/dg/init-improvements branch from 3ed5e46 to 63b613b Compare April 9, 2025 12:57
@smackesey smackesey requested a review from schrockn April 9, 2025 12:57
@smackesey
Copy link
Collaborator Author

Do docs in the same PR to simplify pick process or in follow up?

Prefer follow-up

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
@smackesey smackesey requested a review from gibsondan April 9, 2025 17:06
Copy link
Member

@gibsondan gibsondan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is much better

@smackesey smackesey merged commit c0df99b into master Apr 9, 2025
7 checks passed
@smackesey smackesey deleted the sean/dg/init-improvements branch April 9, 2025 19:16
smackesey added a commit that referenced this pull request Apr 9, 2025
#29121)

Change the `dg init` command in a few ways:

- a `DIRNAME` argument is added
- `--workspace-name` option is removed, replaced by `--workspace` flag
- `DIRNAME` may be set to `.` to create (either workspace or project) in
the current directory
- default workspace prompt is now (`.`)

Examples:

- `dg init`: creates a project, prompts for project name
- `dg init .`: scaffold a new project in the CWD
- `dg init helloworld`: scaffold a new project in new dir `helloworld`
- `dg init -workspace dagster-workspace`: scaffold a new workspace in
new dir `dagster-workspace`, prompt for project name
- `dg init --workspace .`: scaffold a new workspace in the CWD, prompt
for project anme
- `dg init --workspace --project-name helloworld .`: scaffold a new
workspace in the CWD, create project named helloworld

Modified init unit tests.

The arguments/options of the `dg init` command have changed. You may
pass `.` as an argument to initialize a project/workspace in the CWD.
See `dg init --help` for more details.

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants