<commit_before># Makefile to help automate tasks in bookie
WD := $(shell pwd)
PY := bin/python
CELERY := bin/celery worker --app=bookie.bcelery -B -l debug
PEP8 := bin/pep8
PIP := bin/pip
PIP_MIR = PIP_FIND_LINKS='http://mypi http://simple.crate.io/'
NOSE := bin/nosetests
PASTER := bin/pserve
PYSCSS := bin/pyscss
GUNICORN := bin/gunicorn
S3 := s3cp.py --bucket files.bmark.us --public

BOOKIE_INI = bookie.ini
SAURL = $(shell grep sqlalchemy.url $(BOOKIE_INI) | cut -d "=" -f 2 | tr -d " ")

CACHE := $(WD)/download-cache
BOOKIE_JS = bookie/static/js/bookie
JS_BUILD_PATH = bookie/static/js/build
JS_META_SCRIPT = $(PY) scripts/js/generate_meta.py
DEV_JS_FILES := $(wildcard $(BOOKIE_JS)/*.js)
BUILD_JS_FILES := $(patsubst $(BOOKIE_JS)/%.js,$(JS_BUILD_PATH)/b/%.js,$(DEV_JS_FILES))
BUILD_JSMIN_FILES := $(patsubst $(JS_BUILD_PATH)/b/%.js,,$(JS_BUILD_PATH)/b/%-min.js,$(BUILD_JS_FILES))
YUI := yui_3.11.0.zip
JSTESTURL = http://127.0.0.1:9000/tests

EXTENSION = $(WD)/extensions
CHROME = /usr/bin/google-chrome
CHROME_BUILD = $(EXTENSION)/chrome_ext/lib
CHROME_EXT_PATH = $(EXTENSION)/chrome_ext
CHROME_KEY = /home/rharding/.ssh/chrome_ext.pem
CHROME_FILESERVE = /home/bmark.us/www/bookie_chrome.crx
CHROME_BUILD_FILE = $(EXTENSION)/chrome_ext.crx
CHROME_DEV_FILE = $(EXTENSION)/chrome_ext.zip

BOOKIE_CSS = bookie/static/css
RESCSS = bookie/static/css/responsive.css
BASECSS = bookie/static/css/base.css

SYSDEPS := build-essential libxslt1-dev libxml2-dev python-dev libpq-dev git\
	       python-virtualenv redis-server unzip

.PHONY: all
all: deps develop bookie.db db_up js

.PHONY: clean
clean: clean_js clean_css

.PHONY: clean_all
clean_all: clean_venv clean_js clean_css clean_chrome clean_downloadcache

.PHONY: sysdeps
sysdeps:
	sudo apt-get install $(SYSDEPS)

.PHONY: install
install: $(BOOKIE_INI) all first_bookmark css

.PHONY: develop
develop: lib/python*/site-packages/bookie.egg-link
lib/python*/site-packages/bookie.egg-link:
	$(PY) setup.py develop

$(BOOKIE_INI):
	cp sample.ini $(BOOKIE_INI)

# DATABASE
#
# Need a series of commands to handle migrations
bookie.db: develop
	bin/alembic upgrade head

test_bookie.db: develop
	bin/alembic -c test_alembic.ini upgrade head

# The upgade/etc commands are only for the live db. Test databases are
# expected to be torn down and resetup each time.
.PHONY: db_up
db_up: bookie.db
	bin/alembic upgrade head

.PHONY: db_down
db_down: bookie.db
	bin/alembic downgrade
<commit_msg>Allow non-interactive `make sysdeps` (via env var)<commit_after># Makefile to help automate tasks in bookie
WD := $(shell pwd)
PY := bin/python
CELERY := bin/celery worker --app=bookie.bcelery -B -l debug
PEP8 := bin/pep8
PIP := bin/pip
PIP_MIR = PIP_FIND_LINKS='http://mypi http://simple.crate.io/'
NOSE := bin/nosetests
PASTER := bin/pserve
PYSCSS := bin/pyscss
GUNICORN := bin/gunicorn
S3 := s3cp.py --bucket files.bmark.us --public

BOOKIE_INI = bookie.ini
SAURL = $(shell grep sqlalchemy.url $(BOOKIE_INI) | cut -d "=" -f 2 | tr -d " ")

CACHE := $(WD)/download-cache
BOOKIE_JS = bookie/static/js/bookie
JS_BUILD_PATH = bookie/static/js/build
JS_META_SCRIPT = $(PY) scripts/js/generate_meta.py
DEV_JS_FILES := $(wildcard $(BOOKIE_JS)/*.js)
BUILD_JS_FILES := $(patsubst $(BOOKIE_JS)/%.js,$(JS_BUILD_PATH)/b/%.js,$(DEV_JS_FILES))
BUILD_JSMIN_FILES := $(patsubst $(JS_BUILD_PATH)/b/%.js,,$(JS_BUILD_PATH)/b/%-min.js,$(BUILD_JS_FILES))
YUI := yui_3.11.0.zip
JSTESTURL = http://127.0.0.1:9000/tests

EXTENSION = $(WD)/extensions
CHROME = /usr/bin/google-chrome
CHROME_BUILD = $(EXTENSION)/chrome_ext/lib
CHROME_EXT_PATH = $(EXTENSION)/chrome_ext
CHROME_KEY = /home/rharding/.ssh/chrome_ext.pem
CHROME_FILESERVE = /home/bmark.us/www/bookie_chrome.crx
CHROME_BUILD_FILE = $(EXTENSION)/chrome_ext.crx
CHROME_DEV_FILE = $(EXTENSION)/chrome_ext.zip

BOOKIE_CSS = bookie/static/css
RESCSS = bookie/static/css/responsive.css
BASECSS = bookie/static/css/base.css

SYSDEPS := build-essential libxslt1-dev libxml2-dev python-dev libpq-dev git\
	       python-virtualenv redis-server unzip

.PHONY: all
all: deps develop bookie.db db_up js

.PHONY: clean
clean: clean_js clean_css

.PHONY: clean_all
clean_all: clean_venv clean_js clean_css clean_chrome clean_downloadcache

.PHONY: sysdeps
sysdeps:
	if [ $(NONINTERACTIVE) ]; then \
		sudo apt-get install -y $(SYSDEPS); \
	else \
		sudo apt-get install $(SYSDEPS); \
	fi

.PHONY: install
install: $(BOOKIE_INI) all first_bookmark css

.PHONY: develop
develop: lib/python*/site-packages/bookie.egg-link
lib/python*/site-packages/bookie.egg-link:
	$(PY) setup.py develop

$(BOOKIE_INI):
	cp sample.ini $(BOOKIE_INI)

# DATABASE
#
# Need a series of commands to handle migrations
bookie.db: develop
	bin/alembic upgrade head

test_bookie.db: develop
	bin/alembic -c test_alembic.ini upgrade head

# The upgade/etc commands are only for the live db. Test databases are
# expected to be torn down and resetup each time.
.PHONY: db_up
db_up: bookie.db
	bin/alembic upgrade head

.PHONY: db_down
db_down: bookie.db
	bin/alembic downgrade

{'fraction_non_alphanumeric': 0.13434323300777357, 'fraction_numerical': 0.008371536774965119, 'mean_word_length': 4.612975391498882, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3531500', 'n_tokens_mistral': 2086, 'n_tokens_neox': 2022, 'n_words': 434}