1. 03 Oct, 2022 7 commits
  2. 02 Oct, 2022 1 commit
  3. 01 Oct, 2022 1 commit
  4. 29 Sep, 2022 1 commit
  5. 28 Sep, 2022 1 commit
  6. 27 Sep, 2022 1 commit
  7. 26 Sep, 2022 1 commit
  8. 24 Sep, 2022 4 commits
  9. 23 Sep, 2022 2 commits
  10. 22 Sep, 2022 4 commits
  11. 21 Sep, 2022 2 commits
  12. 20 Sep, 2022 1 commit
  13. 18 Sep, 2022 13 commits
  14. 17 Sep, 2022 1 commit
    • update env remove logic (#6195) · 2def3571
      Resolves: #6018 
      
      1. Added a check so that if `python` argument is a file (then it should
      be a python path) - extract it's venv name and raise `IncorrectEnvError`
      if it doesn't belong to this project
          **Before**
          ```
      └❯ poetry env remove
      ~/.cache/pypoetry/virtualenvs/different-project-OKfJHH_5-py3.10/bin/python
          /bin/sh: 1: different-project-OKfJHH_5-py3.10: not found
      
      Deleted virtualenv: ~/.cache/pypoetry/virtualenvs/poetry-4pWfmigs-py3.10
          ```
          Removes current project's env, which is wrong.
          **After**
          ```
      └❯ poetry env remove
      ~/.cache/pypoetry/virtualenvs/different-project-OKfJHH_5-py3.10/bin/python
      
      Env different-project-OKfJHH_5-py3.10 doesn't belong to this project.
          ```
      2. Added the exact same check as before ^, but for cases where env name
      is passed.
          **Before**
          ```
          └❯ poetry env remove different-project-OKfJHH_5-py3.10      
           /bin/sh: 1: different-project-OKfJHH_5-py3.10: not found
      
      Command different-project-OKfJHH_5-py3.10 -c "import sys;
      print('.'.join([str(s) for s in sys.version_info[:3]]))" errored with
      the following return code 127, and output:
          ```
      Errors while trying to exec env name as an interpreter, error is not
      clear.
          **After**
          ```
      └❯ poetry env remove different-project-OKfJHH_5-py3.10
      
      Env different-project-OKfJHH_5-py3.10 doesn't belong to this project.
          ```
      3. Added a couple of tests for **new** and for **old** scenarios which
      weren't tested.
      4. Added `venv_name` fixture for `tests/utils` directory to use in
      `test_env`. Also replaced some of `"simple-project"` hardcoded value to
      use `poetry.package.name`
      
      It's up to maintainers to choose what they want for this project - I'm
      happy either way if we at least fix the bug. I can remove/change any of
      the stuff I added on top of the fix. But yeah I just decided that if we
      fix the bug, we might also make some improvements/changes in this area
      of code. Any thoughts on this are welcome, thanks!
      Alexey committed