Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement bdist_pex. #149

Merged
merged 5 commits into from
Aug 13, 2015
Merged

Implement bdist_pex. #149

merged 5 commits into from
Aug 13, 2015

Conversation

wickman
Copy link
Contributor

@wickman wickman commented Aug 12, 2015

This is my cut at bdist_pex with @msabramo's fixes rebased on top. The main question is if the implemented/documented behavior is sane. It seems reasonable to me but I'm also unsure about what potential customers think.

Addresses feature request #99.

self._write(pex_builder, target, script=name)
else:
# The package has no namesake entry point, so build an environment pex.
# TODO(wickman) Is this a reasonable default behavior? Should we fall back
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its a reasonable default.

@jsirois
Copy link
Member

jsirois commented Aug 13, 2015

This is very very cool. Thanks @msabramo! And thank you @wickman as always.

wickman and others added 5 commits August 13, 2015 13:29
Prevents this error:

    $ python setup.py bdist_pex --pex-args='-r gunicorn-req.txt -r ipython-req.txt'
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help

    error: option --pex-args must not have an argument
Prevents this error:

    $ python setup.py bdist_pex --pex-args="--index-url=http://packages.corp.surveymonkey.com/index"
    running bdist_pex
    Traceback (most recent call last):
      File "setup.py", line 5, in <module>
        pbr=True
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/Users/marca/dev/git-repos/pex/pex/commands/bdist_pex.py", line 64, in run
        if len(self.distribution.entry_points['console_scripts']) == 1:
    KeyError: 'console_scripts'
1. Include version number in output filename, like `sdist` and
`bdist_wheel` do.

2. Output the actual filename that we are writing to, including the
`bdist_dir`.

Instead of this:

    $ python setup.py bdist_pex --pex-args="--index-url=http:/myindex"
    running bdist_pex
    Writing environment pex into dummysvc.pex

we get this:

    $ python setup.py bdist_pex --pex-args="--index-url=http://myindex"
    running bdist_pex
    Writing environment pex into /Users/marca/dev/surveymonkey/DummySvc/dist/dummysvc-0.0.4.dev53.pex
wickman added a commit that referenced this pull request Aug 13, 2015
@wickman wickman merged commit 1d1cae2 into pex-tool:master Aug 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants