Open bergercookie opened 2 years ago
Interesting, thanks for the suggestion. I think this assertion exists to make the issue more obvious for local installations from source. Otherwise the errors produced by using 3.6 may be hard to parse and track back to a simple python version mismatch.
@Skylion007 any thoughts on this?
@aclegg3 Yeah, I would remove the assertion and use the proper setup.py requires. I wonder if there is a way to specify the python version using PEP517.
@bergercookie Would gladly look at a PR that fixes our setup.py if you have a suggestion? Alternatively, would listing the version properly via setup.cfg or pyproject solve the issue?
Habitat-Sim version
Main branch.
🐛 Bug
python3.6.9
as the system python version.I'm specifying this dependency with one of the following syntaxes in
pyproject.toml
:or having
git clone
d habitat-sim,When I have habitat-sim as a dependency, and because it's not published on PyPI so that its dependencies are known, I believe
poetry
has to download the package, create a temporary virtualenvironment, and do a local build, so that it can determine habitat-sim's dependencies, in order to then also fetch them to build my parent project.However, when I'm running
poetry install
to do all the above, poetry fails with the message:This is because, in your
setup.py
, you specify:Why is this check in place? The canonical way of mandating a python version for a package, is, and you already do this later in
setup.py
:Raising an AssertionError when the package is executed by an incompatible python version only disallows the introspection of the package dependencies.
Steps to Reproduce
Steps to reproduce the behavior:
cd
into that package, change the path to habitat-sim specified inpyprojec.toml
accordingly andpoetry build
.Expected behavior
The above will fail with an assertion error. That shouldn't happen since after introspection, poetry will create a virtualenv with the right python version for the code to run in, so the python requirement will eventually be valid.
Note that you can also repro the above behavior without poetry and only
python3.6 -m seutp
from inside habitat-sim's directory.Suggested Fix
I don't see a good reason for this check and assertion error to be in place. I would remove it altogether.
There is nothing >=py3.7 specific when parsing the
setup.py
file and setuptools andpip
itself is able to enforce that the right python version will be used just by specifyingpython-requires = ...
insidesetup()
.System Info
setup.py
, intending to use >=py3.7 to execute it.Thanks.