17

What can I put on our setup.py project configuration file to tell the developers that the project is a private/commercial application/library.

Currently I set:

setup(
    name='MyProject',
    version='0.1.0',
    license='(c) My Company',
    ...
)

Any best practice?

Note:

Nowadays, most of the projects are open source, and adhere to the licences model. However, when you work on the industry, software are private. My company works with off-shore companies which may not be aware of the fact that a software can be private. So, I want to bring this fact to their attention by specifying this in the setup.py file. This is why I'm looking for best practices about that.

Conclusion/Solution

For private/proprietary applications, I will follow rth's recommendation:

  • set the license attribute to “Proprietary”,
  • add the classifier “License :: Other/Proprietary License”,
  • and maybe add a LICENSE file.

The template will be something like that:

setup(
    name='MyProject',
    version='0.1.0',
    license="Proprietary",
    classifiers=[
        'License :: Other/Proprietary License',
        ...
    ],
    ...
)

An alternative could be to set “Not open source”, like defined in the cookiecutter-pypackage template.

Laurent LAPORTE
  • 21,958
  • 6
  • 58
  • 103
  • What is the purpose of your desired configuration setting? What do you mean by "tell developers that the project is a private/commercial application/library"? What do you hope to achieve by doing this? – polo May 20 '17 at 19:01
  • @polo: I have edited my question to explain that in a note. – Laurent LAPORTE May 20 '17 at 19:24
  • can you explain how do you hope your developers will "interact" with this config? Will they be actively looking for it (and if so when and how)? Is this config setting something you wish to use in some automated process (if so what automated process and how would this be used)? – polo May 20 '17 at 21:24

2 Answers2

9

Technically, there is no fundamental difference between licensing open-source and proprietary software.

In both cases you should include a LICENSE file specifying what can and cannot be done with your software (see this related SO question). It is also advised to add a short copyright / license header to every code file in your project (in case they get copied outside of the original package folder).

It is possible to mention the license type in setup.py, however that field is mainly used to display the license for Python packages uploaded to PyPi. Since your code is not open-source (and won't be uploaded to PyPi), this is not very relevant in your case.

rth
  • 10,680
  • 7
  • 53
  • 77
  • Agree. Our libraries are not uploaded to PyPi. Nevertheless, they are uploaded to a private DevPi server which is also a proxy to the official PyPi. So, we can found Open Source projects in DevPi. Our (small) community of users must see the license terms in DevPi. – Laurent LAPORTE May 21 '17 at 15:29
  • 5
    Just put `licence="proprietary"` or `"proprietary and confidential"` in `setup.py` then describe the details in `LICENCE` file and file headers and it should be fine (see e.g. https://softwareengineering.stackexchange.com/questions/68134/best-existing-license-for-closed-source-code ) – rth May 21 '17 at 15:34
0

if you fear people will upload your package by mistake to pypi, maybe some of those tricks would help How to disable uploading a package to PyPi unless --public is passed to the upload command

Fruch
  • 408
  • 5
  • 18