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

1.5.0 missing templates? #780

Closed
WilliamMayor opened this issue Jan 19, 2021 · 3 comments
Closed

1.5.0 missing templates? #780

WilliamMayor opened this issue Jan 19, 2021 · 3 comments
Labels

Comments

@WilliamMayor
Copy link

Describe the bug
After a fresh install on a new project I can't run alembic init because it's missing the 'generic' template. If I try to run list_templates I get an error that the templates directory can't be found.

Expected behavior
Alembic initialises the environment.

To Reproduce

python3 -m venv venv
. venv/bin/activate
pip install alembic==1.5.0
alembic init migrations

Error

$ alembic init migrations
  FAILED: No such template 'generic'
$ alembic list_templates
Available templates:

Traceback (most recent call last):
  File "/usr/local/bin/alembic", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/alembic/config.py", line 559, in main
    CommandLine(prog=prog).main(argv=argv)
  File "/usr/local/lib/python3.9/site-packages/alembic/config.py", line 553, in main
    self.run_cmd(cfg, options)
  File "/usr/local/lib/python3.9/site-packages/alembic/config.py", line 530, in run_cmd
    fn(
  File "/usr/local/lib/python3.9/site-packages/alembic/command.py", line 17, in list_templates
    for tempname in os.listdir(config.get_template_directory()):
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.9/site-packages/alembic/templates'

This error is copied directly from the docker image I'm working in that doesn't have the venv from the above example.

Versions.

  • OS: Debian GNU/Linux 10 (buster)
  • Python: 3.9.1
  • Alembic: 1.5.0
  • SQLAlchemy: 1.3.22
  • Database: PostgreSQL
  • DBAPI: psycopg2

Have a nice day!

@WilliamMayor WilliamMayor added the requires triage New issue that requires categorization label Jan 19, 2021
@zzzeek zzzeek added bug Something isn't working command interface and removed requires triage New issue that requires categorization labels Jan 19, 2021
@zzzeek
Copy link
Member

zzzeek commented Jan 19, 2021

we switched from setup.py to setup.cfg for our metadata and I forgot to test this. will have 1.5.1 release ASAP

@sqla-tester
Copy link
Collaborator

Mike Bayer has proposed a fix for this issue in the master branch:

fix erroneous package_dir directive https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/2488

@zzzeek
Copy link
Member

zzzeek commented Jan 19, 2021

OK 1.5.1 is released, I just did a full pip install here and it seems to work. feel free to try it out!

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

No branches or pull requests

4 participants