8000 Add custom source suffix and HTTP Headers for custom urls with authentication support via env var interpolation by solvingj · Pull Request #63 · codrsquad/portable-python · GitHub
[go: up one dir, main page]

Skip to content

Add custom source suffix and HTTP Headers for custom urls with authentication support via env var interpolation #63

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 11 commits into from
Feb 18, 2025

Conversation

solvingj
Copy link

This was intended to be included in #59
The use case is pretty straightforward and it is working

Copy link
Contributor
@zsimic zsimic left a comment

Choose a reason for hiding this comment

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

To satisfy the linter, let's bump McCabe allowed complexity to 18, I'll refactor this to come back to simpler function later.

Change the setting here: https://github.com/codrsquad/portable-python/blob/main/pyproject.toml#L66 from 14 to 18

@solvingj solvingj changed the title Add configuration support for custom HTTP Headers with env var interpolation for authentication to custom URLs Add custom source suffix and HTTP Headers for custom urls with authentication support via env var interpolation Feb 15, 2025
@solvingj
Copy link
Author

Ok, fixed that, and refactored a bit, added another url fix, and added another forgotten local change of the suffix override for github release assets.

basename = f"{self.m_name}-{self.version}.{suffix}"
else:
# Split on '#' for urls that include a checksum, such as #sha256=... fragment
basename = runez.basename(self.url, extension_marker="#")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to split first on #, and then look for known extension

Copy link
Author

Choose a reason for hiding this comment

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

Makes sense, please feel free to edit if you are available

Copy link
Contributor

Choose a reason for hiding this comment

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

Corrected and added test to observe that a #sha256=... doesn't fool this into thinking url has no known extension.

@zsimic zsimic merged commit 10e7a5b into codrsquad:main Feb 18, 2025
7 checks passed
@zsimic
Copy link
Contributor
zsimic commented Feb 18, 2025

Thank you so much for the contrib once again!!

@zsimic
Copy link
Contributor
zsimic commented Feb 18, 2025

Released as v1.9.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
0