Commit 899f7cfa authored by Maciej Lenartowicz's avatar Maciej Lenartowicz

Merge branch 'makefile-python-version' into 'master'

Fixed Python version in Makefile.

See merge request turris/reforis/reforis-data-collection!1
parents d4d3d1b1 b9dee97d
Pipeline #59668 passed with stage
in 33 minutes and 5 seconds
......@@ -5,11 +5,11 @@
.PHONY: all venv prepare-dev install install-js install-local-reforis watch-js build-js lint lint-js lint-js-fix lint-web test test-js test-web test-js-update-snapshots create-messages init-langs update-messages compile-messages clean
DEV_PYTHON=python3.7
ROUTER_PYTHON=python3.6
VENV_NAME?=venv
VENV_BIN=$(shell pwd)/$(VENV_NAME)/bin
PYTHON=python3
JS_DIR=./js
LANGS = cs da de el en fi fo fr hr hu it ja ko lt nb nb_NO nl pl ro ru sk sv
......@@ -40,29 +40,29 @@ all:
venv: $(VENV_NAME)/bin/activate
$(VENV_NAME)/bin/activate: setup.py
test -d $(VENV_NAME) || $(DEV_PYTHON) -m virtualenv -p $(DEV_PYTHON) $(VENV_NAME)
test -d $(VENV_NAME) || $(PYTHON) -m virtualenv -p $(PYTHON) $(VENV_NAME)
# Some problem in latest version of setuptools during extracting translations.
$(VENV_BIN)/$(DEV_PYTHON) -m pip install -U pip setuptools==39.1.0
$(VENV_BIN)/$(DEV_PYTHON) -m pip install -e .[devel]
$(VENV_BIN)/$(PYTHON) -m pip install -U pip setuptools==39.1.0
$(VENV_BIN)/$(PYTHON) -m pip install -e .[devel]
touch $(VENV_NAME)/bin/activate
prepare-env:
which npm || curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
which npm || sudo apt install -y nodejs
which $(DEV_PYTHON) || sudo apt install -y $(DEV_PYTHON) $(DEV_PYTHON)-pip
which virtualenv || sudo $(DEV_PYTHON) -m pip install virtualenv
which $(PYTHON) || sudo apt install -y $(PYTHON) $(PYTHON)-pip
which virtualenv || sudo $(PYTHON) -m pip install virtualenv
prepare-dev:
cd $(JS_DIR); npm install
make venv
install:
$(ROUTER_PYTHON) -m pip install -e .
$(PYTHON) -m pip install -e .
ln -sf /tmp/reforis-data-collection/reforis_static/reforis_data_collection /tmp/reforis/reforis_static/
/etc/init.d/lighttpd restart
install-js: js/package.json
cd $(JS_DIR); npm install --save-dev
install-local-reforis:
$(VENV_BIN)/$(DEV_PYTHON) -m pip install -e ../reforis
$(VENV_BIN)/$(PYTHON) -m pip install -e ../reforis
watch-js:
cd $(JS_DIR); npm run-script watch
......@@ -75,14 +75,14 @@ lint-js:
lint-js-fix:
cd $(JS_DIR); npm run lint:fix
lint-web: venv
$(VENV_BIN)/$(DEV_PYTHON) -m pylint --rcfile=pylintrc reforis_data_collection
$(VENV_BIN)/$(DEV_PYTHON) -m pycodestyle --config=pycodestyle reforis_data_collection
$(VENV_BIN)/$(PYTHON) -m pylint --rcfile=pylintrc reforis_data_collection
$(VENV_BIN)/$(PYTHON) -m pycodestyle --config=pycodestyle reforis_data_collection
test: test-js test-web
test-js:
cd $(JS_DIR); npm test
test-web: venv
$(VENV_BIN)/$(DEV_PYTHON) -m pytest -vv tests
$(VENV_BIN)/$(PYTHON) -m pytest -vv tests
test-js-update-snapshots:
cd $(JS_DIR); npm test -- -u
......@@ -104,4 +104,4 @@ clean:
rm -rf $(VENV_NAME) *.eggs *.egg-info dist build .cache
rm -rf dist build *.egg-info
rm -rf $(JS_DIR)/node_modules/ reforis_static/reforis_data_collection/js/app.min.js
$(ROUTER_PYTHON) -m pip uninstall -y reforis_data_collection
$(PYTHON) -m pip uninstall -y reforis_data_collection
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment