Package: pyshop
Getting StartedPyshop is a private repository for python packages.The aim is to split private projects in distinct private packages and keep a
setup.py clean and working, by declaring all dependencies, exactly as public
packages on PyPI.Pyshop also proxies and caches packages from PyPI safely using SSL and checking server
certificate.Pyshop uses clear and simple ACLs to manage privileges:an installer group that can only download release files,a developer group that can download and upload release files and browse the
website,an admin group that has developer privileges and accounts management.Since pyshop is intended to host private packages, every user, includingpip,
must be authenticated by login and password.InstallationUsing A virtualenv with Python 3$ cd /srv
$ sudo mkdir pyshop
$ sudo chown $(whoami) pyshop
$ cd pyshop
$ pyvenv .
(pyshop)$ source bin/activate
(pyshop)$ pip install "pyshop[waitress]"
(pyshop)$ cp pyshop.sample.ini pyshop.ini
(pyshop)$ vim pyshop.ini  # change at least the pyshop.cookie_key setting
(pyshop)$ pyshop_setup pyshop.ini  # Create the database
(pyshop)$ pserve pyshop.ini        # start pyshop CTRL+C to stopNoteIf you are using python2 and the pyshop you may not have the pyshop.sample.ini file, you can
download it with:(pyshop)$ curl -o pyshop.ini https://raw.githubusercontent.com/mardiros/pyshop/master/pyshop.sample.iniYou should edit the pyshop.ini file in order to configure thepyshop.cookie_keyand the host:port that hosts the service. When the server
is running visit the website, http://localhost:8000/ by default, to check
everything is fine.For production usage, you should create accounts with thedevelopergroup.
Visithttp://localhost:8000/pyshop/userwith the admin account to create
accounts.You also should also use an https reverse proxy. Python packaging core uses
HTTP basic authentication: it sends user/password in clear.The pythop.sample.ini file use waitress as the default WSGI server, but,
if you are familiar with another WSGI server that support paste format,
you could use it.Daemonize with systemd on linuxPyramid 1.8 has removed deamonized optionsyou have to use a process manager.Here is a simple way to daemonise it undex linux that use systemd(pyshop)$ curl -o pyshop.service https://raw.githubusercontent.com/mardiros/pyshop/master/pyshop.sample.service
(pyshop)$ sudo mv pyshop.service /etc/systemd/system/pyshop.serviceNoteyou may edit the pyshop.service file to adapt path in case you install itPyramid 1.8 has removed deamonized options:http://docs.pylonsproject.org/projects/pyramid/en/latest/whatsnew-1.8.html#backwards-incompatibilitiesUsing DockerCurrently, there is an image of pyshop used for development purpose,
it support both MySQL and PostgreSQL. The PostgreSQL integration is
fully operation, you can run a new Pyshop install using docker-compose,
with the command:docker-compose up pgpyshopIt will create the database with the default pyshop users:privileged user:   login admin, password: changemeunprivileged user: login pip, password changemeIf you want to use a different orchestrator, you have to link the postgresql
container to Pyshop container with the name postgresql.localdomainThe MySQL support does not automate the database setup right now.The official Docker image of Pyshop is available here on the Docker Hub:https://registry.hub.docker.com/u/mardiros/pyshop/Configuring your environmentHere are all configuration files you will need to modify for usual python tools
to use your newly deployed private repository.~/.pip/pip.confConfiguration used by pip. This is a user file, you can set a developer or
the generic pip account.[global]
# when mirroring a package, pyshop retrieves information from PyPI and
# stores it in its database. Be patient, it is not so long.
default-timeout = 120
timeout = 120

[install]
index-url = http://pip:changeme@localhost:8000/simple/

[search]
index = http://pip:changeme@localhost:8000/pypiNoteIf you are using a WSGI server that kills requests if it is too long, like
uWSGI or gunicorn, set an appropriate timeout for this service too.NoteThe search funciton is not working with Python 3setup.cfg and pydistutils.cfgsetup.cfg and pydistutils.cfg are used when runningpython setup.py developto install your package or when usingeasy_install. You should use a generic
account with installer privileges only, shared by all developers.This setting can be set per project or in user$HOME(seesetuptools documentationfor details)[easy_install]
index-url = http://pip:changeme@localhost:8000/simple/This should work now:python setup.py develop~/.pypircConfiguration used by setuptools to upload files.
All developers should have this configuration in their$HOMEto upload
packages.[distutils]
index-servers =
    pyshop

