ensure venv for Python tools#162
Conversation
|
It's been one month – can we please get ahead with this? (We still need to update ocrd_fileformat...) |
| # create+activate a Python venv if not already active | ||
| if [ -z "$(VIRTUAL_ENV)" ]; then \ | ||
| $(PYTHON) -m venv $(SHAREDIR)/venv && \ | ||
| . $(SHAREDIR)/venv/bin/activate && \ | ||
| pip install -U pip; \ | ||
| fi && $(MAKE) -C vendor all |
There was a problem hiding this comment.
@bertsky, @kba, these lines break make all in a default build (VIRTUAL_ENV not set, SHAREDIR=/usr/local/share).
Making a virtual Python environment will fail because of missing write permission.
Using sudo will make things even worse because of git conflicts with different users, and it will also create files owned by root in the user's file tree.
Is it okay if SHAREDIR is writable and already contains a venv to overwrite it by a new create command?
There was a problem hiding this comment.
IMO $(or $(VIRTUAL_ENV), $(SHAREDIR)/venv) should be an explicit prerequisite of vendor (to rule out overwriting and save time).
No description provided.