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

Improve debugpy's capabilities #15946

Merged
merged 4 commits into from
Jun 27, 2022
Merged

Conversation

thejcannon
Copy link
Member

  • Adding an args flag for additional flags (especially useful for debug logs)
  • Adds support for executing module/module+function/console_script

[ci skip-rust]
[ci skip-build-wheels]

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
@thejcannon thejcannon added the category:internal CI, fixes for not-yet-released features, etc. label Jun 25, 2022
@thejcannon thejcannon added this to the 2.13.x milestone Jun 25, 2022
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
return ("-c", f"import {main.module};{main.module}.{main.function}();")
return ("-m", main.module)

assert isinstance(main, ConsoleScript)
Copy link
Member

Choose a reason for hiding this comment

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

It seems like this method should take a ConsoleScript so that the caller is forced to apply (and reason about) this assertion instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

Well either entrypoint or console script, I'll change the type to a union

Copy link
Member Author

@thejcannon thejcannon Jun 27, 2022

Choose a reason for hiding this comment

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

Actually, I think I'm going to leave it as-is. These are the only two subclasses of MainSpecification, and if I change it to use the union, the callsites needs to be casted or asserted, and neither is pretty.

Copy link
Member

Choose a reason for hiding this comment

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

The assert is still happening: it's just hidden. IMO, that's a trap for the caller. But nbd.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah OK, thats fair. Past Josh was lazy, we should shun him.

@thejcannon thejcannon merged commit 21b14c5 into pantsbuild:main Jun 27, 2022
@thejcannon thejcannon deleted the debugpy_args branch June 27, 2022 00:14
thejcannon added a commit to thejcannon/pants that referenced this pull request Jun 28, 2022
- Adding an `args` flag for additional flags (especially useful for debug logs)
- Adds support for executing module/module+function/console_script

[ci skip-rust]
[ci skip-build-wheels]
thejcannon added a commit that referenced this pull request Jun 28, 2022
- Adding an `args` flag for additional flags (especially useful for debug logs)
- Adds support for executing module/module+function/console_script

[ci skip-rust]
[ci skip-build-wheels]
@stuhood stuhood mentioned this pull request Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:internal CI, fixes for not-yet-released features, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants