License Guide for Drivers: Difference between revisions

From SweepMe! Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 7: Line 7:
* Ask the authors and copyright holders when uncertain about the licenses.
* Ask the authors and copyright holders when uncertain about the licenses.


== Choice of a License for Device Classes ==
== Choice of a License for Drivers ==
* MIT License is one of the most often used Open Source Licenses.
* MIT License is one of the most often used Open Source Licenses.
* Author retains copyright and attribution is required in all redistributed copies or substantial potions of the work.
* Author retains copyright and attribution is required in all redistributed copies or substantial potions of the work.
Line 43: Line 43:


=== Libraries and Tools without Redistribution Permissions ===
=== Libraries and Tools without Redistribution Permissions ===
* Contact the original authors and copyright holders and ask for a redistribution permission. This permission must not only grant you the right to redistribute, but also a permission to publish the library together with the Device Class on sweep-me.net is necessary.
* Contact the original authors and copyright holders and ask for a redistribution permission. This permission must not only grant you the right to redistribute, but also a permission to publish the library together with the Driver on sweep-me.net is necessary.
* If your request is denied or unanswered, you must not include the library in the Driver Package!
* If your request is denied or unanswered, you must not include the library in the Driver Package!
* When this library is mandatory, provide instructions to the end user how to obtain this library (e.g. from the driver setup of the hardware).
* When this library is mandatory, provide instructions to the end user how to obtain this library (e.g. from the driver setup of the hardware).
Line 49: Line 49:


=== Quick Chart ===
=== Quick Chart ===
The following table gives an overview of what to do if you use or distribute libraries with various licenses in your Device Class. '''This summary does not replace reading and understanding the various licenses''' and may be incorrect. This table assumes that you do not modify the used library but use and redistribute an unmodified version.
The following table gives an overview of what to do if you use or distribute libraries with various licenses in your Driver. '''This summary does not replace reading and understanding the various licenses''' and may be incorrect. This table assumes that you do not modify the used library but use and redistribute an unmodified version.
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 68: Line 68:
| {{yes|nothing to do}}
| {{yes|nothing to do}}
| {{no|not allowed}}
| {{no|not allowed}}
| {{bad|supply information on how to obtain the library, as the Device Class would not work without}}
| {{bad|supply information on how to obtain the library, as the Driver would not work without}}
|-
|-
! scope="row"| Use and redistribution
! scope="row"| Use and redistribution
Line 95: Line 95:
=== Third-Party Code ===
=== Third-Party Code ===
* Verify that you are allowed to redistribute the third-party work and that the license permits a combination with your MIT licensed work.
* Verify that you are allowed to redistribute the third-party work and that the license permits a combination with your MIT licensed work.
* It is recommended to place all third-party libraries and tools in a separate subdirectory each. This supports the structure of your Device Class and also satisfies the separation requirement of most open source licenses with weak copyleft, as the subdirectory could be easily exchanged by the user.
* It is recommended to place all third-party libraries and tools in a separate subdirectory each. This supports the structure of your Driver and also satisfies the separation requirement of most open source licenses with weak copyleft, as the subdirectory could be easily exchanged by the user.
* Include all required files (including licenses and other copyright notices). '''Do not place a third-party library license with the name ''license.txt'' in the main directory (where the ''main.py'' is) of the Device Class, as this file will be overwritten during the upload process.'''
* Include all required files (including licenses and other copyright notices). '''Do not place a third-party library license with the name ''license.txt'' in the main directory (where the ''main.py'' is) of the Driver, as this file will be overwritten during the upload process.'''


* If you are not allowed to redistribute the third-party library, include a check in the ''__init__'' function of your Driver if the library is present and inform the user if not (including instructions how to obtain the library).
* If you are not allowed to redistribute the third-party library, include a check in the ''__init__'' function of your Driver if the library is present and inform the user if not (including instructions how to obtain the library).

Latest revision as of 20:04, 24 May 2022

To make sure that uploaded Drivers can be used and modified for the widest variety of devices possible, the Drivers should be published under the terms of the MIT License. That way, everyone can use your Driver, adapt it for similar drivers and functionality, or redistribute it. You will still be the author / copyright holder and the copyright notice is required to be included in every copy or substantial potion of your work. However, you also need to pay attention to the license of of other work you might use in your Driver.

Disclaimer

  • This is just a short overview which cannot cover the depth and variety of all licenses.
  • When using code from others, always respect their copyright and their license which must be adhered to.
  • Ask the authors and copyright holders when uncertain about the licenses.

