Skip to content

Remove unused _version.py references#160

Merged
orbeckst merged 3 commits into
MDAnalysis:mainfrom
ojeda-e:issue144-version
May 11, 2026
Merged

Remove unused _version.py references#160
orbeckst merged 3 commits into
MDAnalysis:mainfrom
ojeda-e:issue144-version

Conversation

@ojeda-e

@ojeda-e ojeda-e commented May 9, 2026

Copy link
Copy Markdown
Member

Fixes #144

Changes made in this Pull Request:

  • Removed references from the following files

    • docs/scripts/file_descriptions.yaml
    • {{cookiecutter.repo_name}}/.codecov.yml
    • {{cookiecutter.repo_name}}/.gitattributes
  • Updated documentation (fix typos and updated info) in:

    • docs/source/customising/code.rst
    • docs/source/customising/packaging.rst

PR Checklist

  • [N/!] Tests?
  • Docs?
  • CHANGELOG.md updated?
  • [N/A] AUTHORS.md updated?
  • Issue raised/referenced?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@orbeckst since we are deleting the only line in this file, I think it's best to fully delete .gitattributes with git rm but would prefer to confirm this is the right way to go.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

delete the whole file

@orbeckst

orbeckst commented May 9, 2026 via email

Copy link
Copy Markdown
Member

@ojeda-e

ojeda-e commented May 10, 2026

Copy link
Copy Markdown
Member Author

Can you check that we’re not actually having versioningit write _version.py?

It seems like we are not.

Yes, we do use versioningit, but we do not write the version down to _version.py. The config declared in the {{cookiecutter.repo_name}}/pyproject.toml only includes the blocks [tool.versioningit], [tool.versioningit.vcs], and [tool.versioningit.format]:

[tool.versioningit]
default-version = "1+unknown"
[tool.versioningit.vcs]
method = "git"
# the below line expects tags to look like '1.0.2'.
# if prefixing with a v, e.g. 'v1.0.2', change it to ["v*"]
match = ["*"]
[tool.versioningit.format]
distance = "{base_version}+{distance}.{vcs}{rev}"
dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
distance-dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"

Meaning, the version string is obtained from git. It does not, by itself, create a _version.py file.

Following the versiongit docs, if we were writing the version down to _version.py, it would look like:

[tool.versioningit.write]
file = "src/project_name/_version.py

But nothing in the pyproject.toml indicates we are doing so.

@orbeckst orbeckst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good. I agree with you to delete the .gitattributes. Please do and then we can merge. I am just approving ahead of time.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

delete the whole file

@ojeda-e ojeda-e force-pushed the issue144-version branch from 46a4f51 to e36394e Compare May 11, 2026 20:25
@ojeda-e

ojeda-e commented May 11, 2026

Copy link
Copy Markdown
Member Author

@orbeckst file deleted; this PR is ready to merge.

@orbeckst orbeckst self-assigned this May 11, 2026
@orbeckst orbeckst merged commit 16fe292 into MDAnalysis:main May 11, 2026
12 checks passed
@orbeckst

Copy link
Copy Markdown
Member

Thank you!

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.

Old _version.py references

2 participants