NiklasRosenstein / slap

Slap is a CLI to assist in the process for developing and releasing Python packages.
https://niklasrosenstein.github.io/slap/
Other
18 stars 11 forks source link

`slap venv -i` errors in directory that has a `pyproject.toml` but cannot be managed by Slap #65

Open NiklasRosenstein opened 1 year ago

NiklasRosenstein commented 1 year ago

The slap venv -i command is something you might run from ~/.profile or similar files, so it's not uncommon that it might be invoked in a directory that has a pyproject.toml but is not a compatible Slap project.

Example error?

[ ... ]
  File "/Users/niklas.rosenstein/gitme/slap/.venvs/3.10/lib/python3.10/site-packages/nr/util/functional/_once.py", line 29, in __call__
    self._value = self._supplier()
  File "/Users/niklas.rosenstein/gitme/slap/.venvs/3.10/lib/python3.10/site-packages/slap/project.py", line 150, in _get_dist_name
    return self.handler().get_dist_name(self)
  File "/Users/niklas.rosenstein/gitme/slap/.venvs/3.10/lib/python3.10/site-packages/nr/util/functional/_once.py", line 29, in __call__
    self._value = self._supplier()
  File "/Users/niklas.rosenstein/gitme/slap/.venvs/3.10/lib/python3.10/site-packages/slap/project.py", line 120, in _get_project_handler
    raise RuntimeError(f"unable to identify project handler for {self!r}")
RuntimeError: unable to identify project handler for Project(directory="/Users/niklas.rosenstein/gitme/kraken-base-image")