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
# 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.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
mitclock.so can be obtained via
apt-get with Ubuntu. Furthermore, both
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
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
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
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
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
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:
JJClock's dependancy on
gplclockis optional (and no GPL code exists in my code, beyond API calls found via documentation), does this mean that
gplclockmust be licensed as GPL?
There exists an alternative clock API (
pyclock), which is Apache licensed (???) and supports both
mitclock-- how does this work? Can
JJClockuse this library and remain commercial (without using
clock_api)? What does it mean for
pyclockto "wrap" the GPL library
gplclockand provide it under an Apache license?
pyclock, could I release
clock_apiunder MIT, and keep
What would the implications be here if I distributed
gplclock.so? Does this change anything?
JJClock"dynamically linking" against "gplclock" (stackoverflow.com/questions/40492518/…)? Does
dlopencount as "dynamic linking" (stackoverflow.com/questions/21214902/…)?
gplclock's "API" is GPL, what does that mean for
pyclockbeing Apache licensed? Is