Skip to content

Conversation

awachtler
Copy link

This patch adds a json-info url to pypiserver, which is needed for micropython-upip.

The change enables pypi-server to be used as local package server for micropython projects.

If server is queried like this: http://gretel-2:8080/pypiserver/json it returns this JSON data:

{
"info": {"version": "2.0.0.dev1"}, 
"releases": {
  "2.0.0.dev1": [{"url": "http://gretel-2:8080/packages/pypiserver-2.0.0.dev1.zip"}], 
  "2.0.0dev1aw": [{"url": "http://gretel-2:8080/packages/pypiserver-2.0.0dev1aw.zip"}]
 }
}

I would be happy, if this change can make it to the master branch.

Best Regards, Axel.

@dee-me-tree-or-love
Copy link
Member

Hi @awachtler! Great, thanks a lot for your proposal. I am not sure when exactly I will have a moment to give a review, but I will try to take a good look at it in the coming days. The functionality looks nice already :)
In case of anything, @mplanchard, please feel free to take a second look

@dee-me-tree-or-love
Copy link
Member

dee-me-tree-or-love commented Aug 6, 2021

Hi @awachtler! Sorry getting back to it only after such a delay, but I've taken a look and had to look a bit into Micropython to get slightly more familiar, but it looks like a nice addition in my opinion ;). I will add a few comments, but I think it'll make it nicely into master :). @mplanchard, if you'd have some time, could you give a second opinion?

But to give a better idea and mention this feature to the world, you could add an example of using this endpoint with upip? I think a nice spot for it would be in the readme as a new section in Recipes.

Copy link
Member

@dee-me-tree-or-love dee-me-tree-or-love left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I have left a couple of comments :)

  1. could you align with PEP 503?
  2. if you could add a unit test, would be very grateful!

awachtler added 2 commits August 12, 2021 07:43
- added redirect if package name is not normalized
- raise 404 error if package is not found
@awachtler
Copy link
Author

@dee-me-tree-or-love, I just added normalized package name redirecting.

While testing I found that I should raise 404 error in case of invalid package name.
Currently 3 tests are added, let me know, if more test coverage is required.

The use-case documentation for micropython I will add within the next days.

@awachtler
Copy link
Author

Just updated README.rst

@dee-me-tree-or-love
Copy link
Member

@awachtler great! Thanks a lot, I've seen the newly added changes! Looks great to me! :)
I've spotted a small typo in the README and after that I'd be glad to approve :)

Copy link
Member

@dee-me-tree-or-love dee-me-tree-or-love left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spotted a typo ;)

@awachtler
Copy link
Author

Hallo, @dee-me-tree-or-love, thanks for your careful review, the typo was just fixed.

@dee-me-tree-or-love
Copy link
Member

@awachtler hey great! Thanks a lot for the fixes and the friendly bump to review, merging it 👍

@dee-me-tree-or-love dee-me-tree-or-love merged commit 3713da9 into pypiserver:master Aug 26, 2021
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.

2 participants