#pyproject-metadata

1 messages · Page 1 of 1 (latest)

pseudo yew
#

I'm starting the transfer process

agile hatch
still coyote
#

I can do all that, but want to get an OK from the relevant people.

serene ridge
#

Hi, can anyone push the release flow or add the trusted publishers? Thanks very much. We are eager for a new release

still coyote
#

I've set up trusted publishing configuration on PyPI.

agile hatch
#

Which looks better:

A: Field 'project.keywords' has an invalid type, expecting a list of strings (got 'some string')

B: Field "project.keywords" has an invalid type, expecting a list of strings (got 'some string')

?

strong lynx
#

Took me a while to even see the difference

sonic monolith
#

I wonder if giving the exact value here instead of the type is more confusing than helpful:

Field 'project.keywords' has an invalid type (got 'str', expecting a list of strings)
terse mortar
#

If you use typewriter quotes to signify a string, you shouldn’t also use them to signify a field identifier, especially since in TOML, 'project.keywords' is not equivalent to project.keywords/'project'.'keywords'. So either use text quotes:

Field “project.keywords” has an invalid type, expecting a list of strings (got 'some string')

or markup-like backticks:

Field `project.keywords` has an invalid type, expecting a list of strings (got 'some string')

to signify identifiers

#

@sonic monolith’s suggestion targets the same issue, and is an alternative way to solve it!

agile hatch
#

That wouldn’t fix nested type failures. “Expected list of stings, got list” for example. Also this is for all the messages, not just the type failures.

agile hatch
agile hatch
#

If you use the classic license.file = "somefile.txt", and that file ended in a newline, would you expect the newline to show up in the License metadata? (keeping in mind the email.message format doesn't actually support newlines, but they are hacked in. But the JSON output would have it. And PEP 639 gets rid of this mess with whole files being inserted in email headers)

#

(Question for anyone interested)

manic burrow
#

I would say there should be a final newline even if the original file didn't have it. 😛

forest zephyr
#

I agree. Multi-line text should always end in a newline. Removing leading or tailing empty lines would be fine, though. I would not touch leading whitespace, just full empty lines. In any case, if there are sanitization steps, those should be part of the PEP.

agile hatch
#

PEP 639 gets rid of this mess, so it's only about the old version. 🙂

agile hatch
agile hatch
low oriole
devout monolith
subtle brook
#

Oh I've been doing more than thinking 😆

I have slightly more than half a PEP drafted that I will probably return to in a few weeks. Happy to work with folks here on it!

agile hatch
#

I'd be happy to help on that 🙂

delicate goblet
coarse marsh
#

my guess: someone wanted it to be relatively powerful to reduce the temptation for people to fall back on code in setup.py.

ocean stirrup
coarse marsh
#

Makes a certain amount of sense for, for example, projects that were published during the 2->3 transition and supported e.g. {2.7, 3.4, ... current version} and didn't want to promise support in future versions... ?

delicate goblet
#

The only place where brackets are supported are in extras or inside python_str

#

also, none of the files at your link are pyproject.toml files

#

I guess I need to rephrase my question: how would one use the "in" or "not in" operators in pyproject.toml?

delicate goblet
coarse marsh
#

🤔

silent hatch
#

Hello folks, I hope you are all well 🙂

I might be doing something stupid, but ISTM that PyPI only uses the deprecated License field, and not License-Expression, although I have seen closed issues in the pypi/warehouse project saying stating that PEP 639 was implemented.

Please see https://github.com/psycopg/psycopg/issues/1225 - to the best of my understanding we are doing everything ok and providing PEP 639-compliant package.

Is this a PyPI issue or I'm being obviously wrong?

GitHub

Since version 3.2.13 the license information is missing from PyPI again. This is the same issue as in #1209 but it appears to have reoccurred. I can confirm that the license information was availab...

manic burrow
#

@silent hatch Are you perhaps using an old version of twine to upload the packages?

silent hatch
#

@manic burrow version 6.0.1

#

I'll release psycopg 3.3.1 in a few hours, after packages are built. I have bumped twine to the latest 6.2.0, i'll check if it makes a difference, Surprising that the tool to install overrides the packages metadata tho...

manic burrow
#

Yeah, I think they added license expression support in 6.1.0.

silent hatch
#

Wouldn't it be better to refuse an upload with a broken tool?

marsh kindle
#

I don't think PyPI is actually inspecting the license-expression field in the distribution core metadata. Twine sends over the metadata through HTTP form fields (or headers...? I'm not sure)

marsh kindle
silent hatch
#

Weird design, considering that the METADATA field is in the archive uploaded

silent hatch
marsh kindle
#

It's probably a historical design quirk. Also, it's easier to not have to extract and read files from everything uploaded. Although, PyPI is now doing that to provide .METADATA files so ¯_(ツ)_/¯

#

Point is that PyPI really should avoid relying on the uploading tool sending over the right metadata and instead use the distribution metadata as the single source of truth.

#

That's not as trivial as it sounds as there is no single source of truth since almost every project will at least have a sdist and wheel each with their own core metadata.

#

I'm not a PyPI maintainer though so that's where my involvement ends. That's the context for why things are the way they are today.

silent hatch
marsh kindle
#

I strongly suspect there is already an open issue somewhere.

manic burrow
#

I think this is supposed to be fixed in PEP 694.

marsh kindle
#

PyPI is slowly getting stricter so I'd imagine this will happen at some point

silent hatch
#

I see. Thank you very much for the pointers, @marsh kindle @manic burrow !

agile hatch
#

Twine also often needs recent versions of dependenices, which it never requires. One of the new metadata features (maybe this one?) is disabled if a dependency is old, even with new twine. That's why you should always use pipx/uvx/uv tool.

coarse marsh
#

... pipx uploads stuff?

manic burrow
coarse marsh
#

ah

#

(huh, twine dependencies are actually quite elaborate)

agile hatch
#

Yes, I did. Using pipx or uvx helps keep the dependencies fresh. You can also use uv publish

#

(I almost always publish from GHA with trusted publishing, so don't use either really)

coarse marsh
#

the runners would also update twine itself, yes?

honest narwhal
agile hatch