[pyshop]
username: admin  # or create an account in pyshop admin interface
password: changeme
repository: http://localhost:8000/simple/This should work now:python setup.py sdist upload -v -r pyshopAlternativespypiserver:https://pypi.python.org/pypi/pypiserverlocalshop:http://pypi.python.org/pypi/localshopdjangopypi:http://pypi.python.org/pypi/djangopypichishop:http://pypi.python.org/pypi/chishopChangelist1.3.0 - Released on 2017-06-29Handle package with hyphen, undescore and dot properly.Implement xmlrpc api for pip search for python 3 and by default.Importantconfiguration must be updated. due to a dependency changes.
replace pyramid_xmlrpc by pyramid_rpc.pyramid.includes =
    ...
    pyramid_rpc.xmlrpc
    ...1.2.5 - Released on 2017-06-03Fix packagingversion used to build 1.2.4 was too old and build a broken package.1.2.4 - Released on 2017-05-30Fix for Python 3Update README / install process for pyramid>=1.8 default to python 31.2.3 - Released on 2016-06-22For ldap accounts, do not copy the ldap password into local dbUse https for XML-RPC calls1.2.2 - Released on 2015-02-16Update pyramid dependencies1.2.1 - Released on 2015-02-15Update requests dependencies1.2.0 - Released on 2015-02-15Implement roles editionFilter package by names, if the input is not a classifierAdd purge option to packages (Chris Powell)Add remove file from disk (Chris Powell)Fix XML-RPC viewFix bugs1.1.1 - Released on 2014-11-04Fix packaging (DeaconDesperado)1.1.0 - Released on 2014-10-31Add support of MySQLUse version sanization regex matching PEP386/440.Fix invalid commit call in LDAP user creation.Do not fetch user from database again while creating it from LDAP
information, it will return the currently being created user due to autoflush
and if other thread was about to do the same, it would be protected from doing
anything wrong by the SQL transaction anyway.Consider LDAP created users as local as well.1.0.2Fix upload of local package with waitressFix creation of the repository directory when creating a local package1.0.1Fix pyshop_setup command with Python 31.0Add compatibility with python 3.3 and 3.4Add ldap support (mgoacolou)Replace scss by bootstrap (mgoacolou)0.9.12Authorize developper to upload a patched version of a mirrored package
without any restriction. Some mirrored package may have bugs that are
critical for you, and it’s better to get a mirrored package than rely
on an external sources.0.9.11Fix support of SQLAlchemy 0.9.xFix packaging (missing LICENSE)0.9.10Fix postgresql admin account pages0.9.8Add support for posgresql0.9.7Remove some links in the simple route.Don’t display home pagesDon’t display download links in case there is archive available.
(That fix some install for south for example)0.9.6Fix mirroring of package when the case and underscore are not “correct”0.9.5Fix mirroring of external links browsed (in case it’s not a package)0.9.4Fix packaging0.9.3Fix tests for python 2.6 (unittest2 required and be installed manually)Fix pyramid 1.2 compatibilityRename command pyshop_install to python_setupGive the possibility to use the prefix_route via the settings ‘pyshop.prefix_route’Give the possibility to disable xmlrpc servive via ‘pyshop.enable_xmlrpc’0.9.2Tolerant underscore/hyphen usage in package nameTolerant with trailing slash in urls0.9.1Fix unit tests0.9add key “pyshop.mirror.cache.ttl” in config file.
This settings allow to set the cache time of a package
before refresh it on pypi.add a button in the web interface to force the refresh of mirrored package.
This permit to force reset the ttl of a package on the web interface.add key “pyshop.upload.rewrite_filename” in config file.
This settings disable the rename of package file uploaded on the server.change “satanize” to “sanitize” keys in config file.
Modify this settings in your config file after a migration.add key “pyshop.mirror.wheelify” in config file.
This settings require users to use recent version of pip and setuptools
virtualenv 1.10.1 is OK. This is experimental.
User and Proxy Server must run the same OS on the same architecture to
use that feature.0.8Use requests for xmlrpc queries too.
- validate certificate if https is used
- unified proxies configuration (use environment vars)SAWarning/DeprecationWarning removed
- Fix mirroring link for external files0.7.6Mirror the download_url of the release fileHandle hiphen and underscore [fizyk]Enhance mimetime handling [fizyk]Bugfixes and DeprecationWarning removed0.7.5Fix package version comparisonHandle bdist_wheel formatTo handle the wheel format, (some package like Twisted 13 use it),
for previous install, you must run a migration script like this.$ pyshop_migrate development.ini 0.7.5The sqlite database file will be altered, YOU MAY backup it before run the
script.0.7.4Fix local package usage (broken since 0.7.1) [fizyk]0.7.3Remove all certificates and extra handling for PyPI validation as PyPI now
uses a certificate that can be validated without these.  [disko]0.7.2Remove unused certificates for pypi validation0.7.1Securize download from pypi by forcing https and validate certificate
pypi.python.org certificate chain is embed in the pyshop packageFix package order on web page0.7Sanitize version number on upload.
This is configurable with settingspyshop.upload.satanizeandpyshop.upload.satanize.regexSettingspyshop.satanizeandpyshop.satanize.regexhave been renamed
topyshop.mirror.satanizeandpyshop.mirror.satanize.regex0.6Fix first connection of the web applicationFix the usage of http proxy (forcing request version)0.5Add Link to display all release versionsImprove navigationFix ugly version number sorting0.4Fix release file upgrade (allow developper to override release file)Rename user views to accountAdd view to let the connected user to update his account0.3The settingpyshop.satanize.reghas been renamed topyshop.satanize.regexThe settingcookie_keyhas been renamed topyshop.cookie_keyFix bug on package upload. don’t close the stream while writing it.Add basic tests on packages view0.2Packaging Issue.0.1Initial version.work with pip, setuptoolsmirror packagesupload packagessecure access with login/passwordcreate/update accountstests for python 2.7 onlycompatible with python 2.6