ImperialCollegeLondon / RSEBlog

https://imperialcollegelondon.github.io/RSEBlog/
0 stars 0 forks source link

Incompatibility between arbitrary version for Python, poetry, and specified Python version in `pyproject.toml` #23

Open HarmonicReflux opened 1 month ago

HarmonicReflux commented 1 month ago

There is an issue with the current setup instructions for the project. The first step in the how-to guide is to ensure that Poetry is installed, see also "Make sure you have poetry installed."

However, this will not work unless Poetry is running on Python 3.11, which is the version specified in the pyproject.toml file.

Steps to reproduce:

Expected behaviour:

Actual behaviour:

Proposed solution:

Screenshot from 2024-07-25 20-31-20

Also, on my machine, it was crucial to install the virtual environment like invoking poetry install --no-root instead of poetry install. Else, I am thrown this warning, which in a future version becomes an error:

Warning: The current project could not be installed: No file/folder found for package rseblog
If you do not want to install the current project use --no-root.
If you want to use Poetry only for dependency management but not for packaging, you can disable package mode by setting package-mode = false in your pyproject.toml file.
In a future version of Poetry this warning will become an error!
HarmonicReflux commented 1 month ago

The following commands solved the problem on my machine. These are equivalently the sequence of commands one might include in the project documentation.

pyenv install 3.11  # assumes pyenv is installed (I could not survive without anymore)
pyenv local 3.11
cd ~/Downloads/vcs/RSEBlog  # navigate to your project directory; path valid for my machine
poetry config virtualenvs.in-project true  # optional to place venv in project directory
poetry install --no-root  # avoids warning "Warning: The current project could not be installed: No file/folder found for package rseblog"