-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Consider adding support to setup.py path #4354
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
Comments
I don't think there is a current solution for this, but this probably will be implemented in the v2 on the configuration file (see #4298 (comment)). |
Thank you @stsewd ! |
There are a few issues open on this. It probably makes sense, especially if we also have a way to set path for requirements file/etc. I think originally we were going to use the @stsewd any opinions here? |
@agjohnson I was thinking about this, what I understand, users want to specify their python project root, so rtd can install the project from there. If we use the base option (too general) it won't solve all cases. What I was thinking is having a |
yeah, i think it's probably possible to hit a case where the Regarding schema, i think A couple other options:
python:
packages:
- foo/bar
- bar/foo
python:
packages:
- path: foo/bar
name: bar
some_setup_py_option_maybe: true
python:
install:
# these imply pip?
- requirements: docs/requirements.txt
- requirements: requirements.txt
# this implies setup.py install?
- package: foo/bar/
some_setup_py_options_here_maybe: true
# alternatively, maybe we're explicit about install type
- type: setup.py
path: foo/bar/
- type: pip
path: docs/requirements.txt Any opinion on any of these options? |
I haven't seen a project with multiple python packages, what would be the use case? Having a common repo for all packages with a single documentation point?
Maybe we can change the schema now... But not sure how many users need this now. Doesn't feel normal for me having multiple python projects in the same repo. Also, there is a real difference in using Also, if there are multiple packages, each one may have a different requirements file or maybe None. I'd say we need something like we have now in the python key but for multiple packages. Maybe list of dicts for all the python key or just a single dict, that should be a little easy to implement at this point |
we haven't had the request a lot, and i don't have example projects, but we've had the request to support multiple paths. The repos are generally some form of a monorepo.
Example 1 above is only for installation of a package via setup.py given a path. It leaves requirements file config option where it is now.
I meant that a requirements file implies pip install for the requirements file, as you can't install requirements via setup.py -- a requirements file is not a packaging concept, it's a deployment concept for non-packaged code. The difference between This is going to get complex very quickly, so I'm not certain what exactly we need to support. However, if we wanted to support a
Our potential schema might look like: python:
install:
# Install requirements via pip
- requirements: docs/requirements.txt
# Install path `something/else` via pip
- package: something/else
# Install explicit package via pip
- package: 'django<1.11'
# Install root path as package via setup.py
- package: .
use_setup_py: true |
I think we should leave this to the project dep, not to the rtd config file. python:
install:
- requirements: path/to/req.txt
package: .
method: pip Maybe we want to consider #3181 here too? |
a python:
install:
- package: path/to/package/in/repo/ This is useful for the case where either the package is not top-level or the repo contains multiple packages. |
Marking this design decision as we have a little bit more work to do on a schema addition for this, but i think i like the @rtfd/core this is good issue to chime in on for design decision |
I like Anthony's proposal from #4354 (comment) combined with the Santos' idea of The idea of |
I don't have a strong feeling here, but agree a list of possible options seems the most flexible. It lets us expand it in the future without having to change the syntax, which is a nice win. |
Note: my suggestion is that I do have a couple issues with add First, this seems odd as package is the wrong nomenclature: python:
install:
- package: foo/
method: pipenv pipenv operates on paths, not on packages. I also don't think this does anything helpful, as this is going to be closely analogous to just calling pip -- that is, pipenv won't operate on a lock file and will be calling the system pip for install. Similarly, we shouldn't allow pipenv install on a package identifier like Similarly, I don't think it makes sense to install package identifiers with python:
install:
- package: django>2
method: setup.py So, I think:
All the possibilities, rolled into one config: python:
install:
# Install package at path via pip
- path: contrib/some/package
# Install package at path via setup.py
- path: contrib/some/other/package
method: setup.py
# I'd prefer:
# use_pip: false
# or:
# use_setup: true
# Install package via pip
- package: django>2
# Requirements via pip
- requirements: requirements/docs.txt
# Pipfile via pipenv
- pipfile: . |
I don't think is a good idea to support that, users should specify that on their requirements, setup.py, or pipfile. We want builds to be reproducible and the rtd config file will only work on rtd (and we also will need to take care of command injections). I think |
Supporting package installation is not a strong requirement for this, but it's easy for us to implement if we're already making the above changes. Agreed it shouldn't be used often, but I'd rather offer it if it avoids users from having to maintain a separate requirements file just for docs dependencies. I'm also considering non-python users when I say this. Having to explain dependencies and a requirements file is a lot for these users. It's much easier for these users to just define a |
Just for confirmation of what we have: If a user wants to install from a python:
install:
- requirements: requirements.txt If user wants to install from setup.py python:
install:
- path: path/to/setup
method: setuptools (instead of setup.py, so users don't misunderstand this value with the path?) If user wants pip python:
install:
- path: path/to/package
method: pip This lets the spec open to pipenv too. Also, maybe support both a list and one element for install? Not sure if we are going to hit many cases of monorepos. I prefer |
@stsewd I think your previous comment is what we want. Although, I'm marking some notes:
|
Agreed on all of that 👍 . |
We all arrive to a proper solution and we have the pipfile schema already merged. I'm removing the |
This was already added in #4740. |
When using a project that is inside a different folder in a repository, one wants to install the project using the
setup.py
inside that folder instead of the root repository. Nowadays there is no way to specify the path for thesetup.py
file.Is there any workaround for that ?
The text was updated successfully, but these errors were encountered: