英文:
For a Closed-source Python Library, do you need a setup.py file or is that just for PyPi publication? This package will only be used amongst my team
问题
我正在为我的公司创建一个内部使用的Python库。我已经在src级别包含了一个README文件。然后,还有一个项目文件夹和一个测试文件夹,它们都是从src派生的。当我们没有计划公开发布时,是否需要一个setup.py文件(以及一个许可证文件)?谢谢!
我的文件结构如下:
项目/
|-- 项目/
| |-- __init__.py
| |-- main.py
|-- 测试
| |-- __init__.py
| |-- tests.py
|-- README
英文:
I am creating an internally used Python library for my company. I have included a README on the src level. Then have project and tests folders additionally stemming from the src. When we are not planning on publishing publicly, do we need a setup.py file (and additionally a LICENSE file)? Thanks!
Right now my file structure is:
Project/
|-- project/
| |-- __init__.py
| |-- main.py
|-- tests
| |-- __init__.py
| |-- tests.py
|-- README
答案1
得分: 0
如果您拥有用于Python包的私有注册表,并希望其他团队成员能够通过它安装包,您需要一个setup.py
。或者,如果您希望其他人能够通过.whl
在本地安装它,您需要一个setup.py
来构建包并将其传递给您的团队成员。
对于私有包,拥有一个LICENSE
文件也是个好主意。您可以设置专有许可证,以限制软件的使用、修改和分发仅限于原许可证持有人。
英文:
If you have a private registry for python packages, and you want other team members be able to install it via that, you need a setup.py
. Or if you want others be able to install it locally by having .whl
, you need a setup.py
to build a package and pass it to your teammate.
You can learn about it here and here.
And it's a good idea to have a LICENSE
file, also for a private package. You can set a proprietary license, to restricts the use, modification, and distribution of the software to only the original licensee.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论