/pysudoer

Run a subprocess with administrative privileges, prompting the user with a graphical OS dialog if necessary

Primary LanguagePython

pysudoer

codecov

This is a @o/elecron-sudo's python port.

Run a subprocess with administrative privileges, prompting the user with a graphical OS dialog if necessary.

  • Windows, uses elevate utility with native User Account Control (UAC) prompt (no PowerShell required)

  • OS X, uses bundled applet (inspired by Joran Dirk Greef)

  • Linux, uses system pkexec or gksudo (system or bundled).

If you don't trust binaries bundled in pip package you can manually build tools and use them instead.

Installing

Clone the project:

git clone https://github.com/qlrd/pysudoer.git

Setup

Install poetry:

pipx install poetry

Enter in pysudoer folder:

cd pysudoer

Install dependencies:

poetry install

Pre-commit

Before commit some changes, we recommend to follow a three step:

  • Text formatting:
poetry run poe format
  • Code linting:
poetry run poe lint
  • Test:
poetry run poe test

Build

To build .tar.gz and .whl files:

poetry build