简体   繁体   English

如何分发将可执行文件添加到路径的 Python package?

[英]How to distribute a Python package that adds an executable to the path?

I have a bunch of commands that I want to distribute to my colleagues.我有一堆命令要分发给我的同事。 They want me to package it and add it to their path ( /usr/local/bin )他们要我 package 并将其添加到他们的路径 ( /usr/local/bin )

How would I do this?我该怎么做? We already have a Python repository.我们已经有一个 Python 存储库。 Is this possible in an egg ?这在egg中可能吗?

I dislike answering my own question but I have begun looking at this:我不喜欢回答我自己的问题,但我已经开始看这个:

http://docs.python.org/distutils/setupscript.html#installing-additional-files http://docs.python.org/distutils/setupscript.html#installing-additional-files

Seems like it might be the answer.似乎这可能是答案。 I will update this answer when I try it out on Monday.我将在星期一试用时更新此答案。 Or, if anyone has used something like this before, answer yourself!或者,如果有人以前使用过类似的东西,请自己回答!

One option would be to build an RPM .一种选择是构建一个 RPM This is generally a pretty convenient way to install files to a predefined location.这通常是将文件安装到预定义位置的一种非常方便的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM