GithubHelp home page GithubHelp logo

mosquito / pypi-server Goto Github PK

View Code? Open in Web Editor NEW
118.0 9.0 39.0 1.19 MB

Tornado based server like pypi.python.org. With caching from pypi.

License: MIT License

Python 76.98% CSS 1.27% JavaScript 8.58% HTML 10.81% Makefile 1.38% Dockerfile 0.99%
pypi python package-manager xml-rpc-api simple-api postgresql angular frontend-app

pypi-server's Introduction

PYPI Server

image

Latest Version

image

image

image

Fast asynchronous pypi server implementation.

What is this?

pypi.python.org - is a global package repository of the python packages. This package is a self-hosted pypi service with caching functionallity from the global pypi.

HTTP proxy can't work with XML-RPC of pypi.python.org.

Screenshots

image

image

image

Features

Supports right now:

  • Caching packages from global-pypi
  • Serving own packages (registering and updating)
  • Password authentication for registering and uploading
  • Supported Databases:
    • Postgresql
    • Mysql (mariadb)
    • sqlite3 (only for development)

Installation

Docker

Use docker image and following docker-compose.yml (uses postgresql):

version: '2'

services:
  db:
    image: postgres
    environment:
      POSTGRES_PASSWORD: pypi-server
      POSTGRES_USER: pypi-server
      POSTGRES_DB: pypi-server
    volumes:
      - ./postgresql:/var/lib/postgresql/data

  pypi_server:
    image: mosquito/pypi-server:latest
    links:
      - db
    restart: always
    ports:
      - 8080:80
    volumes:
      - ./packages:/var/lib/pypi-server
    environment:
      # Database URL. Use `sqlite3:///` or `mysql://` when needed
      DB: "postgres://pypi-server:pypi-server@db/pypi-server"

      ## By default random
      #SECRET: changeme

      ## Override standard port
      #PORT: 80

      ## Set "X-Headers" (e.g. X-Forwarded-For)
      #PROXY_MODE: 1

      ## Set 0 when you want to disable proxying from global pypi
      #PYPI_PROXY: 1

      ## Tread-pool size (default cpu_count * 2)
      #POOL_SIZE: 4

      ## Maximum proxy clients count
      #MAX_CLIENTS: 25

      ## PYPI server url
      #PYPY_SERVER: https://pypi.python.org

Centos

Use prepared Centos 7 rpm from releases.

Manual installation:

# Install compillers
yum groupinstall -y "Development tools"

# Install dependency headers
yum install -y python-pip python-devel libxml2-devel libxslt-devel libffi-devel

# Install the database library headers (if you use postgresql)
yum install -y libpqxx-devel

Debian (Ubuntu)

Use prepared deb files from releases.

Manual installation:

# Install compillers
apt-get install -y build-essential
apt-get install -y python-dev python-pip libxml2-dev libxslt-dev libffi-dev
apt-get install -y libpq-dev

Install pypi-server:

pip install pypi-server

If you want to support postgres or mysql database:

pip install 'pypi-server[postgres]' # or 'pypi-server[mysql]'

Default admin login password is: admin admin

How to upload your own package ---------------------------

  1. Make sure that your package setup.py file is correct. Check reference at https://packaging.python.org/distributing/
  2. Create at home directory .pypirc (Note: If your pypi-server is running at http://pip.example.com:8088, the upload URL will be http://pip.example.com:8088/pypi)
[distutils]
index-servers =
    mypypi

[mypypi]
repository=http://pip.example.com:8088/pypi
username=admin
password=admin
  1. Make bundle, register package at your pypi-server and upload package:
cd your_package_root_folder
python setup.py sdist register upload -r mypypi

How to download your package

pip install -i http://pip.example.com:8088/simple --trusted-host pip.example.com  my-package-name

If you want to configure pip to always pull from http://pip.example.com:8088 (which, since pypi-server proxies to pypi.org if it doesn't have a package, probably is what you want to do), you can make a pip.conf

cat ~/.pip/pip.conf
[global]
index-url = http://pip.example.com:8088/simple/

If you don't have an SSL cert for your PyPi server, you probably want to also tell pip to trust that domain anyway,

cat ~/.pip/pip.conf
[global]
index-url = http://pip.example.com:8088/simple/

[install]
trusted-host=pip.example.com

pypi-server's People

Contributors

darkon3-1 avatar devalv avatar guydou avatar hemantkashniyal avatar janeturueva avatar jgiannuzzi avatar mosquito avatar sam-writer avatar uda avatar vlanse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pypi-server's Issues

Default Sqlite metadata database doesn't use configured --storage directory

If using the --storage option, and defaulting to Sqlite database, the metadata.db file is always created as packages/metadata.db regardless of what --storage path was specified.

Using the STORAGE environment places the metadata file into the specified directory.

The reason is that the database options definition uses the default_storage path, which will default to packages unless STORAGE is set, but since the options aren't parsed yet, the --storage value is ignored.

As a user, this is a little surprising -- I'd expected STORAGE and --storage to have the same effect.

I think the best solution would be to defer constructing the database URL until after options parsing, in server.py?

Can't apply all migrations when starting in docker

I used the example docker-compose.yml file, and I get the following error during startup of the pypi container:

pypi_server_1  | [I 191115 13:03:59 __init__:69] Database initialized as 'pypi-server'. Checking migrations...
pypi_server_1  | [I 191115 13:03:59 actions:19] Applying migration: "create_tables.create_users"
pypi_server_1  | [I 191115 13:03:59 actions:19] Applying migration: "create_default_user.create_default_user"
pypi_server_1  | [I 191115 13:03:59 actions:19] Applying migration: "create_package_tables.create_package"
pypi_server_1  | [I 191115 13:03:59 actions:19] Applying migration: "create_package_tables.create_package_version"
pypi_server_1  | [I 191115 13:03:59 actions:19] Applying migration: "create_package_tables.create_package_file"
pypi_server_1  | [I 191115 13:03:59 actions:19] Applying migration: "packagefile_add_url_and_fetched.add_url_fileld"
pypi_server_1  | [I 191115 13:03:59 actions:19] Applying migration: "packagefile_add_url_and_fetched.add_fetched_fileld"
pypi_server_1  | [I 191115 13:03:59 actions:19] Applying migration: "packagefile_basename_unique.add_uniquie_basename_index"
db_1           | 2019-11-15 13:03:59.813 UTC [70] ERROR:  relation "packagefile_basename" already exists
db_1           | 2019-11-15 13:03:59.813 UTC [70] STATEMENT:  CREATE UNIQUE INDEX "packagefile_basename" ON "packagefile" ("basename")
pypi_server_1  | [E 191115 13:03:59 actions:26] Migration failed.
pypi_server_1  | [E 191115 13:03:59 actions:27] relation "packagefile_basename" already exists
pypi_server_1  |     Traceback (most recent call last):
pypi_server_1  |       File "/usr/share/python/app/lib/python3.7/site-packages/pypi_server/db/migrator/actions.py", line 20, in migrate_db
pypi_server_1  |         migration(migrator, DB)
pypi_server_1  |       File "/usr/share/python/app/lib/python3.7/site-packages/pypi_server/db/migrator/migrations/005_packagefile_basename_unique.py", line 11, in add_uniquie_basename_index
pypi_server_1  |         migrator.add_index('packagefile', ('basename',), True)
pypi_server_1  |       File "/usr/share/python/app/lib/python3.7/site-packages/playhouse/migrate.py", line 717, in migrate
pypi_server_1  |         operation.run()
pypi_server_1  |       File "/usr/share/python/app/lib/python3.7/site-packages/playhouse/migrate.py", line 144, in run
pypi_server_1  |         getattr(self.migrator, self.method)(*self.args, **kwargs))
pypi_server_1  |       File "/usr/share/python/app/lib/python3.7/site-packages/playhouse/migrate.py", line 133, in _handle_result
pypi_server_1  |         self.execute(result)
pypi_server_1  |       File "/usr/share/python/app/lib/python3.7/site-packages/playhouse/migrate.py", line 129, in execute
pypi_server_1  |         self.migrator.database.execute_sql(sql, params)
pypi_server_1  |       File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3830, in execute_sql
pypi_server_1  |         cursor.execute(sql, params or ())
pypi_server_1  |     psycopg2.errors.DuplicateTable: relation "packagefile_basename" already exists
pypi_server_1  |     
pypi_server_1  | [C 191115 13:03:59 server:204] Exception on main loop:
pypi_server_1  | [E 191115 13:03:59 server:205] relation "packagefile_basename" already exists
pypi_server_1  |     Traceback (most recent call last):
pypi_server_1  |       File "/usr/share/python/app/lib/python3.7/site-packages/pypi_server/server.py", line 158, in run
pypi_server_1  |         io_loop.run_sync(lambda: init_db(options.database))
pypi_server_1  |       File "/usr/share/python/app/lib/python3.7/site-packages/tornado/ioloop.py", line 458, in run_sync
pypi_server_1  |         return future_cell[0].result()
pypi_server_1  |       File "/usr/share/python/app/lib/python3.7/site-packages/tornado/concurrent.py", line 238, in result
pypi_server_1  |         raise_exc_info(self._exc_info)
pypi_server_1  |       File "<string>", line 4, in raise_exc_info
pypi_server_1  |       File "/usr/share/python/app/lib/python3.7/site-packages/tornado/ioloop.py", line 436, in run
pypi_server_1  |         result = func()
pypi_server_1  |       File "/usr/share/python/app/lib/python3.7/site-packages/pypi_server/server.py", line 158, in <lambda>
pypi_server_1  |         io_loop.run_sync(lambda: init_db(options.database))
pypi_server_1  |       File "/usr/share/python/app/lib/python3.7/site-packages/pypi_server/db/__init__.py", line 91, in init_db
pypi_server_1  |         migrate_db(DB, Migrations, migrator)
pypi_server_1  |       File "/usr/share/python/app/lib/python3.7/site-packages/pypi_server/db/migrator/actions.py", line 20, in migrate_db
pypi_server_1  |         migration(migrator, DB)
pypi_server_1  |       File "/usr/share/python/app/lib/python3.7/site-packages/pypi_server/db/migrator/migrations/005_packagefile_basename_unique.py", line 11, in add_uniquie_basename_index
pypi_server_1  |         migrator.add_index('packagefile', ('basename',), True)
pypi_server_1  |       File "/usr/share/python/app/lib/python3.7/site-packages/playhouse/migrate.py", line 717, in migrate
pypi_server_1  |         operation.run()
pypi_server_1  |       File "/usr/share/python/app/lib/python3.7/site-packages/playhouse/migrate.py", line 144, in run
pypi_server_1  |         getattr(self.migrator, self.method)(*self.args, **kwargs))
pypi_server_1  |       File "/usr/share/python/app/lib/python3.7/site-packages/playhouse/migrate.py", line 133, in _handle_result
pypi_server_1  |         self.execute(result)
pypi_server_1  |       File "/usr/share/python/app/lib/python3.7/site-packages/playhouse/migrate.py", line 129, in execute
pypi_server_1  |         self.migrator.database.execute_sql(sql, params)
pypi_server_1  |       File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3830, in execute_sql
pypi_server_1  |         cursor.execute(sql, params or ())
pypi_server_1  |     psycopg2.errors.DuplicateTable: relation "packagefile_basename" already exists
pypi_server_1  |     

404 error while uploading package

Hi guys!

I can't understand what is wrong:

my .pypirc

[distutils]
index-servers =
  pserver


[pserver]
repository: http://123.12.12.12:8050/pypi
username: user
password: password

I use an external DB and run server as a docker container:

docker run -p 8050:80 --restart=always -v /home/ubuntu/pypackages:/var/lib/pypi-server -e 'postgres://[email protected]/pypi_server' -d mosquito/pypi-server:latest

Then I run python setup.py sdist register upload -r pserver and got error:

Submitting dist/mypackage-1.0.0.tar.gz to http://123.12.12.12:8050/pypi
Upload failed (404): Not Found
error: Upload failed (404): Not Found

The server log:

[W 200828 16:21:23 httputil:774] multipart/form-data missing headers
[I 200828 16:21:23 package:242] Calling action: file_upload
[W 200828 16:21:24 web:2064] 404 POST /pypi (172.31.25.168) 515.85ms

Mysql does not work

I tried to set up this container with mysql database and could not make it work.

My dockerfile:

version: '3.7'
services:
  db:
    image: mysql:${MYSQL_VERSION}
    restart: always
    environment:
      MYSQL_DATABASE: pypi-server
      MYSQL_USER: pypi-user
      MYSQL_PASSWORD: ${DB_USER_PASSWORD}
      MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
    volumes:
      - "pypi-data:/var/lib/mysql:rw"
    ports:
      - 49997:3306
    networks:
      pypi-network: {}
  server:
    image: mosquito/pypi-server:${PYPI_VERSION}
    restart: always
    environment:
      DB: "mysql://pypi-user:${DB_USER_PASSWORD}@db/pypi-server"
      PYPI_SERVER: https://pypi.python.org
    volumes:
      - ./packages:/var/lib/pypi-server
    ports:
      - 49996:80
    networks:
      pypi-network: {}
networks:
  pypi-network:
    driver: bridge
    # Need this to set firewalls on my system
    ipam:
      config:
        - subnet: 192.168.31.0/24
volumes:
  pypi-data:

My .env file for docker-compose looks something like this:

MYSQL_VERSION=8.0.25
PYPI_VERSION=0.4.10
... (the rest of the file removed)

Error I am getting is this:

[I 210720 07:58:38 __init__:52] Database initialized as 'pypi-server'. Checking migrations...
[C 210720 07:58:38 server:204] Exception on main loop:
[E 210720 07:58:38 server:205] MySQLdb or PyMySQL must be installed.
    Traceback (most recent call last):
      File "/usr/share/python/app/lib/python3.7/site-packages/pypi_server/server.py", line 158, in run
        io_loop.run_sync(lambda: init_db(options.database))
      File "/usr/share/python/app/lib/python3.7/site-packages/tornado/ioloop.py", line 458, in run_sync
        return future_cell[0].result()
      File "/usr/share/python/app/lib/python3.7/site-packages/tornado/concurrent.py", line 238, in result
        raise_exc_info(self._exc_info)
      File "<string>", line 4, in raise_exc_info
      File "/usr/share/python/app/lib/python3.7/site-packages/tornado/ioloop.py", line 436, in run
        result = func()
      File "/usr/share/python/app/lib/python3.7/site-packages/pypi_server/server.py", line 158, in <lambda>
        io_loop.run_sync(lambda: init_db(options.database))
      File "/usr/share/python/app/lib/python3.7/site-packages/pypi_server/db/__init__.py", line 90, in init_db
        DB.create_tables([Migrations], safe=True)
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3917, in create_tables
        create_model_tables(models, fail_silently=safe)
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 5356, in create_model_tables
        m.create_table(**create_table_kwargs)
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 5028, in create_table
        if fail_silently and cls.table_exists():
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 5024, in table_exists
        return cls._meta.db_table in cls._meta.database.get_tables(**kwargs)
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 4321, in get_tables
        return [row for row, in self.execute_sql('SHOW TABLES')]
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3828, in execute_sql
        cursor = self.get_cursor()
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3774, in get_cursor
        return self.get_conn().cursor()
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3763, in get_conn
        self.connect()
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3738, in connect
        self._local.conn = self._create_connection()
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3768, in _create_connection
        return self._connect(self.database, **self.connect_kwargs)
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 4310, in _connect
        raise ImproperlyConfigured('MySQLdb or PyMySQL must be installed.')
    peewee.ImproperlyConfigured: MySQLdb or PyMySQL must be installed.

I believe this is caused by the docker container not having all dependencies installed, but am not sure.

P.S.: I also tried to use Postgres configuration, but am consistently getting #45 , basically this container does not seem to be operating well with any of the database systems which I would put close to production.

405 Method Not allowed

When uploading a package using python setup.py sdist upload -r mypypi I get:

Submitting dist/mydist-1.0.3.dev0.tar.gz to http://my.pypi.domain/
Upload failed (405): Method Not Allowed

The server log shows:

[W 171106 16:05:26 httputil:774] multipart/form-data missing headers
[W 171106 16:05:26 web:2063] 405 POST / (10.10.10.10) 2.77ms

I tried this with several packages, even official ones, just to be sure - not a single one passes :-(

Change ownership of a local package?

Hello!

We've been using pypi-server in-house for a while and it works great! Thanks a lot for this. Now, an owner of a in-house package as left the company. I would like to change ownership to someone else. Is that possible?

The main PyPi site now has the feature called "Collaborators" that seems to allow it. Are there plans for something like that here?

Thanks again!

Running into Kubernetes

Hi,

I am playing around with the pypi-server inside a Kubernetes pod.
So far it seems to be working I am able to access to the interface create user etc .... I redirect the port 80 => 32006
When I try http://x.x.x.x:32006/simple/ it's working fine

But each time I try to register / upload a wheel I have an error 404, any idea what I am missing ?

Uploading xxxx-cp38-cp38-manylinux1_x86_64.whl
100% โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 75.8/75.8 kB โ€ข 00:00 โ€ข 261.0 MB/s
INFO     Response from http://x.x.x.x:32006/pipy/:
         404 Not Found
INFO     <html><title>404: Not Found</title><body>404: Not Found</body></html>
ERROR    HTTPError: 404 Not Found from http://x.x.x.x:32006/pipy/
         Not Found

ImportError: cannot import name gensalt

After installing pypi-server and pypi-server[postgres] I get the error when running pypi-server command:
ImportError: cannot import name gensalt

Stack trace:

Traceback (most recent call last):
  File "/home/my_home/environments/.env2/bin/pypi-server", line 7, in <module>
    from pypi_server.server import run
  File "/home/my_home/environments/.env2/local/lib/python2.7/site-packages/pypi_server/server.py", line 20, in <module>
    from pypi_server.handlers.pypi.proxy.client import PYPIClient
  File "/home/my_home/environments/.env2/local/lib/python2.7/site-packages/pypi_server/handlers/__init__.py", line 44, in <module>
    import pypi_server.handlers.pypi
  File "/home/my_home/environments/.env2/local/lib/python2.7/site-packages/pypi_server/handlers/pypi/__init__.py", line 2, in <module>
    from pypi_server.handlers.pypi import simple
  File "/home/my_home/environments/.env2/local/lib/python2.7/site-packages/pypi_server/handlers/pypi/simple/__init__.py", line 2, in <module>
    from pypi_server.handlers.pypi.simple.packages import PackagesHandler
  File "/home/my_home/environments/.env2/local/lib/python2.7/site-packages/pypi_server/handlers/pypi/simple/packages.py", line 9, in <module>
    from pypi_server.db.packages import Package, PackageVersion, PackageFile
  File "/home/my_home/environments/.env2/local/lib/python2.7/site-packages/pypi_server/db/__init__.py", line 17, in <module>
    from .migrator.model import Migrations
  File "/home/my_home/environments/.env2/local/lib/python2.7/site-packages/pypi_server/db/migrator/__init__.py", line 22, in <module>
    import pypi_server.db.migrator.migrations
  File "/home/my_home/environments/.env2/local/lib/python2.7/site-packages/pypi_server/db/migrator/migrations/__init__.py", line 32, in <module>
    sys.modules["{}.{}".format(__name__, mod.name)] = imp.load_source(mod.name, mod.path)
  File "/home/my_home/environments/.env2/local/lib/python2.7/site-packages/pypi_server/db/migrator/migrations/001_create_tables.py", line 3, in <module>
    from pypi_server.db.users import Users
  File "/home/my_home/environments/.env2/local/lib/python2.7/site-packages/pypi_server/db/users.py", line 5, in <module>
    from playhouse.fields import gensalt, hashpw
ImportError: cannot import name gensalt

login error

 [E 180719 09:02:59 web:1591] Uncaught exception POST /api/v1/login (xxx.xxx.xx.xxx)
     .... 
     Traceback (most recent call last):
       File "/usr/lib/python2.7/site-packages/tornado/web.py", line 1512, in _execute
         result = yield result
       File "/usr/lib/python2.7/site-packages/tornado/gen.py", line 1055, in run
         value = future.result()
       File "/usr/lib/python2.7/site-packages/concurrent/futures/_base.py", line 455, in result
         return self.__get_result()
       File "/usr/lib/python2.7/site-packages/concurrent/futures/thread.py", line 63, in run
         result = self.fn(*self.args, **self.kwargs)
       File "/usr/lib/python2.7/site-packages/pypi_server/handlers/api/login.py", line 86, in post
         user = Users.check(login, password)
       File "/usr/lib/python2.7/site-packages/pypi_server/db/users.py", line 77, in check
         user = user[0] if user else None
       File "/usr/lib/python2.7/site-packages/peewee.py", line 3298, in __len__
         return len(self.execute())
       File "/usr/lib/python2.7/site-packages/peewee.py", line 3274, in execute
         self._qr = ResultWrapper(model_class, self._execute(), query_meta)
       File "/usr/lib/python2.7/site-packages/peewee.py", line 2939, in _execute
         return self.database.execute_sql(sql, params, self.require_commit)
       File "/usr/lib/python2.7/site-packages/peewee.py", line 3837, in execute_sql
         self.commit()
       File "/usr/lib/python2.7/site-packages/peewee.py", line 3656, in __exit__
         reraise(new_type, new_type(*exc_args), traceback)
       File "/usr/lib/python2.7/site-packages/peewee.py", line 3828, in execute_sql
         cursor = self.get_cursor()
       File "/usr/lib/python2.7/site-packages/peewee.py", line 3774, in get_cursor
         return self.get_conn().cursor()
     InterfaceError: connection already closed
 [E 180719 09:02:59 web:2064] 500 POST /api/v1/login (xxx.xxx.xx.xxx) 92.30ms

peewee dependency breaks with v3.x

peewee has recently (Jan 2018) moved to v3.x, and in the process has removed JSONField from playground/kv.py. peewee-2.10.2 (last of the 2.x) works; peewee-3.1.2 (current) does not.

Changing the setup.py install_required to use peewee<3.0 rather than just peewee should (temporarily) solve the problem, but I guess it might be better to figure out what's going on with JSONField going forward ...

Invalid multipart/form-data: no final boundary

Hey hey!

Running the latest version in docker and having some troubles to upload packages.

using poetry

$ poetry publish -r mypypi
...
[UploadError]
HTTP Error 404: Not Found

using twine

twine upload --repository-url=http://1.2.3.4/pypi -u admin -p admin dist/package-py3-none-any.whl
Uploading distributions to http://1.2.3.4:8081/pypi
Uploading package-py3-none-any.whl
100%| 10.9k/10.9k [00:00<00:00, 104kB/s]
HTTPError: 404 Client Error: Not Found for url: http://1.2.3.4:8081/pypi

pypi-server output

# poetry
pypi_server_1  | [W 200727 12:07:47 httputil:766] Invalid multipart/form-data: no final boundary
pypi_server_1  | [I 200727 12:07:47 package:242] Calling action: file_upload
pypi_server_1  | [W 200727 12:07:47 web:2064] 404 POST /pypi (10.64.12.21) 99.51ms
# twine
pypi_server_1  | [W 200727 12:09:18 httputil:766] Invalid multipart/form-data: no final boundary
pypi_server_1  | [I 200727 12:09:18 package:242] Calling action: file_upload
pypi_server_1  | [W 200727 12:09:18 web:2064] 404 POST /pypi (10.64.12.21) 97.66ms

do you have any ideas on this? thank you!

Authentication for listing/downloading

Is it possible to allow/disallow users to see/download some particular local packages? That will be great, looking to move from pypiserver to pypi-server

Cannot upload package

I've seen related issues #17 and #25 but I recently upgraded the system to Ubuntu 19.10 and have a docker of the pypi-server running. For some reason I cant upload to it anymore. It was working fine before. I get the following error:

HTTPError: 405 Client Error: Method Not Allowed for url: http://192.168.57.114:5556/

My server forwards to port 5556.

This is what my ~/.pypirc looks like:

[distutils]
index-servers =
    mypypi

[mypypi]
repository=http://192.168.57.114:5556/pypi
username=my_username
password=my_password

Am I missing something here?

Newest Image is not working

Hello,

when I start the new Image I get following log messages:

/usr/bin/env: 'python2.7': No such file or directory

Best regards
Marcus

Cannot install package from server

So I have managed to setup the server and uploaded a package called test-pkg. It is visible both on the server filesystem and in the web interface.

I'm trying to install the package with pip3 but keep failing. I'm running

pip3 install -i http://x.x.x.x:8080/pypi --trusted-host x.x.x.x test-pkg --verbose

And get back:

Collecting test-pkg
  1 location(s) to search for versions of test-pkg:
  * http://X.X.X.X:8080/packages/test-pkg/
  Getting page http://X.X.X.X:8080/packages/test-pkg/
  Starting new HTTP connection (1): X.X.X.X
  http://X.X.X.X:8080 "GET /packages/test-pkg/ HTTP/1.1" 404 69
  Could not fetch URL http://X.X.X.X:8080/packages/test-pkg/: 404 Client Error: Not Found for url: http://X.X.X.X:8080/packages/test-pkg/ - skipping
  Could not find a version that satisfies the requirement test-pkg (from versions: )
Cleaning up...
No matching distribution found for test-pkg
Exception information:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 353, in run
    wb.build(autobuilding=True)
  File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
    require_hashes
  File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 278, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/usr/lib/python2.7/dist-packages/pip/index.py", line 514, in find_requirement
    'No matching distribution found for %s' % req
DistributionNotFound: No matching distribution found for test-pkg

I've tried every combination I could think of for the url and I always get the same error.

The last thing logged on the server is:

Jul 03 16:35:48 app02 pypi-server[15035]: [W 190703 16:35:48 web:2064] 404 GET /pypi/test-pkg/ (x.x.x.x) 0.31ms

macOS Catalina: Docker file does not allow bind-mount.

I have followed your instructions using docker-compose however I am running into ERRORS.

ERROR: Encountered errors while bringing up the project.

When I uses volumes instead of bind mount the docker-compose runs successfully.
However when I try to upload packages to the server I do get "HTTPError: 405 Method Not Allowed ..." error messages when executing python3 -m twine upload --repository private-repository dist/* where private-repository is set correctly to the pypi-sever... (its loading and the admin login works.

Do you have a recommendation how the "Method not allowed can be fixed"?

I apologize if I am asking the obvious, however I am a (docker) newbie.

Software crashes time to time

Hello,

sometimes the pypi-server crashes with following exception. This happens when I upload a new version of a package over setup.py. But this happens only when the server was running over some time. When I restart the cotainer it works all well again.

BR Marcus

[I 190705 12:47:38 client:53] Remote PYPI index updated: 186248 packages,
[W 190705 13:21:50 httputil:774] multipart/form-data missing headers,
[I 190705 13:21:50 package:242] Calling action: file_upload,
[E 190705 13:21:50 base:36] connection already closed,
    Traceback (most recent call last):,
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3830, in execute_sql,
        cursor.execute(sql, params or ()),
    psycopg2.OperationalError: server closed the connection unexpectedly,
    	This probably means the server terminated abnormally,
    	before or while processing the request.,
    ,
    ,
    During handling of the above exception, another exception occurred:,
    ,
    Traceback (most recent call last):,
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3849, in rollback,
        self.get_conn().rollback(),
    psycopg2.InterfaceError: connection already closed,
    ,
    During handling of the above exception, another exception occurred:,
    ,
    Traceback (most recent call last):,
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3833, in execute_sql,
        self.rollback(),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3849, in rollback,
        self.get_conn().rollback(),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3656, in __exit__,
        reraise(new_type, new_type(*exc_args), traceback),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 135, in reraise,
        raise value.with_traceback(tb),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3849, in rollback,
        self.get_conn().rollback(),
    peewee.InterfaceError: connection already closed,
    ,
    During handling of the above exception, another exception occurred:,
    ,
    Traceback (most recent call last):,
      File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run,
        result = self.fn(*self.args, **self.kwargs),
      File "/usr/share/python/app/lib/python3.7/site-packages/pypi_server/handlers/pypi/package.py", line 123, in check_password,
        user = Users.check(login, password),
      File "/usr/share/python/app/lib/python3.7/site-packages/pypi_server/db/users.py", line 77, in check,
        user = user[0] if user else None,
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3298, in __len__,
        return len(self.execute()),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3274, in execute,
        self._qr = ResultWrapper(model_class, self._execute(), query_meta),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 2939, in _execute,
        return self.database.execute_sql(sql, params, self.require_commit),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3837, in execute_sql,
        self.commit(),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3656, in __exit__,
        reraise(new_type, new_type(*exc_args), traceback),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 135, in reraise,
        raise value.with_traceback(tb),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3833, in execute_sql,
        self.rollback(),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3849, in rollback,
        self.get_conn().rollback(),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3656, in __exit__,
        reraise(new_type, new_type(*exc_args), traceback),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 135, in reraise,
        raise value.with_traceback(tb),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3849, in rollback,
        self.get_conn().rollback(),
    peewee.InterfaceError: connection already closed,
[E 190705 13:21:50 web:1591] Uncaught exception POST /pypi (1.2.3.4),
    HTTPServerRequest(protocol='https', host='pypi.domain.com', method='POST', uri='/pypi', version='HTTP/1.1', remote_ip='1.2.3.4', headers={'Host': 'pypi.domain.com', 'User-Agent': 'Python-urllib/3.6', 'Content-Length': '25537', 'Accept-Encoding': 'identity', 'Authorization': 'Basic xxx==', 'Content-Type': 'multipart/form-data; boundary=--------------GHSKFJDLGDS7543FJKLFHRE75642756743254', 'X-Forwarded-For': '1.2.3.4', 'X-Forwarded-Host': 'pypi.domain.com', 'X-Forwarded-Port': '443', 'X-Forwarded-Proto': 'https', 'X-Forwarded-Server': '1abaf1dbe971', 'X-Real-Ip': '1.2.3.4'}),
    Traceback (most recent call last):,
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3830, in execute_sql,
        cursor.execute(sql, params or ()),
    psycopg2.OperationalError: server closed the connection unexpectedly,
    	This probably means the server terminated abnormally,
    	before or while processing the request.,
    ,
    ,
    During handling of the above exception, another exception occurred:,
    ,
    Traceback (most recent call last):,
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3849, in rollback,
        self.get_conn().rollback(),
    psycopg2.InterfaceError: connection already closed,
    ,
    During handling of the above exception, another exception occurred:,
    ,
    Traceback (most recent call last):,
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3833, in execute_sql,
        self.rollback(),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3849, in rollback,
        self.get_conn().rollback(),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3656, in __exit__,
        reraise(new_type, new_type(*exc_args), traceback),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 135, in reraise,
        raise value.with_traceback(tb),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3849, in rollback,
        self.get_conn().rollback(),
    peewee.InterfaceError: connection already closed,
    ,
    During handling of the above exception, another exception occurred:,
    ,
    Traceback (most recent call last):,
      File "/usr/share/python/app/lib/python3.7/site-packages/tornado/web.py", line 1512, in _execute,
        result = yield result,
      File "/usr/share/python/app/lib/python3.7/site-packages/tornado/gen.py", line 1055, in run,
        value = future.result(),
      File "/usr/share/python/app/lib/python3.7/site-packages/tornado/concurrent.py", line 238, in result,
        raise_exc_info(self._exc_info),
      File "<string>", line 4, in raise_exc_info,
      File "/usr/share/python/app/lib/python3.7/site-packages/tornado/gen.py", line 1063, in run,
        yielded = self.gen.throw(*exc_info),
      File "/usr/share/python/app/lib/python3.7/site-packages/pypi_server/handlers/pypi/package.py", line 243, in post,
        yield maybe_future(method()),
      File "/usr/share/python/app/lib/python3.7/site-packages/tornado/gen.py", line 1055, in run,
        value = future.result(),
      File "/usr/share/python/app/lib/python3.7/site-packages/tornado/concurrent.py", line 238, in result,
        raise_exc_info(self._exc_info),
      File "<string>", line 4, in raise_exc_info,
      File "/usr/share/python/app/lib/python3.7/site-packages/tornado/gen.py", line 1063, in run,
        yielded = self.gen.throw(*exc_info),
      File "/usr/share/python/app/lib/python3.7/site-packages/pypi_server/handlers/pypi/package.py", line 146, in wrap,
        self.current_user = yield check_password(username, password),
      File "/usr/share/python/app/lib/python3.7/site-packages/tornado/gen.py", line 1055, in run,
        value = future.result(),
      File "/usr/lib/python3.7/concurrent/futures/_base.py", line 425, in result,
        return self.__get_result(),
      File "/usr/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result,
        raise self._exception,
      File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run,
        result = self.fn(*self.args, **self.kwargs),
      File "/usr/share/python/app/lib/python3.7/site-packages/pypi_server/handlers/pypi/package.py", line 123, in check_password,
        user = Users.check(login, password),
      File "/usr/share/python/app/lib/python3.7/site-packages/pypi_server/db/users.py", line 77, in check,
        user = user[0] if user else None,
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3298, in __len__,
        return len(self.execute()),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3274, in execute,
        self._qr = ResultWrapper(model_class, self._execute(), query_meta),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 2939, in _execute,
        return self.database.execute_sql(sql, params, self.require_commit),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3837, in execute_sql,
        self.commit(),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3656, in __exit__,
        reraise(new_type, new_type(*exc_args), traceback),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 135, in reraise,
        raise value.with_traceback(tb),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3833, in execute_sql,
        self.rollback(),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3849, in rollback,
        self.get_conn().rollback(),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3656, in __exit__,
        reraise(new_type, new_type(*exc_args), traceback),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 135, in reraise,
        raise value.with_traceback(tb),
      File "/usr/share/python/app/lib/python3.7/site-packages/peewee.py", line 3849, in rollback,
        self.get_conn().rollback(),
    peewee.InterfaceError: connection already closed,
[E 190705 13:21:50 web:2064] 500 POST /pypi (1.2.3.4) 127.42ms,
/usr/share/python/app/lib/python3.7/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.,
  """),

Getting "database is locked" error when attempting to install some packages.

$ pip freeze
backports-abc==0.4
backports.ssl-match-hostname==3.5.0.1
bcrypt==3.1.1
certifi==2016.9.26
cffi==1.8.3
futures==3.0.5
lxml==3.6.4
peewee==2.8.5
psycopg2==2.6.2
pycparser==2.14
pypi-server==0.3.30
singledispatch==3.4.0.3
six==1.10.0
slimurl==0.7.6
tornado==4.4.2
tornado-xmlrpc==1.3

Running server using:

$ pypi-server --address=0.0.0.0

pip configuration (~/.pip/pip.conf):

[global]
index-url = http://<domain here>:8080/simple
trusted-host = <domain here>

Installing package using:

$ pip install coverage

Logged error:

[E 161010 08:52:10 web:1548] Uncaught exception GET /simple/coverage/ (10.10.50.180)
    HTTPServerRequest(protocol='http', host='10.10.50.98:8080', method='GET', uri='/simple/coverage/', version='HTTP/1.1', remote_ip='10.10.50.180', headers={'Accept-Encoding': 'gzip, deflate', 'Host': '10.10.50.98:8080', 'Accept': 'text/html', 'User-Agent': 'pip/8.1.2 {"cpu":"x86_64","distro":{"id":"Twenty Two","libc":{"lib":"glibc","version":"2.2.5"},"name":"Fedora","version":"22"},"implementation":{"name":"CPython","version":"2.7.10"},"installer":{"name":"pip","version":"8.1.2"},"openssl_version":"OpenSSL 1.0.1k-fips 8 Jan 2015","python":"2.7.10","system":{"name":"Linux","release":"4.4.14-200.fc22.x86_64"}}', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=600'})
    Traceback (most recent call last):
      File "/home/sdomkowski/ve/pypi-server/lib/python2.7/site-packages/tornado/web.py", line 1469, in _execute
        result = yield result
      File "/home/sdomkowski/ve/pypi-server/lib/python2.7/site-packages/tornado/gen.py", line 1015, in run
        value = future.result()
      File "/home/sdomkowski/ve/pypi-server/lib/python2.7/site-packages/tornado/concurrent.py", line 237, in result
        raise_exc_info(self._exc_info)
      File "/home/sdomkowski/ve/pypi-server/lib/python2.7/site-packages/tornado/gen.py", line 1021, in run
        yielded = self.gen.throw(*exc_info)
      File "/home/sdomkowski/ve/pypi-server/lib/python2.7/site-packages/pypi_server/handlers/pypi/simple/files.py", line 118, in get
        pkg = yield self.proxy_package(package)
      File "/home/sdomkowski/ve/pypi-server/lib/python2.7/site-packages/tornado/gen.py", line 1015, in run
        value = future.result()
      File "/home/sdomkowski/ve/pypi-server/lib/python2.7/site-packages/tornado/concurrent.py", line 237, in result
        raise_exc_info(self._exc_info)
      File "/home/sdomkowski/ve/pypi-server/lib/python2.7/site-packages/tornado/gen.py", line 1021, in run
        yielded = self.gen.throw(*exc_info)
      File "/home/sdomkowski/ve/pypi-server/lib/python2.7/site-packages/pypi_server/handlers/pypi/simple/files.py", line 162, in proxy_package
        pkg = yield proxy_remote_package(pkg_real_name)
      File "/home/sdomkowski/ve/pypi-server/lib/python2.7/site-packages/tornado/gen.py", line 1015, in run
        value = future.result()
      File "/home/sdomkowski/ve/pypi-server/lib/python2.7/site-packages/tornado/concurrent.py", line 237, in result
        raise_exc_info(self._exc_info)
      File "/home/sdomkowski/ve/pypi-server/lib/python2.7/site-packages/tornado/gen.py", line 1021, in run
        yielded = self.gen.throw(*exc_info)
      File "/home/sdomkowski/ve/pypi-server/lib/python2.7/site-packages/pypi_server/cache.py", line 194, in wrap_gen
        f = gen.throw(e)
      File "/home/sdomkowski/ve/pypi-server/lib/python2.7/site-packages/pypi_server/handlers/pypi/simple/files.py", line 69, in proxy_remote_package
        yield [release_fetch(pkg, release) for release in release_part]
    OperationalError: database is locked
[E 161010 08:52:10 web:1971] 500 GET /simple/coverage/ (10.10.50.180) 11279.90ms

Docker image in dockerhub

It seems that the docker image in Dockerhub is broken:

$ docker run -e DB=mysql://xxxx:zzzzz@host/database -e PORT=8080 -p 8080:8080 mosquito/pypi-server:0.4.7
Traceback (most recent call last):
  File "/usr/bin/pypi-server", line 6, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources

Cloning the repo and running a rebuilt docker image is fine, though.

tornado dependency breaks with v5.0

Tornado has recently released their v5.0, which breaks pypi-server's handlers/pypi/proxy/client.py on line 33 where it constructs AsyncHTTPClient passing in an io_loop parameter. It seems v5.0 doesn't support this parameter any longer.

Changing setup.py to further restrict Tornado to tornado>=4.3,<5.0 should fix it until it can be figured out what Tornado is doing with their event loop.

Tested with v5.0 and v4.5.3.

[C 180307 16:08:10 server:204] Exception on main loop:
[E 180307 16:08:10 server:205] initialize() got an unexpected keyword argument 'io_loop'
    Traceback (most recent call last):
      File "/Users/d/work/hmc/hmops/docker/images/pypi_server/venv36/lib/python3.6/site-packages/pypi_server/server.py", line 185, in run
        handlers.base.BaseHandler.THREAD_POOL
      File "/Users/d/work/hmc/hmops/docker/images/pypi_server/venv36/lib/python3.6/site-packages/pypi_server/handlers/pypi/proxy/client.py", line 33, in configure
        cls.CLIENT = AsyncHTTPClient(io_loop=IOLoop.current())
      File "/Users/d/work/hmc/hmops/docker/images/pypi_server/venv36/lib/python3.6/site-packages/tornado/httpclient.py", line 171, in __new__
        instance = super(AsyncHTTPClient, cls).__new__(cls, **kwargs)
      File "/Users/d/work/hmc/hmops/docker/images/pypi_server/venv36/lib/python3.6/site-packages/tornado/util.py", line 312, in __new__
        instance.initialize(*args, **init_kwargs)
    TypeError: initialize() got an unexpected keyword argument 'io_loop'

XML-RPC error with new pypi-server

Hello!

I've just recently installed the pypi-server for in-house use. When I try to use it from the pip client, I get this from the client:

pip search -i myserver mypackage

ERROR: Exception:
Traceback (most recent call last):
File "/home/keith.dart/venvs/ouster_test/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 178, in main
status = self.run(options, args)
File "/home/keith.dart/venvs/ouster_test/lib/python3.6/site-packages/pip/_internal/commands/search.py", line 48, in run
pypi_hits = self.search(query, options)
File "/home/keith.dart/venvs/ouster_test/lib/python3.6/site-packages/pip/_internal/commands/search.py", line 64, in search
pypi = xmlrpc_client.ServerProxy(index_url, transport)
File "/usr/lib/python3.6/xmlrpc/client.py", line 1418, in init
raise OSError("unsupported XML-RPC protocol")
OSError: unsupported XML-RPC protocol

Any suggestions on how to fix this?

Error while uploading using twine

While uploading, I get the following server error:

[I 200426 03:32:00 http1connection:253] Malformed HTTP message from 192.168.59.13: Content-Length too long

Using the following to upload the whl file
python3 -m twine upload --repository-url=http://x.x.x.x:5555/pypi --verbose -u=user -p=pwd pkg.whl

Package not found

I've successfully uploaded a package, but I can't pip install it. I'm using:
pip3 install mypackage -i https://myserver.domain.com/pypi --verbose and can see that pip is getting a 404 back.

I can see in the pypi-server logs that it logs a 404 when I attempt to install a package.

I'm not too familiar with the intricasies of pip, but shouldn't this work?

value too long for type character

I'm getting this error in pypi-server on some uploads:

File "/usr/lib/python2.7/site-packages/peewee.py", line 3830, in execute_sql
        cursor.execute(sql, params or ())
    DataError: value too long for type character varying(25)

This happens when uploading using twine:

creating build/bdist.linux-x86_64/wheel/rikstvutilsconfighelper-0.3.19_support_custom_secr0.dist-info/WHEEL
Uploading distributions to https://pypi.system.rikstv.no/pypi
Uploading rikstvutilsconfighelper-0.3.19_support_custom_secr0-py2-none-any.whl

  0%|          | 0.00/6.39k [00:00<?, ?B/s]
100%|##########| 6.39k/6.39k [00:00<00:00, 39.9kB/s]
Received "500: Internal Server Error" Package upload appears to have failed.  Retry 1 of 5
Uploading rikstvutilsconfighelper-0.3.19_support_custom_secr0-py2-none-any.whl

Can't get caching to work

Running latest released build, using pip to install packages with this server as the index fails every time. From reading the README, this seems like it should work.

Dependencies

root@2bc019b117ee:/# pip list
backports-abc (0.5)
bcrypt (3.1.4)
certifi (2017.7.27.1)
cffi (1.11.2)
futures (3.1.1)
lxml (4.0.0)
peewee (2.10.2)
pip (9.0.1)
pycparser (2.18)
pypi-server (0.3.30)
setuptools (36.5.0)
singledispatch (3.4.0.3)
six (1.11.0)
slimurl (0.7.8)
tornado (4.5.2)
tornado-xmlrpc (1.4)
virtualenv (15.1.0)
wheel (0.30.0)


root@2bc019b117ee:/# python --version
Python 2.7.14

root@2bc019b117ee:/# pypi-server --address=0.0.0.0 --port=80 --proxy-mode=True --logging=debug --pypi-server=https://pypi.python.org
[D 171011 15:40:57 server:133] Preparing signal handling
[D 171011 15:40:57 server:144] Creating application instance
[D 171011 15:40:57 server:151] Creating IOLoop instance.
[I 171011 15:40:57 __init__:29] Opening sqlite database: /packages/metadata.db
[I 171011 15:40:57 __init__:35] Database initialized as '/packages/metadata.db'. Checking migrations...
[D 171011 15:40:57 peewee:3826] ('SELECT name FROM sqlite_master WHERE type = ? ORDER BY name;', ('table',))
[D 171011 15:40:57 peewee:3826] ('SELECT Count(*) FROM "migrations" AS t1', [])
[D 171011 15:40:57 peewee:3826] ('SELECT "t1"."id" FROM "migrations" AS t1 ORDER BY "t1"."id" DESC', [])
[I 171011 15:40:57 server:161] Init thread pool with 16 threads
[I 171011 15:40:57 server:190] Starting server http://0.0.0.0:80/
[D 171011 15:40:57 server:194] Setting "/packages" as storage
[D 171011 15:40:57 server:197] Starting main loop
[D 171011 15:40:57 cache:180] HIT Cache [pypi_server.handlers.pypi.proxy.client.packages] (-5845601213547787238, 3527539, 3527539, 1)
[W 171011 15:41:02 web:2063] 404 GET /requests/ (172.17.0.1) 0.32ms

pip output

pip install --user -i http://localhost:8080 requests                                                                                                                                              
Collecting requests
Could not find a version that satisfies the requirement requests (from versions: )
No matching distribution found for requests

Specific versions fail too

pip install --user -i http://localhost:8080 requests==2.18.4
Collecting requests==2.18.4
Could not find a version that satisfies the requirement requests==2.18.4 (from versions: )
No matching distribution found for requests==2.18.4

Javascript errors

Started the Docker container as described in the documentation, tried :latest and :0.4.4 - for both it results in Javascript errors when accessing the browser UI:

screen shot 2017-11-06 at 15 04 41

Heads-up about the new (global) PyPI

I'm the project manager for the new Python Package Index (Warehouse), which is currently in pre-production at http://pypi.org/ . On the Warehouse roadmap, it looks like the full switch will happen sometime in April, so here's a heads-up about why we're switching, what's changed, and what to expect.

The legacy PyPI site at https://pypi.python.org started in the early 2000s. In recent years, users faced outages, malicious packages, and spam attacks, and the legacy codebase made it hard to maintain and even harder to develop new features.

The new PyPI has a far more modern look, and is up-to-date under the hood as well; a proper web framework (Pyramid), 100% backend test coverage, and a Docker-based development environment, make it easier for current and new developers to maintain it and add features.

Thanks to Mozilla's Open Source Support funding, developers have added many new features, overhauled infrastructure, and made steady progress towards redirecting traffic to the new site and shutting down the old one. As of the middle of last year, package releases must go through the new PyPI, and as of late February, new user account registration is only available on the new site. The full switch will include redirecting browser and pip install traffic from the old site; then, sometime in late April or early May, the legacy site will be entirely shut down.

Your site/service will probably be able to seamlessly switch to the new site, and thanks to redirects, may not have to change anything immediately. Here's a migration guide.

Some new PyPI features:

  • mobile-responsive UI
  • chronological release history for each project (example)
  • easy-to-read project activity journal for project maintainers
  • better search and filtering
  • support for multiple project URLs (e.g., for a homepage and a repo)
  • user-visible Gravatars and email addresses for maintainers
  • no need to "register" a project before initial upload
  • far better backend infrastructure, reducing the frequency of outages

Things that are going away, or already have (sometimes for policy or spam-fighting reasons), include:

And in the works:

For future updates, please sign up for the low-traffic PyPI announcements email list.

Thank you for integrating with PyPI, and please let us know if you have any questions or problems with the new site!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.