I am developing a commerical clock application ("JJClock"), which is written in Python. What I will deliver to my customers will either be a .pyc file or a .so file ("compiled") with Cython -- the fact that a .pyc is reversible doesn't matter, just that I am not giving my customers the source code.
My clock application has a dedicated "backend" that allows me to use two, alternative "get time" libraries: gplclock (GPL licensed) and mitclock (MIT licensed). The core code of JJClock is completely agnostic to which time library is being used (this is controlled via an environment variable).
For example, here is something that looks like my main application:
# jjclock.py
import sys
import clock_api
if __name__ == "__main__":
clock = clock_api.get_clock()
time_now = clock.time()
#
# do something propetary with time_now
#
print time_now
# EOF
and here is the implementation of clock_api:
# clock_api.py
import os
import importlib
class MITClock(object):
def __init__(self):
self.mit_clock = importlib.import_module("mitclock")
def time(self):
return self.mit_clock.getTheTime()
class GPLClock(object):
def __init__(self):
self.gpl_clock = importlib.import_module("gplclock")
def time(self):
#
# IMPORTANT: this API call is different!
# API calls were found via `dir` and the man pages
#
return self.gpl_clock.get_time()
def get_clock():
if os.environ.get("CLOCK", "mit") == "mit":
return MITClock()
elif os.environ["CLOCK"] == "gpl":
return GPLClock()
# EOF
To develop my clock_api file, I utilised the shared objects for gplclock.so and mitclock.so can be obtained via apt-get with Ubuntu. Furthermore, both gplclock and mitclock have publicsed Python API examples, which allowed me to develop both of my clock classes without seeing any of the internal code of either gplclock or mitclock.
If we consider developing an application in C, then we need to #includea header for given library, and therefore it is clear that my commercial object code contains GPL object code (via the #include), then therefore the GPL applies. However, in the above, there is no "code" from gplclock in my application -- only the use of its dynamic API, which could be discoverable by interrogating gplclock via dir in Python.
Furthermore, my application is 100% functional without gplclock. It is completely at the discression of the end user to a) obtain gplclock.so and b) explicitly set the non-default environment variable CLOCK to be gpl.
How JJClock works and runs is completely abstracted from the selected clock -- all of this logic exists inside of the clock_api (e.g., we might want to implement an add method between two clocks, and therefore GPLClock and MITClock would implement the logic to do this operation). Again, this would be developed by not looking or obtaining the source for either: it can all be done via (e.g.,) dir in Python, or maybe even the man pages for both libraries.
It is my understanding that, at the shared object level, there isn't even dynamic linking between JJClock and gplclock. There is just a Python call with the string gplclock and then method invocations are made via getattr, with string of the method name.
So, my questions are:
Even if
JJClock's dependancy ongplclockis optional (and no GPL code exists in my code, beyond API calls found via documentation), does this mean thatgplclockmust be licensed as GPL?There exists an alternative clock API (
pyclock), which is Apache licensed (???) and supports bothgplclockandmitclock-- how does this work? CanJJClockuse this library and remain commercial (without usingclock_api)? What does it mean forpyclockto "wrap" the GPL librarygplclockand provide it under an Apache license?If
JJClockcan usepyclock, could I releaseclock_apiunder MIT, and keepJJClockas commercial?What would the implications be here if I distributed
JJClockalongside withgplclock.so? Does this change anything?
JJClock"dynamically linking" against "gplclock" (https://stackoverflow.com/questions/40492518/is-an-import-in-python-considered-to-be-dynamic-linking)? Doesdlopencount as "dynamic linking" (https://stackoverflow.com/questions/21214902/what-is-the-difference-between-dynamic-linking-and-dynamic-loading)? – Jędrek Jażdżyk Aug 28 '18 at 14:12gplclock's "API" is GPL, what does that mean forpyclockbeing Apache licensed? Ispyclock"licensed incorrectly"? – Jędrek Jażdżyk Aug 28 '18 at 14:13