You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used twine with AppVoyer/travis and had to call it with --password %PYPI_PASS%, but this leaks the Password to the log :-(
I found a way not to leak it (calling it as @twine ... in batch files and set+x; twine ...; set -x in bash scripts), but it would be much easier if twine could get the things from environment variables...
The text was updated successfully, but these errors were encountered:
It would be a nice improvement for any CI. For example it would let create specialized docker containers for building / publishing or let define masked variables into .travis.yml.
It is easy to implement this directly into argparse. here is a snippet that will fetch a value from --my-param cli parameter or a MY_PARAM environment variable:
importargparseclassEnvDefault(argparse.Action):
"""Get default from environment variable """def__init__(self, env, required=True, default=None, **kwargs):
default=os.environ.get(env, default)
self.env=envifdefault:
required=Falsesuper().__init__(default=default, required=required, **kwargs)
def__call__(self, parser, namespace, values, option_string=None):
setattr(namespace, self.dest, values)
parser=argparse.ArgumentParser()
parser.add_argument('--my-param', action=EnvDefault, env='MY_PARAM',
help=('can also be specified using %(env)s ''environment variable'))
I used twine with AppVoyer/travis and had to call it with
--password %PYPI_PASS%
, but this leaks the Password to the log :-(I found a way not to leak it (calling it as
@twine ...
in batch files andset+x; twine ...; set -x
in bash scripts), but it would be much easier if twine could get the things from environment variables...The text was updated successfully, but these errors were encountered: