From fbd9822800608e08ae7718427e860a5540653e34 Mon Sep 17 00:00:00 2001 From: Danilo Reyes Date: Fri, 1 Dec 2023 10:14:11 -0600 Subject: [PATCH] installing python packages the right way --- server/configuration.org | 100 +++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 51 deletions(-) diff --git a/server/configuration.org b/server/configuration.org index 6f5088a..e9a424f 100644 --- a/server/configuration.org +++ b/server/configuration.org @@ -432,9 +432,52 @@ nixfmt # linting cachix # why spend time compiling? # PYTHON. -python3 # base language -pipenv # python development workflow for humans -# poetry # dependency management made easy +(python3.withPackages (ps: with ps; [ + pipenv # python development workflow for humans + # poetry # dependency management made easy + flake8 # wraper for pyflakes, pycodestyle and mccabe + isort # sort Python imports + nose # testing and running python scripts + pyflakes # checks source code for errors + pytest # framework for writing tests + speedtest-cli # check internet speed from the comand line + editorconfig # follow rules of contributin + black # Python code formatter + pylint # bug and style checker for python + (buildPythonApplication rec { + pname = "download"; + version = "1.5"; + src = ../scripts/download/.; + doCheck = false; + buildInputs = [ setuptools ]; + propagatedBuildInputs = + [ pyyaml types-pyyaml ]; + }) + (buildPythonApplication rec { + pname = "ffpb"; + version = "0.4.1"; + src = fetchPypi { + inherit pname version; + sha256 = "sha256-7eVqbLpMHS1sBw2vYS4cTtyVdnnknGtEI8190VlXflk="; + }; + doCheck = false; + buildInputs = [ setuptools ]; + propagatedBuildInputs = + [ tqdm ]; + }) + # (buildPythonApplication rec { + # pname = "qbit_manage"; + # version = "4.0.3"; + # src = fetchPypi { + # inherit pname version; + # sha256 = "sha256-7eVqbLpMHS1sBw2vYS4cTtyVdnnknGtEI8190VlXflk="; + # }; + # doCheck = true; + # buildInputs = [ setuptools ]; + # propagatedBuildInputs = + # [ gitpython requests retrying ruamel-yaml schedule unstable.qbittorrent-api ]; + # }) +]) ) # base language # C# & Rust # omnisharp-roslyn # c# linter and code formatter @@ -446,54 +489,6 @@ pipenv # python development workflow for humans nodejs # not as bad as I thought #+end_src -** PYTHON - -#+begin_src nix -]) ++ (with pkgs.python3Packages; [ - flake8 # wraper for pyflakes, pycodestyle and mccabe - isort # sort Python imports - nose # testing and running python scripts - pyflakes # checks source code for errors - pytest # framework for writing tests - speedtest-cli # check internet speed from the comand line - editorconfig # follow rules of contributin - black # Python code formatter - pylint # bug and style checker for python - (buildPythonApplication rec { - pname = "download"; - version = "1.5"; - src = ../scripts/download/.; - doCheck = false; - buildInputs = [ setuptools ]; - propagatedBuildInputs = - [ pyyaml types-pyyaml ]; - }) - (buildPythonApplication rec { - pname = "ffpb"; - version = "0.4.1"; - src = fetchPypi { - inherit pname version; - sha256 = "sha256-7eVqbLpMHS1sBw2vYS4cTtyVdnnknGtEI8190VlXflk="; - }; - doCheck = false; - buildInputs = [ setuptools ]; - propagatedBuildInputs = - [ tqdm ]; - }) - # (buildPythonApplication rec { - # pname = "qbit_manage"; - # version = "4.0.3"; - # src = fetchPypi { - # inherit pname version; - # sha256 = "sha256-7eVqbLpMHS1sBw2vYS4cTtyVdnnknGtEI8190VlXflk="; - # }; - # doCheck = true; - # buildInputs = [ setuptools ]; - # propagatedBuildInputs = - # [ gitpython requests retrying ruamel-yaml schedule unstable.qbittorrent-api ]; - # }) -#+end_src - ** NODEJS PACKAGES Mostly language servers and linters. @@ -617,6 +612,7 @@ xdg = { "npm/npmrc".source = ../dotfiles/npm/npmrc; "gallery-dl/config.json".source = ../dotfiles/gallery-dl/config.json; "htop/htoprc".source = ../dotfiles/htop/htoprc; + "python/pythonrc".source = ../dotfiles/pythonrc; }; }; #+end_src @@ -755,6 +751,8 @@ environment = { PSQL_HISTORY="${XDG_DATA_HOME}/psql_history"; REDISCLI_HISTFILE="${XDG_DATA_HOME}/redis/rediscli_history"; WINEPREFIX="${XDG_DATA_HOME}/wine"; + PYTHONSTARTUP="${XDG_CONFIG_HOME}/python/pythonrc"; + STACK_ROOT="${XDG_DATA_HOME}/stack"; # OPTIONS HISTFILE = "${XDG_STATE_HOME}/bash/history";