-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add support for arbitrary package names in python.install
#5572
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
We already install the latest version of pip, this is done just after the virtual env creation and before the package/requirements installation. |
Yeah, I see that now. Now I realized that I'm hitting Pip's bug: basically, |
As you can see, bumping things in the virtualenv manually doesn't help: https://readthedocs.org/projects/octomachinery/builds/8869252/ |
Looks like pypa/pip#6264 |
By the way, did anyone suggest providing the ability to just specify |
Anyway, I think bumping setuptools/pip in the system site-packages would "fix" this. At least, it seems like a valid workaround. |
Bumping system site-packages setuptools to at least 40.8.0 or removing it entirely works as a workaround. |
Nice, but in my case, it's 40.9.0 which is required because I rely on a feature introduced there (missing |
The pip in the global system package comes from the default in ubuntu https://github.com/rtfd/readthedocs-docker-images/blob/71714aa45ffd2b00dc599fd1353651a706ed9f49/Dockerfile#L124-L125 |
I don't think we will support that, we depend on a specific workflow, you may find this interesting #1083 |
Yeah... I see. I know I could migrate to gh-pages but if it's possible to fix this on RTD, maybe we should try. |
If the buggy lib is coming from the installation in pyenv, it would be updated the next time we update the docker images |
@stsewd you update |
Alright, it looks like |
I've also found another issue in the build log: /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/bin/python -m pip install --upgrade --cache-dir /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/.cache/pip Pygments==2.3.1 setuptools<41 docutils==0.14 mock==1.0.1 pillow==5.4.1 alabaster>=0.7,<0.8,!=0.7.5 commonmark==0.8.1 recommonmark==0.5.0 sphinx<2 sphinx-rtd-theme<0.5 readthedocs-sphinx-ext<0.6
Requirement already up-to-date: Pygments==2.3.1 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (2.3.1)
Requirement already up-to-date: setuptools<41 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (40.9.0)
Requirement already up-to-date: docutils==0.14 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (0.14)
Requirement already up-to-date: mock==1.0.1 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (1.0.1)
Requirement already up-to-date: pillow==5.4.1 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (5.4.1)
Requirement already up-to-date: alabaster!=0.7.5,<0.8,>=0.7 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (0.7.12)
Requirement already up-to-date: commonmark==0.8.1 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (0.8.1)
Requirement already up-to-date: recommonmark==0.5.0 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (0.5.0)
Requirement already up-to-date: sphinx<2 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (1.8.5)
Requirement already up-to-date: sphinx-rtd-theme<0.5 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (0.4.3)
Requirement already up-to-date: readthedocs-sphinx-ext<0.6 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (0.5.17)
Requirement already satisfied, skipping upgrade: future in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (from commonmark==0.8.1) (0.17.1)
Requirement already satisfied, skipping upgrade: babel!=2.0,>=1.3 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (from sphinx<2) (2.6.0)
Requirement already satisfied, skipping upgrade: imagesize in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (from sphinx<2) (1.1.0)
Requirement already satisfied, skipping upgrade: packaging in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (from sphinx<2) (19.0)
Requirement already satisfied, skipping upgrade: six>=1.5 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (from sphinx<2) (1.12.0)
Requirement already satisfied, skipping upgrade: snowballstemmer>=1.1 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (from sphinx<2) (1.2.1)
Requirement already satisfied, skipping upgrade: requests>=2.0.0 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (from sphinx<2) (2.21.0)
Requirement already satisfied, skipping upgrade: sphinxcontrib-websupport in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (from sphinx<2) (1.1.0)
Requirement already satisfied, skipping upgrade: Jinja2>=2.3 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (from sphinx<2) (2.10)
Requirement already satisfied, skipping upgrade: pytz>=0a in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (from babel!=2.0,>=1.3->sphinx<2) (2018.9)
Requirement already satisfied, skipping upgrade: pyparsing>=2.0.2 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (from packaging->sphinx<2) (2.3.1)
Requirement already satisfied, skipping upgrade: urllib3<1.25,>=1.21.1 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (from requests>=2.0.0->sphinx<2) (1.24.1)
Requirement already satisfied, skipping upgrade: chardet<3.1.0,>=3.0.2 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (from requests>=2.0.0->sphinx<2) (3.0.4)
Requirement already satisfied, skipping upgrade: idna<2.9,>=2.5 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (from requests>=2.0.0->sphinx<2) (2.8)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (from requests>=2.0.0->sphinx<2) (2019.3.9)
Requirement already satisfied, skipping upgrade: MarkupSafe>=0.23 in /home/docs/checkouts/readthedocs.org/user_builds/octomachinery/envs/latest/lib/python3.7/site-packages (from Jinja2>=2.3->sphinx<2) (1.1.1) for some reason, it installs |
Ah, that's fine... |
So I've tried out @stsewd when should we expect P.S. btw a bit unrelated: since you're already using |
I'm not really sure about the docker images in dockerhub, I'm using them without any problem, I guess they work for me bc I added them in a custom dockerfile. I time ago I tried updating pip from the global system/pyenv, but I was facing some complications (I don't remember exactly), that's why I ended up updating pip inside the virtualenv. I'm going to try to play around updating
I guess for historical reasons, when we weren't using it? Also, we don't really activate the virtualenv, we just use the executable from there. I was thinking more in using the |
So I went for a dirty hack and now it fails with SphinX: |
What version of sphinx are you using locally? |
latest |
I think I've figured it out. I'll need to |
We install 1.8.x by default, we don't support 2.0 yet, so you may experiment some weird things (maybe) |
I improved the hack: https://github.com/sanitizers/octomachinery/blob/819713b/docs/conf.py#L14-L65 And it worked: https://readthedocs.org/projects/octomachinery/builds/8872645/ don't repeat this at home! |
Yeah, it says Sphinx 2.0.0 https://docs.octomachinery.dev/ here in the bottom. I didn't set any version limitations. But the problem with hack was replacing things which have already been loaded into runtime via a separate process... |
This was a feature that we cut from the first implementation of our config file, but i think it's important for users to have this functionality. We rely too heavily on packaging patterns of yore, like pushing users towards requirements files, and this doesn't translate to a first class experience for users using more elegant solutions that exist for packaging now. I'd also advocate for enabling editable installs, so that Removing design decision we discussed the need for this and we just need to assign priority now. |
I just ran into this issue, it would indeed be useful 👍 |
Same, I hit this yesterday and found it redundant that I had to make a separate requirements file just for a single package. I don't think we have anything blocking us from implementing this now that we already support a list of requirements files. |
We still need a design decision on how the scheme will look like. One suggestion I have is python:
install:
- packages:
- mkdocs>=1.1
- sphinx |
Sounds good. But don't do too much validation as pip supports many formats including |
@stsewd The format you suggested looks good to me |
I'd like to push this issue forward, it's been in design decision for a while.
Looks great, that feel very natural with the rest of our Are there any design decisions left on this, or are we ready to toss this on the roadmap? |
With the new build.jobs feature, this could also be done with version: 2
build:
os: ubuntu-22.04
tools:
python: "3.10"
jobs:
post_install:
- pip install nox |
Yeah this is another option users will have soon, and mostly functionally the same. I might still be +0.5 on implementation of I don't feel too strongly about this though. |
I don't feel strongly either at this point. I see I wouldn't rush implementing this yet and I'd see how Adding a new config key has a lot of overhead: implementation, maintenance, documentation, and narrative around it as well. If we can get the same output without implementing a new config key, I'm fine testing how it goes with the |
Yeah, I think this is just about providing first class Python support in the end. We don't need to offer anything but I agree this isn't a huge priority with build.jobs, its just is a gap we never closed in our implementation. |
Based on the discussion and feedback, what is the current plan for addressing the gap in native Python installation options and providing better UX for beginners? |
IMHO, I'd say we should not implement this feature request because it's basically re-implementing a Besides, we will be moving people away from a default and pretty-well established pattern where they can find lot of help/troubleshooting guides on internet. Finally, we are making our platform more useful for other documentation tools and languages as well, so there will be a feature difference between Python and NodeJs, for example, where we won't support the same for I'd close the issue as "not planned". |
We likely have enough package installation options to get around the need for a one-off package installation option. Good point about Node, is the same true for Rust and one-off package installation? However, I will also say that I still feel we shouldn't be pushing users towards requirement files where we don't have to either. We have had feedback from Python package maintainers that requirements files are very redundant and something they have to maintain solely for RTD. In addition, modern Python tooling brings lock file support, something you have to hack up when relying on requirements files. To me, requirements files are the last resort option. For Python packaging projects and likely a good subset of projects with maintainers more familiar with Python, there are much better alternatives to both one-off package installation calls and requirements files. But, pure-documentation projects with less familiarity with Python/Node/etc are likely much more ambivalent to these patterns in all regards. I support calling this not planned if we add specific workarounds in our documentation using build.jobs. We can call adding direction to our documentation on package management future documentation improvements, as we likely want to consider user/project personas a bit more. I think we do have some room to offer up better solutions to projects |
This is what I'm saying. There is no need to build such a complex feature (which also will work only for Python projects) when we can just document something like: build:
os: "ubuntu-22.04"
jobs:
pre_build:
- pip install "sphinx<7.3" sphinx-rtd-theme==1.2.2 sphinx-notfound-page It uses standards tools ( |
Sure, and I understood that was the workaround we've been thinking of here. I'm just noting we should update our documentation to satisfy this issue. This workaround is fine for now, but I'd also still say this isn't great UX though. We'll be pointing users to our python configuration options for some usage of pip and build.jobs for other uses of pip. We would want to revisit this if we ever add Node or Rust package install options to the config. Node and Rust already won't have parity with our existing Python options like This is all something to consider for the future and to continue monitoring. We can revisit this issue if project configuration is dictating we should support single package installs for any language. |
@humitos I noticed that So to achieve true reproducibility and complete env provisioning control one is forced to resort to using version: 2
build:
os: ubuntu-22.04
tools:
python: >-
3.11
commands:
- python -m venv "${READTHEDOCS_VIRTUALENV_PATH}"
- >-
"${READTHEDOCS_VIRTUALENV_PATH}"/bin/python -m pip install --exists-action=w -r tests/requirements.in -c tests/requirements.txt
- >-
"${READTHEDOCS_VIRTUALENV_PATH}"/bin/python -m sphinx
-j auto
-W
-n
--keep-going
-T
-E
-b html
-d "${READTHEDOCS_OUTPUT}"/_build/doctrees
-D language=en
docs/
"${READTHEDOCS_OUTPUT}"/html |
@webknjaz Currently, you do need to use In the future, we will surface a However, |
We talked about prioritizing Also, we talked about "having to learn another YAML config" just for something that can be done with pretty standard |
I was trying to follow https://docs.readthedocs.io/en/stable/config-file/v2.html#packages but it seems to miss one important use-case.
My project requires pip 19 for building (because of PEP517 dep).
So I tried to do this:
And it failed because the validator expects a file system path.
I however need this and I don't want to create a requirements file just for this. It also doesn't make sense to put it into dist extras because it needs to be there before building the dist.
I think it should be pretty easy to extend the config. OTOH just having an up-to-date Pip version capable of PEP 517 would also deal with my problem.
Details
Expected Result
Build env have pip>=19.0.3
Actual Result
Failure to parse config
The text was updated successfully, but these errors were encountered: