Skip to content
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

Support flit for installing projects #6280

Closed
kalekundert opened this issue Oct 13, 2019 · 4 comments
Closed

Support flit for installing projects #6280

kalekundert opened this issue Oct 13, 2019 · 4 comments
Labels
Feature New feature

Comments

@kalekundert
Copy link

I have a project that I'm using flit to install and publish, but I don't see a way to get RTD to install it. The process for installing with flit is not much different than installing with pip, basically just running flit install --symlink rather than pip install -e ..

This feature request seems similar to #4783, which seems close to being merged. If there's interest, perhaps I can try to model a PR on that. The v2 configuration file already has a python.install.method field, so it would seem natural to add flit as an option there.

@humitos
Copy link
Member

humitos commented Oct 13, 2019

Hi @kalekundert! We currently do not support other way of installing packages than using pip, setup.py, or conda. The support for pipfile was not merged for different reasons, but one of them is that because we are not sure if we want to support multiples ways of installing packages, given the small amount of people that we are maintaining the core.

There was an attempt of merging and deploying the support for pipfile because the work was already done there, but we are still considering it.

I'd say that we won't support another way of installing Python packages soon, unless there is a good reason to do that. I'm not very familiar with flit: what value gives flit over pip? does it allow to do something that pip can not do currently?

@humitos humitos added the Feature New feature label Oct 13, 2019
@kalekundert
Copy link
Author

First, a disclaimer: Take everything I say with a grain of salt, because I didn't really know anything about any of it until last night.

After looking at this more closely, I don't think this feature request really makes sense. The advantage of flit is that it uses pyproject.toml instead of setup.py, so it's easier to work with, has less boiler-plate, and is more modern. pip can also use pyproject.toml (see PEP 518), though. In fact, my pyproject.toml instructs pip to first install flit, and then to use flit to install my package. Really, the whole idea behind pyproject.toml is for services like RTD to just use pip and nothing else. The practical exception is for pip install --editable, which still requires setup.py and cannot use pyproject.toml. There's a long thread on this topic here.

Last night my docs weren't building, and I thought that was because RTD was trying to do pip install --editable. Today I looked more closely at the logs and saw that RTD was actually calling python setup.py install directly, which obviously won't work if there isn't a setup.py. This surprised me because I had read that the default was to use pip. But at the time I didn't have a .readthedocs.yml config file, so this morning I added one specifying that RTD should use pip, and then my project was able to build.

So in the end, the only thing I'm confused about is why RTD wasn't installing my project with pip by default. Does there need to be a .readthedocs.yml file (possibly empty) for the defaults described in the documentation to take effect? If so, is that ever explicitly stated anywhere?

Anyways, thanks for taking the time to respond to this issue.

@stsewd
Copy link
Member

stsewd commented Oct 13, 2019

So in the end, the only thing I'm confused about is why RTD wasn't installing my project with pip by default. Does there need to be a .readthedocs.yml file (possibly empty) for the defaults described in the documentation to take effect? If so, is that ever explicitly stated anywhere?

Yes, you need to have a configuration file with version: 2 in order to have the defaults described on that page. You can see this restriction at the beginning.

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

@kalekundert
Copy link
Author

Got it, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature
Projects
None yet
Development

No branches or pull requests

3 participants