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

Improve the way settings are managed #1272

Merged
merged 3 commits into from Aug 2, 2019
Merged

Improve the way settings are managed #1272

merged 3 commits into from Aug 2, 2019

Conversation

@sdispater
Copy link
Member

sdispater commented Jul 31, 2019

Pull Request Check List

  • Added tests for changed code.
  • Updated documentation for changed code.

This PR is a refactoring and improvement of the configuration part of Poetry which introduces the following changes.

Local, per-project settings

The config command now supports a --local option which will store the given settings to a local poetry.toml file.

poetry config --local virtualenvs.in-project true

Configuration via environment variables

Poetry can now be configured using environment variables. This is particularly useful in CI environments and avoids having to create configuration files.

The environment variables must be prefixed by POETRY_ and are comprised of the uppercase
name of the setting with dots and dashes replaced by underscore, here is an example:

export POETRY_VIRTUALENVS_PATH=/path/to/virtualenvs/directory

This also works for secret settings, like credentials:

export POETRY_HTTP_BASIC_MY_REPOSITORY_PASSWORD=secret

The settings. prefix is no longer necessary

This one is a breaking change. The settings are now stored differently and no longer needs to be prefixed by settings.. If you have already configured settings you will need to configure them again.

@sdispater sdispater added this to the 1.0 milestone Jul 31, 2019
@sdispater sdispater added this to In progress in 1.0 via automation Jul 31, 2019
@sdispater sdispater added the CLI label Jul 31, 2019
@sdispater sdispater mentioned this pull request Jul 31, 2019
1 of 1 task complete
@sdispater sdispater force-pushed the improved-settings branch from c02cd79 to 0d83542 Jul 31, 2019
poetry/config/config.py Outdated Show resolved Hide resolved
@sdispater sdispater force-pushed the improved-settings branch from 0d83542 to bee4b74 Aug 1, 2019
sdispater added 3 commits Jul 30, 2019
@sdispater sdispater force-pushed the improved-settings branch from bee4b74 to 359a2e7 Aug 1, 2019
@sdispater sdispater merged commit 01fddda into develop Aug 2, 2019
4 checks passed
4 checks passed
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
1.0 automation moved this from In progress to Done Aug 2, 2019
@sdispater sdispater deleted the improved-settings branch Aug 2, 2019
@levrik

This comment has been minimized.

Copy link

levrik commented Aug 27, 2019

I'm quite surprised that the local configuration is written to its own file instead of pyproject.toml. What's the reason for that?

sangaline added a commit to intoli/dysco that referenced this pull request Nov 11, 2019
This bumps the poetry version to 1.0.0 so that we can use `poetry.toml` to
configure the in-project setting. See
python-poetry/poetry#1272 for details.

Merges #6
@sdispater sdispater moved this from Done to Closed in 1.0 Jan 5, 2020
danielgordon pushed a commit to eigentechnologies/cpip that referenced this pull request Jan 15, 2020
In Poetry 1, there is no longer a "settings" prefix for
configuration variables.  See
python-poetry/poetry#1272
for more information.
@gaetan-h gaetan-h mentioned this pull request Jan 16, 2020
gaetan-h added a commit to cognitedata/cognite-replicator that referenced this pull request Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
1.0
  
Closed
3 participants
You can’t perform that action at this time.