[cirq-rigetti]: Unpin requirements (#4798)
Closes #4798.
Converts basic cirq-rigetti test to use pytest-httpx instead of raw httpcore patching. Removes sub-dependencies that are not explicitly used in cirq-rigetti.
- tests (cirq-rigetti): use pytest-httpx
- requirements (cirq-rigetti): remove unused requirements
@vtomole, I'm satisfied with this PR, but I don't know what I need to do to pass your CI tests.
It looks like Type Check fails b/c pytest_httpx isn't installed in the mypy environment. And I don't know how to interpret the "Packaging test" failures. It looks like those (and Windows Pytest) are failing on codeowners, which I don't know anything about/isn't related to this PR.
It looks like Type Check fails b/c pytest_httpx isn't installed in the mypy environment
Yes, looks we are installing pytest_httpx for pytest here but not for the general requirements; which is what mypy is looking for.The easiest way around this would be to move the pytest-httpx requirement to cirq-rigetti/requirements.txt
which I don't know anything about/isn't related to this PR.
This was fixed upstream. I've just merged master into here to fix it.
@drewrisinger this looks like pytest_httpx doesn't have stubs, I think you can fix this by adding it to dev_tools/conf/mypy.ini
After going down a bit of a rabbit hole, I think I figured out an/the issue.
With the requirement of httpx>=0.15.5, the dependency resolvers choose httpx==0.15.5, and the only version of pytest-httpx that is compatible with this is roughly pytest-httpx==0.9.0. pytest-httpx supports PEP561 typing via py.typed file, but only for pytest-httpx>=0.12.1, which is not installed. Confirmation of this from the type-checking CI job:
Successfully installed [...] httpx-0.15.5 [...] mypy-0.782 [...] pytest-httpx-0.9.0 [...]
There are two simple solutions I see:
- update minimum httpx to one that
pytest-httpxsupports for typing. This could have downstream effects, and not 100% sure that the entire cirq library is compatible withhttpx>0.15.5 - Ignore typing for
pytest-httpx, as suggested by @dabacon. I'm going to do this one, but I think it's worth noting that something is apparently restrictinghttpx~=0.15.0, because I don't otherwise understand whyhttpxwouldn't bump to the latest version. AFAICT the only direct usage ofhttpxis incirq-rigetti/cirq_rigetti/service.py.