question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use optional package installs.

See original GitHub issue

Instead 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/websockets
  • pip install uvicorn[pure] - asyncio/h11/wsproto
  • pip install uvicorn[full] - Everything

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:29 (28 by maintainers)

github_iconTop GitHub Comments

1reaction
apollo13commented, Nov 13, 2019

Oh: “Alpine uses a different C library, musl, instead of the more common glibc.” (source)

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:slimin the containers which don’t ship GCC. The default python containers ship gcc so you can compile missing stuff.

1reaction
tomchristiecommented, Nov 13, 2019

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 and pip install uvicorn[standard], and can just clearly document any failure cases)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found