-
Notifications
You must be signed in to change notification settings - Fork 102
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
chore: remove pyrfc3339 and change to datetime.datetime.fromisoformat… #1247
base: main
Are you sure you want to change the base?
Conversation
…() and datetime.datetime.isoformat()
Yeah unfortunately we currently need to specify the dependencies in both
I'm guessing you're using python 3.11+ locally -- BTW as an external contributor your PRs against this repo don't have our CI run automatically, but I believe that you should be able to open a PR against your own fork's main first and have the tests run there -- this will take care of running linting and running tests against multiple python and juju versions |
Btw @EdmilsonRodrigues we most likely won't be looking at PRs over the next couple of weeks due to the holiday season but happy to continue after that -- thanks for your contributions so far |
I'm sorry about our CI:
Please amend the commit message 🙇🏻 |
I tried to open a PR to my own main branch but no test was created. I think I need to configure the github actions. I'll learn how to do it and do it for the next time. Also merry holidays for you all!!! |
allowlist_externals = | ||
pytest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pytest
is not an external, it's installed from the dev dependency group.
try: | ||
from backports.datetime_fromisoformat import MonkeyPatch | ||
|
||
MonkeyPatch.patch_fromisoformat() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what's better: to monkeypatch (and possibly affect other code), or to call this library's version of fromisoformat()
explicitly?
I think I'd prefer the latter.
WDYT?
except ImportError: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the library is required, then it must be there.
Something's terribly wrong if we get an ImportError
here.
…() and datetime.datetime.isoformat()
Description
I tried using backports.datetime_fromisoformat but than the tox tests broke, probably because it required an import in the unit tests. I tried than just using the usual builtin datetime.datetime.fromisoformat and it worked just well.
<Fixes: >
QA Steps
<Commands / tests / steps to run to verify that the change works:>
All CI tests need to pass.
<Please note that most likely an additional test will be required by the reviewers for any change that's not a one liner to land.>
Notes & Discussion
*This is a secondary branch from the Pull Request #1243 *