Skip to content

Implement logging and additional exception handling - #7

Draft
tbowers7 wants to merge 15 commits into
masterfrom
api_changes
Draft

Implement logging and additional exception handling#7
tbowers7 wants to merge 15 commits into
masterfrom
api_changes

Conversation

@tbowers7

Copy link
Copy Markdown
Member

Logging implemented (rather than just print to screen), but will print to stdout if no logger passed in.

Additional error catching for various situations seen during the routine running.

Documentation cleanup and some variable name changes for clarity.

	renamed:    johnnyfive/old_email.py -> ToyModels/old_email.py
	modified:   johnnyfive/gmail.py
	modified:   johnnyfive/utils.py
	modified:   johnnyfive/confluence.py
	modified:   johnnyfive/gmail.py
	modified:   johnnyfive/slack.py
	modified:   johnnyfive/utils.py
	modified:   setup.py
	modified:   johnnyfive/confluence.py
	modified:   johnnyfive/gmail.py
	modified:   johnnyfive/utils.py
@tbowers7
tbowers7 force-pushed the api_changes branch 5 times, most recently from 47184a2 to f4e8906 Compare November 30, 2022 00:44
	modified:   johnnyfive/confluence.py
	modified:   johnnyfive/gmail.py
	modified:   johnnyfive/slack.py
	modified:   johnnyfive/utils.py
tbowers7 added 6 commits June 19, 2023 17:52
	modified:   README.md
	modified:   johnnyfive/gmail.py
The `pkg_resources` package is being deprecated in favor of `importlib`
modules `resources` and `metadata`.  This commit updates this package
to be in line with this change.

	modified:   johnnyfive/confluence.py
	modified:   johnnyfive/gmail.py
	modified:   johnnyfive/utils.py
In the case where a GMAIL message has multiple "parts" (i.e., HTML,
images, etc.), the payload['body'] dictionary element is empty, and
what would be there is as a list in the 'parts' element.  In the simple
case where the GMAIL message is text only, there is only one part (as
is the case with relay DOL messages -- the test case when developing
this class).

This commit adds a check for the 'parts' dictionary element, and selects
the first PART, if such a list exists.  Otherwise, the usual behavior of
extracting the payload['body'] dictionary element holds.  This works
with the hand-delivered DOL messages of the past few days (the mail
relay is down due to IT issues), but no guarantee is made or implied
that this fix will be appropriate or work in all use cases of this
j5 class.

	modified:   johnnyfive/gmail.py
	modified:   johnnyfive/gmail.py
	modified:   johnnyfive/slack.py
	modified:   johnnyfive/utils.py
	new file:   pyproject.toml
	modified:   johnnyfive/__init__.py
	modified:   johnnyfive/classes.py
	modified:   johnnyfive/confluence.py
	modified:   johnnyfive/gmail.py
	modified:   johnnyfive/slack.py
	modified:   johnnyfive/utils.py
	modified:   johnnyfive/confluence.py
	modified:   johnnyfive/gmail.py
@tbowers7
tbowers7 force-pushed the api_changes branch 5 times, most recently from 208bd65 to e1b630b Compare February 18, 2025 22:58
	modified:   johnnyfive/gmail.py
	modified:   johnnyfive/utils.py
tbowers7 added 2 commits May 5, 2025 13:17
Add more exceptions to safely catch when connecting to a service.

	modified:   johnnyfive/utils.py
Was only using the configuration file bits, so just copied those over.

Don't need the large list of dependencies that ligmos has when using
just this library.

	modified:   johnnyfive/utils.py
	modified:   setup.py
Modernize JohnnyFive packaging for Python 3.14 with a standards-based pyproject.toml, compatible runtime constraints, SPDX MPL-2.0 license identifiers, complete type annotations, and NumPy-style API documentation.

Replace the project’s Ligmos dependency surface with the small, local compatibility functionality J5 actually uses, keeping installation and deployment lighter while retaining the established public behavior.

Add unit and integration-style tests for the core utilities and service integrations, providing regression coverage for configuration, Gmail message rendering, and Confluence page operations.

Make Gmail message rendering resilient to multipart and nested MIME structures. Messages without a directly rendered body no longer cause an IndexError during automated report processing.

Move Confluence connectivity to atlassian-python-api v5 and the explicit ConfluenceServer REST client for both password and bearer-token authentication.

Remove the deprecated JSON-RPC permission preflight and avoid administrator-only REST permission enumeration. J5 now lets each required REST operation enforce the automation account’s actual privileges.

Verify the complete suite in the j5 conda environment, including client construction and REST operation compatibility checks, so the updated integrations remain suitable for current service APIs.

This consolidated change captures the Python 3.14 modernization, reduced dependency footprint, service API migrations, documentation, typing, and test coverage in one coherent release update.

Co-authored-by: Codex <noreply@openai.com>
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