{"id":18081899,"url":"https://github.com/vindarel/syp","last_synced_at":"2025-04-05T22:29:12.798Z","repository":{"id":57472973,"uuid":"50597886","full_name":"vindarel/syp","owner":"vindarel","description":"Sync your packages with your dotfiles (and vice versa).","archived":false,"fork":false,"pushed_at":"2017-12-15T19:50:53.000Z","size":70,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-12T04:17:11.286Z","etag":null,"topics":["command-line-app","dotfiles","package-manager","python-command"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vindarel.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-28T16:49:00.000Z","updated_at":"2021-11-22T16:19:33.000Z","dependencies_parsed_at":"2022-09-19T09:50:32.708Z","dependency_job_id":null,"html_url":"https://github.com/vindarel/syp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vindarel%2Fsyp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vindarel%2Fsyp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vindarel%2Fsyp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vindarel%2Fsyp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vindarel","download_url":"https://codeload.github.com/vindarel/syp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411241,"owners_count":20934650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-app","dotfiles","package-manager","python-command"],"created_at":"2024-10-31T13:17:09.403Z","updated_at":"2025-04-05T22:29:12.779Z","avatar_url":"https://github.com/vindarel.png","language":"Python","readme":"* Sync your packages with your dotfiles (and vice versa)\n\nWhen we use a package manager (be it apt, pip, npm,…), we want to sync\nthe list of installed packages  in requirement files.  We then declare\na mapping that links a package manager to its requirements file:\n\n#+BEGIN_SRC python\nREQUIREMENTS_ROOT_DIR = \"~/dotfiles/\"\nREQUIREMENTS_FILES = {\n    \"apt\": {\n        \"file\": \"apt.txt\", # =\u003e ~/dotfiles/apt.txt\n        \"pacman\": \"apt-get\",\n        \"install\": \"install -y --force-yes\",\n        \"uninstall\": \"remove\",\n        },\n    # and so on for pip, pip3, gem, npm, docker and guix.\n}\n#+END_SRC\n\nand we call\n\n: syp --pm apt foo bar\n\nto add the two packages \"foo\" and \"bar\" in =~/dotfiles/apt.txt= and at\nthe same  time, to check if  this list has been  edited manually (with\npackages added or removed) and  act accordingly (we make diffs against\nthe cache at =~/.syp/apt.txt=).\n\nSee the Settings section below.\n\nTested on python 2.7 and 3.4.\n\n** Install\n\n: pip install syp\n\n** Usage\n\nThe basic usage  is to check all of the  package managers, and install\nand remove what's necessary:\n\nExample:\n\n: syp\n\ncan output:\n\n#+BEGIN_HTML\n \u003cimg src=\"http://i.imgur.com/NXiddZB.png\" \u003c/img\u003e\n#+END_HTML\n\n\nWe set the package manager with  =--pm= and *give one or many packages\nto install*:\n\n: syp --pm pip syp foo bar\n\nwill   append   \"syp\",   \"foo\"   and    \"bar\"   at   the   bottom   of\n=~/dotfiles/pip.txt= (if they are not there yet), check if pip.txt was\nmanually edited, and suggest a list of packages to install and remove.\n\nSo a suggested alias is\n\n: alias sypip=\"syp --pm pip \"\n\nIf  no package  manager is  specified, *we  use apt  by default*  (see\nSettings below).\n\nTo *remove packages*, use =--rm=:\n\n: syp --pm pip foo --rm\n\n\nWe can *add a message* with =-m=. It will be appended on the same line:\n\n: syp --pm pip foo -m \"foo is a cool package\"\n\n\nWe can *edit  the list* of packages for that  package manager before the\noperations with =-e= (=--editor=):\n\n: syp --pm pip foo --rm -e\n\n* Settings\n\nThe  default settings  come  with a  configuration  for =apt=,  =pip=,\n=pip3=, =gem=, =npm=, =docker= and =guix=.\n\nThe user settings, stored at =~/.syp/settings.py=, is a regular python\n file that will  be =exec='ed on startup.   So, if you want  to add or\n overide  a package  manager settings,  edit the  =REQUIREMENTS_FILES=\n dictionnary  accordingly. Only the key \"file\" is required:\n\n#+BEGIN_SRC python\nREQUIREMENTS_FILES['apt'] = {\n    \"file\": \"requirements-apt.txt\", # required. appended to REQUIREMENTS_ROOT_DIR\n    \"pacman\": \"aptitude\",           # by default, same as the package manager name, here 'apt'\n    \"install\": \"install -y\",        # 'install' by default\n    \"uninstall\": \"remove\",          # 'uninstall' by default.\n}\n#+END_SRC\n\nSee also\n#+BEGIN_SRC python\n#: The base directory where lies the configuration files.\nREQUIREMENTS_ROOT_DIR = \"~/dotfiles/\"\n\n#: System package manager, as a default.\nSYSTEM_PACMAN = \"apt-get\"\n#+END_SRC\n\n* Develop\n: pip install -e .\n* Todos and ideas\n\n- auto commit\n- auto-recognize a virtualenv ?\n- allow for more than a requirement file for one package manager.\n- ask all and apply\n- more tests\n\n  Bust most of all... use [[https://gnu.org/software/guix/][Guix]] !\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvindarel%2Fsyp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvindarel%2Fsyp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvindarel%2Fsyp/lists"}