Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
groodt opened this issue Mar 10, 2023 · 10 comments
Open

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

groodt opened this issue Mar 10, 2023 · 10 comments

Comments

@groodt
Copy link

groodt commented Mar 10, 2023

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
Copy link
Contributor

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 NickCrews changed the title PEP-541 docopt Claim docopt name on pypi (PEP-541) May 5, 2023
@NickCrews
Copy link
Contributor

NickCrews commented May 30, 2023

@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
Copy link
Contributor

keleshev commented Jun 1, 2023

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
Copy link
Author

groodt commented Jun 1, 2023

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
Copy link

cmurat commented Nov 6, 2023

@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
Copy link
Contributor

keleshev commented Nov 9, 2023

@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
Copy link
Contributor

NickCrews commented Nov 13, 2023

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:

  • type annotations
  • update packaging to use standard and static pyproject.toml instead of setuptools-specific and dynamic setup.py
  • move to github actions from travis for CI
  • add test coverage
  • move to PDM or a more modern project manager tool from tox, venv, etc

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
Copy link
Contributor

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
Copy link
Contributor

keleshev commented Nov 14, 2023

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
Copy link
Contributor

The other things are are important for projects in active development

Yeah that is mostly true, though I might modify

  • having test coverage is important even for maintenance mode so people can be confident in this lib
  • moving to static metadata helps with dependency/static analysis

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.

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

No branches or pull requests

4 participants