Skip to content

Move requests package to optional dependency #417

Open
@phillipuniverse

Description

@phillipuniverse

I have a fully asynchronous FastAPI application that I use with Rollbar for error tracking. I want to avoid other developers accidentally utilizing the requests package to make external API calls as it will introduce blocking code within a fully asynchronous service.

However, requests is non-optional

pyrollbar/setup.py

Lines 82 to 87 in 55d08a6

# In the current version, `requests>= 0.12.1`
# always installs the latest version of the package.
'requests>=0.12.1; python_version == "2.7"',
'requests>=0.12.1; python_version >= "3.6"',
'requests<2.26,>=0.12.1; python_version == "3.5"',
'requests<2.22,>=0.12.1; python_version == "3.4"',
and will always come in as a transitive dependency with Rollbar.

Ideally, adding a dependency on pyrollbar would not transitively bring in the requests package.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions