Closed daniel-mohr closed 1 year ago
Thanks for your report!
pip
? System-level pip in ubuntu can be to Python 2.7, so possibly you have to use pip3
pip
it is (and also of Python interpreter)? maybe it does not support the syntax?Just in case there was some confusion:
But it looks like you were trying to install the demo repo, which does not contain anything useful at all, and in a real-world setting probably one of the things the user should do is enabling PyPI releases if it is a tool and adapt the documentation accordingly.
To instantiate the repo you have to run cookiecutter https://github.com/Materials-Data-Science-and-Informatics/fair-python-cookiecutter
.
(In any case, of course installing the resulting Python package is supposed to work, so the issue is absolutely valid)
I'm really mean here the demo repo -- it is more or less the output of your cookiecutter
.
I run my short tests in a docker shell, e. g. docker run --mount type=bind,source=$(pwd),destination=/app --rm -it ubuntu:22.04
.
Regarding pip
: I installed only python3-pip
therefore it is really the python3 version:
ubuntu:22.04:
# pip --version
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)
ubuntu:20.04:
# pip --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
@daniel-mohr so there are two issues here actually
I can reproduce your problem with the URL resolution inside docker, yet with the same pip version (22.0.2) works outside of docker. It looks like an issue that is not related to the template, but rather your way of testing with the docker shell. The used URL format is supported by pip for a long time, see e.g. here, so maybe your issue is because the docker shell has not enough networking setup properly / DNS resolution failure.
Concerning the other issue - I've tested with different pip versions and apparently it does not work with pip < 21.2
, because of a bug in the toml parsing in pip
, i.e. creating problems with the pip version provided in Ubuntu 20.04.
the old pip
seems to choke on this, which is valid TOML 1.0:
include = [
"*.md", "LICENSE", "LICENSES", ".reuse/dep5", "CITATION.cff", "codemeta.json",
{ path = "mkdocs.yml", format = "sdist" },
{ path = "docs", format = "sdist" },
{ path = "tests", format = "sdist" },
]
I've already stumbled on this problem in various contexts where Python projects still used the broken toml
package instead of the tomli
/ tomllib
, and I won't butcher the project configuration to accomodate an old broken parser (here I just want to follow best practice and not bundle docs in the wheels distribution, but include them in the source dist).
So the workaround is to simply update to a recent version of pip (pip install --upgrade pip
) before trying to install the package.
I fear in this case there's no other solution, because whatever pip
is currently installed must process the pyproject.toml
first, even to know that it needs to update itself. I might add a note somewhere in the README/docs.
Describe the bug
The proposed installation instruction does not work.
To Reproduce Steps to reproduce the behavior:
apt-get update
apt-get install python3 python3-pip git
pip install git+ssh://git@github.com:Materials-Data-Science-and-Informatics/fair-python-cookiecutter-demo.git
leads to:
Solutions? For ubuntu:22.04 it could be fixed by using https:
pip install git+https://github.com/Materials-Data-Science-and-Informatics/fair-python-cookiecutter-demo.git
I'm not sure if ubuntu:20.04 in your scope. But this does not work at all: