jedie/poetry-publish

FileNotFoundError while calling poetry commands on Windows

Closed this issue · 4 comments

on Windows, After having re-installed poetry the recommended way with

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python

I am encountering a FileNotFoundError from subprocess when running poetry run publish
(poetry is in my path, and just runs fine from command line)
:

Set version in "pyproject.toml" to: v0.1.0
        Call: 'poetry version 0.1.0'

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\sebastienh\Dev\GeoH5io\devtools\publish.py", line 10, in publish
    package_root=Path(geoh5py.__file__).parent.parent, version=geoh5py.__version__,
  File "C:\Users\sebastienh\AppData\Local\pypoetry\Cache\virtualenvs\geoh5py-aUl-vF3z-py3.7\lib\site-packages\poetry_publish\publish.py", line 71, in poetry_publish
    verbose_check_call('poetry', 'version', version)
  File "C:\Users\sebastienh\AppData\Local\pypoetry\Cache\virtualenvs\geoh5py-aUl-vF3z-py3.7\lib\site-packages\poetry_publish\utils\subprocess_utils.py", line 28, in verbose_check_call
    env=os.environ
  File "C:\Program Files\Python37\lib\subprocess.py", line 342, in check_call
    retcode = call(*popenargs, **kwargs)
  File "C:\Program Files\Python37\lib\subprocess.py", line 323, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:\Program Files\Python37\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Program Files\Python37\lib\subprocess.py", line 1178, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
jedie commented

think it's a PATH problem.
Maybe we should find poetry in path and use the complete path to it.

jedie commented

We can use path = shutil.which('poetry')
Maybe we should it generally use for all subprocess calls.

if only a PATH issue, I cannot do not really see why it fails with subprocess.check_output(), but succeeds with subprocess.run()...

how did usage of subprocess.run() break the tests?

jedie commented

Is hopefully fixed by 9e17747