Readthedocs.org: Upgrade setuptools versions before installation like we do with pip

Created on 27 Jun 2020  路  18Comments  路  Source: readthedocs/readthedocs.org

Details

Expected Result

I would expect the python setup.py install command to install the package without issue... I have no problem installing it with the same command locally with the same python version.

Actual Result

The build fail due to Could not find suitable distribution for Requirement.parse('tensorflow<=2.2,>=2')

Accepted Improvement

All 18 comments

Did you try replicating in a clean environment with the same python version as rtd? Also, what OS are you using?

And I can see your last build is passing https://readthedocs.org/projects/deel-lip/builds/11351896/

Latest build is passing because I switched from using python setup.py install to pip install ..

I can install locally with python setup.py install in a clean environment, with Python 3.7 on Windows (10).

Maybe we are using an old version of setuptools, also I think python setup.py install is deprecated in favor of pip install .

Maybe we are using an old version of setuptools,

I am using the default-bundled setuptools which is 47.1.0 on Windows 10 (Python 3.7).

also I think python setup.py install is deprecated in favor of pip install .

Yes, I think so, but python setup.py install is the default behavior on readthedocs.

We force the version to be 45.1.0 https://github.com/readthedocs/readthedocs-docker-images/blob/f8db06c9cf64c3473a524c08b547805288b81f71/Dockerfile#L182

Yes, I think so, but python setup.py install is the default behavior on readthedocs.

Yeah, that's why we recommend using a configuration file (pip is the default there)

I've the same issue.

No local packages or working download links found for tensorflow==1.15.3
error: Could not find suitable distribution for Requirement.parse('tensorflow==1.15.3')

The issue it's is related with the fact that pip in readthedocs envirioment it's not in the last version.

It's possible to force an upgrade of pip and setuptools in readthedocs system using the setup.py? For example

python -m pip install --upgrade pip setuptools

That solved in my machine

We do upgrade pip before building. If we need to update setuptools as well and it doesn't break anything I'm :+1:

I put that in my setup.py

pipVersion = pkg_resources.require("pip")[0].version
setuptoolsVersion = pkg_resources.require("setuptools")[0].version

print("\n PIP Version", pipVersion, "\n")
print("\n Setuptools Version", setuptoolsVersion, "\n")

and created a new build at readthedocs. This it's the output

PIP Version 20.1.1 

Setuptools Version 41.0.1 

The problem it's realted with this version of setuptools.

Also, a workaround is to force the upgrade of setuptools from a requirements file

https://docs.readthedocs.io/en/stable/config-file/v2.html#python-install

The python.install key will execute the steps in the order you put them, so you can have a requirements file updating setuptools and after that install tensorflow. I'll check how the setuptools upgrade goes from our side.

This worked! I fixed the setuptools to be at version 49.1.0. Thanks!

@devmessias btw, if this is the repo, you need to change to v2, otherwise that setting doesn't have effect when using the v2 config file https://github.com/stdogpkg/emate/blob/develop/.readthedocs.yaml (also, the v2 config file ignores all the options from the webui, so you'll need to install your package there as well)

Ah ok. I changed the config in the admin panel because of that. The v2 has backward compatibility with v1 files and configs?

Not really, but you can read how to migrate at https://docs.readthedocs.io/en/stable/config-file/v2.html#migrating-from-v1

Ok, Thank you for all the help!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cagataycali picture cagataycali  路  4Comments

SylvainCorlay picture SylvainCorlay  路  3Comments

krzychb picture krzychb  路  4Comments

dxgldotorg picture dxgldotorg  路  3Comments

gtalarico picture gtalarico  路  4Comments