Open SMoraisAnsys opened 3 weeks ago
Thanks for opening a Pull Request. If you want to perform a review write a comment saying:
@ansys-reviewer-bot review
FYI, I tested this on a fork of pyconceptev
as I think poetry
handling might have been difficult.
The PR : https://github.com/SMoraisAnsys/pyconceptev/pull/1
The CI associated consists in running multiple workflows where I build the documentation twice:
use-python-cache = True
, remove virtual environment and build documentation with use-python-cache = True
. The packages are downloaded for the first documentation build and not downloaded for the second documentation build.use-python-cache = True
, remove virtual environment and build documentation with use-python-cache = False
. The packages are downloaded every time to build the documentation!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 pyansys-sound
and it worked, see https://github.com/ansys/pyansys-sound/pull/111
Tested in pyansys-geometry
and working as expected, see https://github.com/ansys/pyansys-geometry/pull/1404
Following a discussion with @RobPasMue, the implementation of the
doc-build
action 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-dir
flag forpip
build backend or--no-cache
flag forpoetry
backend if the input asks for no python cache;poetry
orpip
.Extra: to handle
poetry
and 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 true
will 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.