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 documentation on the behaviour of update and install #4117

Open
chernals opened this issue May 30, 2021 · 7 comments
Open

Improve documentation on the behaviour of update and install #4117

chernals opened this issue May 30, 2021 · 7 comments
Labels
area/docs Documentation issues/improvements good first issue

Comments

@chernals
Copy link

I believe that the documentation could be improved regarding what update and install are doing.

To me it is not really clear, for example:

  • when doing update are the new packages installed? is the pyproject.toml file update with latest version numbers?
  • when should one do install ? Only the first time?

Maybe we could collect here answers to questions like the two above and I'll be happy to make a PR for the doc.

@chernals chernals added area/docs Documentation issues/improvements status/triage This issue needs to be triaged labels May 30, 2021
@finswimmer
Copy link
Member

The purpose of poetry install is to:

  • create a venv if None exists
  • resolve dependency and write the exact version to poetry.lock if None exists
  • install the locked dependencies in the venv
  • install the current project in editable mode

A poetry install is only necessary if you:

  • create the venv the first time
  • change any metadata of the project, like version number
  • add "scripts" entry points to the pyproject.toml

The purpose of poetry update is to:

  • update all dependencies to the current version within in the pyproject.toml specified version range
  • write the updated version to poetry.lock
  • the version numbers in pyproject.toml remain untouched

@chernals
Copy link
Author

Thanks !

How does poetry update behave when "extra" dependencies are declared or with respect to development dependencies? Does it follow what poetry install did when last executed? (for example if poetry install --no-dev then poetry update will not touch the developement dependencies, if poetry install (without -E foo0 then poetry update will not touch the foo extra dependencies?

@mrkeuz
Copy link

mrkeuz commented Jun 11, 2022

Same issue with poetry install . Always confused with this command help.

Help also should explain:

  • where dependencies will be installed - exactly into virtual environment (even poetry shell virtual env not activated). Not to system python dependencies. Even poetry shell / virtual env not activated. While virtualenvs.create = true

I understand now that it assumed and expected but not clear from docs. At first, I have trying to install packages into system via poetry install. Exactly because not well documented.

@rafrafek
Copy link
Contributor

Are dev (or other groups) dependencies installed by default?

@neersighted
Copy link
Member

Are dev (or other groups) dependencies installed by default?

The best intro to the feature is the release announcement which goes into detail with examples. Yes, they are installed by default using Poetry (but not captured by tools that build/install as a Python package).

@rafrafek
Copy link
Contributor

Yes, they are installed by default using Poetry (but not captured by tools that build/install as a Python package).

Can we add this information to the docs here: https://python-poetry.org/docs/cli/#install

@neersighted
Copy link
Member

PRs welcome :)

@finswimmer finswimmer added good first issue and removed status/triage This issue needs to be triaged labels Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs Documentation issues/improvements good first issue
Projects
None yet
Development

No branches or pull requests

5 participants