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

Adopt setuptools-scm packaging #1577

Merged
merged 1 commit into from Jun 15, 2021
Merged

Adopt setuptools-scm packaging #1577

merged 1 commit into from Jun 15, 2021

Conversation

ssbarnea
Copy link
Member

@ssbarnea ssbarnea commented Jun 14, 2021

One direct benefit of this change is that package version is no longer hardcoded and is generated based on last tag.

Related: #1555

@ssbarnea ssbarnea added the enhancement This issue/PR relates to a feature request. label Jun 14, 2021
@codeclimate
Copy link

codeclimate bot commented Jun 14, 2021

Code Climate has analyzed commit f00bed7 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (0% is the threshold).

This pull request will bring the total coverage in the repository to 100.0% (0.0% change).

View more on Code Climate.

@luzfcb
Copy link
Contributor

luzfcb commented Jun 14, 2021

LGTM.

The only thing I don't like about setuptools_scm is that apparently, it doesn't work well with PEP 508, that is, if there are requirements like:

package@https://github.com/repository/project/archive/branch_or_commit_hash.zip#sha1=HASH

I discovered this behavior yesterday so I don't have a solution or workaround

pip install pip -U
pip install django-user-sessions@https://github.com/jazzband/django-user-sessions/archive/master.zip

@ssbarnea
Copy link
Member Author

It is expected not to work with git archives because it does not have any clue about which version to use. Git clones work. Is not the only thing not working with git archives. If I remember well microsoft was considering adding some extra metadata to these archives in order to enable consumers to make use of tag information.

Copy link
Member

@simobasso simobasso left a comment

Choose a reason for hiding this comment

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

Hey @ssbarnea 👋 ,

Does this configuration get only the last tag? What about backports?

@ssbarnea
Copy link
Member Author

ssbarnea commented Jun 14, 2021

It will work for maintenance branches too because it will inherit from last tag from current history and generate a devX version. In fact it does know to also increase the minor version by default. Feel free to try it.

Also keep in mind that no release is made without a tag and the tag value. That does not prevent accidents like tagging the wrong version for the branch. Still that part is addressed differently via https://github.com/orgs/cookiecutter/teams/cookiecutter-sentinel/discussions/4

@simobasso simobasso merged commit 5aa5ce8 into master Jun 15, 2021
@simobasso simobasso mentioned this pull request Jun 15, 2021
@audreyfeldroy
Copy link
Member

Hi @simobasso @ssbarnea @luzfcb it looks like you have done a huge amount of work on attempting to improve packaging of Cookiecutter. The current team that is trying to put out the Cookiecutter 2 release (including myself) is having trouble getting setuptools_scm and build to work properly. We want to use the improved setup that you created here in this pull request, but we just cant get it to work on my computer. Can any of you help us sometime over the next 24 hours over a voice screen share in discord the Cookiecutter Discord? The ideal situation would be for us to use the current setup as-is to the new release, but if we cant figure it out, we will revert this pull request.

NOTE: This message was typed by @ozer550 as Audrey is unable to use her hands.

@ssbarnea ssbarnea deleted the fix/setuptools-scm branch December 29, 2021 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue/PR relates to a feature request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants