Skip to content

Fixed normalising requirements file path in dependencies section#2861

Merged
andrewnester merged 4 commits intomainfrom
fix/normalise-requirements-path
May 13, 2025
Merged

Fixed normalising requirements file path in dependencies section#2861
andrewnester merged 4 commits intomainfrom
fix/normalise-requirements-path

Conversation

@andrewnester
Copy link
Copy Markdown
Contributor

Changes

Fixed normalising requirements file path in dependencies section

Fixes #2849

Why

Previously we incorrectly normalised requirements file passed not treating -r prefix in such paths.
Instead we should normalise the path after -r and then prefix it with -r again/

Tests

Added acceptance test


func normalizePath(path string, location dyn.Location, bundleRootPath string) (string, error) {
// Handle requirements file paths with -r flag
reqPath, ok := strings.CutPrefix(path, "-r ")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we also TrimSpace in case there multiple spaces?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point, fixed + added test

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What about --requirement

@andrewnester andrewnester enabled auto-merge May 13, 2025 10:48
@andrewnester andrewnester disabled auto-merge May 13, 2025 11:38
@andrewnester andrewnester merged commit 23b6656 into main May 13, 2025
9 of 10 checks passed
@andrewnester andrewnester deleted the fix/normalise-requirements-path branch May 13, 2025 11:38
deco-sdk-tagging bot added a commit that referenced this pull request May 14, 2025
## Release v0.252.0

### Dependency updates
* Upgraded Go SDK to 0.69.0 ([#2867](#2867))
* Upgraded to TF provider 1.79.0 ([#2869](#2869))

### Bundles
* Remove unused fields from resources.models schema: creation\_timestamp, last\_updated\_timestamp, latest\_versions and user\_id. Using them now raises a warning ([#2828](#2828)).
* Preserve folder structure for app source code in bundle generate ([#2848](#2848))
* Fix normalising requirements file path in dependencies section ([#2861](#2861))
* Fix default-python template not to add environments when serverless=yes and include\_python=no ([#2866](#2866))
* Fix handling of Unicode characters in Python support ([#2873](#2873))
* Add support for secret scopes in DABs ([#2744](#2744))
* Make `artifacts.*.type` optional in bundle JSON schema ([#2881](#2881))
* Fix support for `spot_bid_max_price` field in Python support ([#2883](#2883))
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.

requirements.txt relative path not replaced correctly when used in serverless dependency

3 participants