Skip to content

git: ignore .python-version in every directory#5608

Merged
mehmetoguzderin merged 1 commit intogpuweb:mainfrom
dneto0:update-gitignore
Mar 23, 2026
Merged

git: ignore .python-version in every directory#5608
mehmetoguzderin merged 1 commit intogpuweb:mainfrom
dneto0:update-gitignore

Conversation

@dneto0
Copy link
Contributor

@dneto0 dneto0 commented Mar 23, 2026

pyenv uses the .python-version to specify the Python version
to use in this directory and its descendants. This should
not be checked into the repo, since it might specify a version
that another person might not have.

@dneto0 dneto0 requested a review from alan-baker March 23, 2026 17:55
@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2026

Previews, as seen when this build job started (7877cf6):
WebGPU webgpu.idl | Explainer | Correspondence Reference
WGSL grammar.js | wgsl.lalr.txt

@dneto0 dneto0 enabled auto-merge (squash) March 23, 2026 18:00
Copy link
Member

@mehmetoguzderin mehmetoguzderin left a comment

Choose a reason for hiding this comment

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

Is .python-version commonly ignored? I think .DS_Store is good to ignore recursively however the version file is sometimes in-tree.

@dneto0
Copy link
Contributor Author

dneto0 commented Mar 23, 2026

Is .python-version commonly ignored? I think .DS_Store is good to ignore recursively however the version file is sometimes in-tree.

I accidentally added .python-version to a PR. Alan caught it. here

.python-version is how pyenv knows what Python version to use for a local directory. If it gets added by accident then the version I might have would affect someone else. I think the bad case is if the file specifies a version the other person does not have.

@dneto0 dneto0 force-pushed the update-gitignore branch from 149eada to 059a939 Compare March 23, 2026 18:10
pyenv uses the .python-version to specify the Python version
to use in this directory and its descendants.  This should
not be checked into the repo, since it might specify a version
that another person might not have.
@dneto0 dneto0 force-pushed the update-gitignore branch from 059a939 to 7877cf6 Compare March 23, 2026 18:11
@dneto0 dneto0 changed the title git: ignore .DS_Store and .python-version in every directory git: ignore .python-version in every directory Mar 23, 2026
@dneto0 dneto0 requested review from dj2 and mehmetoguzderin March 23, 2026 18:12
@dneto0 dneto0 disabled auto-merge March 23, 2026 18:12
Copy link
Member

@mehmetoguzderin mehmetoguzderin left a comment

Choose a reason for hiding this comment

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

If we want to pinpoint Python version for local env creation sometime in future maybe we can use pyproject etc. and .python-version is interpreted differently between pyenv and uv so it might be better to avoid in-tree. Thx

@mehmetoguzderin mehmetoguzderin merged commit 93f086c into gpuweb:main Mar 23, 2026
4 checks passed
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