From 826117b24d1ec29150f3c55871ba4ca5880408f6 Mon Sep 17 00:00:00 2001 From: Brandon Myers Date: Tue, 2 Jul 2019 18:50:38 -0500 Subject: [PATCH] Update makefile and setup config --- Makefile | 55 ++++++++++++++++++++++++++++++++++++++++++------------- setup.cfg | 2 +- 2 files changed, 43 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 37ae65e..03c5422 100644 --- a/Makefile +++ b/Makefile @@ -4,11 +4,49 @@ # Copyright (c) 2014-2017 Mozilla Corporation # Author: gdestuynder@mozilla.com -all: - ./setup.py build -install: - ./setup.py install +.PHONY: clean clean-pyc clean-build help +.DEFAULT_GOAL := help + +define PRINT_HELP_PYSCRIPT +import re, sys + +for line in sys.stdin: + match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line) + if match: + target, help = match.groups() + print("%-20s %s" % (target, help)) +endef +export PRINT_HELP_PYSCRIPT + +help: + @python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) + +clean: clean-build clean-pyc ## remove all build and Python artifacts + +clean-build: ## remove build artifacts + rm -fr build/ + rm -fr dist/ + rm -fr .eggs/ + find . -name '*.egg-info' -exec rm -fr {} + + find . -name '*.egg' -exec rm -f {} + + +clean-pyc: ## remove Python file artifacts + find . -name '*.pyc' -exec rm -f {} + + find . -name '*.pyo' -exec rm -f {} + + find . -name '*~' -exec rm -f {} + + find . -name '__pycache__' -exec rm -fr {} + + +release: dist ## package and upload a release + twine upload dist/* + +dist: clean ## builds source and wheel package + python setup.py sdist + python setup.py bdist_wheel + ls -l dist + +install: clean ## install the package to the active Python's site-packages + python setup.py install rpm: fpm -s python -t rpm -d pytz -d python-requests-futures --replaces python-mozdef ./setup.py @@ -19,12 +57,3 @@ deb: tests: test test: py.test tests - -pypi: - python setup.py sdist check upload --sign - -clean: - rm -rf *pyc - rm -rf build - rm -rf __pycache__ - rm -rf dist diff --git a/setup.cfg b/setup.cfg index 35a54f5..314b914 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,2 @@ [bdist_rpm] -release = 1%{?dist} +release = 1%%{?dist}