<commit_before>PROTOC=protoc
RETHINKDB_HOME=../..
PROTO_FILE_DIR=$(RETHINKDB_HOME)/src/rdb_protocol
PROTO_BASE=ql2
PROTO_FILE=$(PROTO_FILE_DIR)/$(PROTO_BASE).proto

PYTHON_SRC=rethinkdb
PBCPP_SRC=rethinkdb
PYTHON_PB_FILE=$(PYTHON_SRC)/$(PROTO_BASE)_pb2.py
CPP_PB_FILE=$(PBCPP_SRC)/$(PROTO_BASE).pb.cc
PBCPP=rethinkdb_pbcpp.so
PBCPP_BUILT=./build/lib.linux-x86_64-2.7/rethinkdb_pbcpp.so

all: $(PYTHON_PB_FILE) $(PBCPP)

$(PYTHON_PB_FILE): $(PROTO_FILE)
	$(PROTOC) --python_out=$(PYTHON_SRC) -I$(PROTO_FILE_DIR) $(PROTO_FILE)

$(CPP_PB_FILE): $(PROTO_FILE)
	$(PROTOC) --cpp_out=$(PBCPP_SRC) -I$(PROTO_FILE_DIR) $(PROTO_FILE)

$(PBCPP): $(PBCPP_BUILT)
	cp $(PBCPP_BUILT) $(PBCPP)

$(PBCPP_BUILT): $(CPP_PB_FILE)
	python setup.py build 

clean:
	rm -f $(PYTHON_PB_FILE)
	rm -f $(CPP_PB_FILE)
	rm -f $(PBCPP)
	rm -rf ./build
	rm -rf ./dist
	rm -rf ./rethinkdb.egg-info
	rm -rf ./protobuf

PY_PKG_DIR=$(RETHINKDB_HOME)/build/packages/python

sdist: $(PYTHON_PB_FILE) $(CPP_PB_FILE)
	/usr/bin/python setup.py sdist

publish: $(PYTHON_PB_FILE)
	mkdir -p $(PY_PKG_DIR)
	cp setup.py $(PY_PKG_DIR)
	cp MANIFEST.in $(PY_PKG_DIR)
	cp -r rethinkdb $(PY_PKG_DIR)
	cp $(PYTHON_PB_FILE) $(PY_PKG_DIR)/rethinkdb
	cd $(PY_PKG_DIR); python setup.py register sdist upload

.PHONY: all clean publish sdist<commit_msg>Python driver build: do not require an optional file<commit_after>PROTOC=protoc
RETHINKDB_HOME=../..
PROTO_FILE_DIR=$(RETHINKDB_HOME)/src/rdb_protocol
PROTO_BASE=ql2
PROTO_FILE=$(PROTO_FILE_DIR)/$(PROTO_BASE).proto

PYTHON_SRC=rethinkdb
PBCPP_SRC=rethinkdb
PYTHON_PB_FILE=$(PYTHON_SRC)/$(PROTO_BASE)_pb2.py
CPP_PB_FILE=$(PBCPP_SRC)/$(PROTO_BASE).pb.cc
PBCPP=rethinkdb_pbcpp.so
PBCPP_BUILT=./build/lib.linux-x86_64-2.7/rethinkdb_pbcpp.so

all: $(PYTHON_PB_FILE) $(PBCPP)

$(PYTHON_PB_FILE): $(PROTO_FILE)
	$(PROTOC) --python_out=$(PYTHON_SRC) -I$(PROTO_FILE_DIR) $(PROTO_FILE)

$(CPP_PB_FILE): $(PROTO_FILE)
	$(PROTOC) --cpp_out=$(PBCPP_SRC) -I$(PROTO_FILE_DIR) $(PROTO_FILE)

$(PBCPP): $(PBCPP_BUILT)
	test ! -e $< || cp $< $@

$(PBCPP_BUILT): $(CPP_PB_FILE)
	python setup.py build

clean:
	rm -f $(PYTHON_PB_FILE)
	rm -f $(CPP_PB_FILE)
	rm -f $(PBCPP)
	rm -rf ./build
	rm -rf ./dist
	rm -rf ./rethinkdb.egg-info
	rm -rf ./protobuf

PY_PKG_DIR=$(RETHINKDB_HOME)/build/packages/python

sdist: $(PYTHON_PB_FILE) $(CPP_PB_FILE)
	/usr/bin/python setup.py sdist

publish: $(PYTHON_PB_FILE)
	mkdir -p $(PY_PKG_DIR)
	cp setup.py $(PY_PKG_DIR)
	cp MANIFEST.in $(PY_PKG_DIR)
	cp -r rethinkdb $(PY_PKG_DIR)
	cp $(PYTHON_PB_FILE) $(PY_PKG_DIR)/rethinkdb
	cd $(PY_PKG_DIR); python setup.py register sdist upload

.PHONY: all clean publish sdist
{'fraction_non_alphanumeric': 0.1632420091324201, 'fraction_numerical': 0.0060882800608828, 'mean_word_length': 5.810880829015544, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6238391', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1211, 'n_words': 197}