Skip to content
Prev Previous commit
Next Next commit
Updated Makefile
  • Loading branch information
Mindstan committed Sep 13, 2022
commit f0f507a1773819000bcb0ad1473e3b0fcd6a12fb
33 changes: 15 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
PYTHON_VERSION = 3.6.9
PYTHON_VERSION = 3.9.13

PIP = env/bin/pip
PYTHON = env/bin/python
VIRTUALENV = $(PYENV_ROOT)/versions/$(PYTHON_VERSION)/bin/virtualenv
PIP = poetry run pip
PYTHON = poetry run python

env:
pyenv install -s $(PYTHON_VERSION) # make sure expected python version is available
$(PYENV_ROOT)/versions/$(PYTHON_VERSION)/bin/pip install virtualenv # ensure virtualenv is installed for given python
if [ ! "$(shell $(PYTHON) -V)" = "Python $(PYTHON_VERSION)" ]; then \
echo "WARNING: python version mismatch => reset virtualenv" && rm -rf env/; \
fi
if [ ! -d env/ ]; then \
$(VIRTUALENV) env/; \
fi
# 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

Expand All @@ -34,17 +30,18 @@ test:
env/bin/pytest

dist: clean
#check-manifest
$(PYTHON) setup.py sdist bdist_wheel
ls -l dist
env/bin/twine check dist/*
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" `sed -rn 's/^__version__\s*=\s*"(.+)"/\1/p' yolov5/__init__.py`
git tag -f -a -m "Auto-generated tag" $(VERSION)
git push --tags --force

release: clean dist tag
env/bin/twine upload dist/* --repository-url https://pypi.psycle.dev/
poetry publish -r psycle

lint:
env/bin/black . --exclude '/(env)/'
Expand Down