google / vimdoc

Helpfile generation for vim
Apache License 2.0
292 stars 29 forks source link

[feature] Support PEP518 #128

Closed Freed-Wu closed 1 year ago

Freed-Wu commented 1 year ago

According to https://peps.python.org/pep-0621, any python project should store its metadata in pyproject.toml, not .gitlint, .yamllint.yaml, .vintrc.yml, addon-info.json, or other thing.

Many projects have support PEP621, such as

So I advise this project can support, too.

Before python3.11, toml support must be provided by third-party package, such as

You can use one as extras_require.

After python3.11, tomllib is a builtin package. Not need install any toml package. Remember python<3.11 in requirements.txt

Freed-Wu commented 1 year ago

it should be https://peps.python.org/pep-0518/#tool-table (right, pep only have a number which make it is hard to remember), It suggests every python tool store their setting to pyproject.tomls tool.

dbarnett commented 1 year ago

So are we not talking about PEP621 at all here, just PEP518?

Specifically you're suggesting to move metadata from https://github.com/google/vimdoc/blob/main/setup.py to pyproject.toml, right? And presumably suggesting the same for vroom at https://github.com/google/vroom/blob/main/setup.py? Is there any practical benefit for converting existing metadata into that structure?

Freed-Wu commented 1 year ago

It's my fault to remember two PEP's number :cry:

In conclusion, PEP621 let developer change setup.py to pyproject.toml, (from a python script to a data exchange format), PEP518 let deveoper change the setting of a tool written by python to pyproject.toml's [tool.XXX].

PEP518

Before PEP518, every tool written by python has its own config file, codespell's .codespellrc, gitlint's .gitlint.

However, these configuration is different format: dosini (.codespellrc), json (addon-info.json), yaml (.yamllint.yml) toml (pyproject.toml) User must learn dosini, json, yaml, toml, even more language to know their syntaxes. PEP518 summon all python developers use pyproject.toml, codespell store its configuration to [tool.codespell], etc.

In other languages, one configuration file has been accepted broadly, such as nodejs's package.json, julia's project.toml, rust's cargo.toml, etc. PEP518 hope python can use one pyproject.toml to configure all things.

So, if PEP518 is accepted by vimdoc, it should be

[tool.vimdoc]
name=XXX
XXX=XXX

PEP621

PEP621 isn't related to user, it is just related to developer. It let developer change setup.py to pyproject.toml. It can be another issue to explain why.

Freed-Wu commented 1 year ago

Because this package has probability to be rewriten in other language, close it. See https://github.com/google/vimdoc/issues/118#issuecomment-1328105580