JelleZijlstra / autotyping

Automatically add simple type annotations to your code
215 stars 18 forks source link

Cannot be used as a standalone script when installed via pip #69

Closed k4nar closed 4 months ago

k4nar commented 4 months ago

Hi,

PR https://github.com/JelleZijlstra/autotyping/pull/65 has introduced a very convenient way of using the project with python -m autotyping.

However, it doesn't work when installing the project via pip :smiling_face_with_tear: :

$ pip install git+https://github.com/JelleZijlstra/autotyping@master
[...]
$ python -m autotyping --safe foo.py                                
python: No module named autotyping.__main__; 'autotyping' is a package and cannot be directly executed

The file __main__.py is indeed missing from the distributed package.


Also, it would be even more awesome if the project was providing a cli entrypoint, so that autotyping could be used as a command :partying_face: .

k4nar commented 4 months ago

If you stumble upon this issue and you impatiently want to use this project without libcst.tool, cloning the repository and installing it with pip install -e . works.

JelleZijlstra commented 4 months ago

Would you be interested in contributing a PR? It would be good to add the entrypoint too.

I'd probably cut a release after this is fixed (cc @hauntsaninja in case you were thinking of contributing other changes).

hauntsaninja commented 4 months ago

Sure, I can open a PR

k4nar commented 4 months ago

I can confirm it works, thanks :raised_hands: !