Open sqlalchemy-bot opened 7 years ago
Michael Bayer (zzzeek) wrote:
I'd be more comfortable with a flag --update-manifest. Way way less risky and surprising. what do you think?
Luke Schlather (lukeschlather) wrote:
Everyone I work with (including me) is continually surprised when they deploy a new package and alembic fails. I think --update-manifest is a decent place to put the feature, but I know my company's documentation is going to say to always use the option.
I do get the worry, since our packaging setup certainly isn't universal and I'm sure there are cases where updating the manifest could have unexpected results. Also the logic around update-or-create MANIFEST.in could be a little surprising, though simply appending if exists is probably fine.
Michael Bayer (zzzeek) wrote:
Um...why aren't you using a wildcard in your MANIFEST.in? there's no need to add individual __init__.py
files, and also alembic init doesn't create any __init__.py
files anyway. were you looking for individual line items for every new version file?
Michael Bayer (zzzeek) wrote:
oh I see you want it to create __init__.py
files. These need to all be options, preferably one that uses a package name for "script_location" in alembic.ini.
Michael Bayer (zzzeek) wrote:
like this:
alembic init --package myapp.foo
it will then use PYTHONPATH and import to figure out where "myapp.foo" is supposed to be and will generate the entrypoint in alembic.ini script_location, and make sure whatever __init__.py
is necessary.
Luke Schlather (lukeschlather) wrote:
alembic init --package myapp.foo
Sounds good. In that case it seems more reasonable to me to make --update-manifest assumed, since it shouldn't have to do as much guessing.
Changes by Michael Bayer (zzzeek):
Changes by Michael Bayer (zzzeek):
Migrated issue, originally created by Luke Schlather (lukeschlather)
When I run alembic init, it generates alembic.ini, alembic, and alembic/versions/ .
I run this in a namespaced directory (e.g. database) under a python package. It would be nice if alembic automatically detected that it was being created within a python package, and modified the Manifest, and/or added init.py files to ensure it is distributed along with the package.
As an example, suppose I had a structure like:
If I were to run "alembic init" in the database directory, it would be nice if alembic init detected the setup.py in the root of the project, created a MANIFEST.in if need be, and created init.py files so it instead looks like: