Skip to content
This repository has been archived by the owner on Jul 11, 2021. It is now read-only.

Commit

Permalink
use virtualenv to install packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 committed Jun 24, 2018
1 parent a49c03c commit 8bba244
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@ TERM_OUTPUT = terms.csv
# make config; don't change until you read man (1) make
# WARNING: changing -j4 to -j will spawn arbitrary processes and probably set your computer thrashing
MAKEFLAGS += -j4 --warn-undefined-variables
ifeq ($(shell echo $$BASH_VERSION),,)
export ENV = .virtualenv/bin/activate
else
export BASH_ENV = .virtualenv/bin/activate
endif
SHELL = sh

# data variables
GRADEFORGE = python -m gradeforge
GRADEFORGE = gradeforge

# NOTE: BOOKSTORE_OUTPUT is not here because a) getting books for every section would
# get us IP-banned and b) cut doesn't work with newlines
Expand Down Expand Up @@ -65,7 +70,15 @@ data: $(DATA)
install: .gradeforge_installed

.gradeforge_installed:
if [ -z $$VIRTUAL_ENV ]; then pip install --user .; else pip install .; fi
if [ -z $$VIRTUAL_ENV ]; then \
which virtualenv || { \
echo 'refusing to install globally; run `pip install .` to continue'; \
exit 1; \
}; \
virtualenv .virtualenv; \
. .virtualenv/bin/activate; \
pip install .; \
else pip install .; fi
touch $@

.PHONY: all_grades all_sections
Expand Down

0 comments on commit 8bba244

Please sign in to comment.