04-13-2018, 01:18 PM | #1 |
Junior Member
Posts: 7
Karma: 10
Join Date: Mar 2018
Device: gabox01
|
Need help in setting up a Development environment
Hello,
Quote from the docs: "The next step is to set the environment variable CALIBRE_DEVELOP_FROM to the absolute path of the src directory. So, following the example above, it would be /home/kovid/work/calibre/src. How to set environment variables depends on your Linux distribution and what shell you are using." What's the reason behind this? I don't want to run any pre-made binaries, I'd like to run the whole thing from source, including the GUI. Any way to achieve that? "That’s it! You are now ready to start hacking on the calibre code. For example, open the file src\calibre\__init__.py in your favorite editor and add the line: print ("Hello, world!") near the top of the file. Now run the command calibredb. The very first line of output should be Hello, world!" I don't understand this.Why should I run calibredb after making changes to the source? Run what command with calibredb? Sorry if I look dumb, but I would expect source files, libraries, and a main method to run. Nothing else. Thanks |
04-13-2018, 09:08 PM | #2 |
creator of calibre
Posts: 44,346
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You are running the whole thing from source including the GUI.
And using calibredb is simply an easy way to check that you have setup things correctly. |
Advert | |
|
04-22-2018, 12:12 PM | #3 | ||
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
You've chosen to look at the binary install development method, rather than setting up a Linux source build. If you didn't want to run someone else's premade binaries, then obviously you need to build them yourself... But, are you trying to develop the C extension code? If not, what is wrong with using the pre-made binaries together with your modified python code? Quote:
Code:
from calibre.db.cli.main import main sys.exit(main()) |
||
04-30-2018, 03:18 PM | #4 | |
Junior Member
Posts: 7
Karma: 10
Join Date: Mar 2018
Device: gabox01
|
Quote:
I'm not familiar with python, but in the Java world, when I want to run any app from source, I compile the sources, look for the main class, and just run the thing. No precompiled binaries needed. Please explain to me at a kindergarten level why this is even an option because i don't get it. |
|
04-30-2018, 04:12 PM | #5 |
Wizard
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
It is worth reading up on how Python works. Python does not have a traditional compile phase and uses a “Just-in-time” technique for the python source code. By starting with the compiled binaries you make certain that all dependencies (C modules, libraries etc) are installed. If now install the source as well then any modules that have been changed will use the updated Python source.
Going right back to basics and building non-Python components is a much bigger task and not one that is required if you are only making alterations at the Python level. |
Advert | |
|
05-01-2018, 03:18 AM | #6 | |
Junior Member
Posts: 7
Karma: 10
Join Date: Mar 2018
Device: gabox01
|
Quote:
Would it be technically possible to put those C modules, libraries etc.. in a directory in binary form, and make them available to your python code, so you don't have to use a binary at all? In Java, you can use the classpath to achieve that. |
|
05-01-2018, 06:35 AM | #7 | |
Wizard
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Setting up Calibre development environment | EngelEatos | Development | 3 | 04-22-2018 12:20 PM |
Setting up a development environment ... | BWinmill | Kobo Developer's Corner | 27 | 06-16-2014 08:21 AM |
"Setting up a calibre development environment" documentation suggestion | trying | Development | 1 | 03-30-2014 10:25 PM |
Setting up Mac Calibre development environment? | pdurrant | Calibre | 2 | 01-06-2009 07:10 AM |
Setting up development environment | tompe | OpenInkpot | 9 | 08-27-2008 02:26 PM |