Skip to content

Conversation

@amritamishra01
Copy link

Summary
This PR adds support for installing simplejson as an optional extra by updating the extras_require section in setup.py.
Rationale
As discussed in issue #7032, requests currently supports simplejson if it is already present in the environment, but there is no explicit or reliable way to install it alongside requests. This can lead to unexpected behavior if simplejson is removed or missing.
By defining an optional extra, users can install it explicitly using:
pip install requests[simplejson]
or with Poetry:
poetry add requests[simplejson]
This follows Python packaging best practices and makes the dependency relationship clear without modifying core behavior of the library.
Changes
Updated setup.py by adding the following entry inside extras_require:
'simplejson': ['simplejson']
Verification
Tested locally in a clean environment.
pip install .[simplejson]
Verified import with:
import simplejson
print("simplejson imported successfully!")
Output:
simplejson imported successfully!
Closes #7032

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.

Add simplejson as an optional extra

1 participant