Switch from versioneer to setuptools-scm#1008
Switch from versioneer to setuptools-scm#1008zsol merged 4 commits intopsf:masterfrom vezeli:setuptools-scm
Conversation
|
Following on from #981 (comment): I did $ ls -l dist/black-19.3b1.dev84+g0a19a5d.tar.gz
-rw-r--r-- 1 hugo staff 1.0M 6 Sep 08:48 dist/black-19.3b1.dev84+g0a19a5d.tar.gz
$ ls -l /tmp/Downloads/black-19.3b0.tar.gz
-rw-r--r--@ 1 hugo wheel 152K 6 Sep 08:48 /tmp/Downloads/black-19.3b0.tar.gzShould some excludes be added to |
|
Good point, @hugovk! The ideal solution would be for
Also slides 11-13 in https://blog.ionelmc.ro/presentations/packaging/#slide:11 might be useful. |
|
I think it is good that you pointed it out @hugovk as this is an important difference. One should bear in mind that this behavior is not a bug in
This frees developers from dealing with MANIFEST.in potentially making errors. In our particular case, the listing of the sdist (that is shown) does not include docs which should probably be present there and .github contains CODE_OF_CONDUCT.md which I think is nice to have it. Thanks for the comments @hugovk and @ashwinvis. I prefer to leave it compatible with PyPA but let's see what the maintainers think. |
|
This is definitely a lot more elegant. @zsol what do you think? Also, there's a minor merge conflict. |
|
I skimmed through it during the weekend and looked good to me. Haven't had time to review in depth yet. I'm happy with the approach though 👍 |
|
Thanks! |

The idea of version tracking with tools like
versioneerandsetuptools-scmis to help developers keep track of the code version with respect to SHA-1 and the distance from the last tag. Clean tags are short and useful for users and dirty tags are useful for developers. For detailed examples see pypa/setuptools_scm project and the issue here. Starting from #981, Black implementedversioneerfor version tracking.This PR further improves the process of version tracking by proposing a switch to
setuptools-scmpackage.setuptools-scmis a Python Package Authority (PyPA) project, i.e. the organization that maintains many of the relevant projects in Python packaging such aspip,setuptools,pipenv(all of which Black is using) + others.Some of the benefits of switching to
setuptools-scmare:versioneer, it does not pollute the git project directory with _version.py, versioneer.py and .gitattributes files helping the project clean. Note that a new file _version.py (different from the previous _version.py used forversioneer) is going to be present and contains a single line with the version number oncepython setup.py --versionruns. However, it is not going to be a part of the git directory (included in .gitignore).setuptools-scmwill stay compatible with these changes.setuptools-scmto automatically generate MANIFEST.in (which is one of the possibilities sincesetuptools-scmcommunicates with .git).