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 PagerDuty into a multi-file module #36

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Deconstrained
Copy link
Contributor

@Deconstrained Deconstrained commented Feb 14, 2025

This pull request addresses #27.

It includes significant structural changes to the pagerduty package by refactoring what was a monolithic python module file into a multi-file module in the pagerduty directory.

For backwards compatibility, all helper methods and classes are imported to the root namespace of the module (in __init__.py). Any new API client classes (i.e. for the newer integration product APIs) are expected to be added in aptly-named files and similarly imported to the root of the module. Classes are expected to be usable as they always previously have. For example:

# Valid, preferred
client = pagerduty.RestApiV2Client(API_KEY)

# Also now valid, but should not be necessary:
client = pagerduty.rest_api_v2_client.RestApiV2Client(API_KEY)

Going forward, any specialized helpers that are declared only in the module where they are used are not necessary to import into the root module namespace (or add to sphinx/source/module_reference.rst for that matter) unless the intention is to publish them for use outside their original purpose. All methods should still have docstrings regardless.

@Deconstrained Deconstrained force-pushed the issue-27-multi-file-refactor branch from 788813b to 396deb4 Compare February 14, 2025 23:06
@Deconstrained Deconstrained force-pushed the issue-27-multi-file-refactor branch from d207c63 to bfd390a Compare February 14, 2025 23:13
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.

1 participant