gitignore icon indicating copy to clipboard operation
gitignore copied to clipboard

Add `poetry.toml` to `Python.gitignore`

Open faresbakhit opened this issue 2 years ago • 3 comments

Reasons for making this change:

Poetry is a Python dependency management and packaging tool.

poetry.toml is a local configuration file for projects powered by poetry, The settings commonly added to this file are user-specific settings like 'cache-dir' and 'virtualenvs.path' and shouldn't be committed for everyone .

Even the poetry repository includes it in it's .gitignore file: https://github.com/python-poetry/poetry/blob/0d7b16f7f6f5bb63a7a507291064dd18f1ff2d93/.gitignore#L40

Links to documentation supporting these rule changes:

The documentation for poetry.toml: https://python-poetry.org/docs/configuration/

Link to application or project’s homepage:

  • https://github.com/python-poetry/poetry
  • https://python-poetry.org/

faresbakhit avatar Oct 08 '21 10:10 faresbakhit

I am curious if you explain the reason for the poetry toml over the lock file or if they related? https://github.com/github/gitignore/pull/3911

bdougie avatar Dec 07 '21 06:12 bdougie

Fixed merge conflicts

I am curious if you explain the reason for the poetry toml over the lock file or if they related? #3911

No, poetry.toml and poetry.lock serve two different purposes. The former is for project specific local configurations (docs) and the latter is for dependency locking (e.g. package-lock.json, Cargo.lock).

faresbakhit avatar Dec 07 '21 21:12 faresbakhit

+1 to this. master now has poetry section where this addition should go with some description comments. https://github.com/github/gitignore/blob/d0b80a469983a7beece8fa1f5c48a8242318b531/Python.gitignore#L97

majiang avatar Apr 26 '22 02:04 majiang