diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 69a81ce..1215370 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -138,25 +138,15 @@ ("C-c C-p" . flycheck-previous-error) ("C-c C-l" . flycheck-list-errors))) -(use-package pyvenv) - -(defun find-venv () - "Try to find a .venv/ directory in the current project" - (require 'f) - (let ((basedir (f-traverse-upwards - (lambda (path) - (let ((venv-path (f-expand ".venv" path))) - (f-exists? venv-path)))))) - (when basedir (f-expand ".venv" basedir)))) +; Requires poetry to be installed +(use-package poetry) (defun load-python-env () "Set up the Python IDE in the current project" (interactive) - (let ((venv-dir (find-venv))) - (when venv-dir - (progn - (pyvenv-activate venv-dir) - (lsp))))) + (progn + (poetry-venv-workon) + (lsp))) (defun symbols-at-point () (let* ((lsp--document-symbols-request-async t) diff --git a/.config/setup/01-install-packages.sh b/.config/setup/01-install-packages.sh index 7976326..3d40362 100755 --- a/.config/setup/01-install-packages.sh +++ b/.config/setup/01-install-packages.sh @@ -21,7 +21,6 @@ network-manager \ pipx \ postfix \ pulseaudio-utils \ -python3-venv sway \ swayidle \ swaylock \ @@ -32,8 +31,12 @@ xournalpp \ " PIPX_PKGS="\ +poetry \ yt-dlp \ " sudo DEBIAN_FRONTEND=noninteractive apt-get install --yes ${DEB_PKGS} -pipx install ${PIPX_PKGS} +for pkg in ${PIPX_PKGS}; +do + pipx install "${pkg}" +done diff --git a/.local/bin/init-venv b/.local/bin/init-venv new file mode 100755 index 0000000..327ddbc --- /dev/null +++ b/.local/bin/init-venv @@ -0,0 +1,11 @@ +#! /usr/bin/sh + +poetry add \ + --group dev \ + black \ + isort \ + 'python-lsp-server[rope]' \ + ruff-lsp +poetry add \ + --group test \ + coverage diff --git a/.local/bin/make-venv b/.local/bin/make-venv deleted file mode 100755 index ce028f7..0000000 --- a/.local/bin/make-venv +++ /dev/null @@ -1,11 +0,0 @@ -#! /usr/bin/sh - -python3 -m venv .venv -. .venv/bin/activate -pip install \ - black \ - coverage \ - isort \ - 'python-lsp-server[rope]' \ - ruff-lsp -pip install -e . diff --git a/.profile b/.profile index 4887c45..891292f 100644 --- a/.profile +++ b/.profile @@ -32,4 +32,5 @@ export QT_IM_MODULE="fcitx" export XMODIFIERS="@im=fcitx" export BORG_REPO="/media/backup/" export BORG_PASSCOMMAND="cat ${HOME}/.keys/borg-passphrase.txt" +export PYTHON_KEYRING_BACKEND="keyring.backends.null.Keyring" . "$HOME/.cargo/env"