11SRC =./aspose_barcode_cloud
22
3+ ifneq ($(wildcard .venv) ,)
4+ PYTHON = .venv/bin/python
5+ else
6+ PYTHON = python
7+ endif
8+
39.PHONY : all
410all : format lint test-tox
511
@@ -10,11 +16,11 @@ check_git:
1016
1117.PHONY : dist
1218dist :
13- python setup.py sdist bdist_wheel --universal
19+ $( PYTHON ) setup.py sdist bdist_wheel --universal
1420
1521.PHONY : format
1622format :
17- black --line-length=120 -v $(SRC ) tests/ scripts/ snippets/ * .py
23+ $( PYTHON ) -m black --line-length=120 -v $(SRC ) tests/ scripts/ snippets/ * .py
1824
1925.PHONY : format_doc
2026format_doc :
@@ -25,48 +31,54 @@ format_doc:
2531
2632.PHONY : init
2733init :
28- python -m pip install --upgrade pip
29- python -m pip install -r requirements.txt -r lint-requirements.txt -r test-requirements.txt
34+ $(PYTHON ) -m pip install --upgrade pip
35+ $(PYTHON ) -m pip install -r requirements.txt -r lint-requirements.txt -r test-requirements.txt
36+
37+ .PHONY : venv
38+ venv :
39+ python -m venv .venv
40+ .venv/bin/python -m pip install --upgrade pip
41+ .venv/bin/python -m pip install -r requirements.txt -r lint-requirements.txt -r test-requirements.txt
3042
3143.PHONY : init-docker
3244init-docker :
33- python -m pip install -r publish-requirements.txt -r requirements.txt
45+ $( PYTHON ) -m pip install -r publish-requirements.txt -r requirements.txt
3446
3547.PHONY : lint
3648lint :
3749 # stop the build if there are Python syntax errors or undefined names
38- python -m flake8 aspose_barcode_cloud --count --select=E9,F63,F7,F82 --show-source --statistics --extend-exclude ' .*'
50+ $( PYTHON ) -m flake8 aspose_barcode_cloud --count --select=E9,F63,F7,F82 --show-source --statistics --extend-exclude ' .*'
3951 # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
40- python -m flake8 aspose_barcode_cloud --count --exit-zero --max-line-length=127 --statistics --extend-ignore=E501 --extend-exclude ' .*'
52+ $( PYTHON ) -m flake8 aspose_barcode_cloud --count --exit-zero --max-line-length=127 --statistics --extend-ignore=E501 --extend-exclude ' .*'
4153
4254.PHONY : publish
4355publish : check_git test-tox dist
44- python -m twine upload dist/*
56+ $( PYTHON ) -m twine upload dist/*
4557
4658.PHONY : publish-docker
4759publish-docker : init-docker unittest dist
48- python -m twine upload dist/* --verbose
60+ $( PYTHON ) -m twine upload dist/* --verbose
4961
5062.PHONY : test
5163test :
52- python -m pytest --cov=aspose_barcode_cloud tests/
64+ $( PYTHON ) -m pytest --cov=aspose_barcode_cloud tests/
5365 ./scripts/run_snippets.sh
5466
5567.PHONY : cover
5668cover :
57- python -Werror -m pytest --cov-report html:coverage --cov=aspose_barcode_cloud tests/
69+ $( PYTHON ) -Werror -m pytest --cov-report html:coverage --cov=aspose_barcode_cloud tests/
5870
5971.PHONY : unittest
6072unittest :
61- python -Werror -m unittest discover -v
73+ $( PYTHON ) -Werror -m unittest discover -v
6274
6375.PHONY : test-example
6476test-example :
65- python -Werror example.py
77+ $( PYTHON ) -Werror example.py
6678
6779.PHONY : test-tox
6880test-tox :
69- python -m tox $(SRC )
81+ $( PYTHON ) -m tox $(SRC )
7082
7183.PHONY : insert-examples
7284insert-examples :
0 commit comments