forked from ultralytics/yolov5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (37 loc) · 1.25 KB
/
Makefile
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
48
49
50
PYTHON_VERSION = 3.9.13
PIP = poetry run pip
PYTHON = poetry run python
VERSION := $(shell sed -rn 's/^__version__\s*=\s*"(.+)"/\1/p' yolov5/__init__.py)
env:
# make sure expected python version is available
PYTHON_CONFIGURE_OPTS=--enable-shared pyenv install -s $(PYTHON_VERSION)
pyenv local $(PYTHON_VERSION)
poetry install --with dev
$(PIP) install -qU pip
init:
$(PIP) install -Ur requirements-dev.txt
clean: clean-build clean-pyc ## remove all artifacts
clean-build: ## remove build artifacts
@rm -rf build/
@rm -rf dist/
@rm -rf *.egg-info
clean-pyc: ## remove Python file artifacts
-@find . -name '*.pyc' -not -path "./.tox/*" -follow -print0 | xargs -0 rm -f
-@find . -name '*.pyo' -not -path "./.tox/*" -follow -print0 | xargs -0 rm -f
-@find . -name '__pycache__' -type d -not -path "./.tox/*" -follow -print0 | xargs -0 rm -rf
test:
env/bin/pytest
dist: clean
poetry check
ifneq ($(VERSION),$(strip $(shell poetry version | cut -d " " -f 2 )))
$(error Package and code versions mismatch, please try poetry install)
endif
poetry build
tag:
git tag -f -a -m "Auto-generated tag" $(VERSION)
git push --tags --force
release: clean dist tag
poetry publish -r psycle
lint:
env/bin/black . --exclude '/(env)/'
env/bin/pylint --disable=C yolov5