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

huangapple go评论68阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年2月13日 23:22:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/75437857.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定