-
Notifications
You must be signed in to change notification settings - Fork 448
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
use setuptools_scm to manage package version and sdist file list #648
Conversation
For example, if you look at the CI log, the version string produced for this PR branch is:
Since the last tag is Then, after the The last part of the version, folowing If the commit coincided with a git tag (and if the working directory is not "dirty"), then the version string produced would simply be, e.g., If the working directory is dirty, another suffix (starting with |
May I suggest we use three MAJOR.MINOR.PATCH digits for the next tag, i.e. 3.1.0, instead of 3.1? |
Mhmm, I don't like redundant trailing zeroes, which are simply ugly. We shouldn't sacrifice readability just for dumb programming.
|
I agree with Werner that the third "patch" digit could be seen as redundant when it's '0'. I re-read the PEP 440, the official Python specification for version identification implemented by setuptools and pip to identify packages and resolve dependencies. The "final release" segment of a version is defined as
This conforms with what Werner suggested. However, the spec also notes that
Anyway, isn't it funny how we haven't tagged a release for a year, and now we find ourselves discussing whether it's going to be 3.1 or 3.1.0... |
OK, I implemented the custom version scheme as discussed above. Because the current tag is still
All the next release tags should be in the form This is because the default I could change the pattern to I think this is ready to be merged now. |
d8174e0
to
6d3d6ba
Compare
hmm, I can see the reaction hasn't been very enthusiastic so far... 😞 |
393e102
to
c00bed9
Compare
I think we all know a release hasn't happened in a while, we don't need a new more complicated version numbering scheme for that (imho). |
Can we keep it simple please? :) |
I'm all for more automation, but adding new, niche, tools, just to remove the "pain" of changing a version number doesn't look that much of a gain to me. I understand we want more releases, but the reason we don't have more regular releases is because of multiple half-finished modules in tree; mostly mine! varLib, mtiLib. Perhaps a facility to mark certain modules as unstable would get us closer to having releases. WDYT? |
c98abaa
to
b14dab8
Compare
There are several interrelated problems at stake here. We don't tag releases very often -- because, like Behdad said, there's stuff which is not completed, and many can only work in their spare time, etc. The less frequently we release, the more the very action of releasing becomes like.. "oh my god! This is going to be perfect". As we don't release often, we don't often deploy to the official repository where Python users expect nowadays to find Python packages. Because of that, users will be inevitably led to install fonttools from the git repository -- which is supposed to be the in-development, unstable copy. (Not to mention that Now, the version number that shows in the It's not just users that can't tell what-the-fonttools they are being using, but other developers as well are put into an un uncomfortable situation. They would like to use fonttools (the library) in their own tools, but they can't simply add it to their Alternatively, they maintain monstrous "requirements.txt" files with several git urls of all the dependencies of the dependencies of the dependencies..., which the user is supposed to This situation is bad, and it can't go on like that forever. The thing is, fonttools and all its sister projects are being used for production. They need to be deployed to users' machines or to servers to make fonts. These products must be reproducible. There has to be, and in fact there are, better way to distribute these packages which does not require doing all this mess. The proposal to add a automated versioning tool like
About marking some sub-packages as "unstable", as Behdad suggested, I believe anything which is merged in master has to be deemed stable enough. Maybe not bug-free-release-ready, but nevertheless, kind of useable. If one doesn't want it to be used yet, I think one should keep it in a separate branch, and rebase that until it gets ready. I guess I've exhausted all arguments. I just would like to be able to take care of this, because I know I could solve it if you allow me to. |
@anthrotype +1
This is a big thing, having a way of being able to troubleshoot a user issue by knowing which version is installed (and not having to explain git to folks) is really important to the larger, not-as-technical-as-you-may-assume crowd. |
a09ea0c
to
c529e7d
Compare
For simplicity, I dropped the Also for further simplicity, I would like to drop the custom version scheme suggested early on by Werner (2756148), and simply use the default one with three major.minor.patch numbers, e.g |
I used graphviz to visualize the dependency hell. If you like, you can show it in your slides in Warsaw ;) digraph fontmake_deps {
# fonttools -> brotli [style=dotted]
# fonttools -> zopfli [style=dotted]
# fonttools -> unicodedata2 [style=dotted]
# fonttools -> xattr [style=dotted]
# fonttools -> PyQt5 [style=dotted]
# fonttools -> AppKit [style=dotted]
# fonttools -> pygtk [style=dotted]
# fonttools -> reportlab [style=dotted]
cu2qu -> fonttools
cu2qu -> ufoLib
# cu2qu -> defcon [style=dotted]
ufoLib -> fonttools
defcon -> fonttools
defcon -> ufoLib
# defcon -> compositor [style=dotted]
ufo2ft -> fonttools
ufo2ft -> ufoLib
ufo2ft -> compreffor [style=dotted]
ufo2ft -> cu2qu [style=dotted]
# ufo2ft -> defcon [style=dotted]
# ufo2ft -> unicodedata2 [style=dotted]
booleanOperations -> fonttools
booleanOperations -> ufoLib
# booleanOperations -> defcon [style=dotted]
compreffor -> fonttools
fontMath -> fonttools
fontMath -> ufoLib
mutatorMath -> defcon
mutatorMath -> fontMath
glyphsLib -> fonttools
glyphsLib -> defcon
glyphsLib -> mutatorMath
fontmake -> fonttools
fontmake -> cu2qu
fontmake -> defcon
fontmake -> ufo2ft
fontmake -> booleanOperations [style=dotted]
fontmake -> mutatorMath [style=dotted]
fontmake -> glyphsLib [style=dotted]
} |
@anthrotype looking at that graph, I wondered why booleanOperations needed defcon: checking the source, I don't see a dependency on it. One less circle of hell! |
It' true, it does not import from it, but I would argue it is a de facto dependency, as it expects something like a Defcon glyph as input. Robofab is no longer an option, but yes, fontparts glyph objects should be compatible with booleanOperations, though I haven't tried myself. I guess I can remove that arrow from the graph. |
@anthrotype maybe you can make the arrow line dotted to indicate a soft dependency. |
Thanks for the comments! |
oh... http://furius.ca/snakefood/ (I wish I had found this before!) |
38c603e
to
bf01b22
Compare
setuptools_scm handles managing python package versions using git metadata instead of declaring them as the version argument or in a git-managed file. https://github.com/pypa/setuptools_scm
Else Travis only clones the last 50 commits, and `git describe` doesn't work.
…_resources Do not export 'version' from top-level fontTools.__init__ module, as it is rarely used; importing pkg_resources here would slow down importing fontTools.
573f50c
to
113e1bd
Compare
…ly write MAJOR.MINOR otherwise it risks changing too often... ;)
setuptools_scm, from the Python Packaging Authority (PyPA), is a setuptools extension which uses Git (or Mercurial) to manage Python package versions.
Basically, it uses the revision control metadata to generate a unique version string for setup.py, and optionally a 'version.py' file which can be included in the distribution.
Depending on the number of commits intervened since the last tag, and on the clean/dirty state of the repository, it produces a unique version string, which guarantees that installed packages metadata is kept up-to-date with the source, without requiring tedious manual work, like manually checking in a version file that has to be modified at each release cycle.
I'm really keen on having this implemented here, as well as in the rest of the dependent packages.
Together with the PyPI deployment on tags, this will ensure that maintainers (i.e., us) will be encouraged to cut new releases more frequently, with all the benefits that ensue from that, for both users and developers.
Libraries could require other libraries as "abstract" dependencies in setup.py's
install_requires
, specifying only a name and a minimum required version, and without needing to resolve the dependency graph manually. Pip-installing one package will automatically pip-install the others.Applications (e.g. fontmake) that are meant to be deployed in production could use pip's "requirements.txt" to specify concrete dependencies, with "pinned-down" version numbers (e.g.
fonttools==3.1.0
).If we set it up for all the ten or something requirements of fontmake, we could finally put an end to the infamous "dependency hell".