Review request: Kcmgrub2

Michael Jansen kde at michael-jansen.biz
Wed Apr 6 23:01:20 BST 2011


On Wednesday 06 April 2011 20:57:02 Alberto Mattea wrote:
> In data mercoledì 6 aprile 2011 20:43:40, Michael Jansen ha scritto:
> > > > You might also want to consider using KDE's
> > > > macro_optional_find_package() together with macro_log_feature(),
> > > > so you show a list of all the dependencies which have or have
> > > > not been found instead of failing at the first one.
> > > > 
> > > > I remember some discussions before about build-time and runtime
> > > > dependencies in applications written in Python, but I can't
> > > > remember
> > > > the outcome. Someone with a distro hat should have more
> > > > information
> > > > about this.
> > > 
> > > Thanks, I'll look into this.
> > 
> > I think i can summarize. NEVER check for runtime dependencies on compile
> > time. And since all python/ruby/perl dependencies are runtime
> > dependencies just don't check for them in a makefile whatever.
> > 
> > When starting the app try to import what you need and bail out
> > gracefully
> > if something it missing. A small upfront method that checks if all
> > mandatory dependencies are there is all that is needed.
> > 
> > in ruby
> > 
> > begin
> > 
> > 	require 'whatever'
> > 
> > rescue LoadError
> > 
> > 	$stderr.puts "Required library whatever is missing.'
> > 	exit -1
> > 
> > end
> > [... repeat as required]
> > 
> > Python can do the same
> > 
> > And then document all required and optional dependencies in a readme so
> > the packagers can add the required dependencies to the package they
> > will build.
> > 
> > Mike
> 
> Thanks. Does this apply also to pyqt/pykde itself?

Preferably so. Remember that most script programs do not require to be 
installed. A ruby program even if having a rakefile most of the time is able 
to be run from the checkout. And what i remember from python the same applies 
there. 

So if you want to play nice your main script checks for pyqt/pykde and does 
the same. Costs you nothing. But immediately failing without checking is 
acceptable to if the resulting error message is clear enough.
>>> import PyKDE4
>>> import PyKDE5
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named PyKDE5
>>> 

I guess that makes it clear i have to install PyKDE5. Which repo was that 
again? :))

Mike






More information about the kde-core-devel mailing list