-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
[Feature-Request] Support PathLike interface in directory
parameter
#318
[Feature-Request] Support PathLike interface in directory
parameter
#318
Comments
Would you like to have a go at this? Happy to accept a PR with this change. |
Sure, thanks for the fast feedback. I'll try to draft this up by end of the week at the latest. |
Just wondering, what is the minimum required Python version of |
Do you need to refer directly to |
That would be the straight-forward thing to do, but it would except basically all python objects, since they all provide a The Is this too cumbersome and I should just go with the |
I actually see it as a good feature to have that any objects can be used with the only requirement that they return the path when str() is applied to them. |
Alright, then I'll implement it with just calling |
It would be great if the constructor of
Migrate
would accept aPathLike
object instead of requiring a string.E.g., currently i have to use:
It would be nice to be able to do:
In this example, it does not really matter, but in my application I source all paths from a config object that uses
Path
for all file system paths andFlask-Migrate
is the only one not supporting this and I have to usestr(Path)
to convert myPath
back to astr
.This is probably pretty simple to implement, because the restriction seems to come from the line
config.set_main_option('script_location', directory)
which could simply callstr(directory)
instead, at least that is what I have in my stacktrace:The text was updated successfully, but these errors were encountered: