简体   繁体   English

PyPi版本控制

[英]PyPi versioning

Newbie here. 新手在这里。 I've created my first Python package and I managed to register it on Pypi, as well as upload the tar.gz file. 我创建了我的第一个Python包,并设法在Pypi上注册了它,并上传了tar.gz文件。 Now whenever I want to run: 现在,只要我想运行:

pip install myPackage

I get this error in console: 我在控制台中收到此错误:

Could not find a version that satisfies the requirement myPackage (from versions: 1.0dev)
No distributions matching the version for flashCardStudy
Storing debug log for failure in /Users/xxx/Library/Logs/pip.log

I believe this is because my version is development version I guess? 我相信这是因为我的版本是我猜的开发版本? So yeah, I can install it by adding --pre argument but what I'd really like is to turn it into a normal version so to speak. 是的,我可以通过添加--pre参数来安装它,但是我真正想要的是将其转换为普通版本。

I've tried figuring out how to do it and looking at some docs but I can't still figure it out. 我试图弄清楚如何做,并查看了一些文档,但我仍然无法弄清楚。 In my setup.py my version is set to '1.0' so I don't see where to problem is. 在我的setup.py我的版本设置为“ 1.0”,所以我看不出问题出在哪里。 If anyone wants to have a look at the file, here it is. 如果有人想看一下文件,就在这里

So I found the problem. 所以我发现了问题。 I used utility called Paster which generates package structure, including setup.py and setup.cfg files among others. 我使用了称为Paster的实用程序,该实用程序会生成包结构,包括setup.pysetup.cfg文件。 My utility hasn't been updated in a while and meanwhile submission rules to PyPi have changed. 我的实用程序已经有一段时间没有更新了,与此同时,向PyPi提交的规则也发生了变化。 It now requires certain setup.py structure and unless it passes via pip , it's labeled as development version - which pip does not install without --pre argument. 现在,它需要某些setup.py结构,除非它通过pip传递,否则它将被标记为开发版本-如果没有--pre参数,则不会安装该pip。

So I just went to PyPi pages and looked at setup.py tutorial, did it their way and now it works. 因此,我只是转到PyPi页面,并查看了setup.py教程,按原样进行操作,现在可以使用了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM