File: Makefile

package info (click to toggle)
filetype.py 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,560 kB
  • sloc: python: 1,841; makefile: 42; sh: 21
file content (47 lines) | stat: -rw-r--r-- 1,291 bytes parent folder | download
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
46
47
all: lint unit

export PYTHONPATH:=${PWD}
version=`python -c 'import filetype; print(filetype.version)'`
filename=filetype-`python -c 'import filetype;print(filetype.version)'`.tar.gz

lint:
	@flake8 .

test: clean lint
	@echo "Running tests ..."
	@python -m unittest discover

documentation:
	@pdoc --html --overwrite --all-submodules --html-dir docs filetype
	@rm -rf docs/v${version}
	@mv docs/filetype docs/v${version}

deploy-documentation: documentation
	@cd docs && git checkout gh-pages
	@cd docs && git add .
	@cd docs && git commit -am release
	@cd docs && git push --force origin gh-pages

clean:
	@printf "Cleaning up files that are already in .gitignore... "
	@for pattern in `cat .gitignore`; do find . -name "$$pattern" -delete; done
	@echo "OK!"

tag:
	@echo "Creating tag v$(version)..."
	@echo $(version)
	@git tag -a v$(version) -m "Version v$(version)"
	@git push origin v$(version)

compress:
	@printf "Exporting to $(filename)... "
	@tar czf $(filename) filetype setup.py README.md LICENSE

publish:
	@echo "==> Releasing package $(version)..."
	@python setup.py sdist bdist_wheel
	@twine upload dist/* --repository-url https://upload.pypi.org/legacy/
	@rm -fr build dist .egg pook.egg-info

release: clean docs deploy-documentation tag compress publish
	@echo "DONE!"