-
-
Notifications
You must be signed in to change notification settings - Fork 252
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
Fix alembic.ini
templates to match configparser
file format.
#1397
Conversation
Thanks Seems to be a reasonable change |
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 zzzeek to try to get revision f7198e3 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 need this PR to be rebased on main for me to work with it. |
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 zzzeek to try to get revision 073cbd9 of this pull request into gerrit so we can run tests and reviews and stuff
New Gerrit review created for change 073cbd9: https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5587 |
OK I used github's UX for this |
Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5587 has been merged. Congratulations! :) |
In the
alembic.ini
templates, I moved the inline comment aboutversion_path_separator
to their own lines as required byconfigparser
.Description
In a recent project, I included the following configuration values in my
alembic.ini
. Note that the last line is the default line from the current genericalembic.ini
template.When running
alembic check
, I encountered:It seemed that the comment in the last line was being included as part of the parsed config value, which should be
os
.Alembic currently uses
configparser.ConfigParser
from the standard libary to parsealembic.ini
files. The defaultconfigparser
file format requires that comments be on their own lines, although this can be customized. I changed the three copies of this line in Alembic'salembic.ini
templates to remove the inline comments. In my case, this change fixed theValueError
.This issue could also be fixed by changing the default instance of
ConfigParser
, usinginline_comment_prefixes=("#",)
. I imagine, however, that it might be better to use the default file format.Checklist
This pull request is:
must include a complete example of the issue. one line code fixes without an
issue and demonstration will not be accepted.
Fixes: #<issue number>
in the commit messageinclude a complete example of how the feature would look.
Fixes: #<issue number>
in the commit messageHave a nice day!