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

feat: add base protocols for Resource and ResourceSequence #364

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

tdstein
Copy link
Collaborator

@tdstein tdstein commented Dec 16, 2024

No description provided.

Copy link

github-actions bot commented Dec 16, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
1883 1754 93% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
src/posit/connect/bundles.py 98% 🟢
src/posit/connect/content.py 96% 🟢
src/posit/connect/environments.py 0% 🟢
src/posit/connect/groups.py 82% 🟢
src/posit/connect/jobs.py 0% 🟢
src/posit/connect/metrics/shiny_usage.py 100% 🟢
src/posit/connect/metrics/usage.py 100% 🟢
src/posit/connect/metrics/visits.py 100% 🟢
src/posit/connect/oauth/associations.py 100% 🟢
src/posit/connect/oauth/integrations.py 100% 🟢
src/posit/connect/oauth/sessions.py 100% 🟢
src/posit/connect/packages.py 0% 🟢
src/posit/connect/permissions.py 99% 🟢
src/posit/connect/resources.py 91% 🟢
src/posit/connect/tasks.py 100% 🟢
src/posit/connect/users.py 96% 🟢
src/posit/connect/vanities.py 94% 🟢
src/posit/connect/variants.py 100% 🟢
TOTAL 81% 🟢

updated for commit: db9af30 by action🐍

@tdstein tdstein force-pushed the tdstein/better-protocols branch from 93e75eb to 8eb0486 Compare December 16, 2024 20:19
Comment on lines +91 to +94
T = TypeVar("T", bound=Resource)


class ResourceSequence(Protocol[T]):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thank you

def __getitem__(self, key: Hashable) -> Any: ...


class _Resource(dict, Resource):
Copy link
Collaborator

@schloerke schloerke Dec 16, 2024

Choose a reason for hiding this comment

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

This class is no longer needed, right?

Or maybe the methods of _Resource and BaseResource need to be merged?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Correct. The BaseResource class should go away. But that likely requires finishing the migration to the new implicit subtyping pattern. Which I am planning to complete.

Co-authored-by: Barret Schloerke <barret@posit.co>
@tdstein tdstein marked this pull request as ready for review December 17, 2024 14:48
@tdstein tdstein merged commit dbafa68 into main Dec 17, 2024
35 checks passed
@tdstein tdstein deleted the tdstein/better-protocols branch December 17, 2024 15:34
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.

None yet

2 participants