Choice of a License for Drivers

  • MIT License is one of the most often used Open Source Licenses.
  • Author retains copyright and attribution is required in all redistributed copies or substantial potions of the work.
  • Highly compatible license, can be combined with a variety of work with other licenses. This is a big advantage over licenses with strong copyleft (like GPL). Drivers regularly need to be combined with proprietary libraries from the hardware manufacturer which is impossible with GPL code (but allowed with MIT licensed code).

Own Work

Written from Scratch

  • For code that has been written completely by yourself or your team, you are the copyright holder and can license this work under the terms of the MIT License without any problems.

Based on another MIT licensed Driver

  • As the MIT License allows modifications and redistributions, you are allowed to create your Driver based on another one.
  • The original copyright notice must still be present, i.e. the original authors must be attributed.
  • In the header of the main.py file, you can add a second copyright line.
  • In the upload form, you need to list all authors, the original ones, your name, and the names of all authors in your team (if any).


Third-Party Libraries and Tools

General

  • When including third-party libraries, you must make sure that this is allowed (usually true for open source licenses).
  • The third-party library or tool will then be redistributed within the Driver Package with its original license (no relicensing).
  • Only your own work will be MIT licensed.
  • For clarity and separation, third-party work should be placed in a separate subdirectory.

Permissive Licenses and Licenses with Weak Copyleft

  • E.g. MIT, BSD, Apache license
  • Can be redistributed with its original license and attribution in a subdirectory.
  • If you only use a library ("import <module>" in Python) without modifying or redistributing that library, you do not have any obligations for common permissive licenses.

Licenses with Strong Copyleft

  • E.g. GPL
  • Combined work is fully required to be licensed under GPL, making it incompatible with all proprietary code (like libraries for the hardware communication from the manufacturer) or even other open source licenses.
  • Your code is already "infected" by the GPL copyleft when importing such a module in Python.
  • Due to that problem, strong copyleft licenses should be avoided. Luckily, this license is rarely used for hardware related code and libraries (probably because of this issue).

Libraries and Tools without Redistribution Permissions

  • Contact the original authors and copyright holders and ask for a redistribution permission. This permission must not only grant you the right to redistribute, but also a permission to publish the library together with the Driver on sweep-me.net is necessary.
  • If your request is denied or unanswered, you must not include the library in the Driver Package!
  • When this library is mandatory, provide instructions to the end user how to obtain this library (e.g. from the driver setup of the hardware).
  • To prevent a crash of the measurement, the Drivers should check for the presence of the required library.

Quick Chart

The following table gives an overview of what to do if you use or distribute libraries with various licenses in your Driver. This summary does not replace reading and understanding the various licenses and may be incorrect. This table assumes that you do not modify the used library but use and redistribute an unmodified version.

MIT BSD PSF Apache LGPL GPL Commercial / Unknown
Use, but no redistribution (for modules already included in SweepMe!) nothing to do nothing to do nothing to do nothing to do nothing to do not allowed supply information on how to obtain the library, as the Driver would not work without
Use and redistribution add original license to redistributed library add original license to redistributed library add original license to redistributed library add original license to redistributed library add original license to redistributed library, the user must be able to replace the LGPL library with his own library version/code add original license to redistributed library, your own code must also be GPL, no commercial libraries or libraries with GPL-incompatible licenses must be used ask the author / copyright holder for permission and include that permission

Modifications of Third-Party Code

  • If third-party code is a MIT licensed Driver or template from another contributor, see above.
  • Otherwise, modifications of third-party libraries should be avoided and actually should not be necessary.
  • If such a modification is inevitable, you must make sure that this is allowed and the resulting derivative work (which in most cases will have the same license as the original work) is then treated similar to a third-party library.

Best Practices for Drivers

Own Code

  • For your own code and your modifications of other MIT licensed Drivers (from other contributors).
  • Place a copyright notice and the MIT License as a comment in the header of all your code files.
  • There is no need to include a separate license.txt file as the upload process will automatically generate this file (and overwrite any existing license.txt).
  • In the upload form, specify the year and all authors that contributed to the Driver. If the Driver was based on another MIT licensed work (like another Driver), all authors of this work have to be included, as well.

Third-Party Code

  • Verify that you are allowed to redistribute the third-party work and that the license permits a combination with your MIT licensed work.
  • It is recommended to place all third-party libraries and tools in a separate subdirectory each. This supports the structure of your Driver and also satisfies the separation requirement of most open source licenses with weak copyleft, as the subdirectory could be easily exchanged by the user.
  • Include all required files (including licenses and other copyright notices). Do not place a third-party library license with the name license.txt in the main directory (where the main.py is) of the Driver, as this file will be overwritten during the upload process.
  • If you are not allowed to redistribute the third-party library, include a check in the __init__ function of your Driver if the library is present and inform the user if not (including instructions how to obtain the library).