From 1f975728aa57ba5ad191b141170addc5de34e797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Fri, 21 Jul 2023 19:12:04 +0100 Subject: [PATCH 1/9] unpin python 3.7 for cloudflare & fix build --- poetry.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/poetry.lock b/poetry.lock index e2c5f21ed..23de520f3 100644 --- a/poetry.lock +++ b/poetry.lock @@ -627,9 +627,9 @@ doc = ["mkdocs-bootswatch (>=1,<2)", "mkdocs-minify-plugin (==0.5.*)", "pygments [package.source] type = "git" -url = "https://github.com/cachix/mkdocs-rss-plugin" -reference = "no-git" -resolved_reference = "017bdb52095703c79e0632f219b5adf9f212873c" +url = "https://github.com/Guts/mkdocs-rss-plugin" +reference = "feature/no-git-no-cry" +resolved_reference = "bac5e8935196011b4fb16c5076113d5e3ff13806" [[package]] name = "packaging" From e175a9f9262546e96276c5537f0a51036dec74f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Mon, 10 Jul 2023 11:27:33 +0100 Subject: [PATCH 2/9] Rewrite CLI in Python --- flake.nix | 4 ++++ poetry.lock | 22 +++++++++------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/flake.nix b/flake.nix index b548f0091..0de7f0fad 100644 --- a/flake.nix +++ b/flake.nix @@ -26,6 +26,10 @@ url = "github:nix-community/poetry2nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + inputs.poetry2nix = { + url = "github:nix-community/poetry2nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; outputs = { self, nixpkgs, pre-commit-hooks, nix, ... }@inputs: let diff --git a/poetry.lock b/poetry.lock index 23de520f3..4460fa52c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -609,12 +609,14 @@ files = [ [[package]] name = "mkdocs-rss-plugin" -version = "1.5.0" +version = "1.8.0" description = "MkDocs plugin which generates a static RSS feed using git log and page.meta." optional = false -python-versions = ">=3.7, <4" -files = [] -develop = false +python-versions = ">=3.8, <4" +files = [ + {file = "mkdocs-rss-plugin-1.8.0.tar.gz", hash = "sha256:475bf4ea05cbe786af38d519b55352b1b2eb87597ad680fcbc309056864ed5c4"}, + {file = "mkdocs_rss_plugin-1.8.0-py2.py3-none-any.whl", hash = "sha256:0fa13c99730c1d3ad9ec05102ff3d148c9849396c40b30be789339d38722fa8f"}, +] [package.dependencies] GitPython = ">=3.1,<3.2" @@ -625,12 +627,6 @@ tzdata = {version = "==2022.*", markers = "python_version >= \"3.9\" and sys_pla dev = ["black", "feedparser (>=6.0,<6.1)", "flake8 (>=4,<5.1)", "pre-commit (>=2.10,<2.21)", "pytest-cov (==4.0.*)", "validator-collection (>=1.5,<1.6)"] doc = ["mkdocs-bootswatch (>=1,<2)", "mkdocs-minify-plugin (==0.5.*)", "pygments (>=2.5,<3)", "pymdown-extensions (>=7,<10)"] -[package.source] -type = "git" -url = "https://github.com/Guts/mkdocs-rss-plugin" -reference = "feature/no-git-no-cry" -resolved_reference = "bac5e8935196011b4fb16c5076113d5e3ff13806" - [[package]] name = "packaging" version = "23.2" @@ -1079,13 +1075,13 @@ test = ["flake8", "isort", "pytest"] [[package]] name = "tzdata" -version = "2022.7" +version = "2023.3" description = "Provider of IANA time zone data" optional = false python-versions = ">=2" files = [ - {file = "tzdata-2022.7-py2.py3-none-any.whl", hash = "sha256:2b88858b0e3120792a3c0635c23daf36a7d7eeeca657c323da299d2094402a0d"}, - {file = "tzdata-2022.7.tar.gz", hash = "sha256:fe5f866eddd8b96e9fcba978f8e503c909b19ea7efda11e52e39494bad3a7bfa"}, + {file = "tzdata-2023.3-py2.py3-none-any.whl", hash = "sha256:7e65763eef3120314099b6939b5546db7adce1e7d6f2e179e3df563c70511eda"}, + {file = "tzdata-2023.3.tar.gz", hash = "sha256:11ef1e08e54acb0d4f95bdb1be05da659673de4acbd21bf9c69e94cc5e907a3a"}, ] [[package]] From 7379c1d508af82e0277041d4463db9409a46ba0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Thu, 27 Jul 2023 14:06:46 +0100 Subject: [PATCH 3/9] devenv inputs add --- src/modules/devenv-lib.nix | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/modules/devenv-lib.nix diff --git a/src/modules/devenv-lib.nix b/src/modules/devenv-lib.nix new file mode 100644 index 000000000..0dee070f5 --- /dev/null +++ b/src/modules/devenv-lib.nix @@ -0,0 +1,27 @@ +{ pkgs, lib, config, inputs }: + +{ + getInput = { name, url, attribute, follows ? [ ] }: + let + flags = lib.concatStringsSep " " (map (i: "--follows ${i}") follows); + yaml_follows = lib.concatStringsSep "\n " (map (i: "${i}:\n follows: ${i}") follows); + command = + if lib.versionAtLeast config.devenv.cliVersion "1.0" + then '' + run the following command: + + $ devenv inputs add ${name} ${url} ${flags} + '' + else '' + add the following to your devenv.yaml: + + ✨ devenv 1.0 made this easier: https://devenv.sh/getting-started/#installation ✨ + + inputs: + ${name}: + url: ${url} + ${if follows != [] then "inputs:\n ${yaml_follows}" else ""} + ''; + in + inputs.${name} or (throw "To use '${attribute}', ${command}\n\n"); +} From 32b72fc68979b155fd08da88a26a00d24499f1b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Thu, 27 Jul 2023 14:10:32 +0100 Subject: [PATCH 4/9] cli --- src/devenv/cli.py | 3 +++ src/modules/devenv-lib.nix | 27 --------------------------- 2 files changed, 3 insertions(+), 27 deletions(-) delete mode 100644 src/modules/devenv-lib.nix diff --git a/src/devenv/cli.py b/src/devenv/cli.py index 6c949be97..36b640251 100644 --- a/src/devenv/cli.py +++ b/src/devenv/cli.py @@ -179,6 +179,9 @@ def cli(ctx, offline, system, debugger, nix_flags, verbose): ctx.obj["gc_root"] = DEVENV_HOME_GC ctx.obj["gc_project"] = DEVENV_HOME_GC / str(int(time.time() * 1000)) +@cli.group() +def processes(): + pass @cli.group() def processes(): diff --git a/src/modules/devenv-lib.nix b/src/modules/devenv-lib.nix deleted file mode 100644 index 0dee070f5..000000000 --- a/src/modules/devenv-lib.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ pkgs, lib, config, inputs }: - -{ - getInput = { name, url, attribute, follows ? [ ] }: - let - flags = lib.concatStringsSep " " (map (i: "--follows ${i}") follows); - yaml_follows = lib.concatStringsSep "\n " (map (i: "${i}:\n follows: ${i}") follows); - command = - if lib.versionAtLeast config.devenv.cliVersion "1.0" - then '' - run the following command: - - $ devenv inputs add ${name} ${url} ${flags} - '' - else '' - add the following to your devenv.yaml: - - ✨ devenv 1.0 made this easier: https://devenv.sh/getting-started/#installation ✨ - - inputs: - ${name}: - url: ${url} - ${if follows != [] then "inputs:\n ${yaml_follows}" else ""} - ''; - in - inputs.${name} or (throw "To use '${attribute}', ${command}\n\n"); -} From b15e06c7982fae56e7e957bd90a2356f73c63876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Sat, 19 Aug 2023 12:25:56 +0100 Subject: [PATCH 5/9] Debug --- .github/workflows/buildtest.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index bc22edb47..9b8ff1044 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -29,6 +29,8 @@ jobs: run: | nix profile remove '.*' nix profile install --accept-flake-config . + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 - name: Run tests run: | devenv ci From 0d67f34e3b4855c393919530a814dd3713438d33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Sat, 19 Aug 2023 19:18:12 +0100 Subject: [PATCH 6/9] Disable macos-latest for now --- .github/workflows/buildtest.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index 9b8ff1044..bc22edb47 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -29,8 +29,6 @@ jobs: run: | nix profile remove '.*' nix profile install --accept-flake-config . - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - name: Run tests run: | devenv ci From 84c80b3d39000a8218897fbd521fd45465461927 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 19 Feb 2024 00:19:24 -0500 Subject: [PATCH 7/9] sync with upstream --- flake.nix | 4 ---- poetry.lock | 22 +++++++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/flake.nix b/flake.nix index 0de7f0fad..b548f0091 100644 --- a/flake.nix +++ b/flake.nix @@ -26,10 +26,6 @@ url = "github:nix-community/poetry2nix"; inputs.nixpkgs.follows = "nixpkgs"; }; - inputs.poetry2nix = { - url = "github:nix-community/poetry2nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; outputs = { self, nixpkgs, pre-commit-hooks, nix, ... }@inputs: let diff --git a/poetry.lock b/poetry.lock index 4460fa52c..e2c5f21ed 100644 --- a/poetry.lock +++ b/poetry.lock @@ -609,14 +609,12 @@ files = [ [[package]] name = "mkdocs-rss-plugin" -version = "1.8.0" +version = "1.5.0" description = "MkDocs plugin which generates a static RSS feed using git log and page.meta." optional = false -python-versions = ">=3.8, <4" -files = [ - {file = "mkdocs-rss-plugin-1.8.0.tar.gz", hash = "sha256:475bf4ea05cbe786af38d519b55352b1b2eb87597ad680fcbc309056864ed5c4"}, - {file = "mkdocs_rss_plugin-1.8.0-py2.py3-none-any.whl", hash = "sha256:0fa13c99730c1d3ad9ec05102ff3d148c9849396c40b30be789339d38722fa8f"}, -] +python-versions = ">=3.7, <4" +files = [] +develop = false [package.dependencies] GitPython = ">=3.1,<3.2" @@ -627,6 +625,12 @@ tzdata = {version = "==2022.*", markers = "python_version >= \"3.9\" and sys_pla dev = ["black", "feedparser (>=6.0,<6.1)", "flake8 (>=4,<5.1)", "pre-commit (>=2.10,<2.21)", "pytest-cov (==4.0.*)", "validator-collection (>=1.5,<1.6)"] doc = ["mkdocs-bootswatch (>=1,<2)", "mkdocs-minify-plugin (==0.5.*)", "pygments (>=2.5,<3)", "pymdown-extensions (>=7,<10)"] +[package.source] +type = "git" +url = "https://github.com/cachix/mkdocs-rss-plugin" +reference = "no-git" +resolved_reference = "017bdb52095703c79e0632f219b5adf9f212873c" + [[package]] name = "packaging" version = "23.2" @@ -1075,13 +1079,13 @@ test = ["flake8", "isort", "pytest"] [[package]] name = "tzdata" -version = "2023.3" +version = "2022.7" description = "Provider of IANA time zone data" optional = false python-versions = ">=2" files = [ - {file = "tzdata-2023.3-py2.py3-none-any.whl", hash = "sha256:7e65763eef3120314099b6939b5546db7adce1e7d6f2e179e3df563c70511eda"}, - {file = "tzdata-2023.3.tar.gz", hash = "sha256:11ef1e08e54acb0d4f95bdb1be05da659673de4acbd21bf9c69e94cc5e907a3a"}, + {file = "tzdata-2022.7-py2.py3-none-any.whl", hash = "sha256:2b88858b0e3120792a3c0635c23daf36a7d7eeeca657c323da299d2094402a0d"}, + {file = "tzdata-2022.7.tar.gz", hash = "sha256:fe5f866eddd8b96e9fcba978f8e503c909b19ea7efda11e52e39494bad3a7bfa"}, ] [[package]] From 2ccee8f260645b50fc1f868593ca6b5fb9495bf5 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 20 Feb 2024 00:39:22 -0500 Subject: [PATCH 8/9] flatten python requirements (2) --- docs/reference/options.md | 6 +- examples/python/.test.sh | 5 +- examples/python/devenv.nix | 2 +- examples/python/requirements.txt | 1 + examples/python/requirements2.txt | 1 + .../python/subrequirements/constraints.txt | 1 + .../python/subrequirements/requirements3.txt | 2 + src/modules/languages/python.nix | 50 ++++++++----- src/modules/support/flattenreq.py | 74 +++++++++++++++++++ 9 files changed, 117 insertions(+), 25 deletions(-) create mode 100644 examples/python/requirements2.txt create mode 100644 examples/python/subrequirements/constraints.txt create mode 100644 examples/python/subrequirements/requirements3.txt create mode 100644 src/modules/support/flattenreq.py diff --git a/docs/reference/options.md b/docs/reference/options.md index 99a0d25c2..638c9a3d4 100644 --- a/docs/reference/options.md +++ b/docs/reference/options.md @@ -2713,17 +2713,16 @@ boolean - [https://github.com/cachix/devenv/blob/main/src/modules/languages/python.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/python.nix) - ## languages.python.venv.requirements -Contents of pip requirements.txt file. +Path to pip requirements.txt file as a string. Must be relative to devenv root. This is passed to `pip install -r` during `devenv shell` initialisation. *Type:* -null or strings concatenated with “\\n” or path +null or string @@ -2734,7 +2733,6 @@ null or strings concatenated with “\\n” or path - [https://github.com/cachix/devenv/blob/main/src/modules/languages/python.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/python.nix) - ## languages.python.version The Python version to use. diff --git a/examples/python/.test.sh b/examples/python/.test.sh index 0ad7cfa28..12c4d124a 100755 --- a/examples/python/.test.sh +++ b/examples/python/.test.sh @@ -1,4 +1,5 @@ -#!/usr/bin/env bash +#!/bin/sh set -ex python --version | grep "3.11.3" -python -c "import requests;print(requests)" \ No newline at end of file +python -c "import requests;print(requests)" +python -c "import arrow;print(arrow.__version__)" | grep "1.2.3" diff --git a/examples/python/devenv.nix b/examples/python/devenv.nix index dd34e1b7d..dcb01bc1a 100644 --- a/examples/python/devenv.nix +++ b/examples/python/devenv.nix @@ -6,6 +6,6 @@ version = "3.11.3"; venv.enable = true; - venv.requirements = ./requirements.txt; + venv.requirements = "./requirements.txt"; }; } diff --git a/examples/python/requirements.txt b/examples/python/requirements.txt index f2293605c..becae46f3 100644 --- a/examples/python/requirements.txt +++ b/examples/python/requirements.txt @@ -1 +1,2 @@ requests +-r requirements2.txt diff --git a/examples/python/requirements2.txt b/examples/python/requirements2.txt new file mode 100644 index 000000000..ec8058b23 --- /dev/null +++ b/examples/python/requirements2.txt @@ -0,0 +1 @@ +-r subrequirements/requirements3.txt \ No newline at end of file diff --git a/examples/python/subrequirements/constraints.txt b/examples/python/subrequirements/constraints.txt new file mode 100644 index 000000000..57889784a --- /dev/null +++ b/examples/python/subrequirements/constraints.txt @@ -0,0 +1 @@ +arrow==1.2.3 \ No newline at end of file diff --git a/examples/python/subrequirements/requirements3.txt b/examples/python/subrequirements/requirements3.txt new file mode 100644 index 000000000..4447788e1 --- /dev/null +++ b/examples/python/subrequirements/requirements3.txt @@ -0,0 +1,2 @@ +arrow +-c constraints.txt \ No newline at end of file diff --git a/src/modules/languages/python.nix b/src/modules/languages/python.nix index e391d195b..dee1f95a5 100644 --- a/src/modules/languages/python.nix +++ b/src/modules/languages/python.nix @@ -2,6 +2,7 @@ let cfg = config.languages.python; + flattenreq = pkgs.writers.writePython3 "flattenreq" { flakeIgnore = [ "E501" ]; } (builtins.readFile ../support/flattenreq.py); libraries = lib.makeLibraryPath ( cfg.libraries ++ (lib.optional cfg.manylinux.enable pkgs.pythonManylinuxPackages.manylinux2014Package) @@ -26,12 +27,6 @@ let ]; }; - requirements = pkgs.writeText "requirements.txt" ( - if lib.isPath cfg.venv.requirements - then builtins.readFile cfg.venv.requirements - else cfg.venv.requirements - ); - nixpkgs-python = config.lib.getInput { name = "nixpkgs-python"; url = "github:cachix/nixpkgs-python"; @@ -45,10 +40,16 @@ let VENV_PATH="${config.env.DEVENV_STATE}/venv" + function recreate_venv () { + ${pkgs.coreutils}/bin/rm -rf "$VENV_PATH" + ${package.interpreter} -m venv --upgrade-deps "$VENV_PATH" + echo "${package.interpreter}" > "$VENV_PATH/.devenv_interpreter" + } + profile_python="$(${readlink} ${package.interpreter})" devenv_interpreter_path="$(${pkgs.coreutils}/bin/cat "$VENV_PATH/.devenv_interpreter" 2> /dev/null|| false )" venv_python="$(${readlink} "$devenv_interpreter_path")" - requirements="${lib.optionalString (cfg.venv.requirements != null) ''${requirements}''}" + requirements="${lib.optionalString (cfg.venv.requirements != null) ''$DEVENV_ROOT/"${cfg.venv.requirements}"''}" # recreate venv if necessary if [ -z $venv_python ] || [ $profile_python != $venv_python ] @@ -58,24 +59,37 @@ let ${lib.optionalString cfg.poetry.enable '' [ -f "${config.env.DEVENV_STATE}/poetry.lock.checksum" ] && rm ${config.env.DEVENV_STATE}/poetry.lock.checksum ''} - echo ${package.interpreter} -m venv --upgrade-deps "$VENV_PATH" - ${package.interpreter} -m venv --upgrade-deps "$VENV_PATH" - echo "${package.interpreter}" > "$VENV_PATH/.devenv_interpreter" + recreate_venv + venv_recreated=1 fi source "$VENV_PATH"/bin/activate # reinstall requirements if necessary + # -n means nonempty if [ -n "$requirements" ] then - devenv_requirements_path="$(${pkgs.coreutils}/bin/cat "$VENV_PATH/.devenv_requirements" 2> /dev/null|| false )" - devenv_requirements="$(${readlink} "$devenv_requirements_path")" - if [ -z $devenv_requirements ] || [ $devenv_requirements != $requirements ] + tmp="$(${pkgs.coreutils}/bin/mktemp -d)" + ${flattenreq} "$requirements" "$tmp" + + existing_requirements="$VENV_PATH/.devenv_requirements" + [ -f $existing_requirements ] || existing_requirements="/dev/null" + existing_constraints="$VENV_PATH/.devenv_constraints" + [ -f $existing_constraints ] || existing_constraints="/dev/null" + + if ! ${pkgs.diffutils}/bin/cmp --silent "$tmp/requirements.txt" "$existing_requirements" || ! ${pkgs.diffutils}/bin/cmp --silent "$tmp/constraints.txt" "$existing_constraints"; then - echo "${requirements}" > "$VENV_PATH/.devenv_requirements" - echo "Requirements changed, running pip install -r ${requirements}..." - "$VENV_PATH"/bin/pip install -r ${requirements} + if [ -z "$venv_recreated" ] + then + echo "Requirements changed, rebuilding Python venv..." + recreate_venv + fi + echo "Installing requirements..." + ${pkgs.coreutils}/bin/install "$tmp/requirements.txt" "$VENV_PATH/.devenv_requirements" + ${pkgs.coreutils}/bin/install "$tmp/constraints.txt" "$VENV_PATH/.devenv_constraints" + "$VENV_PATH"/bin/pip install -r "$VENV_PATH/.devenv_requirements" -c "$VENV_PATH/.devenv_constraints" fi + ${pkgs.coreutils}/bin/rm -rf "$tmp" fi ''; @@ -176,10 +190,10 @@ in venv.enable = lib.mkEnableOption "Python virtual environment"; venv.requirements = lib.mkOption { - type = lib.types.nullOr (lib.types.either lib.types.lines lib.types.path); + type = lib.types.nullOr lib.types.str; default = null; description = '' - Contents of pip requirements.txt file. + Path to pip requirements.txt file as a string. Must be relative to devenv root. This is passed to `pip install -r` during `devenv shell` initialisation. ''; }; diff --git a/src/modules/support/flattenreq.py b/src/modules/support/flattenreq.py new file mode 100644 index 000000000..cf86b1cd3 --- /dev/null +++ b/src/modules/support/flattenreq.py @@ -0,0 +1,74 @@ +import os +import re +import sys + +envvar_pattern = r"\$\{([^\}]+)\}" + + +def replace_envvars(text, file_path): + def replace(match): + env_var = match.group(1) + val = os.environ.get(env_var, None) + if val is None: + raise ValueError( + f"No such environment variable {env_var} in {text} within " + f"{file_path}" + ) + return val + + return re.sub(envvar_pattern, replace, text) + + +def flatten_requirements(file_path, outdir): + requirements = set() + constraints = set() + + def process_file(file_path): + if not file_path.startswith(os.path.sep): + prefix = os.getcwd() + file_path = os.path.join(prefix, file_path) + with open(file_path, "r") as file: + for line in file: + prefix = os.path.dirname(file_path) + line = line.strip() + if line.startswith("-r"): + line = replace_envvars(line, file_path) + nested_file_path = re.match(r"-r\s+(.+)", line).group(1) + if not nested_file_path.startswith(os.path.sep): + nested_file_path = os.path.join(prefix, nested_file_path) + process_file(nested_file_path) + elif line.startswith("-c"): + line = replace_envvars(line, file_path) + constraint_file_path = re.match(r"-c\s+(.+)", line).group(1) + if not constraint_file_path.startswith(os.path.sep): + constraint_file_path = os.path.join( + prefix, constraint_file_path + ) + process_constraints(constraint_file_path) + elif not line.startswith("#") and line: + requirements.add(line) + + def process_constraints(constraint_file_path): + with open(constraint_file_path, "r") as file: + for line in file: + line = line.strip() + if not line.startswith("#") and line: + constraints.add(line) + + process_file(file_path) + + with open(os.path.join(outdir, "requirements.txt"), "w") as output_file: + for req in sorted(requirements): + output_file.write(req + "\n") + + with open(os.path.join(outdir, "constraints.txt"), "w") as con_output_file: + for con in sorted(constraints): + con_output_file.write(con + "\n") + + +if __name__ == "__main__": + requirements_file_path, outdir = sys.argv[1], sys.argv[2] + if os.path.isfile(outdir): + raise OSError(f"{outdir} is an existing file") + os.makedirs(outdir, exist_ok=True) + flatten_requirements(requirements_file_path, outdir) From b46f8259a652f2489787ace97a450314b8c4f6f9 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 20 Feb 2024 00:48:10 -0500 Subject: [PATCH 9/9] remove shadowed function --- src/devenv/cli.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/devenv/cli.py b/src/devenv/cli.py index 36b640251..dedae7327 100644 --- a/src/devenv/cli.py +++ b/src/devenv/cli.py @@ -183,11 +183,6 @@ def cli(ctx, offline, system, debugger, nix_flags, verbose): def processes(): pass -@cli.group() -def processes(): - pass - - os.environ["DEVENV_DIR"] = str(DEVENV_DIR) DEVENV_GC = DEVENV_DIR / "gc" os.environ["DEVENV_GC"] = str(DEVENV_GC)