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

Problem with --pip-show parser for a module with nothing on the License: line but which has following lines #567

Open
bryder opened this issue May 1, 2024 · 3 comments
Labels
bug Something isn't working ready-to-ship

Comments

@bryder
Copy link

bryder commented May 1, 2024

We came across this for

ml-dtypes 0.4.0

It's license section looks like this

License: 
                                         Apache License
                                   Version 2.0, January 2004
                                http://www.apache.org/licenses/
        
           TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

etc etc.

jc --version
jc version:  1.25.2
python interpreter version:  3.10.9
python path:  /usr/home/bryder/bin/jc

https://github.com/kellyjonbrazil/jc
(c) 2019-2024 Kelly Brazil

Reproducing it in bash

<<<'Name: ml-dtypes
Version: 0.4.0
Summary: 
Home-page: 
Author: 
Author-email: ml_dtypes authors <ml_dtypes@google.com>
License: 
                                         Apache License
                                   Version 2.0, January 2004
                                http://www.apache.org/licenses/
        
Location: /usr/home/bryder/.local/lib/python3.9/site-packages
Requires: numpy
Required-by: 
'  jc --pip-show
jc:  Error - pip-show parser could not parse the input data.
             If this is the correct parser, try setting the locale to C (LC_ALL=C).
             For details use the -d or -dd option. Use "jc -h --pip-show" for help.

If I put Apache License on the same line as License:

<<<'Name: ml-dtypes
Version: 0.4.0
Summary: 
Home-page: 
Author: 
Author-email: ml_dtypes authors <ml_dtypes@google.com>
License:       Apache License
                                   Version 2.0, January 2004
                                http://www.apache.org/licenses/
        
Location: /usr/home/bryder/.local/lib/python3.9/site-packages
Requires: numpy
Required-by: 
'  jc --pip-show
[{"name":"ml-dtypes","version":"0.4.0","summary":null,"home_page":null,"author":null,"author_email":"ml_dtypes authors <ml_dtypes@google.com>","license":"      Apache License\nVersion 2.0, January 2004\nhttp://www.apache.org/licenses/\n","location":"/usr/home/bryder/.local/lib/python3.9/site-packages","requires":"numpy","required_by":null}]

It works.

I'm not sure if it's legal to leave the License: line empty.

Perhaps I should contact the ml_dtypes authors instead?

@kellyjonbrazil
Copy link
Owner

Thank you for reporting this. It looks like an easy fix and I should be able to get it into the dev branch in the next couple of days.

@kellyjonbrazil kellyjonbrazil added the bug Something isn't working label May 1, 2024
@kellyjonbrazil
Copy link
Owner

I have a fix for this in the dev branch and it will make it into the next release:

https://github.com/kellyjonbrazil/jc/blob/dev/jc/parsers/pip_show.py

You can test by copying the parser file above into your parser plugin folder:

  • Linux/unix: $HOME/.local/share/jc/jcparsers
  • macOS: $HOME/Library/Application Support/jc/jcparsers
  • Windows: $LOCALAPPDATA\jc\jc\jcparsers

@bryder
Copy link
Author

bryder commented May 6, 2024

Works well for me thanks (checked on linux)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready-to-ship
Projects
None yet
Development

No branches or pull requests

2 participants