[FR] Add a .gitignore file to egg-info, dist-info, dist and build directories
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
What's the problem this feature will solve?
Presently, git users tend to configure their repositories to ignore generated files from setuptools. This is easy enough (and expressive enough) to do for people who know what they are doing. For novice users though, it is very easy to commit these generated files into a repository (due to ignorance or by accident).
Describe the solution you'd like
I propose that we change the default such that generated directories (build, dist, *.dist-info and *.egg-info) are ignored. This is not a re-hash of #2455 and https://github.com/pypa/setuptools/pull/1497#issuecomment-423323011) - I am proposing that we generate files in build/.gitignore (and the other directories in question) containing *.
There may be expert corner-cases where people actually want to commit these files. In that case, they would need to remove the .gitignore file manually.
This proposal does not contradict https://github.com/pypa/setuptools/pull/4453, where developers are recommended to put common (across multiple projects) .gitignore specific configuration into a common place (not every project). To quote @jaraco's very good article:
[The]
.gitignorefor a project should specify elements unique to that project and not elements peculiar to the language or system or user.
My proposal supports that position further - there will be less incentive for projects to add *.egg-info / *.dist-info into their project's .gitignore, and there is no work needed on the part of a developer to configure their git to handle Python/setuptools like projects.
This also aligns well with the approach taken in https://github.com/python/cpython/issues/83417.
Alternative Solutions
No response
Additional context
Some notes:
- We could now remove some of the guidance in https://github.com/pypa/setuptools/pull/4201/files related to
.gitignore.
Code of Conduct
- I agree to follow the PSF Code of Conduct
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the setuptools entry points that create build, dist, *.dist-info, and *.egg-info directories, then review the .gitignore guidance referenced from pull request #4201. The work is done when each generated directory contains a .gitignore with the proposed * content and the related guidance is consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, python
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100