-
-
Notifications
You must be signed in to change notification settings - Fork 812
bug/python non top level requirements #2470
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@trigger.dev/python": patch | ||
--- | ||
|
||
Fixed the bug where you can only specify the requirements file as top level | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,7 +121,7 @@ class PythonExtension implements BuildExtension { | |
image: { | ||
instructions: splitAndCleanComments(` | ||
# Copy the requirements file | ||
COPY ${this.options.requirementsFile} . | ||
COPY ${this.options.requirementsFile} ${this.options.requirementsFile} | ||
# Install dependencies | ||
RUN pip install --no-cache-dir -r ${this.options.requirementsFile} | ||
Comment on lines
+124
to
126
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Use JSON-array COPY and quote the pip path; normalize for Windows backslashes Prevents failures when the requirements path contains spaces or backslashes and makes COPY unambiguous. - COPY ${this.options.requirementsFile} ${this.options.requirementsFile}
+ COPY ["${this.options.requirementsFile.replace(/\\\\/g, "/")}", "${this.options.requirementsFile.replace(/\\\\/g, "/")}"]
# Install dependencies
- RUN pip install --no-cache-dir -r ${this.options.requirementsFile}
+ RUN pip install --no-cache-dir -r "${this.options.requirementsFile.replace(/\\\\/g, "/")}" If you prefer readability, precompute the normalized path once and reuse it: // above, before context.addLayer(...)
const reqFile = this.options.requirementsFile!.replace(/\\/g, "/"); and then: - COPY ["${this.options.requirementsFile.replace(/\\\\/g, "/")}", "${this.options.requirementsFile.replace(/\\\\/g, "/")}"]
+ COPY ["${reqFile}", "${reqFile}"]
- RUN pip install --no-cache-dir -r "${this.options.requirementsFile.replace(/\\\\/g, "/")}"
+ RUN pip install --no-cache-dir -r "${reqFile}" 🤖 Prompt for AI Agents
|
||
`), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Polish changelog phrasing (“top‑level”)
Tighten wording and fix the hyphenation.
📝 Committable suggestion
🤖 Prompt for AI Agents