Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 07-11-2020, 04:31 PM   #1
Boilerplate4U
Enthusiast
Boilerplate4U began at the beginning.
 
Boilerplate4U's Avatar
 
Posts: 38
Karma: 10
Join Date: Jul 2020
Device: Kobo Clara HD
PyCharm setup and py3?

Hi all!

I'm able use the PyCharm remote debugger (using pydevd_pycharm) and "calibre-debug" but now I'd like to run everything within the IDE. Dev env = macOS Catalina.
  1. Anyone that managed to setup pycharm (2020) for Calibre (4.20) in regards to env-vars, search paths and so forth?
  2. I noticed some references to py3 (ispy3) etc. Will Calibre 4.20 work with python v3.8?

Thanks in advance!
Boilerplate4U is offline   Reply With Quote
Old 07-11-2020, 05:36 PM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,037
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Boilerplate4U View Post
Hi all!

I'm able use the PyCharm remote debugger (using pydevd_pycharm) and "calibre-debug" but now I'd like to run everything within the IDE. Dev env = macOS Catalina.
  1. Anyone that managed to setup pycharm (2020) for Calibre (4.20) in regards to env-vars, search paths and so forth?
  2. I noticed some references to py3 (ispy3) etc. Will Calibre 4.20 work with python v3.8?

Thanks in advance!
Calibre 4.20 will not work with Python 3. But there is a Python 3 beta version.

https://www.mobileread.com/forums/sh...d.php?t=325721
JSWolf is offline   Reply With Quote
Advert
Old 07-12-2020, 12:00 PM   #3
Boilerplate4U
Enthusiast
Boilerplate4U began at the beginning.
 
Boilerplate4U's Avatar
 
Posts: 38
Karma: 10
Join Date: Jul 2020
Device: Kobo Clara HD
Ok, thanks!

I've tried to decode the launcher app (the binary) "calibre-debug" to find out the Calibre entry point in debug-mode and other arguments but in vain. dtrace does give you only a limited view of the program arguments.

I've also tried to find out how it works by looking in the source for the luncher apps but there are no docs how they are constructed and as I don't have a complete dev-env I can't use the build process.

Can anyone please give me a hint how calibre-debug is starting up things? A qualified guess is that "start_gui" ("srs/gui2/main.py") might be the entry point...


PHP Code:
pwd
~/src/calibre/bypy/macos
ls -l
total 128
-rw-r--r--  1 calibre  staff  31460 Jul  6 16:17 __main__.py
-rw-r--r--  1 calibre  staff   1642 Jul  6 16:17 launcher.c
-rw-r--r--  1 calibre  staff   1072 Jul  6 16:17 placeholder.c
-rw-r--r--  1 calibre  staff   3304 Jul  6 16:17 sign.py
-rw-r--r--  1 calibre  staff   5293 Jul  6 16:17 site.py
-rw-r--r--  1 calibre  staff   6427 Jul  6 16:17 util.c
-rw-r--r--  1 calibre  staff    246 Jul  6 16:17 util.
Btw, whats the reason why the launcher apps are created as binaries instead of regular scripts?
Boilerplate4U is offline   Reply With Quote
Old 07-12-2020, 12:07 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,870
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre-debug executes main() from debug.py
kovidgoyal is offline   Reply With Quote
Old 07-12-2020, 12:19 PM   #5
Boilerplate4U
Enthusiast
Boilerplate4U began at the beginning.
 
Boilerplate4U's Avatar
 
Posts: 38
Karma: 10
Join Date: Jul 2020
Device: Kobo Clara HD
Quote:
Originally Posted by kovidgoyal View Post
calibre-debug executes main() from debug.py
Ok, thank you!

1. Are there any other settings, env-vars or arguments needed before calling main()?

2. Btw, where is the src for v4.99 (py3 beta) located? Couldn't find any branch or tag at github "https://github.com/kovidgoyal/calibre" for 4.99...

Thanks, Lars.
Boilerplate4U is offline   Reply With Quote
Advert
Old 07-12-2020, 01:00 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,870
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The py3 branch. And if you want to run calibre from source using a binary read https://manual.calibre-ebook.com/develop.html
kovidgoyal is offline   Reply With Quote
Old 07-12-2020, 04:01 PM   #7
Boilerplate4U
Enthusiast
Boilerplate4U began at the beginning.
 
Boilerplate4U's Avatar
 
Posts: 38
Karma: 10
Join Date: Jul 2020
Device: Kobo Clara HD
Quote:
Originally Posted by kovidgoyal View Post
The py3 branch. And if you want to run calibre from source using a binary read https://manual.calibre-ebook.com/develop.html
Thanks!

Fyi, the following settings are required by PyCharm to work on macOS (ie set by launcher "caliber-debug"). In the example below Calibre is cloned to "/Users/lars/src/calibre"

Code:
CloneRoot = /Users/lars/src/calibre
CALIBRE_DEVELOP_FROM = CloneRoot/src  <======
PHP Code:
sys.path
=========
/
Users/bob/lars/calibre/src         (env "CALIBRE_DEVELOP_FROM")
/
Applications/calibre.app/Contents/Resources/Python/lib/python2.7
/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/lib-dynload
/Applications/calibre.app/Contents/Resources/Python/site-packages
/Applications/calibre.app/Contents/Resources/Python

os
.environ
==========
CALIBRE_DEVELOP_FROM=/Users/lars/src/calibre/src
FONTCONFIG_PATH
=/Applications/calibre.app/Contents/Resources/fonts
FONTCONFIG_FILE
=/Applications/calibre.app/Contents/Resources/fonts/fonts.conf
PYTHONIOENCODING
=UTF-8
IPYTHONDIR
=/Users/lars/Library/Caches/calibre/ipython
SSL_CERT_FILE
=/Applications/calibre.app/Contents/Resources/resources/mozilla-ca-certs.pem

sys
.exec_prefix
===============
/
Applications/calibre.app/Contents/Resources/Python 
Boilerplate4U is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting PyCharm code completion while writing Calibre plugins trying Development 6 03-30-2014 05:47 AM
Continual Setup Pullar Kobo Reader 13 11-14-2011 09:48 AM
Can't get to setup kmb99 Kobo Tablets 4 11-03-2011 01:44 PM
Pandigital Novel Setup BlkDimnd More E-Book Readers 0 07-31-2010 12:26 AM
PRS-500 My setup Nogg Sony Reader Dev Corner 12 08-22-2007 01:30 PM


All times are GMT -4. The time now is 12:13 AM.


MobileRead.com is a privately owned, operated and funded community.