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

Use environment markers in setup.py rather than explicitly switching requirements. #135

Closed
tomchristie opened this issue Jul 19, 2018 · 3 comments

Comments

@tomchristie
Copy link
Member

Recommended by @uranusjr, here: #82 (comment)

I would strongly recommend using PEP 508 environment markers to specify dependencies instead. This allows for the same effect (in relatively recent Setuptools and pip), prevents the packager from needing to maintain platform-specific artifacts (e.g. wheels), and has immensely better compatibility with the new trend of locking-aware dependency management tools like Pipenv and Poetry.

The following should be functionality-wise equivalent to the if-elif-else clause:

requirements = [
    'click',
    'h11',
    'websockets>=6.0',
    "httptools; platform_system != 'Windows' and 'CYGWIN' not in platform_system and platform_python_implementation != 'PyPy'",
    "uvloop; platform_system != 'Windows' and 'CYGWIN' not in platform_system and platform_python_implementation != 'PyPy'",
]
@tomchristie
Copy link
Member Author

This would be a nice simple one for a contributor to jump in on! 😄

@tomchristie
Copy link
Member Author

Closing in favor of using optional dependencies #219

@vlcinsky
Copy link
Contributor

PR #309 resolves this issue, released in uvicorn==0.4.6

This will change in next major version, where use of extras is to be implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants