Skip to content

Add upload-time support to links parsed from a JSON API#1023

Closed
zanieb wants to merge 2 commits intodevpi:mainfrom
zanieb:zb/upload-time
Closed

Add upload-time support to links parsed from a JSON API#1023
zanieb wants to merge 2 commits intodevpi:mainfrom
zanieb:zb/upload-time

Conversation

@zanieb
Copy link
Copy Markdown

@zanieb zanieb commented Dec 20, 2023

Adds support for including the upload-time field from PyPI in the JSON output. This allows package managers to filter files by upload time.

For example:

❯ curl -s -H 'Accept: application/vnd.pypi.simple.v1+json' 'http://localhost:3141/root/pypi/+simple/black' | jq .files\[0]
{
  "filename": "black-18.3a0-py3-none-any.whl",
  "url": "http://localhost:3141/root/pypi/+f/718/3263650ba3071/black-18.3a0-py3-none-any.whl",
  "hashes": {
    "sha256": "7183263650ba3071034e90b40a1ea74abccbd32cf525cef6d7914479dbe7f2fb"
  },
  "requires-python": ">=3.6",
  "upload-time": "2018-03-14T21:30:34.781336Z"
}

I'd appreciate some guidance on where to add test coverage.

@fschulze
Copy link
Copy Markdown
Contributor

I would advice you to wait with this feature. I'm doing a complete refactor of the storage backend which will make this much easier. Currently it is very hard to get right with backward compatibility, replication and what have you.

@fschulze
Copy link
Copy Markdown
Contributor

Please keep this open though, it is a good use case to test my refactoring.

zanieb added a commit to astral-sh/packse that referenced this pull request Dec 21, 2023
@zanieb
Copy link
Copy Markdown
Author

zanieb commented Dec 21, 2023

No problem thanks for giving it a look.

I needed this personally, otherwise my package manager tests skip all of the wheels :) but I can just install from my fork for now.

Let me know if you need anything.

@zanieb
Copy link
Copy Markdown
Author

zanieb commented Oct 1, 2024

Let me know if you want me to revisit this.

@pelson
Copy link
Copy Markdown

pelson commented Apr 10, 2025

I was just contributing to pypi-timemachine, which is essentially doing the same thing as uv's exclude-newer, and noted this PR - having something like this would be super useful for that use case.

In devpi/devpi-constrained#12 I proposed seeing if there is an option, and interest, to re-use parts of simple-repository for handling some of the data model and logic. Since @fschulze suggests that there is a significant internal re-write, perhaps it is a good option to re-use such a library. I don't think simple-repository is perfect at this point, but it is a pretty good start, and I think integrating it into something like devpi would certainly lead to some improvement on the simple-repository side (which I would be most happy to do!).

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.

3 participants