Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 我是否可以在命令行上指定PyPI服务器信息,例如用户名和密码,而不是使用.pypirc?_Python_Setuptools_Pypi - Fatal编程技术网

Python 我是否可以在命令行上指定PyPI服务器信息,例如用户名和密码,而不是使用.pypirc?

Python 我是否可以在命令行上指定PyPI服务器信息,例如用户名和密码,而不是使用.pypirc?,python,setuptools,pypi,Python,Setuptools,Pypi,My.pypirc文件: [distutils] index-servers = pypi internal [pypi] username:pypiusername password:pypipasswd [internal] repository: http://10.11.12.13:8080 username: ning password: xxxx 我想写一个脚本来上传软件包,但不想在它运行的机器上需要一个.pypirc文件。我可以用-r指定存储库,但是有没有办法同时指定

My.pypirc文件:

[distutils]
index-servers =
  pypi
  internal

[pypi]
username:pypiusername
password:pypipasswd

[internal]
repository: http://10.11.12.13:8080
username: ning
password: xxxx

我想写一个脚本来上传软件包,但不想在它运行的机器上需要一个.pypirc文件。我可以用
-r
指定存储库,但是有没有办法同时指定
用户名
密码
?或者是否有传递其他文件的选项(例如
--config file./my pypyrc

我很震惊,setuptools在命令行上没有安全的方法来完成这项工作,但您可以使用Twine()


您可以尝试使用
用户名作为存储库url的前缀:password@http://yourrepo:8000
twine upload -u USERNAME -p PASSWORD dist/*