Use optional package installs.
See original GitHub issueInstead of the platform detection I’d like uvicorn to use optional installs.
pip install uvicorn
- Just the package itself.pip install uvicorn[standard]
- uvloop/httptools/websocketspip install uvicorn[pure]
- asyncio/h11/wsprotopip install uvicorn[full]
- Everything
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:29 (28 by maintainers)
Top Results From Across the Web
Using installed optional packages - IBM
Installed optional packages enable an administrator to declare a dependency in an application's manifest file to a shared library, with ...
Read more >Optional Package Overview
Optional packages are packages of Java classes and associated native code that application developers can use to extend the functionality of the core ......
Read more >What Are NPM's Optional Dependencies and When Should ...
Execute npm install someDependency --save-optional to install a package as an optional dependency. The installed package will be put into ...
Read more >Optional dependencies in distutils / pip - python - Stack Overflow
I call them optional dependencies, because that is what ubuntu's package manager call them. They are not strictly required, but if they are ......
Read more >What are Optional Dependencies and when should we use them
The term optional dependencies apply to dependencies that won't cause a failure during the installation of an application or project since ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, this is one of the reasons why I generally try to use debian-based python docker containers because installing in them is way faster (as you can use the prebuilt wheels). As a result you can also use
python:slim
in the containers which don’t ship GCC. The default python containers ship gcc so you can compile missing stuff.I’m slightly surprised we’re not seeing more folks chiming in with “installing uvicorn fails on my platform”.
Do either of “websockets” (Includes a small C extention but I think has an optional pure python fallback) or “uvloop” also fail to install for you.
I’m wondering if there’s an environment marker or some other workaround we could use to make sure that they only installed optionally.
(Tho we’re probably okay once we move to
pip install uvicorn
andpip install uvicorn[standard]
, and can just clearly document any failure cases)