-
Notifications
You must be signed in to change notification settings - Fork 101
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
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!!! |
Please rebase 🙇🏻 |
bc0ade2
to
81e2eef
Compare
Thanks for this, @EdmilsonRodrigues. If you can rebase from main and fix your commit messages (or squash them) to use conventional commits (using commit types from the example at that page), then I think we can go ahead and merge this |
4bbfa6d
to
c0dfa92
Compare
I'm really sorry if I'm not doing this right. I'm still learning how to do rebasing and working in a project like this. I think it worked now. |
c0dfa92
to
03911db
Compare
Thank you for all the guidance during this process. |
03911db
to
e31d227
Compare
The command I used was
|
e31d227
to
43f2a46
Compare
input: refacor: change monkeypatch to use local imports |
A simple fix would be to squash all your commits into one and update the commit message.
|
43f2a46
to
3aa4221
Compare
When I used this, it let me rename all my commits, because I still haven't learned how to squash, but I'll study more git this month so the problems I faced with this PR won't happen again in the next one, sorry again. |
No worries, you'll get a hang of it as you contribute to open source more. |
I'm sorry for silly rules that this repo imposes. I'm helping maintain it, but I didn't start it or invent these rules. |
I think when you've rebased last, your * 3aa4221 (edmilson/backports) chore: remove deps backports-datetime-fromisoformat
* 59e3cd4 chore: rebase with main
* 62fcdb2 refactor: change monkeypatch to use local imports
* 6814f06 chore: remove pyrfc3339 and change to datetime.datetime.fromisoformat() and datetime.datetime.isoformat()
* e5d384d refactor: change monkeypatch to use local imports
* 172590a chore: change setup.py to use backports instead of pyrfc
* 1d9d6ba chore: added backports to tox.ini and pyproject.toml
* d1abfa8 chore: remove pyrfc3339 and change to datetime.datetime.fromisoformat() and datetime.datetime.isoformat()
| * 1907f7a (upstream/main, origin/main, main) Merge pull request #1250 from dimaqq/upstream-type-fixes
| |\
| |/
|/|
* | e7bcdc9 (edmilson/main, upstream-type-fixes) chore: don't allow 0.25.2 either, still broken
* | 2423ef7 chore: block broken(?) pytest-asyncio version
* | 35ba68b chore: type hint improvements from the helper thread branch
|/
* a58645e Merge pull request #1244 from tmihoc/add-discourse-docs |
Or maybe you've made the mistake of merging upstream main into your main or cherry-picked specific commits. Typically what I would do in this case is Or you can rebase your branch on top of upstream/main directly. Up to you. |
chore: added backports to tox.ini and pyproject.toml chore: change setup.py to use backports instead of pyrfc refactor: change monkeypatch to use local imports chore: change pyrfc3339 to backports.from_isoformat refactor: change monkeypatch to use local imports chore: rebase with main chore: remove deps backports-datetime-fromisoformat
3aa4221
to
2bbe89b
Compare
Thank you for your pacience and guidance. I am really thankful for that. |
# Note: fromtimestamp bizarrely produces a time without | ||
# a time zone, so we need to use accept_naive. | ||
go_cookie["Expires"] = pyrfc3339.generate(unix_time, accept_naive=True) | ||
go_cookie["Expires"] = datetime.datetime.fromtimestamp( |
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.
Is the output exactly same?
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.
Not exactly, these are the outputs:
pyrfc3339: 2025-01-30T14:49:41Z
datetime.isoformat(): 2025-01-30T14:49:41.562687
But this was already discussed, I think in the other PR about the same issue, but as both are different formats that are part of the RFC3339 specification, we decided to proceed.
But if it's not possible, I can find another solution. There was also that manual parse I did to make them equal.
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.
It's just something I need to be clear about and run by juju (server) folks.
@SimonRichardson wdyt? or nominate someone, pls.
/build |
…() 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 *