Package: pyrene
A PY-thon RE-pository NE-twork toolPython packagerepositoriesare nodes in a network.Pyreneis a tool to transferpackagesbetween repositorieswith an easy syntax:
sources and targets are both defined asrepo:packagewith package dependencies, thus the target will be self contained!Pyreneis also an opinionated (read: simple, useful)
configuration tool forpip.InstallationAs an application into a separatevirtualenvusingvirtualenvwrapper:mkvirtualenv app-pyrene
pip install pyrenecreating this link is optional, but let’s us usepyreneoutside its virtualenv:ln -s ~/.virtualenvs/app-pyrene/bin/pyrene ~/binA simple networkThe following simple network is intended to be a working reference setup for Pyrene.Repositories arepypi,local,privateas defined below:repopypiis a pre-defined repo pointing to the public Python package repository athttps://pypi.python.org/simpleIt is used for publishing packages of public interest.It is avolatile repo:project owners can DELETE published packages or even entire projects.The obvious package names are mostly already taken.repolocalis a pre-defined repo pointing to the local directory:~/.pip/localThe user wants this to be the default repository for new package installs:$ pyrene use localThis directory holds all packages needed for development, thus development
can continue offline as well.The developer has full control over the repository.repoprivateis accessible through a potentially restricted urlhttps://packages.proprietary.com/simpleThis repository holds all packages needed for deployments: both publicly
available packages from pypi and in-house developed closed source ones.The project/company has full control over the repo content.It is not pre-defined, so define it:$ pyrene
...
Pyrene: http_repo private
Pyrene[private]: set download_url=https://packages.proprietary.com/simple/
Pyrene[private]: set upload_url=https://packages.proprietary.com/pypi
Pyrene[private]: set username=<me@company repo>
Pyrene[private]: set password=<secret>Herepyreneis used in shell mode, andPyrene[…]:is a prompt for
commands.Usage scenariosImport a public package for offline use$ pyrene copy pypi:public-package local:This also copies all the dependencies ofpublic-packageas well.Publish an in-house package$ cd in-house-pkg
$ python setup.py sdist
$ pyrene copy dist/in-house-pkg-1.0.0.tgz local:
$ pyrene copy local:in-house-pkg private:Deploy an application# make pip use the `private` repository by default by [over]writing `~/.pip/pip.conf`
$ pyrene use private
$ mkvirtualenv app
$ pip install application
$ start-application
...
# restore the dev-env
$ deactivate
$ rmvirtualenv app
$ pyrene use localFeedbackThis is an early release so if you have any problems
(including usability), please tell them about athttps://github.com/krisztianfekete/pyrene/issuesFeaturesshell with help, command completion and colors for configuration and interactive
operations:$ pyrene
...
Pyrene: directory_repo local
Pyrene[local]: set directory=/path/to/repo
Pyrene[local]: copy pypi:someinterestingpkg==0.1 local:
Pyrene[local]: work_on private
Pyrene[private]: copy local:someinterestingpkg private:
Pyrene[private]: help use
...copy packages between repos (and directories):$ pyrene copy source-repo:package-with-lots-of-dependencies destination-repo:serve local directory repos over http (package sharing with coworkers?):$ pyrene serve dir-repoconfigure pip (by writing a~/.pip/pip.conffile) to use a repo without–index-urlor–find-linkscommand line options:$ pyrene use repoInternalsThe network configuration is persisted in the file~/.pyrene(including passwords in plain text),
which can be thought of as a combined~/.pypircand~/.pip/pip.conf.All operations are delegated to external tools (not to reinvent theeggs):downloading packages is delegated topipuploading via http/https is delegated totwineserving a directory is delegated topypiserverTools are heavily influenced to work in a certain way bygiving them approriate command line optionssetting an environment variablewriting a config file for themall of them painful manually.Repositories defined in~/.pypircare imported on first startup, and
theusecommand replaces~/.pip/pip.confto makepipwork without
options.Changelog0.2.0 (2014-07-02)wheels are not downloaded anymore - local wheels can still be uploadeddelegate http uploads totwine- simplifies code & licensestatus command: show python packaging configuration statususe command: makes backup of existing config before writing ~/.pip/pip.confadd known repos on first run:repositories from.pypirc(only setsupload-url)pypiashttp://pypi.python.orglocalas~/.pip/localnew command: import_pypircreadline historyshow version on startup0.1.3 (2014-05-13)fix #1: existing package at remote http repo stops copy0.1.2 (2014-05-09)setup.cfg: fix keywords & classifiers, early release notice0.1.1 (2014-05-08)initial release - for testing