Skip to main content

Sync your packages in dotfiles.

Project description

* Sync your packages with your dotfiles

When we use a package manager (be it apt, pip, npm,…), we want to sync
the list of installed packages in requirement files. We then declare
a mapping that links a package manager to its requirements file:

#+BEGIN_SRC python
REQUIREMENTS_ROOT_DIR = "~/dotfiles/"
REQUIREMENTS_FILES = {
"apt": "apt.txt",
"pip": "pip.txt",
"npm": "npm.txt",
}
#+END_SRC

Note: see =syp --init=

Note: tested on python 2.7 and 3.4

The basic usage is to check all of them, and install and remove
what's necessary (compared with the cache at =~/.syp/=):

Example:

: syp

can output:

#+BEGIN_HTML
<img src="http://i.imgur.com/NXiddZB.png" </img>
#+END_HTML


So obviously we can *set the package manager* we want to use and *give
one or many packages to install*:

: syp --pm pip syp foo bar

will append syp, foo and bar to the bottom of =~/dotfiles/pip.txt= and
install them.

So a suggested alias is

: alias sypip="syp --pm pip "

If no package manager is specified, we use the default one (see =settings.py=):

To *remove packages*, use =--rm=:

: syp --pm pip foo --rm


We can *add a message* with =-m=. It will be appended on the same line:

: syp --pm pip foo -m "foo is a cool package"


We can *edit the list* of packages for that package maneger before the
operations with =-e= (=--editor=):

: syp --pm pip foo --rm -e

* Develop
: pip install -e .
* TODOs and ideas

- more tests
- auto-recognize a virtualenv
- undo last action
- auto commit
- allow for more than a requirement file for one package manager.

Bust most of all… use [[https://gnu.org/software/guix/][Guix]] !

Project details


Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page