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
Move up to fstrings #1886
Move up to fstrings #1886
Conversation
There may be some issues still. My local builds still fail on lint and functional ENV's. Perhaps it is correct for the functional build to fail as it runs on 3.5? There are also some lines of code that I'm unsure of on how to convert to fstrings at the moment. I'll look into those over the next few days. Code review/advice is very much appreciated |
kinto/core/authentication.py
Outdated
@@ -34,6 +34,7 @@ def unauthenticated_userid(self, request): | |||
return | |||
|
|||
hmac_secret = settings["userid_hmac_secret"] | |||
# Unsure how to use fstring with *args |
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 would say that f"{credentials[0]}:{credentials[1]"
is fine. Or leave the format() call
kinto/core/events.py
Outdated
@@ -29,6 +29,7 @@ def __init__(self, payload, request): | |||
self.request = request | |||
|
|||
def __repr__(self): | |||
# Not sure what proper conversion to fstring is |
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.
This is probably better to leave it with format()
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.
We could do this, I think it should work
# Not sure what proper conversion to fstring is | |
# def __repr__(self): | |
return f"<{self.__class__.__name__} action={self.payload['action']} uri={self.payload['uri']}>" |
It looks to me! Thanks for taking the time to do this!
This PR will drop support of Python 3.5. It looks like you should run black to format your changes (see TravisCI job py36) |
It's my pleasure! About the TravisCI config, we should update the python version but also tell Travis that we expect 3.5 to fail, correct? |
No we should remove the travis config for py35 altogether. |
Thank you for this work. To be honest I didn't expect it to be so much of an improvement. |
You and @leplatrem have been very kind to me and made my first experience with open source extremely welcoming. I'm very happy to have started here at Kinto 😀 |
Let's make a quick poll: https://twitter.com/Natim/status/1064904568272764931 |
I think you may need to edit your link |
I did indeed 💃 |
Looks good! |
Could you please update your branch, we'll merge ;) |
Is there anything that still needs to be done from me? 👍 |
Nope it seems good to me 👍 |
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.
👍
Changelog is not properly dated on 12.0.0 |
It's still unreleased and it's marked as such, so I think it's OK, right? |
Yes it is the normal process, the date is fixed only when we release it. |
Fixes #1659
For when it's necessary to drop support for older Python Versions.
kinto/config/__init__.py
kinto/schema_validation.py
kinto/core/scripts.py
kinto/core/openapi.py
kinto/core/__init__.py
kinto/core/utils.py
kinto/core/cache/postgresql/__init__.py
kinto/core/storage/memory.py
kinto/core/storage/exceptions.py
kinto/core/storage/postgresql/client.py
kinto/core/storage/testing.py
kinto/core/statsd.py
kinto/core/initialization.py
kinto/core/resource/model.py
kinto/core/resource/schema.py
kinto/core/permission/memory.py
kinto/core/views/heartbeat.py
kinto/core/views/errors.py
kinto/core/views/batch.py
kinto/core/testing.py
kinto/plugins/quotas/scripts.py
kinto/plugins/quotas/listener.py
kinto/plugins/openid/__init__.py
kinto/plugins/openid/views.py
kinto/plugins/default_bucket/__init__.py
kinto/plugins/history/listener.py
kinto/authorization.py
kinto/views/records.py
kinto/core/authentication.py
kinto/core/events.py
kinto/core/storage/postgresql/__init__.py
kinto/core/storage/postgresql/migrator.py
kinto/core/errors.py
kinto/core/resource/__init__.py
kinto/core/resource/viewset.py
kinto/core/permission/postgresql/__init__.py
kinto/core/authorization.py
kinto/plugins/accounts/scripts.py
kinto/plugins/accounts/__init__.py
kinto/plugins/accounts/views.py
kinto/plugins/accounts/authentication.py
kinto/views/permissions.py
kinto/views/groups.py
kinto/__main__.py
Cleanup