Skip to content

Use setuptools entry points

Marius Gedminas requested to merge mgedmin/undertime:entry-points into master

Continuing from #4 (comment 65623889)

So I would very much welcome patches that would improve this, but undertime must remain, in the source, a single file so it can easily be copied by hand by people that just need a quick hack.

I know the feeling -- my profilehooks and objgraph remain single-file modules for this reason, although I haven't actually used them that way for a very long time (pip install is more convenient)!

Anyway, here's a merge request that

  • gets rid of the module symlink
  • makes setuptools install it in site-packages and create a wrapper script via an entry point
  • stops setup.py from importing the module so you can build an sdist without having all the install_requires already preinstalled in your system Python
  • adds a rudimentary tox.ini so I could test that the wrapper scripts work fine

Unfortunately I couldn't try to build a Debian package with my changes since my Ubuntu 17.10 dev machine doesn't have the python3-terminaltables package. Please verify what happens when a Debian package is built (i.e. are the wrapper scripts generated by pybuild fine, or do they pay the pkg_resources import time cost?).

Merge request reports