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: Dead dependencies and code cleanup #13344
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmp was being used from past.builtins library since it was deprecated in PY2. It's hard to understand behaviour of their usages, so this is an attempt to replicate behaviour with simpler logic, making this more readable. Also, removed usages of iteritems and string_types, compatibility imports
* Remove six for PY2 compatability since our dependencies are not, PY2 is legacy. * Removed usages of utils from future/past libraries since they are deprecated. This includes 'from __future__ ...' and 'from past...' statements. * Removed compatibility imports for PY2, switched from six imports to standard library imports. * Removed utils code blocks that handle operations depending on PY2/3 versions. * Removed 'from __future__ ...' lines from templates/code generators * Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
* The library bleach-whitelist was deprecated and renamed to bleach-allowlist. * Updated the usages and requirements for the same.
While executing git commands in the shell via Frappe processes, use context managers to ensure files get closed after usage. This fixes the ResourceWarning errors due to unclosed files.
Watchdog isn't used by Frappe, and there wasn't any mechanism to access it directly either. By default, bench serve (or start) uses Werkzeug's watchdogreloader
This fixes the ResourceWarning errors due to unclosed files while utilizing the website router
Escaped when proven easier
* Remove trailing whitespaces in translatable strings * Sort imports appropriately
Simplify conditional block and str appending
gavindsouza
requested review from
leela,
prssanna,
ruchamahabal,
surajshetty3416 and
a team
as code owners
May 27, 2021 09:42
Found the following deprecation warnings in the CI tests that broke after the last merge. Will accommodate them in this PR.
Edit: Updated Jinja2 and PyJWT to get rid of those. |
gavindsouza
force-pushed
the
drop-py2-code
branch
from
May 27, 2021 11:10
ee68a16
to
72c2393
Compare
Update from 2.11.3 to 3.0.1 Ref: https://jinja.palletsprojects.com/en/3.0.x/changes/
* Update pinned dep fromm 1.7.1 to 2.0.1 * Updated usages as per changelog ref: https://python.libhunt.com/pyjwt-changelog
This comment has been minimized.
This comment has been minimized.
bench setup requirements solved previous error,
reinstall again solved it. I'm not able to successfully run tests locally
|
gavindsouza
referenced
this pull request
Jun 3, 2021
…on_key (#13399) * fix: only allow keys generated by fernet in encrypt()/decrypt() * fix: sider and semgrep fixes
I created a fresh develop bench and everything worked. Sorry for wrong review and delayed reply. |
51 tasks
This was referenced Jul 18, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
future
,past
utils' usages (includesunicode_literals
,print_function
,with_metaclass
,cmp
)if PY2
andif not PY3
, and other variations of it; and other compatibility codestring_types
,text_type
,integer_types
,urllib
,StringIO
, etc)watchdog
,future
,bleach-whitelist
packages from requirements.txtbleach-allowlist
as replacement forbleach-whitelist
in requirements.txt