slashmili / python-jalali

Jalali calendar binding for Python based on Python's datetime module
http://pypi.python.org/pypi/jdatetime/
Other
339 stars 47 forks source link

Copyright issue #148

Closed roozbehp closed 6 months ago

roozbehp commented 6 months ago

It appear that the conversion code is copied from http://www.farsiweb.info/jalali/jalali.c without following its license and mentioning its copyright holders (which includes myself). Would you please fix it at your earliest opportunity? The license should be LGPL 2.1 or later and the copyright holders should be Roozbeh Pournader and Mohammad Toossi, as well as any new contributors.

farzadghanei commented 6 months ago

@slashmili I had the impression the conversion code is based on what's commented in the jalali module:

# dervied from http://farsitools.sf.net
# Copyright (C) 2003-2011  Parspooyesh Fanavar (http://parspooyesh.com/)

https://github.com/slashmili/python-jalali/blob/main/jdatetime/jalali.py#L1

But I agree, the logic seems very much the same to what @roozbehp is sharing, and I can confirm is the algorithm implemented and distributed by Roozbeh Pournader in C.

Although what jdatetime uses is a re-implementation in Python and not the same exact code, the logic is almost identical.

@roozbehp since this library is a re-implementation, and it's being distributed under a different, but still liberal and open license (Python license), could you please share your opinion regarding this license difference, and is there way to include the LGPL licensed logic, while keeping the license of the library as is?

roozbehp commented 6 months ago

The Python implementation in jalali.py is clearly a derived work from my work, and as such, should carry the name of the copyright holders and be distributed under LGPL 2.1 or later. It doesn't matter that it's not the same exact C code. It's clearly derived from that code, and even the names of most variables is the same.

BTW, farsitools.sf.net, which is mentioned at the top of that file, is where a copy of my original C code used to live. It was maintained by the FarsiWeb Project Group. So the file header admits it's being derived from our work, it just drops the copyright holders' names and changes the license without permission.

If there are reasons LGPL cannot be used, please tell me the reasons so I may consider relicensing. (You would still need to hunt down the other copyright holder, Mohammad Toossi.)

roozbehp commented 6 months ago

Looking at https://pypi.org/search/?c=License+%3A%3A+OSI+Approved+%3A%3A+GNU+Library+or+Lesser+General+Public+License+%28LGPL%29, it appears that a lot of Python modules there are licensed under LGPL, so I don't see a reason this can't be fixed to LGPL.

slashmili commented 6 months ago

@roozbehp I sincerely apologize for the oversight. It was a mistake on my part and should not have occurred.

I've updated the Jalali file and will merge it to main.

About the license of the python-jalali project, I need to conduct some research on my options as I prefer to keep it under the Python License.

farzadghanei commented 6 months ago

Looking at https://pypi.org/search/?c=License+%3A%3A+OSI+Approved+%3A%3A+GNU+Library+or+Lesser+General+Public+License+%28LGPL%29, it appears that a lot of Python modules there are licensed under LGPL, so I don't see a reason this can't be fixed to LGPL.

@roozbehp this Jalali date time library is trying to mimic the API of datetime module in the Python standard library (as much as possible for generic use cases), and to be a drop-in replacement (with caveats).

I think that's why the license was chosen to be what Python uses, so it can be safely used everywhere the Python standard library can be used. Changing it to LGPL, may have some consequence, hence my question, if there would be a way to keep the license as is for the module (adding attributions in the module is not an issue and already done by #149 ).

More info on Python license (currently used by this library):

slashmili commented 6 months ago

alternatively we can release jalali.py under a separate package(which will be released under LGPL 2.1) and just use it as a dependency.Do you think this is an acceptable solution?

farzadghanei commented 6 months ago

If I'm not mistaken, it should be OK to vendor the LGPL file in packages with other licenses, as long as that specific module is licensed LGPL, the rest of the package can keep a different license.

There are other examples of this (old versions of requests, etc.)

I may be missing something, but I don't see much difference between this, or extracting that module and distributing that as LGPL (which I agree that is still an option).

Maybe it's possible to

This project is licensed under the Python license, with the exception of the `jalali.py` module, which is included under the terms of the LGPL. The source code and its license can be found at `jalali.py`. 

This is just an example BTW.

roozbehp commented 6 months ago

Separating jalali.py to a dependency package is fine with me, as well as including it in the same package and clarifying that the package includes code under two different licenses. In the second case, you need to be careful about the metadata, so users would know that they are using LGPL code too and be aware of its requirements.

roozbehp commented 6 months ago

Would you create a pull request for https://github.com/slashmili/python-jalali/blob/main/LICENSE too?

slashmili commented 6 months ago

@roozbehp done in #150

Just for sake of transparency:

slashmili commented 6 months ago

As all issues been addressed

slashmili commented 6 months ago

FYI @roozbehp it seems to me that these repos are using the same algorithm

https://github.com/jalaali

roozbehp commented 6 months ago

FYI @roozbehp it seems to me that these repos are using the same algorithm

https://github.com/jalaali

Thanks a lot. I took a quick look, and at least the JavaScript, Python, and Go versions appear to be independently developed and use a different algorithm too. Would you please point me to a file where you think could have a copyright issue?

slashmili commented 6 months ago

Sorry for the false alarm, I was looking at the python code and saw some similar calculations.