Quantcast
Channel: Update version number on each commit - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Update version number on each commit

$
0
0

I am following good practices on How to write a Python script header. I liked the idea to include a version number so each of my Python files has a line that says: __version__ = '1.0.0', different from each other (files version are uncorrelated with each other). However, changing each file manually to edit the version number before the commit is very tedious and I will eventually stop doing it.

Is there a way to search for each file that changed on the new commit and update its version number?


This question has been marked as a duplicate of Automatic version number both in setup.py (setuptools) AND source code?. However, this case is different because of the following:

  1. I have several files, each file has it's own version (as a matter of fact, I don't even have a setup.py yet). The code should change the version of each file SEPARATELY, meaning one file can be on version 50.3.4 and the other on 0.0.2.
  2. I don't care about the tag of git. I don't save versions on git at all.
  3. I want to avoid setting the version number myself. The question he wants to either set the version on Setup or git and then the other one be the same. I want the version number to be increased automatically. Example. If version was 1.0.2 I want it to ve 1.0.3 after the commit (if that particular file has indeed changed).

The question wanted to either choose (manually) a version on setup.py file or git and then update the other accordingly. I have not version on git at all.

The accepted solution (that is indeed a solution to the question) is not helpful at all for example because I have to manually change the file's version and then it will add that version to git (which has nothing to do with what I want for all the listed reasons).


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images