fix invalid specifier that was breaking example notebooks & pip-installing from GitHub/sdist. Also update readthedocs configuration files and remove testing on python 2.7 due to breaking changes in readthedocs and GitHub actions. #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi all, thanks for creating such a useful package!
Noticed during @johndmurray's guest lecture in torwager/ComputationalFoundations that the Minimal Example and Simple Example Colab notebooks are broken. Installing
PsychRNN
from the GitHub repo in the first cell fails because the version specifier after "python_version
" in this line is invalid:PsychRNN/setup.py
Line 29 in 2f54155
The reason the example notebooks were working fine previously (and regular
pip install PsychRNN
is still working for now) is actually a little convoluted --When building a package from a source distribution (e.g., the GitHub repo), old versions of
setuptools
(prior tov61.0
) would simply ignore invalid specifiers rather than throwing an error. The Colab VM had an oldersetuptools
version installed back when the example notebooks were written, so at that point the invalid specifier inPsychRNN/setup.py
was just getting ignored. But when Colab'ssetuptools
installation was finally updated back in March 2023 (it's now atv67.7.2
), the example notebooks suddenly broke because that line insetup.py
started preventing the package from being successfully built from the repo.The reason that ignoring the invalid specifier like
setuptools
used to do actually caused things to work right is kind of a happy accident. Ignoring the specifier makes that line insetup.py
read:Items passed to
install_requires
are names of packages that the current package depends on. So rather than specifying what version(s) of Python itself thePsychRNN
package requires (which I think was the intent based on the README), passing'python_version'
toinstall_requires
actually means "This package requires a package namedpython_version
".Just by chance, there actually happens to be a package named "
python_version
" available on PyPI, soPsychRNN
has been installing the "python_version
" package as a dependency rather than checking for the Python versions it actually requires.Finally, the reason you can still successfully install
PsychRNN
from PyPI withpip install PsychRNN
for the moment is that the package is available on PyPI as a binary distribution (a.k.a. "wheel") that was pre-built with an oldsetuptools
version back when it was uploaded in Jan. 2021. Installing this built distribution doesn't meanssetup.py
doesn't have to be parsed again to build the package after downloading it, which is the step that's failing. (Though it will fail if you try to install the source distribution withpip install --no-binary :all: PsychRNN
). Importantly however, this will also stop working beginning in Jan. 2024. The next major release ofpip
(v24.0) will start enforcing valid specifiers just likesetuptools v61.0
did, a new release will need to be pushed to PyPI for users to continue to be able to install the package (with up-to-datepip
versions).This PR is a minimal change but should fix all of these issues.
Note the
python_requires
argument added tosetup.py
does technically impose minimum version requirements on bothsetuptools
(>=24.2.0
) andpip
(>=9.0.0
), however both of these versions were released >7 years ago, and any Python versions that could possibly still be using anything older are long since EOL.Thanks again, and hope this is helpful!