EDIT: check out fix-python instead, make Python run "as usual" on NixOS!
- You are using NixOS
- You start working on a Python project
- You manage the dependencies in a classic Python virtual environment using pip or poetry
EDIT: check out fix-python instead, make Python run "as usual" on NixOS!
| let | |
| nixpkgs-src = builtins.fetchTarball { | |
| # master of 2021-01-05. | |
| url = "https://github.com/NixOS/nixpkgs/archive/1a57d96edd156958b12782e8c8b6a374142a7248.tar.gz"; | |
| sha256 = "1qdh457apmw2yxbpi1biwl5x5ygaw158ppff4al8rx7gncgl10rd"; | |
| }; | |
| pkgs = import nixpkgs-src { | |
| config = { | |
| # allowUnfree may be necessary for some packages, but in general you should not need it. |
After watching Bryan Cantrill's presentation on [Running Aground: Debugging Docker in Production][aground] I got all excited (and strangely nostalgic) about the possibility of core-dumping server-side Python apps whenever they go awry. This would theoretically allow me to fully inspect the state of the program at the point it exploded, rather than relying solely on the information of a stack trace.
| (require 'flycheck) | |
| ;; From https://github.com/flycheck/flycheck/issues/1974#issuecomment-1343495202 | |
| (flycheck-define-checker python-ruff | |
| "A Python syntax and style checker using the ruff utility. | |
| To override the path to the ruff executable, set | |
| `flycheck-python-ruff-executable'. | |
| See URL `http://pypi.python.org/pypi/ruff'." | |
| :command ("ruff" | |
| "--format=text" |
If you are getting this in gdb on macOS while trying to run a program:
Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))gdbc)There's a couple of ways, one way is
SPC / and type in your search stringSPC x S and search string - where x is your scope indicator (p for project, d for directory, etc..)C-c C-e inside the helm buffer to put all your match occurences and puts them into a special buffer called the edit buffer or something like thatC-c C-c to commit your changes.| import pexpect | |
| import pyotp | |
| import signal | |
| import struct | |
| import sys | |
| import fcntl | |
| import termios | |
| import json | |
| from pathlib import Path |
Emacs packages, features, files, layers, extensions, auto-loading, require,
provide, use-package… All these terms getting you confused? Let’s clear up
a few things.
Emacs files contains code that can be evaluated. When evaluated, the functions, macros and modes defined in that file become available to the current Emacs session. Henceforth, this will be termed as loading a file.
One major problem is to ensure that all the correct files are loaded, and in the
| --- | |
| - hosts: all | |
| tasks: | |
| - name: Install prerequisites | |
| apt: name={{item}} update_cache=yes | |
| with_items: | |
| - apt-transport-https | |
| - ca-certificates | |
| - curl | |
| - software-properties-common |