← Back to team overview

bzr-windows team mailing list archive

Re: Windows Installers now a separate project (call for helpers)

 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vincent Ladeuil wrote:
>>>>>> "bialix" == Alexander Belchenko <bialix@xxxxxxx> writes:
> 
> Thanks for the useful reminder and pointer to qbzr for nice
> examples.
> 
> <snip/>
> 
>     bialix> In this case you should declare API that every
>     bialix> plugin's setup.py should follow. You can start from
>     bialix> here: every setup.py should be importable, e.g. call
>     bialix> to main setup() function should be guarded with
> 
>     bialix> if __name__ == '__main__':
>     bialix> 	setup(...)
> 
>     bialix> Then you need to define the set of functions every
>     bialix> setup.py should provide to get modules list, data
>     bialix> list, dependencies list etc.
> 
> extensions C file names, etc :-D
> 
>     bialix> So when main setup.py will import setup.py from
>     bialix> plugin it can easily access plugin-specific
>     bialix> info. Without these 2 steps there is no way forward.
> 
> Sorry for being unclear before, what I want is that we go forward
> with implementing these 2 steps.
> 
>      Vincent

Because it is very much non-standard for setup.py, I would probably
suggest moving this into 'extension_setup.py' or 'plugin_setup.py'. The
main setup.py can then import this file.

Also, note that namespaces, etc get tricky with this. In bzr it is
common to have plugins have an __init__.py right next to the setup.py.
When that is true, you can then do:
  sys.path.append('~/.bazaar/plugins')
  import plugin_name.setup

However, for things that need to be "setup.py install" ed (like
tortoisebzr) that is not the case. So under those circumstances just doing:
  sys.path.append('path/to/tortoisebzr')
  import setup

Gets you into trouble with namespaces, because they for *all* plugins
you are importing a simple "setup.py" module, and python will want to
say "I've already got that imported". (You can probably play tricks with
del sys.modules['setup']... but you have to play tricks.)

So another alternative is that for a plugin named foo, you create a
file: foo_setup.py

Just some thoughts, and why it isn't *just* as trivial as getting
'setup.py' working.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqtLM0ACgkQJdeBCYSNAAPXeQCgsRViRXtdaWKKHQhFxopO7E5x
nOEAoI6UIyMoyEi5mG5w/v5tsIlpG2xX
=mW8G
-----END PGP SIGNATURE-----



Follow ups

References