[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Packaging Grip



Hi,

I'm packaging grip[1] (ITP #790611[2]) and have a few doubts:

Should I package it as an application or a library? It is really a CLI
application, but when called it imports its main function as a
module[3].

I can't use its entry point script directly because it expects to be
installed using easy-install, raising an error when called:

pkg_resources.DistributionNotFound: The 'grip==4.1.0' distribution was
not found and is required by the application

I can easily deal with this removing this entry point script, adding
execution permissions to the "__main__.py" file and linking it to
/usr/bin/grip. I've looked at the "python-django" source and it
installs[4] a custom script[5] that decides if "django-admin" should
be called with Python 2 or 3. I'm supposed to use this approach, as I
guess both Python versions should be supported when packaging it as a
module?

What I mean is: is there a best practice when dealing with entry point
scripts? Or any approach is fine as long as it that calls the correct
script as the main binary? I've consulted the Debian Python Policy and
didn't found an answer.

Regards,
Tiago.

[1]: https://github.com/joeyespo/grip
[2]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=790611
[3]: https://github.com/joeyespo/grip/blob/v4.1.0/grip/__main__.py
[4]: http://sources.debian.net/src/python-django/1.9.4-1/debian/python-django-common.install/
[5]: http://sources.debian.net/src/python-django/1.9.4-1/debian/django-admin/

-- 
Tiago "Myhro" Ilieve
Blog: https://blog.myhro.info/
GitHub: https://github.com/myhro
LinkedIn: https://br.linkedin.com/in/myhro
Montes Claros - MG, Brasil


Reply to: