jazzband / docopt-ng

Humane command line arguments parser. Now with maintenance, typehints, and complete test coverage.
MIT License
181 stars 20 forks source link

Claim `docopt` name on pypi (PEP-541) #48

Open groodt opened 1 year ago

groodt commented 1 year ago

If this project is a more maintained version of the original docopt (now unmaintained), I think that this project should claim the pypi docopt name.

NickCrews commented 1 year ago

As context, I started a discussion on python.org about this.

I've sent emails to the maintainer of docopt on PyPI seeing what they think about the name transfer, I'll post here with any updates.

NickCrews commented 1 year ago

@keleshev, I thought I'd try reaching out here as well. What do you think an ideal future for docopt would look like? What would be your hesitations with a name transfer? I think you may find it interesting that I actually just reverted the "magic" stuff that was added after the fork, as I'm trying to get this back to the pure core that you left.

keleshev commented 1 year ago

Hi @NickCrews, the last time I checked, docopt.py was basically perfect and didn't need to change. However, I haven't been working actively with Python for a long while, and I know that Python has been moving forward (type annotations, other features), so I'm open to very small pull requests with clear description.

I will try to go through existing pull requests too.

groodt commented 1 year ago

Is there a reason you prefer not to share the burden with a willing team of maintainers @keleshev ? JazzBand is a reliable and experienced crew. You'll still retain all origin credit and copyright, and even maintainer status I imagine if you still want to be involved.

They've modernized the package a repo a lot and will continue to move it forward as python advances.

cmurat commented 10 months ago

@keleshev It is understandable that you may not want to spend time on maintaining docopt. But it still needs maintenance otherwise it will be unusable soon. That is why this fork exists. If you are not willing to do it, consider letting others take it over so that the community can continue to benefit from it.

keleshev commented 10 months ago

@cmurat I'm actively working on a new reference implementation (https://github.com/keleshev/docopt.ml), once it is done, I (or a volunteer) will update docopt.py to be up-to-date with that.

I have been out of touch with Python development, so I'm not aware what maintenance is required for docopt.py except for type annotations.

As for type annotation, I am interested to hear how to make the return type of docopt type-safe in mypy. I think it is a difficult challenge in Python, considering that the return type depends on the docstring. In OCaml I could achieve it with GADTs. In F# it can be done with type-providers.

NickCrews commented 10 months ago

I think that course sounds like an improvement, but I'm still nervous that it still suffers from the same basic problem that a single person is the gatekeeper for all fixes and modernization. Could we come up with a governance strategy that somehow gives the community the ability to at least fix bugs and keep things modern? I totally agree that I think docopt is feature complete and should only very minimally change. Only 2 people have responded to my question about this, but it sounds like they agree too.

I'm not aware what maintenance is required for docopt.py except for type annotations.

See the differences between your repo and this fork:

I think it is a difficult challenge in Python, considering that the return type depends on the docstring

My understanding is that this is impossible in python. Best we can do is dict[str, Any].

keleshev commented 10 months ago

I don't think anything on your list except type annotations is observable by users.

The other things are are important for projects in active development, not for a project that is in maintenance mode.

keleshev commented 10 months ago

If dict[str, Any] is all we can do, then it is of very little benefit. The downside is dropping support for older Python versions—I don't have an intuition for how important that is.

NickCrews commented 10 months ago

The other things are are important for projects in active development

Yeah that is mostly true, though I might modify

Also, if we ever take the time to tweak the implementation to improve error messages, then the modern CI and project management stuff is more relevant. But so far I haven't been motivated to do that work yet either :)

If dict[str, Any] is all we can do, then it is of very little benefit.

True, for actually type safety benefits. But adding types has the benefit of reducing boilerplate for users who want to type check the rest of their code: If docopt doesn't have types, then mypy errors for all users saying "couldn't find annotations". Then users have to configure mypy to ignore these errors, or write their own stubs. I personally find this benefit of reducing user boilerplate more compelling than the actual added type safety.

The downside is dropping support for older Python

Type annotations will work for all python versions 3.7+. Version 3.6 stopped getting security patches almost 2 years ago, so I think it is reasonable to break anyone still on that. Not sure if I am off base here, if others have thoughts then chime in.