diff --git a/poetry.lock b/poetry.lock index 31f6a0bc61c..0d97c04ba2d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -46,9 +46,9 @@ optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" [package.extras] -redis = ["redis (>=3.3.6,<4.0.0)"] -memcached = ["python-memcached (>=1.59,<2.0)"] msgpack = ["msgpack-python (>=0.5,<0.6)"] +memcached = ["python-memcached (>=1.59,<2.0)"] +redis = ["redis (>=3.3.6,<4.0.0)"] [[package]] name = "certifi" @@ -233,10 +233,10 @@ six = ">=1.9" webencodings = "*" [package.extras] -all = ["genshi", "chardet (>=2.2)", "lxml"] -chardet = ["chardet (>=2.2)"] -genshi = ["genshi"] lxml = ["lxml"] +genshi = ["genshi"] +chardet = ["chardet (>=2.2)"] +all = ["lxml", "chardet (>=2.2)", "genshi"] [[package]] name = "httpretty" @@ -299,8 +299,8 @@ optional = false python-versions = ">=3.7" [package.extras] -test = ["pytest", "pytest-trio", "pytest-asyncio (>=0.17)", "testpath", "trio", "async-timeout"] -trio = ["trio", "async-generator"] +trio = ["async-generator", "trio"] +test = ["async-timeout", "trio", "testpath", "pytest-asyncio (>=0.17)", "pytest-trio", "pytest"] [[package]] name = "keyring" @@ -439,8 +439,8 @@ python-versions = ">=3.6" importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} [package.extras] -dev = ["pre-commit", "tox"] -testing = ["pytest", "pytest-benchmark"] +testing = ["pytest-benchmark", "pytest"] +dev = ["tox", "pre-commit"] [[package]] name = "poetry-core" @@ -570,7 +570,7 @@ coverage = {version = ">=5.2.1", extras = ["toml"]} pytest = ">=4.6" [package.extras] -testing = ["fields", "hunter", "process-tests", "six", "pytest-xdist", "virtualenv"] +testing = ["virtualenv", "pytest-xdist", "six", "process-tests", "hunter", "fields"] [[package]] name = "pytest-forked" @@ -701,11 +701,11 @@ jeepney = ">=0.6" [[package]] name = "shellingham" -version = "1.4.0" +version = "1.5.0" description = "Tool to Detect Surrounding Shell" category = "main" optional = false -python-versions = "!=3.0,!=3.1,!=3.2,!=3.3,>=2.6" +python-versions = ">=3.4" [[package]] name = "six" @@ -887,7 +887,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest- [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "15542c18243196724e924f1145d082c3997843f33743544474a56747d144e480" +content-hash = "09541fcf8596626fc1d10fc7a2cdb256cfe4bd82cb0f3bf07afd636e62e7322b" [metadata.files] atomicwrites = [ @@ -1382,8 +1382,8 @@ secretstorage = [ {file = "SecretStorage-3.3.2.tar.gz", hash = "sha256:0a8eb9645b320881c222e827c26f4cfcf55363e8b374a021981ef886657a912f"}, ] shellingham = [ - {file = "shellingham-1.4.0-py2.py3-none-any.whl", hash = "sha256:536b67a0697f2e4af32ab176c00a50ac2899c5a05e0d8e2dadac8e58888283f9"}, - {file = "shellingham-1.4.0.tar.gz", hash = "sha256:4855c2458d6904829bd34c299f11fdeed7cfefbf8a2c522e4caea6cd76b3171e"}, + {file = "shellingham-1.5.0-py2.py3-none-any.whl", hash = "sha256:a8f02ba61b69baaa13facdba62908ca8690a94b8119b69f5ec5873ea85f7391b"}, + {file = "shellingham-1.5.0.tar.gz", hash = "sha256:72fb7f5c63103ca2cb91b23dee0c71fe8ad6fbfd46418ef17dbe40db51592dad"}, ] six = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, diff --git a/pyproject.toml b/pyproject.toml index 9217bbbf6e4..f5357b51117 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,7 +61,7 @@ pkginfo = "^1.5" platformdirs = "^2.5.2" requests = "^2.18" requests-toolbelt = "^0.9.1" -shellingham = "^1.1" +shellingham = "^1.5" tomlkit = ">=0.11.1,<1.0.0" # exclude 20.4.5 - 20.4.6 due to https://github.com/pypa/pip/issues/9953 virtualenv = "(>=20.4.3,<20.4.5 || >=20.4.7)" diff --git a/src/poetry/utils/shell.py b/src/poetry/utils/shell.py index 1a5de3c9cf5..bce274f3700 100644 --- a/src/poetry/utils/shell.py +++ b/src/poetry/utils/shell.py @@ -93,7 +93,7 @@ def activate(self, env: VirtualEnv) -> int | None: self._path, ["-i"], dimensions=(terminal.height, terminal.width) ) - if self._name == "zsh": + if self._name in ["zsh", "nu"]: c.setecho(False) c.sendline(f"{self._get_source_command()} {shlex.quote(str(activate_path))}") @@ -119,13 +119,15 @@ def _get_activate_script(self) -> str: suffix = ".ps1" elif self._name == "cmd": suffix = ".bat" + elif self._name == "nu": + suffix = ".nu" else: suffix = "" return "activate" + suffix def _get_source_command(self) -> str: - if self._name in ("fish", "csh", "tcsh"): + if self._name in ("fish", "csh", "tcsh", "nu"): return "source" return "."