Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a need for bumpversion (or bump2version) when setuptools_scm is available?

TLDR;

The question is as the title says.

To bump or not to bump?

I started using bump2version and then discovered setuptools_scm (fairly new to developing full-fledged python programs) and now I am confused.

https://setuptools.readthedocs.io/en/latest/history.html#v20-6-0 (ancient, I know, and I use v40-x-x) mentions the integration of bumpversion, however, there is no mention of ever dropping bumpversion support in subsequent changelogs.

Meanwhile, 1.4 Extending and Reusing Setuptools section of setuptools documentation mentions setuptools_scm (and setuptools_svn) for integration with git, Hg and svn.

BLAB (Bottom-Line-At-Bottom)

So, the question is: Is bumpversion deprecated/obsolete?


Addendum

To further clarify I will try and explain my use-case a bit more

I have a super-project that has multiple subprojects.

super
├───base/
├───core/
├───lib/
├───version/requirements.txt
└───modules/
    ├───module-1/
    ├───module-2/
    ├───module-3/
    ├───module-4/
    └───module-5/

The super is a master git, with each subproject as a submodule (which have their own submodules) and of course, each of them maintains its own release versions (which is easy enough)

A release of the project is comprised of signed-off modules that are inter-compatible with everything else.

My current approach

I am currently using a submodule called version that maintains a requirements.txt + pyproject.toml and pulls the whole thing together into a distributable package. Following guidelines in https://github.com/pypa/pipfile/issues/27 and somewhat pulling from https://caremad.io/posts/2013/07/setup-vs-requirement/

The question remains: Is there a canonical approach to doing something like this?

like image 944
Ahmed Masud Avatar asked Jul 07 '19 10:07

Ahmed Masud


1 Answers

If you use setuptools_scm, you probably don't need bump2version. And vice versa.

There is no 'canonical' way to bump a version in Python. Multiple tools exist, and you can use the one you like (or none at all).

The message in the setuptools changelog is about what the setuptools authors use in their own Git repository. They still use bump2version, as seen in this config file.

The projects setuptools_scm and setuptools are similar in name but they're totally independent.

like image 171
florisla Avatar answered Oct 07 '22 14:10

florisla