Skip to content

[components docs] Flesh out existing code location docs, test #27604

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 5 commits into from
Feb 6, 2025

Conversation

benpankow
Copy link
Member

Summary

Adds a section to the 'existing project' docs about adding to pyproject.toml (necessary for dg cli to work) alongside optionally configuring a uv environment.

This was after playing around trying to port a DOP project, I found some of these steps not immediately obvious & had a hard time setting up a new venv.

Places the existing + new contents under integration test.

@benpankow benpankow requested a review from neverett as a code owner February 6, 2025 01:14
try:
actual_output = (
subprocess.check_output(
f'{cmd} && echo "PWD=$(pwd);"', shell=True, stderr=subprocess.STDOUT
Copy link
Contributor

Choose a reason for hiding this comment

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

Using && will only echo the PWD if the command succeeds. To ensure the PWD is always captured for proper directory tracking, this should use ; instead: f'{cmd}; echo "PWD=$(pwd);"'

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

@benpankow benpankow force-pushed the benpankow/existing-code-location-test branch from 644be30 to 43e4f0f Compare February 6, 2025 01:15
Copy link

github-actions bot commented Feb 6, 2025

Deploy preview for dagster-docs ready!

Preview available at https://dagster-docs-j434slfc0-elementl.vercel.app

Direct link to changed pages:

Comment on lines 64 to 69
except subprocess.CalledProcessError as e:
print(f"Ran command {cmd}") # noqa: T201
print("Got output:") # noqa: T201
print(e.output.decode("utf-8").strip()) # noqa: T201
raise e

Copy link
Contributor

Choose a reason for hiding this comment

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

The actual_output variable needs to be assigned before the error handling block exits. When an exception occurs, the code will raise a NameError when trying to access actual_output in the subsequent lines. Consider assigning e.output.decode('utf-8').strip() to actual_output before printing and raising the exception.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

@benpankow benpankow requested a review from smackesey February 6, 2025 20:52
Copy link
Collaborator

@smackesey smackesey left a comment

Choose a reason for hiding this comment

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

one comment but otherwise lgtm

@@ -6,6 +6,9 @@ extend = "../pyproject.toml"
# Shorter line length for docs snippets for better browser formatting.
line-length = 88

# Ignore a specific file
extend-exclude = ["docs_beta_snippets/guides/components/existing-project/6-initial-definitions.py"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Much prefer to ignore a file by putting:

# noqa

At the top then having this setting

Copy link
Member Author

Choose a reason for hiding this comment

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

a blank noqa gets stripped out automatically from another ruff rule in the base file, since we have a rule against noqa 😞
Screenshot 2025-02-06 at 1 56 12 PM

@benpankow benpankow force-pushed the benpankow/existing-code-location-test branch from a211d2b to 95cc4bb Compare February 6, 2025 21:53
@benpankow benpankow merged commit b634872 into master Feb 6, 2025
6 of 7 checks passed
@benpankow benpankow deleted the benpankow/existing-code-location-test branch February 6, 2025 22:03
LoHertel pushed a commit to LoHertel/dagster that referenced this pull request Feb 11, 2025
…r-io#27604)

## Summary

Adds a section to the 'existing project' docs about adding to
`pyproject.toml` (necessary for `dg` cli to work) alongside optionally
configuring a `uv` environment.

This was after playing around trying to port a DOP project, I found some
of these steps not immediately obvious & had a hard time setting up a
new venv.

Places the existing + new contents under integration test.
braunjj pushed a commit that referenced this pull request Feb 14, 2025
## Summary

Adds a section to the 'existing project' docs about adding to
`pyproject.toml` (necessary for `dg` cli to work) alongside optionally
configuring a `uv` environment.

This was after playing around trying to port a DOP project, I found some
of these steps not immediately obvious & had a hard time setting up a
new venv.

Places the existing + new contents under integration test.
brentjericho pushed a commit to brentjericho/dagster that referenced this pull request Feb 21, 2025
…r-io#27604)

## Summary

Adds a section to the 'existing project' docs about adding to
`pyproject.toml` (necessary for `dg` cli to work) alongside optionally
configuring a `uv` environment.

This was after playing around trying to port a DOP project, I found some
of these steps not immediately obvious & had a hard time setting up a
new venv.

Places the existing + new contents under integration test.
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.

2 participants