The Crossbar.io Python package install a crossbar command line script to actually start, stop etc Crossbar.io. See here. console_scripts and entry_points is a setuptools feature.
Now, this works, but unfortunately, setuptools will generate a script upon installation that contains a shell shebang with a absolute path to the Python executable to be used.
Because of this, a Crossbar.io installation is not relocatable. I've tested that using portable PyPy. When the path in the crossbar script is adjusted to the relocated position, it works!
It will also work
- with
#!/usr/bin/env pypyas the first line and the respective (portable) PyPy on PATH - OR by starting Crossbar.io like this
pypy -m crossbar.controller.cli version
A fully relocatable installation would be very nice, as we could just tar up a binary "package" and let the user completely choose installation directory. Well, there isn't anything to install then anymore (if we use a fully self-contained build), as the directory can just be moved.
Of course 1. in above depends on /usr/bin/env, which isn't for Windows, and which might be at different locations for different Unix flavors.
Probably Linux always has it under /usr/bin/env .. not sure.
On the other hand, that tarball will be OS/arch specific anyways .. so this doesn't seem to be a big restriction.
We only need binary packages for Linux and FreeBSD (Windows, OSX, .. are out of scope for now)
该提问来源于开源项目:crossbario/crossbar