50

I would like to run my own internal PyPI server, foregg distribution within my organization.

I have found a few projects, such as:

As I understand it, pypi.python.org uses software called Cheese Shop.

My questions:

  1. Why can't I use Cheese Shop itself? (I can't find it and am not sure it exists)
  2. How do other people solve this problem? (Currently we useblushSVN to distribute 'eggs')

This seems canonical:The Python Wiki,Python Implementations. Still, I'm interested in feedback.

How can I roll my own PyPI?

Peter Mortensen's user avatar
Peter Mortensen
31.4k22 gold badges110 silver badges134 bronze badges
askedAug 5, 2009 at 19:43
drue's user avatar
4
  • The main reason for the clones is that the pypi code is horrible :)CommentedNov 17, 2009 at 22:04
  • We tried to assemble all dependencies in a buildout script @Buildout crate.ioCommentedMay 2, 2013 at 19:47
  • related:stackoverflow.com/q/18052217/611007CommentedApr 23, 2015 at 15:26
  • The second link is broken (plone.org):"This page does not seem to exist…"CommentedFeb 5, 2024 at 23:33

9 Answers9

22

For a lightweight solution, usepypiserver.

Peter Mortensen's user avatar
Peter Mortensen
31.4k22 gold badges110 silver badges134 bronze badges
answeredOct 13, 2012 at 15:46
wangeek's user avatar
Sign up to request clarification or add additional context in comments.

Comments

17

Update: PyPi is now powered byWarehouse, which is the replacement for Cheese Shop.

The source to Cheese Shop can be downloaded fromhttps://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:

# Mount pypi repositories into URI spaceAlias /pypi   /var/pypi# /pypi/dev: Redirect for unknown packages (fallback to pypi)RewriteCond   /var/pypi/dev/$1 !-dRewriteCond   /var/pypi/dev/$1 !-fRewriteRule   ^/pypi/dev/([^/]+)/?$ http://pypi.python.org/pypi/$1/ [R,L]RewriteCond   /var/pypi/dev/$1/$2 !-fRewriteRule   ^/pypi/dev/([^/]+)/([^/]+)$ http://pypi.python.org/pypi/$1/$2 [R,L]# /pypi/stable: Redirect for unknown packages (fallback to pypi)RewriteCond   /var/pypi/stable/$1 !-dRewriteCond   /var/pypi/stable/$1 !-fRewriteRule   ^/pypi/stable/([^/]+)/?$ http://pypi.python.org/pypi/$1/ [R,L]RewriteCond   /var/pypi/stable/$1/$2 !-fRewriteRule   ^/pypi/stable/([^/]+)/([^/]+)$ http://pypi.python.org/pypi/$1/$2 [R,L]
Jacob Tomlinson's user avatar
Jacob Tomlinson
3,8533 gold badges37 silver badges67 bronze badges
answeredAug 6, 2009 at 0:00
John Millikin's user avatar

1 Comment

After investigating all of the available options, I am not satisfied with any of them. However, the apache solution is the simplest, and is what I ended up using, even if it is far from ideal.
9

Warehouse

Warehouse would be your best bet in 2017. From the project's README:

Warehouse is a next generation Python Package Repository designed to replace the legacy code base that currently powersPyPI

...

You can run Warehouse locally usingdocker anddocker-compose. SeeGetting started in the documentation for instructions on how to set it up.

It is maintained byThe Python Packaging Authority (PyPA) who work in cooperation with members of the Python core development team, and there is alive version running athttps://pypi.org/ which mirrors everything in the legacy PyPI (https://pypi.python.org/).

answeredSep 5, 2017 at 20:34
Day's user avatar

1 Comment

I started a small EC2 instance to use as pypi server with 15GB of hard drive. All the containers needed by warehouse didn't fit in that drive!
7

devpi

We are using it in a corporate environment and are pretty satisfied. It supports replication, private indexes and index inheritance.

answeredApr 5, 2018 at 15:53
David's user avatar

2 Comments

How do you guys add more packages to devpi ?
The interface is the same as pypi. You can use twine to upload packages. There are some access settings that need to be enabled in the devpi server though.
5

There is a fork of djangopypi named djangopypi2 you can get it fromhttps://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

answeredOct 7, 2013 at 22:46
juliocesar's user avatar

Comments

2

Updated: crate.io has shut down and the domain is now something else entirely.

One project that hasn't been mentioned ishttps://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.

answeredSep 28, 2012 at 0:40
tilgovi's user avatar

4 Comments

It looks as though the crate.io domain has now been repurposed?
And now that lin is dead :p
@Mark Think I found the GitHub, at least:github.com/crateio/crate.io. Superseded byWarehouse, according toReddit.
This project is no longer under active development.
1

If you would like a lighter solution than deploying an entire PyPI server, you could try using a server index generated bybasketweaver.

Peter Mortensen's user avatar
Peter Mortensen
31.4k22 gold badges110 silver badges134 bronze badges
answeredSep 23, 2009 at 20:14
Taras Mankovski's user avatar

1 Comment

Important to note that BasketWeaverdoesn't have a clue about wheels and that its latest release was in 2009!
-1

Another missing from this (oldish) list:

djangopypi

It is 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.

Peter Mortensen's user avatar
Peter Mortensen
31.4k22 gold badges110 silver badges134 bronze badges
answeredJan 23, 2013 at 8:57
Stefano's user avatar

Comments

-1

And thecrate source code is available, though documentation is, least that can be said, nonexistent:

Crate.Web

It's a Django application providing a Python Package Index. It uses a couple of other packages fromtheCrate repositories, so you might be able to roll out your own version without Django.

I'm specifically thinking about a static one. I always thought there should be a very easy way to go explore directly some [preconfigured] repositories and shop cheese directly from my GitHub orBitbucket public and private repositories, with just a simple (gunicorn) process running.

Peter Mortensen's user avatar
Peter Mortensen
31.4k22 gold badges110 silver badges134 bronze badges
answeredJan 23, 2013 at 9:04
Stefano's user avatar

1 Comment

Sorry just notice that @tilgovi answer was also speaking about the crate source repository, not only the live service atcrate.io, though that's the one which is linked in the answer.

Your Answer

Sign up orlog in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to ourterms of service and acknowledge you have read ourprivacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.