nusCS2113-AY1819S1 / forum

5 stars 0 forks source link

Import external library for feature. #94

Open teojunjie opened 5 years ago

teojunjie commented 5 years ago

Hi are we allowed to use an external library for our feature? I will probably import this java library https://github.com/xdrop/fuzzywuzzy if its ok?

okkhoy commented 5 years ago

@teojunjie Approved, subject to the condition below: Note that you need to make an explicit mention in your code to satisfy the requirements of GPLv3 license used by fuzzywuzzy. Take a look at this link for some idea on what should be done.

teojunjie commented 5 years ago

Hi @okkhoy , i am still be abit unclear on what i need to do to use this 3rd party library, i am not sure how to go about doing this. From what i searched , there seem to be alot of rules and regulations when implementing 3rd party software and it has gotten me really confused.

okkhoy commented 5 years ago

For this particular case, you can add a line at the beginning of all the classes that use the library telling that this file is licensed under GPLv3 as required by the dependency "fuzzywuzzy". Users should refer to GPLv3 license terms for details. However, the rest of the project is licensed under MIT License.

Though I must agree, I am not fully sure if that is exactly what they meant by GPLv3 compliance 😕

Would leave it to you to get a better understanding using the link and manage in case there are any disputes related to usage terms.

Below: Just FYI, no need to bother too much about it.

In CS2113/T, we have the following restrictions:

  1. Do not use artifacts without attributing (hence the requirement for seeking permission is in place)
  2. No libraries that require payment/restricts usage due to payment are allowed.
  3. The library should not internally use some form of database for storing and working with the data.
  4. Open sourced libraries with permissive usage terms are encouraged.
  5. Usage license terms should match or be compatible with MIT license under which AB4 is released.

Your case falls under (4) above. In this case, my understanding is that, GPLv3 dictates that the product also should be released using GPLv3 license or compatible license. The legal aspect of it is quite confusing to me too! Based on my searching, MIT is compatible with GPLv3. So I am hoping that adding that disclaimer may suffice!

teojunjie commented 5 years ago

@okkhoy Will the credits below be enough if i put it at the beginning of the files that uses their code?

Credits This application uses Open Source components. You can find the source code of their open source projects along with license information below. We acknowledge and are grateful to these developers for their contributions to open source.

Project: JavaWuzzy https://github.com/xdrop/fuzzywuzzy Copyright (C) 2007 Free Software Foundation, Inc. http://fsf.org/ GNU General Public License v3.0 https://github.com/xdrop/fuzzywuzzy/blob/master/LICENSE

okkhoy commented 5 years ago

Nopes. I don't think that will keep the FSF guys happy 😕 At minimum, you need to indicate that the file that uses fuzzywuzzy is licensed under GPLv3 whereas the rest is under MIT.

PS: If there is some other fuzzy matching library with Apache/MIT license, think of using that instead for less headache!

QzSG commented 5 years ago

If I am not wrong, it also requires your product license to become Gplv3, as in code you written can be considered under mit license, but when the product as a whole comes into consideration, it is a gplv3 licensed product.

I think that is why mit licensed projects will try all means to not include any gpl libraries, it's compatible but forces several issues in terms of licensing. There are many articles out there saying that gplv3 should not be used for libraries as it forces the library users to change the license used in their project, also why people call gplv3 a viral license.

teojunjie commented 5 years ago

If I am not wrong, it also requires your product license to become Gplv3, as in code you written can be considered under mit license, but when the product as a whole comes into consideration, it is a gplv3 licensed product.

I think that is why mit licensed projects will try all means to not include any gpl libraries, it's compatible but forces several issues in terms of licensing. There are many articles out there saying that gplv3 should not be used for libraries as it forces the library users to change the license used in their project, also why people call gplv3 a viral license.

Do we have to do this? @okkhoy Or can i just add another line indicating what u suggested that the " file that uses fuzzywuzzy is licensed under GPLv3 whereas the rest is under MIT."

okkhoy commented 5 years ago

@teojunjie, @QzSG is correct. In the absolute sense, I am not sure if adding a line as I suggested is also good enough. This is the reason I said if you find an equivalent library with Apache or MIT license, use it!

In the interest of time and effort I suggest the following:

  1. Find a library equivalent to fuzzywuzzy (I am sure there are many, as students have implemented earlier fuzzy search without using fuzzywuzzy)
  2. If (1) above fails then go ahead and license your product under GPLv3 license while retaining MIT license.