carpentries / lesson-example

Example lesson using The Carpentries lesson template.
https://carpentries.github.io/lesson-example/
Other
64 stars 173 forks source link

`make serve` gives warning about python venv #362

Open gcapes opened 3 years ago

gcapes commented 3 years ago

I have a python venv in the root of (most of) my carpentries lessons. This is required to run the make check-lesson-all and so on. However, when I run make serve I get an error (warning?)

        ** ERROR: directory is already being watched! **

        Directory: /home/mbexegc2/Documents/training/course-material/git-course/venv/lib64

        is already being watched through: /home/mbexegc2/Documents/training/course-material/git-course/venv/lib

        MORE INFO: https://github.com/guard/listen/blob/master/README.md

I looked at the linked README but didn't really understand what to do.

It's not really a problem in that the site still builds locally, but it's a bit distracting.

Hopefully this is the correct place for this issue.

gcapes commented 3 years ago

The fix for this is to add venv to the exclude list at the end of _config.yml

gcapes commented 3 years ago

Just realised this should go in the lesson-example repo instead. Can someone move this issue?

maxim-belkin commented 3 years ago

Based on the provided error message, it looks like the error is caused by the lib64 "directory", which is probably a link to the lib directory. Can you check that lib64 is a link to lib and, if so, delete it and see if it works? You can recreate it afterwards if it doesn't work for you for some reason but I'm hopeful because I don't have lib64 directory in my venv folder and things work fine.

gcapes commented 3 years ago

@fmichonneau Thanks for moving the issue

@maxim-belkin Deleting the lib64 link gets rid of the error message, but given lib64 is automatically created, wouldn't my proposed solution above would be much neater than having to manually delete these automatically created links? It would also fix it for anyone else who finds themselves in my position.

maxim-belkin commented 3 years ago

wouldn't my proposed solution above would be much neater than having to manually delete these automatically created links?

At the moment, name and location of a folder that stores virtual environment files (venv in your report) are not standardized -- both are chosen by the user who creates it. If we choose to exclude venv in the _config.yml here, we won't solve the problem for other users with this problem who might choose to use different name/location. To solve the problem we need to standardize this folder's name & location. What we can do is create a virtualenv rule in the Makefile which would be responsible for creating a virtual environment and dealing with everything related to it. Once the name and location of that folder are systematized, we can make changes to _config.yml, if they're still necessary.

maxim-belkin commented 3 years ago

Btw, I think carpentries/styles was the correct place for this report, but it doesn't matter where we discuss this.