{"id":17494355,"url":"https://github.com/lkubb/salt-tool-pipx-formula","last_synced_at":"2025-04-10T21:53:45.352Z","repository":{"id":134852563,"uuid":"483876486","full_name":"lkubb/salt-tool-pipx-formula","owner":"lkubb","description":"Manage standalone python programs with pipx and Salt. Provides execution and state module for Salt.","archived":false,"fork":false,"pushed_at":"2024-11-25T12:38:59.000Z","size":181,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T21:53:36.791Z","etag":null,"topics":["devops","pipx","python","salt-formula","saltstack"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lkubb.png","metadata":{"files":{"readme":"docs/README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-21T02:14:07.000Z","updated_at":"2024-11-25T12:39:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"bc68ce80-54bb-441e-b012-b3a3d4b1e286","html_url":"https://github.com/lkubb/salt-tool-pipx-formula","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/lkubb%2Fsalt-tool-pipx-formula","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkubb%2Fsalt-tool-pipx-formula/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkubb%2Fsalt-tool-pipx-formula/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkubb%2Fsalt-tool-pipx-formula/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lkubb","download_url":"https://codeload.github.com/lkubb/salt-tool-pipx-formula/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248305843,"owners_count":21081562,"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":["devops","pipx","python","salt-formula","saltstack"],"created_at":"2024-10-19T13:06:16.550Z","updated_at":"2025-04-10T21:53:45.330Z","avatar_url":"https://github.com/lkubb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. _readme:\n\nPipx Formula\n============\n\nManages Pipx in the user environment.\n\n.. contents:: **Table of Contents**\n   :depth: 1\n\nUsage\n-----\nApplying ``tool_pipx`` will make sure ``pipx`` is configured as specified.\n\nExecution and state module\n~~~~~~~~~~~~~~~~~~~~~~~~~~\nThis formula provides a custom execution module and state to manage packages installed with Pipx. The functions are self-explanatory, please see the source code or the rendered docs at :ref:`em_pipx` and :ref:`sm_pipx`.\n\nCommon problems\n---------------\n* Especially on MacOS + Homebrew, after brew upgraded its Python, `all installed packages will be broken \u003chttps://github.com/pypa/pipx/issues/146\u003e`_. A workaround is to issue ``pipx reinstall-all``. It might make sense to depend on a different, more stable ``python``, e.g. ``pipx reinstall-all --python /usr/bin/python3``.\n\nConfiguration\n-------------\n\nThis formula\n~~~~~~~~~~~~\nThe general configuration structure is in line with all other formulae from the `tool` suite, for details see :ref:`toolsuite`. An example pillar is provided, see :ref:`pillar.example`. Note that you do not need to specify everything by pillar. Often, it's much easier and less resource-heavy to use the ``parameters/\u003cgrain\u003e/\u003cvalue\u003e.yaml`` files for non-sensitive settings. The underlying logic is explained in :ref:`map.jinja`.\n\nUser-specific\n^^^^^^^^^^^^^\nThe following shows an example of ``tool_pipx`` per-user configuration. If provided by pillar, namespace it to ``tool_global:users`` and/or ``tool_pipx:users``. For the ``parameters`` YAML file variant, it needs to be nested under a ``values`` parent key. The YAML files are expected to be found in\n\n1. ``salt://tool_pipx/parameters/\u003cgrain\u003e/\u003cvalue\u003e.yaml`` or\n2. ``salt://tool_global/parameters/\u003cgrain\u003e/\u003cvalue\u003e.yaml``.\n\n.. code-block:: yaml\n\n  user:\n\n      # Force the usage of XDG directories for this user.\n    xdg: true\n\n      # Put shell completions into this directory, relative to user home.\n    completions: '.config/zsh/completions'\n\n      # Persist environment variables used by this formula for this\n      # user to this file (will be appended to a file relative to $HOME)\n    persistenv: '.config/zsh/zshenv'\n\n      # Add runcom hooks specific to this formula to this file\n      # for this user (will be appended to a file relative to $HOME)\n    rchook: '.config/zsh/zshrc'\n\n      # This user's configuration for this formula. Will be overridden by\n      # user-specific configuration in `tool_pipx:users`.\n      # Set this to `false` to disable configuration for this user.\n    pipx:\n        # packages to install with pipx (convenience)\n      packages:\n        - cookiecutter\n        - cruft\n        - poetry\n\nFormula-specific\n^^^^^^^^^^^^^^^^\n\n.. code-block:: yaml\n\n  tool_pipx:\n\n      # Specify an explicit version (works on most Linux distributions) or\n      # keep the packages updated to their latest version on subsequent runs\n      # by leaving version empty or setting it to 'latest'\n      # (again for Linux, brew does that anyways).\n    version: latest\n    install_method: pkg\n\n      # Default formula configuration for all users.\n    defaults:\n      packages: default value for all users\n\n\nAvailable states\n----------------\n\nThe following states are found in this formula:\n\n.. contents::\n   :local:\n\n\n``tool_pipx``\n~~~~~~~~~~~~~\n*Meta-state*.\n\nPerforms all operations described in this formula according to the specified configuration.\n\n\n``tool_pipx.package``\n~~~~~~~~~~~~~~~~~~~~~\nInstalls the Pipx package only.\n\n\n``tool_pipx.xdg``\n~~~~~~~~~~~~~~~~~\nEnsures Pipx adheres to the XDG spec\nas best as possible for all managed users.\nHas a dependency on `tool_pipx.package`_.\n\n\n``tool_pipx.completions``\n~~~~~~~~~~~~~~~~~~~~~~~~~\nInstall Pipx completions into user's rchook file.\n\nMind that for ``zsh``, the position of the line loading\nthe completions matters. It needs to be placed before\n``autoload -U bashcompinit \u0026\u0026 bashcompinit``, but after\n``compinit``.\n\n\n``tool_pipx.packages``\n~~~~~~~~~~~~~~~~~~~~~~\n\n\n\n``tool_pipx.clean``\n~~~~~~~~~~~~~~~~~~~\n*Meta-state*.\n\nUndoes everything performed in the ``tool_pipx`` meta-state\nin reverse order.\n\n\n``tool_pipx.package.clean``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n\n``tool_pipx.xdg.clean``\n~~~~~~~~~~~~~~~~~~~~~~~\nRemoves Pipx XDG compatibility crutches for all managed users.\n\n\n``tool_pipx.completions.clean``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nRemoves pipx completions for all managed users.\n\n\n``tool_pipx.packages.clean``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n\n\nDevelopment\n-----------\n\nContributing to this repo\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nCommit messages\n^^^^^^^^^^^^^^^\n\nCommit message formatting is significant.\n\nPlease see `How to contribute \u003chttps://github.com/saltstack-formulas/.github/blob/master/CONTRIBUTING.rst\u003e`_ for more details.\n\npre-commit\n^^^^^^^^^^\n\n`pre-commit \u003chttps://pre-commit.com/\u003e`_ is configured for this formula, which you may optionally use to ease the steps involved in submitting your changes.\nFirst install  the ``pre-commit`` package manager using the appropriate `method \u003chttps://pre-commit.com/#installation\u003e`_, then run ``bin/install-hooks`` and\nnow ``pre-commit`` will run automatically on each ``git commit``.\n\n.. code-block:: console\n\n  $ bin/install-hooks\n  pre-commit installed at .git/hooks/pre-commit\n  pre-commit installed at .git/hooks/commit-msg\n\nState documentation\n~~~~~~~~~~~~~~~~~~~\nThere is a script that semi-autodocuments available states: ``bin/slsdoc``.\n\nIf a ``.sls`` file begins with a Jinja comment, it will dump that into the docs. It can be configured differently depending on the formula. See the script source code for details currently.\n\nThis means if you feel a state should be documented, make sure to write a comment explaining it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flkubb%2Fsalt-tool-pipx-formula","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flkubb%2Fsalt-tool-pipx-formula","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flkubb%2Fsalt-tool-pipx-formula/lists"}