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

Use setuptools-scm to control version #125

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Use setuptools-scm to control version #125

wants to merge 1 commit into from

Conversation

PicoCentauri
Copy link
Contributor

@PicoCentauri PicoCentauri commented Dec 11, 2024

Use setuptools-scm to automatically create the version string based on git tag. For example for the current PR this would be

torch-pme-0.1.1.dev3+g2f000d0

using these systems makes comparisons between developer version easier.

Contributor (creator of pull-request) checklist

  • Tests updated (for new features and bugfixes)?
  • Documentation updated (for new features)?
  • Issue referenced (for PRs that solve an issue)?

Reviewer checklist

  • CHANGELOG updated with public API or any other important changes?

📚 Documentation preview 📚: https://torch-pme--125.org.readthedocs.build/en/125/

@PicoCentauri PicoCentauri requested a review from Luthaf December 11, 2024 12:50
@Luthaf Luthaf changed the title Use SCM to control version Use setuptools-scm to control version Dec 11, 2024
pyproject.toml Outdated Show resolved Hide resolved
@Luthaf
Copy link
Contributor

Luthaf commented Dec 11, 2024

The setup is producing torch_pme-0.1.dev1+g21ae94a-py3 as a version number on CI, is this expected? Maybe a missing checkout depth on github actions.

@PicoCentauri
Copy link
Contributor Author

The setup is producing torch_pme-0.1.dev1+g21ae94a-py3 as a version number on CI, is this expected? Maybe a missing checkout depth on github actions.

But isn't the action checking out the current branch?

@Luthaf
Copy link
Contributor

Luthaf commented Dec 11, 2024

The action is doing a shallow fetch by default, and does not pull tags/history. There is an option to load the history

@PicoCentauri PicoCentauri force-pushed the scm branch 2 times, most recently from adfabca to 89c1210 Compare December 11, 2024 14:37
@PicoCentauri PicoCentauri requested a review from Luthaf December 11, 2024 14:38
@PicoCentauri PicoCentauri force-pushed the scm branch 2 times, most recently from 03ac88c to 0e97642 Compare December 11, 2024 14:59
MANIFEST.in Outdated
@@ -9,6 +9,7 @@ prune tests
prune .github
prune .tox

exclude src/torchpme/_version.py
Copy link
Contributor

Choose a reason for hiding this comment

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

are you sure about this? I would think we need this file included in the sdist so we have the same version when building the wheels from the sdist as when building wheels from the git checkout.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No I was not. But I tried and the _version.py is in the wheel and for the sdist it will be created again. So seems to be okay to have this here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh you might be right with the sdist.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added an ignore for check-manifest. This fixes the issue and we have a _version.py in the sdist.

@PicoCentauri PicoCentauri force-pushed the scm branch 4 times, most recently from 39359b1 to 26fce8c Compare December 12, 2024 08:03
@PicoCentauri
Copy link
Contributor Author

version seems to be fine now.

torch_pme-0.1.1.dev4%2Bgc83b853-0

@PicoCentauri PicoCentauri force-pushed the scm branch 2 times, most recently from 84a0fb6 to 1242fcb Compare December 12, 2024 08:13
@PicoCentauri PicoCentauri requested a review from Luthaf December 12, 2024 08:14
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.

2 participants