Repository navigation
fix: doc build without python cache - #543
SMoraisAnsys wants to merge 19 commits into
Conversation
|
Thanks for opening a Pull Request. If you want to perform a review write a comment saying: @ansys-reviewer-bot review |
RobPasMue
left a comment
There was a problem hiding this comment.
Some comments :) otherwise LGTM
| source .venv/bin/activate | ||
| if [[ ${{ env.BUILD_BACKEND }} == 'poetry' ]]; then | ||
| python -m pip install poetry ${{ env.PYTHON_NO_CACHE_OPTION }} | ||
| poetry install --with doc ${{ env.PYTHON_NO_CACHE_OPTION }} |
There was a problem hiding this comment.
venvs and poetry don't get along well AFAIK... Have you tried this with a poetry based project? Also... where is the venv created? I can't see it in this file...
There was a problem hiding this comment.
I'll need to check on such repo yeah, I didn't tried yet :)
| - name: Documentation build (Linux) | ||
| if: ${{ runner.os == 'Linux' }} | ||
| uses: ansys/actions/_doc-build-linux@main | ||
| uses: ansys/actions/_doc-build-linux@fix/doc-build-without-python-cache |
There was a problem hiding this comment.
Please remember to change this
| - name: Documentation build (Windows) | ||
| if: ${{ runner.os == 'Windows' }} | ||
| uses: ansys/actions/_doc-build-windows@main | ||
| uses: ansys/actions/_doc-build-windows@fix/doc-build-without-python-cache |
Co-authored-by: Roberto Pastor Muela <[email protected]>
|
FYI, I tested this on a fork of The CI associated consists in running multiple workflows where I build the documentation twice:
The idea of those workflow is to mock how a VM would behave when it had been already used with caching. The logs are here, know that I manually checked and it was consistent. |
|
Tested on |
|
Tested in |
|
Closing following #621 |
Following a discussion with @RobPasMue, the implementation of the
doc-buildaction did not correctly take into account the fact of not using caching when installing Python packages.Note: this is particularly annoying when one works with self-hosted runners where you can easily think that you are using the latest version of a package and it's not the case.
This PR does:
--no-cache-dirflag forpipbuild backend or--no-cacheflag forpoetrybackend if the input asks for no python cache;poetryorpip.Extra: to handle
poetryand virtual environment, I usepoetry config virtualenvs.create false. This configures poetry to not create a new virtual environment and ensure it uses the activated virtual environment. Another approach would have been to usepoetry's capability to create a virtual environment in-project. However, this wouldn't work well in the case of our VM with self hosted runners. Indeed, if a virtual environment has already been created for the project under{cache-dir}/virtualenvs, usingpoetry config virtualenvs.in-project truewill not cause poetry to create or use a local virtual environment.To fix that, a manual deletion of the virtual environment is required but it would troublesome in the long run... Thus, this option is not leveraged.