Readthedocs.org: readthecods uses virtual environment even when it is disabled

Created on 2 Sep 2015  路  21Comments  路  Source: readthedocs/readthedocs.org

Hi, I haven't changed anything in my code but from one day to the next the built of my docs fails.

When building, it starts with

python -mvirtualenv --system-site-packages /home/docs/checkouts/readthedocs.org/user_builds/pypet/envs/latest

python /home/docs/checkouts/readthedocs.org/user_builds/pypet/envs/latest/bin/pip install --use-wheel --find-links=/home/docs/checkouts/readthedocs.org/deploy/wheels -U -I sphinx==1.3.1 Pygments==2.0.2 virtualenv==13.1.0 setuptools==18.0.1 docutils==0.11 mkdocs==0.14.0 mock==1.0.1 pillow==2.6.1 readthedocs-sphinx-ext==0.5.4 sphinx-rtd-theme==0.1.8 alabaster>=0.7,<0.8,!=0.7.5 recommonmark==0.1.1

 python /home/docs/checkouts/readthedocs.org/user_builds/pypet/envs/latest/bin/pip install --exists-action=w -rrequirements.txt 

The latest statement fails because it cannot find the HDF5 library (which is used by PyTables).
However, I don't want read the docs to install my package at all, I have not checked the box "Install your project inside a virtualenv using setup.py install". But it still tries to do that!
Why? How can I force read the docs not to install my package but just compile the docs?

Thanks!

Accepted Improvement

Most helpful comment

Hm, i guess this issue is related to my current problem:
I have pybluez listed in my requirements.txt and not checked anything to install my package but RTD still tries to do so and fails because pybluez depends on bluez-clibs.
Why does RTD parse and install my requirements.txt and is there any way to turn that off?

All 21 comments

Btw I do have a requirements.txt in my top-level project folder. Have there been some internal changes in read the docs that ignore the tick mark "Install your project inside a virtualenv using setup.py install" if there is such a file?

Well, I can confirm my hypothesis. In case I remove the requirements.txt file from my package, readthedocs stops installing my package.

Can you please fix the problem that having a requirements.txt file overrides the tick mark Install your project inside a virtualenv using setup.py install? Thanks!

If the intended outcome is to skip requirements.txt or setup.py, we should have build options for those, and not piggyback on use_virtualenv. The use_virtualenv option only stops the setup.py as it stands now, and could likely be dropped.

Fixes for this are welcome.

Hello, bitten by this as well. I think I 've tracked the problem down to https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/projects/tasks.py#L281

That piece of code uses the defined requirements file and if it does not exist, tries to guess it. Then in line 294 the requirements_file_path variable is bound to exist if the repo has a requirementst.txt file (or a pip_requirements.txt file). That part of code has been refactored in https://github.com/rtfd/readthedocs.org/commit/ff432361a606da4b9b9952b1eee17589202acc62 although I must admit I do not see at this point in time why the previous version was working fine.

This seems to me to be entirely independent of the virtualenv setting, so the documentation is misleading as already pointed out. At least the part about "Requires Virtualenv" that is.

As far as a design decision goes, my proposal (if worth anything) is to have a flag to allow skipping installing requirements.txt, independent of the use_virtualenv setting.

I think this is something that we need to consider for our upcoming new build system. See related ticket #1649,

I can't build my documentation as well. It seems having a requirements.txt file overrides the tick mark Install your project inside a virtualenv using setup.py install.
So what is the status of this issue now?

1649 was closed after a proposed fix that changed this option

Is this still an issue for anyone?

@agjohnson I think so, yes. Not sure how this got fixed and what actions are required on my part, but what I did was empty out the requirements file option (I had worked around the problem by specifying a non-breaking-my-build doc-requirements.txt) in the admin interface and try to build my project. It failed, trying to build all of the dependencies in requirements.txt

Are there any docs detailing the new behavior and how it is configured ?

Hm, i guess this issue is related to my current problem:
I have pybluez listed in my requirements.txt and not checked anything to install my package but RTD still tries to do so and fails because pybluez depends on bluez-clibs.
Why does RTD parse and install my requirements.txt and is there any way to turn that off?

We automatically try find requirements.txt. You should be able to explicitly set requirements_file: null in our yaml config, though I'm not sure if that triggers the auto-search or assumes we're explicitly not going to search for a file.

You should be able to explicitly set requirements_file: null in our yaml config

This is still not working yet. There is a PR to handle this case at https://github.com/rtfd/readthedocs-build/pull/38

So, the residual problem of this ticket is that rtd automatically picks the requirements.txt file?

We currently automatically detect the configuration file if the setting is None in the configuration file, we could use '' (empty string).

From this comment https://github.com/rtfd/readthedocs.org/pull/4355/files#r202485887 I suppose that using '' we are forcing RTD to not use or install any requirements.txt file.

I don't really like that solution because it's not too explicit to me, but if that works to omit finding it, we can close this issue. @stsewd what do you think?

I was waiting to have the v2 released to close this, right now, people can't use '' in v1 (I haven't tested it, but I'm pretty sure it will raise an error).

This was implemented in our configuration file (v2), isn't available for users yet, but I hope it will be soon or at least for some users (we can add a flag to make it available to some projects).

@stsewd I wouldn't close the issue if we don't have a solution for the final user yet.

I going to bring this to the team and see if we can select some projects to use the v2 of the config file, if not I'll open this till we are ready for that

So, we are planning to activate this to some projects, if anyone is interested in test the beta of the v2 config, please comment with your rtd project :)

I'm interested in testing it with Blueproximity. The doc build is currently failing because of this bug.

@Thor77 great! here are some docs of the v2 config file https://github.com/rtfd/readthedocs.org/pull/4451/files#diff-33bbde7fca852e881b51aa90f9f86b3f

I'll let you know when you can add the file to your project (we only need to activate a flag for your project)

Was this page helpful?
0 / 5 - 0 ratings