Skip to content
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

TypeError: current() got an unexpected keyword argument 'head_only' #380

Closed
mdantonio opened this issue Jan 19, 2021 · 5 comments · Fixed by eddieferrer/sizesquirrel-open#216

Comments

@mdantonio
Copy link

mdantonio commented Jan 19, 2021

Alembic just released a new version (1.5.0) with the following breaking change:

Removed deprecated --head_only option to the alembic current command

Due to that Flask-Migrate no longer works with the following error:

TypeError: current() got an unexpected keyword argument 'head_only'

As a temporary workaround I simply installed alembic < 1.5.0

@miguelgrinberg
Copy link
Owner

2.6.0 released with this fix.

@mdantonio
Copy link
Author

mdantonio commented Jan 19, 2021

Just tested, thank you

@scuerda
Copy link

scuerda commented Feb 8, 2021

@miguelgrinberg Hey Miguel, just a heads up, but we just got burned by this in a bit of an unpleasant way. In setup.py you have 'alembic>=0.7'...we didn't have alembic pinned locally and as a result, when we re-computed out dependencies, installing flask-migrate 2.5.2 inadvertently upgraded us to 1.5.0. So folks ought to pin alembic specifically if they are using flask-migrate.

@miguelgrinberg
Copy link
Owner

@scuerda yes, the problem is that when the 2.5.2 release came out Alembic 1.5 did not exist yet, so I did not know that it was going to be incompatible and for that reason that release does not have a restriction on that alembic version.

In general I assume that you will be installing Flask-Migrate in one of these two scenarios:

  • On a new project: you will be doing pip install flask-migrate, which will bring all the correct dependencies. You will then save your dependencies to a requirements.txt file.
  • On an existing project: you will be doing pip install -r requirements.txt, which will bring all the correct dependencies that were saved by the first case.

You seem to be trying to use a third case that I have not really intended to support, which is to install an old release in a new project.

@scuerda
Copy link

scuerda commented Feb 9, 2021

@miguelgrinberg Totally fair point. I wasn't intending to suggest that there was work to do on your part for this. I wanted to describe my situation to leave some bread crumbs for anyone else who might get bit by letting their dependencies drift a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants