Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure in non-poetry project #1

Closed
jayvdb opened this issue Sep 28, 2020 · 7 comments
Closed

Failure in non-poetry project #1

jayvdb opened this issue Sep 28, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@jayvdb
Copy link

jayvdb commented Sep 28, 2020

  File "/usr/lib/python3.8/site-packages/tox_poetry_installer.py", line 269, in tox_testenv_install_deps
    poetry = PoetryFactory().create_poetry(venv.envconfig.config.toxinidir)
  File "/usr/lib/python3.8/site-packages/poetry/factory.py", line 42, in create_poetry
    raise RuntimeError(
RuntimeError: [tool.poetry] section not found in pyproject.toml
@enpaul
Copy link
Owner

enpaul commented Sep 28, 2020

Thank you for the the error report! The plugin is intended to be used with projects that use poetry for their dependency management, but you're correct that it should also handle being installed to a non-poetry project more gracefully. I think adding a check that logs a warning and then skips the rest of the plugin's dependency processing would be a bit more user friendly.

@jayvdb
Copy link
Author

jayvdb commented Sep 29, 2020

tox plugins should not assume they are installed in a venv dedicated to a single project. tox is usually installed outside any venv, as it creates the venvs for any project.
Adding a check would be great. A warning isnt appropriate if the project isnt using poetry; even a notice would be superfluous. A debug level log entry would suffice.

@enpaul
Copy link
Owner

enpaul commented Sep 29, 2020

That makes a lot of sense. I always install tox to my project environment, rather than the user/system python, to avoid dependency conflicts so I didn't run into this problem, but you're correct that it's a very valid use case. Adding a debug notice is definitely the proper way to handle it. Thank you for clarifying this, I'll make a patch for it.

@enpaul enpaul added the bug Something isn't working label Sep 29, 2020
@enpaul
Copy link
Owner

enpaul commented Sep 29, 2020

@jayvdb When you have a moment, could you confirm that v0.2.2 fixes this for you? If so then I can close this issue

@jayvdb
Copy link
Author

jayvdb commented Sep 29, 2020

  File "/usr/lib/python3.8/site-packages/tox_poetry_installer.py", line 285, in tox_testenv_install_deps
    raise err
  File "/usr/lib/python3.8/site-packages/tox_poetry_installer.py", line 270, in tox_testenv_install_deps
    poetry = PoetryFactory().create_poetry(venv.envconfig.config.toxinidir)
  File "/usr/lib/python3.8/site-packages/poetry/factory.py", line 38, in create_poetry
    poetry_file = self.locate(cwd)
  File "/usr/lib/python3.8/site-packages/poetry/factory.py", line 336, in locate
    raise RuntimeError(
RuntimeError: Poetry could not find a pyproject.toml file in /path/to/pytest-djangoapp or its parents

@enpaul enpaul closed this as completed in 05c5a26 Sep 29, 2020
@enpaul
Copy link
Owner

enpaul commented Sep 30, 2020

Sorry, didn't realize that commit would close the issue. If the problem continues please feel free to re-open the issue and I'll try to get a better grasp on what's breaking.

@jayvdb
Copy link
Author

jayvdb commented Sep 30, 2020

No worries. This bit is working now. Much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants