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

refactor: add url class in place of urls module functions #244

Merged
merged 4 commits into from
Jul 29, 2024

Conversation

tdstein
Copy link
Collaborator

@tdstein tdstein commented Jul 26, 2024

Adds a new class, urls.Url, which wraps the existing urls.create and urls.append methods. This alleviates the need to import .urls in most situations (see #246).

The new class urls.Url supports Python append via the special method __add__. This is convenient for appending paths to the base endpoint. (e.g., new_url = base_url + '/path').

@tdstein tdstein changed the title refactor: add url class in place of urls module functions" refactor: add url class in place of urls module functions Jul 26, 2024
Copy link

github-actions bot commented Jul 26, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
1232 1163 94% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
src/posit/connect/bundles.py 100% 🟢
src/posit/connect/client.py 99% 🟢
src/posit/connect/config.py 100% 🟢
src/posit/connect/content.py 100% 🟢
src/posit/connect/env.py 100% 🟢
src/posit/connect/groups.py 48% 🟢
src/posit/connect/me.py 100% 🟢
src/posit/connect/metrics/shiny_usage.py 100% 🟢
src/posit/connect/metrics/visits.py 100% 🟢
src/posit/connect/oauth.py 100% 🟢
src/posit/connect/permissions.py 100% 🟢
src/posit/connect/tasks.py 100% 🟢
src/posit/connect/urls.py 100% 🟢
src/posit/connect/users.py 100% 🟢
src/posit/connect/variants.py 100% 🟢
TOTAL 96% 🟢

updated for commit: 5eb6b03 by action🐍

@tdstein tdstein force-pushed the tdstein/improve-url-parsing branch from db5fb68 to f1f13ea Compare July 26, 2024 02:54
@jonkeane
Copy link
Collaborator

The changes look fine to me and slightly less boiler plate which is nice. Would you mind adding a description to the PR with pros / cons for the historical record?

Copy link
Collaborator

@toph-allen toph-allen left a comment

Choose a reason for hiding this comment

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

😍

@tdstein tdstein merged commit e4ddf78 into main Jul 29, 2024
31 checks passed
@tdstein tdstein deleted the tdstein/improve-url-parsing branch July 29, 2024 13:56
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.

3 participants