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

Use paste.deploy to parse alembic config files #22

Conversation

MatthewWilkes
Copy link

Alembic uses configparser to parse its config files, which is
compatible with the paste.deploy ini config files in terms of
encoding, but paste.deploy has additional features such as
user = config: lines. This reduces the amount of places that
alembic config files are generated throughout the codebase and
uses paste.deploy to extract the config values for the app:conduit
section before directly inserting them into an alembic config.

This allows users to omit script_location from test.ini, and moreover
to omit any parameters required by alembic that are set in a parent
of the relevant app:conduit block.

Alembic uses configparser to parse its config files, which is
compatible with the paste.deploy ini config files in terms of
encoding, but paste.deploy has additional features such as
`user = config:` lines. This reduces the amount of places that
alembic config files are generated throughout the codebase and
uses paste.deploy to extract the config values for the `app:conduit`
section before directly inserting them into an alembic config.

This allows users to omit `script_location` from test.ini, and moreover
to omit any parameters required by alembic that are set in a parent
of the relevant app:conduit block.
@MatthewWilkes MatthewWilkes force-pushed the wilkes/alembic-script-location branch from e8cd265 to 60ccad9 Compare May 16, 2019 10:47
@MatthewWilkes
Copy link
Author

Force-push was following a rebase onto master.

Copy link
Member

@zupo zupo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@MatthewWilkes
Copy link
Author

Let's hold off on this, one of the other TODOs is related.

@MatthewWilkes
Copy link
Author

I've created teamniteo/pyramid_deferred_sqla#3 to track the related topic. I think it would be nice if we could unify these two concepts, so the pyramid_deferred_sqla package contained the heavy lifting from this PR.

@digitalresistor
Copy link

Instead of using paste.deploy I would recommend using plaster, this way you can support alternate configuration files so long as there is a plaster module for it. plaster_pastedeploy exists and works for .ini files.

Pyramid itself also uses plaster.

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 this pull request may close these issues.

3 participants