salesforce-marketingcloud / FuelSDK-Python

FuelSDK for python
Other
126 stars 194 forks source link

[Enhancement] Relax version restriction on requests package in 0.9+ #117

Open maxsond opened 4 years ago

maxsond commented 4 years ago

Is your feature request related to a problem? Please describe In version 0.9, Setup.py requires requests version 2.2.1, which does not fit well in projects that make use of newer version of requests (specifically, that make use of the json keyword argument in the post method).

Describe the solution you'd like Relax the requests version requirement in setup.py. Maybe >=2.2, < 3?

Describe alternatives you've considered I've considered moving my project to Python 3, but that didn't fit in the time I had.

I've also considered that I might be mistaken and that there is a good reason to lock out later versions of requests, but if there is that would be valuable information for me so I can take that into account in my project.

And I considered forking the package and making this change myself, but I'd strongly prefer not to maintain that going forward.

Additional context I had a poke around the FuelSDK source to try to find why it demanded exactly version 2.2.1. The strongest argument I could find was that it passes the data=json.dumps(data) and content-type header as arguments to the post method rather than simply json=data since that keyword is unavailable in requests 2.2.1, but this syntax is just as valid in later versions of requests as it is in 2.2.1 despite the added availability of the json keyword so I don't see a need to raise errors when installing FuelSDK alongside later versions of requests.