hi there -

this question lacks specifics.   There are no configuration options that are 
relevant to the "alembic init" command in any case so it's not clear what 
config settings you are seeing as "ignored"; init uses only the name of the ini 
file given and this works:

from alembic.config import Config
from alembic import command


alembic_cfg = Config("my_alembic_init.ini")
command.init(alembic_cfg, "./my_test_init")


output:

Creating directory /home/classic/dev/alembic/my_test_init ...  done
  Creating directory /home/classic/dev/alembic/my_test_init/versions ...  done
  Generating /home/classic/dev/alembic/my_test_init/script.py.mako ...  done
  Generating /home/classic/dev/alembic/my_test_init/README ...  done
  File /home/classic/dev/alembic/my_alembic_init.ini already exists, skipping
  Generating /home/classic/dev/alembic/my_test_init/env.py ...  done
  Please edit configuration/connection/logging settings in 
'/home/classic/dev/alembic/my_alembic_init.ini' before proceeding.

Perhaps you're suggesting that the "my_alembic_init.ini" file should be 
*written* to include the options that are present in the object?     We are 
using Python stdlib configparser: 
https://docs.python.org/3/library/configparser.html   and it is actually news 
to me that this even includes an option to "write" the file.  I would suggest 
running alembic.init(), then programmatically reading the .ini file that's 
generated, as this depends upon lots of settings set up in templates like 
alembic/templates/generic/alembic.ini.mako which are not otherwise present in 
Alembic, then add the options you want, then write the file.   this will get 
you that result, hope this helps.



On Fri, Oct 9, 2020, at 5:39 PM, 'Car
ol Guo' via sqlalchemy-alembic wrote:
> I noticed that the command.init api ignores any config settings set by 
> cfg.set_main_option or cfg.set_option. Is there any reasons that we could not 
> allow the init file generated by command.ini api to use those user config 
> settings?
> 
> 

> --
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy-alembic" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy-alembic+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy-alembic/76df5d17-a059-4e42-909d-4d81b132eb3en%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/sqlalchemy-alembic/76df5d17-a059-4e42-909d-4d81b132eb3en%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy-alembic+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy-alembic/b88b8093-0f1f-4474-9847-f3a9c4ac9588%40www.fastmail.com.

Reply via email to