<commit_before>unexport LANG
unexport LC_ADDRESS
unexport LC_COLLATE
unexport LC_CTYPE
unexport LC_IDENTIFICATION
unexport LC_MEASUREMENT
unexport LC_MESSAGES
unexport LC_MONETARY
unexport LC_NAME
unexport LC_NUMERIC
unexport LC_PAPER
unexport LC_TELEPHONE
unexport LC_TIME

PANDOC_VERSION := $(shell pandoc --version)
PROTOC_VERSION := $(shell protoc --version)

PROJDIR   = $(realpath $(CURDIR))
TOOLS_DIR = $(PROJDIR)/tools/devrel
CA_DIR    = $(PROJDIR)/tools/test-ca

.PHONY: lint
lint:
	./.runner lint

.PHONY: pb_clean
pb_clean:
	@echo "==> Python (clean)"
	@rm -rf riak/pb/*_pb2.py riak/pb/*.pyc riak/pb/__pycache__ __pycache__ py-build

.PHONY: pb_compile
pb_compile: pb_clean
ifeq ($(PROTOC_VERSION),)
	$(error The protoc command is required to parse proto files)
endif
ifneq ($(PROTOC_VERSION),libprotoc 2.5.0)
	$(error protoc must be version 2.5.0)
endif
	@echo "==> Python (compile)"
	@protoc -Iriak_pb/src --python_out=riak/pb riak_pb/src/*.proto
	@python setup.py build_messages

.PHONY: test_sdist
test_sdist:
	@python setup.py sdist

.PHONY: release_sdist
release_sdist:
ifeq ($(VERSION),)
	$(error VERSION must be set to build a release and deploy this package)
endif
ifeq ($(PANDOC_VERSION),)
	$(error The pandoc command is required to correctly convert README.md to rst format)
endif
ifeq ($(RELEASE_GPG_KEYNAME),)
	$(error RELEASE_GPG_KEYNAME must be set to build a release and deploy this package)
endif
	@python -c 'import pypandoc'
	@echo "==> Python tagging version $(VERSION)"
	# NB: Python client version strings do NOT start with 'v'. Le Sigh.
	# validate VERSION and allow pre-releases
	@./build/publish $(VERSION) validate
	@git tag --sign -a "$(VERSION)" -m "riak-python-client $(VERSION)" --local-user "$(RELEASE_GPG_KEYNAME)"
	@git push --tags
	@echo "==> Python (sdist release)"
	@python setup.py sdist upload --show-response --sign --identity $(RELEASE_GPG_KEYNAME)
	@./build/publish $(VERSION)

.PHONY: release
release: release_sdist
ifeq ($(RELEASE_GPG_KEYNAME),)
	$(error RELEASE_GPG_KEYNAME must be set to build a release and deploy this package)
endif
	@echo "==> Python 2.7 (release)"
	@python2.7 setup.py build --build-base=py-build/2.7 bdist_egg upload --show-response --sign --identity $(RELEASE_GPG_KEYNAME)
	@echo "==> Python 3.3 (release)"
	@python3.3 setup.py build --build-base=py-build/3.3 bdist_egg upload --show-response --sign --identity $(RELEASE_GPG_KEYNAME)
	@echo "==> Python 3.4 (release)"
	@python3.4 setup.py build --build-base=py-build/3.4 bdist_egg upload --show-response --sign --identity $(RELEASE_GPG_KEYNAME)
	@echo "==> Python 3.5 (release)"
	@python3.5 setup.py build --build-base=py-build/3.5 bdist_egg upload --show-response --sign --identity $(RELEASE_GPG_KEYNAME)

.PHONY: unit-test
unit-test:
	@./.runner unit-test<commit_msg>remove comments<commit_after>unexport LANG
unexport LC_ADDRESS
unexport LC_COLLATE
unexport LC_CTYPE
unexport LC_IDENTIFICATION
unexport LC_MEASUREMENT
unexport LC_MESSAGES
unexport LC_MONETARY
unexport LC_NAME
unexport LC_NUMERIC
unexport LC_PAPER
unexport LC_TELEPHONE
unexport LC_TIME

PANDOC_VERSION := $(shell pandoc --version)
PROTOC_VERSION := $(shell protoc --version)

PROJDIR   = $(realpath $(CURDIR))
TOOLS_DIR = $(PROJDIR)/tools/devrel
CA_DIR    = $(PROJDIR)/tools/test-ca

.PHONY: lint
lint:
	./.runner lint

.PHONY: pb_clean
pb_clean:
	@echo "==> Python (clean)"
	@rm -rf riak/pb/*_pb2.py riak/pb/*.pyc riak/pb/__pycache__ __pycache__ py-build

.PHONY: pb_compile
pb_compile: pb_clean
ifeq ($(PROTOC_VERSION),)
	$(error The protoc command is required to parse proto files)
endif
ifneq ($(PROTOC_VERSION),libprotoc 2.5.0)
	$(error protoc must be version 2.5.0)
endif
	@echo "==> Python (compile)"
	@protoc -Iriak_pb/src --python_out=riak/pb riak_pb/src/*.proto
	@python setup.py build_messages

.PHONY: test_sdist
test_sdist:
	@python setup.py sdist

.PHONY: release_sdist
release_sdist:
ifeq ($(VERSION),)
	$(error VERSION must be set to build a release and deploy this package)
endif
ifeq ($(PANDOC_VERSION),)
	$(error The pandoc command is required to correctly convert README.md to rst format)
endif
ifeq ($(RELEASE_GPG_KEYNAME),)
	$(error RELEASE_GPG_KEYNAME must be set to build a release and deploy this package)
endif
	@python -c 'import pypandoc'
	@echo "==> Python tagging version $(VERSION)"
	@./build/publish $(VERSION) validate
	@git tag --sign -a "$(VERSION)" -m "riak-python-client $(VERSION)" --local-user "$(RELEASE_GPG_KEYNAME)"
	@git push --tags
	@echo "==> Python (sdist release)"
	@python setup.py sdist upload --show-response --sign --identity $(RELEASE_GPG_KEYNAME)
	@./build/publish $(VERSION)

.PHONY: release
release: release_sdist
ifeq ($(RELEASE_GPG_KEYNAME),)
	$(error RELEASE_GPG_KEYNAME must be set to build a release and deploy this package)
endif
	@echo "==> Python 2.7 (release)"
	@python2.7 setup.py build --build-base=py-build/2.7 bdist_egg upload --show-response --sign --identity $(RELEASE_GPG_KEYNAME)
	@echo "==> Python 3.3 (release)"
	@python3.3 setup.py build --build-base=py-build/3.3 bdist_egg upload --show-response --sign --identity $(RELEASE_GPG_KEYNAME)
	@echo "==> Python 3.4 (release)"
	@python3.4 setup.py build --build-base=py-build/3.4 bdist_egg upload --show-response --sign --identity $(RELEASE_GPG_KEYNAME)
	@echo "==> Python 3.5 (release)"
	@python3.5 setup.py build --build-base=py-build/3.5 bdist_egg upload --show-response --sign --identity $(RELEASE_GPG_KEYNAME)

.PHONY: unit-test
unit-test:
	@./.runner unit-test
{'fraction_non_alphanumeric': 0.13343055049216188, 'fraction_numerical': 0.011301494713816989, 'mean_word_length': 4.691908713692946, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '5761502', 'n_tokens_mistral': 2084, 'n_tokens_neox': 2001, 'n_words': 563}