pyodide / micropip

A lightweight Python package installer for Pyodide
https://micropip.pyodide.org
Mozilla Public License 2.0
68 stars 16 forks source link

Add devpi docker image #67

Closed ryanking13 closed 11 months ago

ryanking13 commented 1 year ago

This PR adds devpi docker image, which is a private PyPI server that can be used for testing micropip.

devpi is not integrated with micropip tests yet, since micropip does not support alternative registries yet. I will open follow-up PRs.

This PR includes:

rth commented 1 year ago

Thanks @ryanking13! Some comments are above.

I see the value of having a real server for Python wheels but I think Docker (or installing this server) ideally shouldn't be required to run tests (or at least it should be optional) As far as I know pip doesn't do this for tests. The other alternative is to use this test server, record the response and save them to the file system then mock the response with it. It's a bit more work though.

Maybe @pradyunsg would have some guidance on the best way to test compliance with a server that exposes a PyPI-like JSON API?

ryanking13 commented 1 year ago

I see the value of having a real server for Python wheels but I think Docker (or installing this server) ideally shouldn't be required to run tests (or at least it should be optional) As far as I know pip doesn't do this for tests. The other alternative is to use this test server, record the response and save them to the file system then mock the response with it. It's a bit more work though.

Yes, that is a good point. I was also a bit concerned about making docker mandatory to run tests. I like the idea of recording the responses from the test server and mocking the response with it. Basically, I wanted to remove our mock_fetch class, which is very hard to maintain I think.

ryanking13 commented 11 months ago

Closing as we added a way to run a mock server in #74.