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

Switching from versioneer to setuptools-scm #165

Merged
merged 54 commits into from
Sep 11, 2021
Merged

Conversation

roxyboy
Copy link
Member

@roxyboy roxyboy commented Aug 31, 2021

A PR to switch from versioneer to setuptools_scm for managing versions.

fixes #164

@rabernat
Copy link
Collaborator

I think you also need to remove this stuff

xrft/xrft/__init__.py

Lines 1 to 4 in 744209f

from ._version import get_versions
__version__ = get_versions()["version"]
del get_versions

plus this file: https://github.com/xgcm/xrft/blob/master/xrft/_version.py

@rabernat
Copy link
Collaborator

So you can see from the CI that the version is not getting set right. It's currently showing up as 0.1.dev1+gc81d518.

https://github.com/xgcm/xrft/pull/165/checks?check_run_id=3475121204#step:5:136

@rabernat
Copy link
Collaborator

rabernat commented Sep 2, 2021

@roxyboy - did you see Tom's comments in #164 (comment)?

@roxyboy
Copy link
Member Author

roxyboy commented Sep 2, 2021

@roxyboy - did you see Tom's comments in #164 (comment)?

Yes, and I've been trying to copy and paste files that he's edited but I have yet to figure it out :((

Comment on lines 23 to 24
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you actually change the secrets on the repo? If not, this change will break the release process.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for pointing this out. I didn't so... I'll revert to the previous edits.

@rabernat
Copy link
Collaborator

rabernat commented Sep 3, 2021

Here are another thread on the same topic: pypa/setuptools_scm#414
It sounds like the core problem is described here: pypa/setuptools_scm#480

From reading that, one fix could be

    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0

Copy link
Collaborator

@rabernat rabernat left a comment

Choose a reason for hiding this comment

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

I found more stuff that doesn't make sense here.

setup.cfg Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
ci/environment-py3.6.yml Outdated Show resolved Hide resolved
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

It doesn't matter if you add this in the pre-commit workflow. It needs to be added in the workflow where you care about the version number. What you do in this workflow won't affect the other workflows.

@rabernat
Copy link
Collaborator

rabernat commented Sep 10, 2021

I'm going to go out on a limb and ping open-source 🦸 @ocefpaf.

Filipe, our package is in a bit of a jam. Versioneer stopped working, so we are trying to upgrade to setuptools_scm. But at this PR illustrates, we can't get it working with our release workflow (version number detected is wrong). So we are stuck, unable to release.

Do you have any tips or suggestions to help us get out of this situation? Do you see any problems with the config introduced here?

Edit: It is actually working! See https://github.com/xgcm/xrft/runs/3569028145?check_suite_focus=true#step:5:128

@ocefpaf
Copy link

ocefpaf commented Sep 10, 2021

I really love to be pinged on a packaging issue that get resolved in less than 10 min until I get here 😄

Shameless plug though I'm keeping a "package skeleton" as an alternative to cookie cutters out there: https://github.com/ioos/ioos-python-package-skeleton

It is supposed to be a copy-n-paste updated references for scientific Python packaging. I'm writing docs on it to make it easier to navigate them.

@rabernat
Copy link
Collaborator

Yes we know about the package skeleton. Unfortunately this project predates it.

@rabernat rabernat merged commit 491cc24 into xgcm:master Sep 11, 2021
@roxyboy
Copy link
Member Author

roxyboy commented Sep 13, 2021

Should we make a new release so that PyPI is up to date?

@rabernat
Copy link
Collaborator

rabernat commented Sep 13, 2021

Yes, can you try to make the release?

We released 0.3.1 on GitHub, but it didn't work for pypi (thus this PR): https://github.com/xgcm/xrft/releases
We can't delete a release, so I would move on to 0.3.2. However, to test things out, let's make a "release candidate"

Use v0.3.2-rc0 for the tag and release title when drafting a new release and check the box that says "This is a pre-release". Let's see if the release workflow works.

@rabernat
Copy link
Collaborator

I just ran pip install xrft==0.3.1rc0 and it worked! So I would move forward with the release of 0.3.2.

@roxyboy
Copy link
Member Author

roxyboy commented Sep 13, 2021

Bravo!! 👯

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.

pypi release github workflow failure
3 participants