[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Application libraries private, Distutils metadata available for console scripts and introspection



it just works, are you sure the script you're invoking is in the right
dir?

| mkdir -p /tmp/foo/bar /tmp/foo/bar.egg-info
| cat >/tmp/foo/bar/__init__.py <<EOF
| def run():
|         print('it works!')
| EOF
| 
| cat >/tmp/foo/bar.egg-info/entry_points.txt <<EOF
| [console_scripts]
| run = bar:run
| EOF
| 
| 
| cat > /tmp/foo/run <<EOF
| #! /usr/bin/python3
| 
| __requires__ = 'bar'
| import sys
| from pkg_resources import load_entry_point
| 
| if __name__ == '__main__':
|     sys.exit(
|        load_entry_point('bar', 'console_scripts', 'run')()
|     )
| 
| EOF
| 
| chmod +x /tmp/foo/run
| /tmp/foo/run
| ln -s /tmp/foo/run /tmp/baz
| /tmp/baz

outputs "it works!"
-- 
Piotr Ożarowski                         Debian GNU/Linux Developer
www.ozarowski.pl          www.griffith.cc           www.debian.org
GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645


Reply to: