fix: Address mypy typing errors in v2 SDK#157
Conversation
Update all typing that used requests to take httpx classes instead. Logic changes should be minimal, this is mostly to change type hints where a `httpx.Response` is used instead of a `requests.Response`, etc. Add mypy to `make lint` so that we can cath these errors before merging. The publish job runs a full linter suite, and these changes made it to main but broke the publish job.
1de02e3 to
c9f00ce
Compare
pawel-kmiecik
left a comment
There was a problem hiding this comment.
Found a nit, but generally LGTM
There was a problem hiding this comment.
I've just noticed that with V2 poetry is required.
Previously it was just set as a build tool but everything worked with pip.
Now, the dependencies are defined as poetry deps in pyproject.toml so they are not installed with the package (like pydantic) if installing with pip install -e ..
I think it requires adding some Makefile commands to install the package properly (with poetry install) or adding install steps in the README
Don't want to block the PR due to timezone gap
Ah, good call! I'm not very familiar with poetry but I suppose this is the time to switch over the makefile commands where it's needed. I'll throw in a new issue for this, as right now I'm trying to unblock the split page retry fixes, and CI does seem to be installing everything as needed. |
* Fix some verbose isinstance checks * Use single line for install-dev
fd93aa4 to
39f182d
Compare
Fix all mypy errors due to incorrect typing after the SDK v2 merge (#135). Logic changes should be minimal, this is mostly to change type hints where a
httpx.Responseis used instead of arequests.Response, etc. I removed someform_utils.pyfunctions where we no longer need to convert a httpx request back to Requests. There's more we can cleanup in here, but let's get the V2 migration settled first.Add mypy to
make lintso that we can cath these errors before merging. The publish job runs a full linter suite, and these changes made it to main but broke the publish job.Also, remove the Patch Custom Code step that I added to the generate. This broke the job. There are some minor changes to the Speakeasy code on the main branch. In the short term, this means we'll have to run
make patch-custom-codewhenever we regenerate.To verify
Make sure you can lint and run the tests locally.
make lintandmake test. You can also verify that the pdf split behavior has not changed with a call to your local server: