aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 000c4683b7bb701282b0c92302e5d93f2f7c66da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
SHELL := /bin/bash

.PHONY: deps
deps: ## Install dependencies from setup.py into pipenv
	pipenv install '-e .'

.PHONY: help
help: ## Print info about all commands
	@echo "Commands:"
	@echo
	@grep -E '^[/.a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "    \033[01;32m%-40s\033[0m %s\n", $$1, $$2}'

data/release_export_expanded.json.gz: ## Download release export
	mkdir -p data
	wget -c https://archive.org/download/fatcat_bulk_exports_2020-08-05/release_export_expanded.json.gz -O $@

.PHONY: black
black: ## Format all Python files
	find . -name "*.py" -exec black {} \;

.PHONY: dist
dist: ## Create source distribution and wheel
	python setup.py sdist bdist_wheel

.PHONY: clean
clean: ## Clean all artifacts
	rm -rf dist
	rm -rf fuzzycat.egg-info/

# Upload requires https://github.com/pypa/twine and some configuration.
.PHONY: upload
upload: dist
	# https://pypi.org/account/register/
	# $ cat ~/.pypirc
	# [pypi]
	# username:abc
	# password:secret
	#
	# For internal repositories, name them in ~/.pypirc (e.g. "internal"), then
	# run: make upload TWINE_OPTS="-r internal" to upload to hosted pypi
	# repository.
	#
	# For automatic package deployments, also see: .gitlab-ci.yml.
	twine upload $(TWINE_OPTS) dist/*