Update installation docs and possibly Django
I was interested in looking at a couple of the issues here, but the docs for getting things setup seem to be missing a few bits of information, and the current setup is not compatible with the latest version of Python
Notably:
- The
Makefilerelies on bothpipandpythonbeing present, however on every system I've used in the past ~10 years (MacOS and Ubuntu, can't speak for Windows) whenever you install Python3 through the normal package managers (even if not alongside Python2), the commands arepip3andpython3whereaspipandpythonhave tended to always refer to Python2. This can be worked around with some aliases and a venv, but I feel like this requirement should be noted somewhere in the docs to identify what version of Python should be used and/or the other general requirements to run the project - Similar to the first issue, the current Django version is not compatible with the latest version of Python. Currently PokeAPI uses Django v3.2.25, which is a year and 2 major versions behind the latest. The issue is that this version still relies on the
cgimodule, which was removed from Python in version 3.13 last year, and it's not clear in the README what version of Python is actually recommended (I had presumed the latest, but that was not the case)
I am aware of the Docker instructions, but the point still stands that the non-Docker instructions seem to be outdated and such
Windows uses py, python to point to the python installation and its generally just recommended to do python -m pip or python3 in this case. As you mentioned old linux based distros used to use python2 and referred to it as python and while migrating they referred to the later 3.x versions as python3.
There is a pep around this too: https://peps.python.org/pep-0394/
But yeah the alias will wary largely based on the users os/distro and setup, maybe just add a note in the README I suppose.
old linux based distros
To be clear, this isn't just a thing with older Linux distros. I've been using Ubuntu for around 10 years now, but in that time I've used at least 5 different machines all with fresh installations. The Ubuntu machine I most recently setup (around 2 years ago) had things this way, python was Python2 and python3 was Python3
This is also the case for MacOS, my brand new Mac Mini from this year also works this way (which is why I noticed it at all)
maybe just add a note in the README I suppose
Agreed, this is all that's required imo which is why I proposed this in the original post as well
It depends on distros again some keep it for legacy reasons and some now refer to python and python3 synonymously like for example fedora and arch.
The fedora migration doc: https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
Some like ubuntu, debian etc keep it for stability or legacy reasons
Yes, and I didn't say otherwise? I'm not really sure what the point of the comments are here tbqh, I was a just pointing out why the lack of clarity in the README can be an issue for some users
Yeah, fair enough I saw another pr I think #1302 which was directly making changes to the makefile hence I spoke to chime in :)
We could add a Makefile target that checks if the local python is a Python3 environment and if not print a warning and exit. What do you think?
check-python:
test '3' -eq $(python -c 'import sys; print(sys.version_info[0])')