Skip to content

Upgrade setuptools versions before installation like we do with pip #7241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Holt59 opened this issue Jun 27, 2020 · 18 comments · Fixed by #7290
Closed

Upgrade setuptools versions before installation like we do with pip #7241

Holt59 opened this issue Jun 27, 2020 · 18 comments · Fixed by #7290
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code

Comments

@Holt59
Copy link

Holt59 commented Jun 27, 2020

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')

@stsewd stsewd added the Support Support question label Jun 29, 2020
@stsewd
Copy link
Member

stsewd commented Jul 2, 2020

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/

@stsewd stsewd added the Needed: more information A reply from issue author is required label Jul 2, 2020
@Holt59
Copy link
Author

Holt59 commented Jul 3, 2020

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).

@no-response no-response bot removed the Needed: more information A reply from issue author is required label Jul 3, 2020
@stsewd
Copy link
Member

stsewd commented Jul 6, 2020

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

@Holt59
Copy link
Author

Holt59 commented Jul 6, 2020

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.

@stsewd
Copy link
Member

stsewd commented Jul 6, 2020

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)

@devmessias
Copy link

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.

@devmessias
Copy link

See tensorflow/tensorflow#34302

@devmessias
Copy link

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

@stsewd
Copy link
Member

stsewd commented Jul 7, 2020

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

devmessias added a commit to stdogpkg/emate that referenced this issue Jul 7, 2020
devmessias added a commit to stdogpkg/emate that referenced this issue Jul 7, 2020
@devmessias
Copy link

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.

@stsewd
Copy link
Member

stsewd commented Jul 7, 2020

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.

@devmessias
Copy link

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

@stsewd stsewd added Improvement Minor improvement to code and removed Support Support question labels Jul 7, 2020
@stsewd stsewd changed the title Build fails at python setup.py install due to tensorflow not being found Upgrade setuptools versions before installation like we do with pip Jul 7, 2020
@stsewd
Copy link
Member

stsewd commented Jul 7, 2020

@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)

@devmessias
Copy link

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

@stsewd
Copy link
Member

stsewd commented Jul 7, 2020

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

@devmessias
Copy link

Ok, Thank you for all the help!

@stale
Copy link

stale bot commented Aug 22, 2020

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.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Aug 22, 2020
@stsewd
Copy link
Member

stsewd commented Aug 23, 2020

There is a PR open #7290

@stale stale bot removed the Status: stale Issue will be considered inactive soon label Aug 23, 2020
@stsewd stsewd added the Accepted Accepted issue on our roadmap label Aug 23, 2020
stsewd added a commit that referenced this issue Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants