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

fix(python): incorrect escaped characters cause warnings #4538

Merged
merged 8 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion packages/@jsii/python-runtime/tests/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Python jsii runtime tests
## Development Iteration

When iterating on the jsii runtime for Python, the develomer must run
When iterating on the jsii runtime for Python, the developer must run
`yarn build` before making a subsequent attempt at running `pytest` (e.g: via
`yarn test`). This is because the tests run on the code installed in `.env` and
this is updated only by `yarn build`.
Expand Down
3 changes: 2 additions & 1 deletion packages/jsii-pacmak/lib/targets/python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const requirementsFile = path.resolve(
// we use single-quotes for multi-line strings to allow examples within the
// docstrings themselves to include double-quotes (see https://github.com/aws/jsii/issues/2569)
const DOCSTRING_QUOTES = "'''";
const RAW_DOCSTRING_QUOTES = `r${DOCSTRING_QUOTES}`;

export default class Python extends Target {
protected readonly generator: PythonGenerator;
Expand Down Expand Up @@ -1902,7 +1903,7 @@ class PythonModule implements PythonType {
*/
private emitModuleDocumentation(code: CodeMaker) {
if (this.moduleDocumentation) {
code.line(DOCSTRING_QUOTES);
code.line(RAW_DOCSTRING_QUOTES); // raw string
kaizencc marked this conversation as resolved.
Show resolved Hide resolved
code.line(this.moduleDocumentation);
code.line(DOCSTRING_QUOTES);
}
Expand Down
Loading