python 如何滚动我自己的pypi?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1235331/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to roll my own pypi?
提问by drue
I would like to run my own internal pypi server, for egg distribution within my organization.
我想运行我自己的内部 pypi 服务器,以便在我的组织内分发鸡蛋。
I have found a few projects, such as:
我找到了一些项目,例如:
As I understand it, pypi.python.org uses software called Cheese Shop.
据我了解,pypi.python.org 使用名为 Cheese Shop 的软件。
My questions:
我的问题:
- Why can't I use cheeseshop itself? (I can't find it, not sure it exists)
- How do other people solve this problem? (Currently we use blushsvn to distribute eggs)
- 为什么我不能使用 cheeseshop 本身?(我找不到它,不确定它是否存在)
- 其他人如何解决这个问题?(目前我们使用blushsvn来分发鸡蛋)
*edit: This seems canonical http://wiki.python.org/moin/PyPiImplementations. Still, I'm interested in feedback.
*编辑:这似乎是规范的http://wiki.python.org/moin/PyPiImplementations。不过,我对反馈很感兴趣。
采纳答案by John Millikin
Update: PyPi is now powered by Warehouse, which is the replacement for Cheese Shop.
更新:PyPi 现在由Warehouse提供支持,它是 Cheese Shop 的替代品。
The source to Cheese Shop can be downloaded from https://bitbucket.org/pypa/pypi/src. There is also an example, from the page you linked to, of using Apache as a "dumb" Python package repository:
Cheese Shop 的源代码可以从https://bitbucket.org/pypa/pypi/src下载。还有一个示例,来自您链接到的页面,使用 Apache 作为“哑”Python 包存储库:
# Mount pypi repositories into URI space
Alias /pypi /var/pypi
# /pypi/dev: Redirect for unknown packages (fallback to pypi)
RewriteCond /var/pypi/dev/ !-d
RewriteCond /var/pypi/dev/ !-f
RewriteRule ^/pypi/dev/([^/]+)/?$ http://pypi.python.org/pypi// [R,L]
RewriteCond /var/pypi/dev// !-f
RewriteRule ^/pypi/dev/([^/]+)/([^/]+)$ http://pypi.python.org/pypi// [R,L]
# /pypi/stable: Redirect for unknown packages (fallback to pypi)
RewriteCond /var/pypi/stable/ !-d
RewriteCond /var/pypi/stable/ !-f
RewriteRule ^/pypi/stable/([^/]+)/?$ http://pypi.python.org/pypi// [R,L]
RewriteCond /var/pypi/stable// !-f
RewriteRule ^/pypi/stable/([^/]+)/([^/]+)$ http://pypi.python.org/pypi// [R,L]
回答by wangeek
For light-weight solution, use pypiserver.
对于轻量级解决方案,请使用pypiserver。
回答by Day
Warehouse
仓库
Warehousewould be your best bet in 2017. From the project's README:
Warehouse将是您 2017 年的最佳选择。来自该项目的 README:
Warehouse is a next generation Python Package Repository designed to replace the legacy code base that currently powers PyPI
Warehouse 是下一代 Python 包存储库,旨在替换当前支持PyPI的遗留代码库
...
...
You can run Warehouse locally using
docker
anddocker-compose
. See Getting startedin the documentation for instructions on how to set it up.
您可以使用
docker
和在本地运行 Warehousedocker-compose
。有关 如何设置的说明,请参阅 文档中的入门。
It is maintained by The Python Packaging Authority (PyPA)who work in cooperation with members of the Python core development team, and there is a live version running at https://pypi.org/which mirrors everything in the legacy PyPI (https://pypi.python.org/).
它由与 Python 核心开发团队成员合作的 Python Packaging Authority (PyPA)维护,并且在https://pypi.org/上运行了一个实时版本,它反映了遗留 PyPI ( https: //pypi.python.org/)。
回答by David
回答by juliocesar
There is a fork of djangopypi named djangopypi2 you can get it from https://github.com/popen2/djangopypi2/, I installed it and works for me, this option is what I had choose from a list of about 24 alternatives that I have found in a recently search, you can see the list here: http://uyeya.blogspot.com/2013/10/list-of-local-alternatives-of-pypi.html
有一个名为 djangopypi2 的 djangopypi 分支,您可以从https://github.com/popen2/djangopypi2/获取它,我安装了它并对我来说有效,这个选项是我从我从大约 24 个替代方案中选择的在最近的搜索中发现,你可以在这里看到列表:http: //uyeya.blogspot.com/2013/10/list-of-local-alternatives-of-pypi.html
回答by tilgovi
Updated: crate.io has shut down and the domain is now something else entirely.
更新:crate.io 已经关闭,域名现在完全是别的东西。
One project that hasn't been mentioned is https://crate.io/, which seems very active. It claims to be a "Next Generation Python Packaging Index", but they have their repositories split nicely into pieces that seem to welcome customization and remixing to your purposes.
一个没有被提及的项目是https://crate.io/,它似乎非常活跃。它声称是“下一代 Python 打包索引”,但他们的存储库很好地分成了几部分,似乎欢迎根据您的目的进行定制和重新混合。
回答by Taras Mankovski
If you would like a lighter solution then deploying an entire pypi server, you could try using a server index generated by basketweaver.
如果您想要更轻松的解决方案,然后部署整个 pypi 服务器,您可以尝试使用由basketweaver生成的服务器索引。
回答by Stefano
Another missing from this (oldish) list:
此(旧)列表中的另一个缺失:
djangopypi
姜戈皮
Django based, which might be a slight overkill, but I love django and it makes it extremely simple to modify it to your need should it not be satisfying.
基于 Django,这可能有点矫枉过正,但我喜欢 django,如果它不令人满意,可以根据需要修改它非常简单。
回答by Stefano
And crate source code is available, though documentation is, least that can be said, not-existent:
并且 crate 源代码是可用的,尽管文档至少可以说是不存在的:
It's a Django Application providing a Python Package Index. Uses a couple other packages from https://github.com/crateioso you might be able to roll out your own version without django.
它是一个提供 Python 包索引的 Django 应用程序。使用来自https://github.com/crateio的几个其他软件包,因此您可以在没有 django 的情况下推出自己的版本。
I'm specifically thinking about a static one, I always thought there should be a very easy way to go explore directly some [pre-configured] repositories and shop cheese directly from my github/bitbucket public and private repos, with just a simple (gunicorn) process running.
我特别在考虑一个静态的,我一直认为应该有一种非常简单的方法可以直接从我的 github/bitbucket 公共和私有存储库中直接探索一些 [预配置] 存储库和购买奶酪,只需一个简单的 ( gunicorn) 进程正在运行。
回答by stuxnetting
I ran into the same problem, and ClueReleaseManagersolved the problem of hosting an internal PyPI server/custom Python repository for me.
我遇到了同样的问题,ClueReleaseManager为我解决了托管内部 PyPI 服务器/自定义 Python 存储库的问题。
That answers question two, and I guess you already have the answer to question one.
这回答了第二个问题,我想你已经有了第一个问题的答案。