[issue45101] Small inconsistency in usage message between the python and shell script versions of python-config

2021-09-23 Thread Kien Dang


Kien Dang  added the comment:

Thanks. I didn't know about the `pkg-config` thing. I just checked with 
pkg-config on macOS

`pkg-config --help` prints usage instructions to stdout

pkg-config followed by invalid options prints output to stderr, for example 
`pkg-config --asdf` prints `Unknown option --asdf` to stderr.

The PR I submitted does something similar, making both python and shell script 
versions of `python-config` to print out the usage instruction message to 
stdout when --help is provided and stderr when given invalid arguments.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45101] Small inconsistency in usage message between the python and shell script versions of python-config

2021-09-10 Thread Éric Araujo

Éric Araujo  added the comment:

I think python-config is modelled after pkg-config: what does the latter do?

Also, I’m not sure it would be appropriate to change behaviour in existing 
releases.

--
nosy: +eric.araujo
versions:  -Python 3.10, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45101] Small inconsistency in usage message between the python and shell script versions of python-config

2021-09-04 Thread Kien Dang


Change by Kien Dang :


--
keywords: +patch
pull_requests: +26594
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28162

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45101] Small inconsistency in usage message between the python and shell script versions of python-config

2021-09-04 Thread Kien Dang


New submission from Kien Dang :

`python-config` outputs a usage instruction message in case either the `--help` 
option or invalid arguments are provided.

However there is a small different in the output I/O between the python and 
shell script versions of `python-config`. In the python version, the message 
always prints to `stderr`.

https://github.com/python/cpython/blob/bc1c49fa94b2abf70e6937373bf1e6b5378035c5/Misc/python-config.in#L15-L18

def exit_with_usage(code=1):
print("Usage: {0} [{1}]".format(
sys.argv[0], '|'.join('--'+opt for opt in valid_opts)), file=sys.stderr)
sys.exit(code)

while in the shell script version it always prints to `stdout`.

https://github.com/python/cpython/blob/bc1c49fa94b2abf70e6937373bf1e6b5378035c5/Misc/python-config.sh.in#L5-L9

exit_with_usage ()
{
echo "Usage: $0 
--prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir|--embed"
exit $1
}

This inconsistency does not affect most users of `python-config`, who runs the 
script interactively. However it might cause issues when run programmatically.

--
components: Demos and Tools
messages: 401054
nosy: kiendang
priority: normal
severity: normal
status: open
title: Small inconsistency in usage message between the python and shell script 
versions of python-config
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com