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

Allow selection between pyzmq and pyzmq-static. #6

Closed
wants to merge 1 commit into from
Closed

Allow selection between pyzmq and pyzmq-static. #6

wants to merge 1 commit into from

Conversation

matthewryanscott
Copy link

STATIC_DEPS=1 on the command line will turn on pyzmq-static dependency; otherwise, pyzmq itself is used.

I added this because it was easy to install a pre-built binary egg for pyzmq on Windows, but could not easily install pyzmq-static.

Note that I have not yet tested this. I'll have another, separate patch soon that makes the "zerorpc-client" script install correctly on Windows.

STATIC_DEPS=1 on the command line will turn on pyzmq-static dependency; otherwise, pyzmq itself is used.
@bombela
Copy link
Member

bombela commented Mar 16, 2012

Is it possible to automatically install pyzmq-static when pyzmq is not found? I have no clue if that's something easy/doable with distutils...

@matthewryanscott
Copy link
Author

I am not sure if there is something in distutils or setuptools that can do that.

One approach I can think of is to try an import at the top:

try:
    import zmq
except ImportError, e:
    zmq = None

Then build a list of dependencies, attaching pyzmq-static to the bottom as needed:

REQUIREMENTS = [
    'req1 >= 1.0, < 1.1',
    'req2, >= 1.2, < 1.3',
]
if zmq is None:
    REQUIREMENTS.append('pyzmq-static >= 2.1.7.1, < 2.2')
setup(
    # ...
    install_requires=REQUIREMENTS,
    # ...
)

@bombela
Copy link
Member

bombela commented Mar 20, 2012

what about simply detecting if we are on windows? then it select the non-static one?

import platform
platform.system()
'Windows'

At the time goes, we will know if it need to be handled in a different way for different OS/platform. What do you think?

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.

None yet

2 participants