-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Refactoring Code #335
Refactoring Code #335
Conversation
- Replace yield inside for loop with yield from - Replace if statement with if expression
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.
Thanks for the effort,
this breaks compat with py2 because of the yield from
as mentioned. I'm not sure if we want to that. (maybe we should?)
cc @zzzeek
@CaselIT I Code this based on Python 3.X |
I just noticed that mako still supports 2.7. It may be time to drop it, let's wait mike's opinion :) |
it would have to be a new "minor" release number 1.2 |
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.
OK, this is sqla-tester setting up my work on behalf of CaselIT to try to get revision 7706cd6 of this pull request into gerrit so we can run tests and reviews and stuff
New Gerrit review created for change 7706cd6: https://gerrit.sqlalchemy.org/c/sqlalchemy/mako/+/3064 |
these are good changes but i think there should first be a new mako 1.2 startup that is python 3 only, then these refactorings go in. anyone want to work on this? |
will take a look |
@zzzeek added https://gerrit.sqlalchemy.org/c/sqlalchemy/mako/+/3078 we need to run black, but probably after this is merged. the above patch will probably cause some conflicts with this one |
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.
OK, this is sqla-tester setting up my work on behalf of CaselIT to try to get revision d94a809 of this pull request into gerrit so we can run tests and reviews and stuff
Failed to create a gerrit review, git squash against branch 'main' failed |
I'll try to fix the conflicts later |
Change-Id: Icdadaf29df281378b6bcf2398acfd4520b8c59c5 # Conflicts: # mako/exceptions.py # mako/ext/pygmentplugin.py # mako/lexer.py # mako/parsetree.py # mako/pygen.py # mako/pyparser.py # mako/template.py # mako/util.py # setup.py
Change-Id: I5cc5d75ce180c509a466e9e2a6aef19a87a4b9e5
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.
OK, this is sqla-tester setting up my work on behalf of CaselIT to try to get revision c6243b1 of this pull request into gerrit so we can run tests and reviews and stuff
Patchset c6243b1 added to existing Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/mako/+/3140 |
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.
mike bayer (zzzeek) wrote:
a couple of changes including one type-related error that I think has to be restored. some bigger points:
-
do we want to just go straight to python 3.7?
-
do we have a ticket to fix the pkg_resources stuff?
View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/mako/+/3140
-
mako/ext/linguaplugin.py (line 27): if we use python 3.7 we can use nullcontext() here
if fileobj is None:
ctx = open(filename, "r")
else:
ctx = contextlib.nullcontext(fileobj)
with ctx as file_:
yield from self.process_file(file_)
https://docs.python.org/3/library/contextlib.html#contextlib.nullcontext
python 3.6 ends on december 23 this year
updated in gerrit |
I've added it to #340 |
Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/mako/+/3140 has been merged. Congratulations! :) |
thanks! |
@CaselIT is this PR merged in another way ? |
yes, it was merged by with a commit here c47d172 |
I don't understand why it changed the author :\ I must have messed something up. sorry :( |
@CaselIT No problem, its a great thing to help one of the most thing i use daily 🚀 |
Federico Caselli (CaselIT) wrote: leftover for branch name change. this was already merged View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/mako/+/3064 |
Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/mako/+/3064 has been abandoned. That means that at least for the moment I need to close this pull request. Sorry it didn't work out :( |
Setup.py
with
when opening file to ensure closureUtil.py
Template.py
Runtime.py
PyParser.py
Pygen.py
Parsetree.py
Lookup.py
Lexer.py
Exceptions.py
with
when opening file to ensure closureAst.py
in
operatorPygmentplugin.py