-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (37 loc) · 1.58 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
FLAKE8_CONFIG := $(shell \
if python -c "import toml" 2>/dev/null; then \
python -c "import toml; data = toml.load('pyproject.toml'); flake8 = data.get('tool', {}).get('flake8', {}); max_line_length = flake8.get('max-line-length', 128); ignores = ' '.join(['--ignore=' + i for i in flake8.get('ignore', [])]); print(f'--max-line-length {max_line_length} {ignores}')"; \
else \
echo "--max-line-length 128"; \
fi)
target:
@echo -e "\033[1mdotenvplus v$(shell grep -oP '(?<=__version__ = ")[^"]*' dotenvplus/__init__.py)\033[0m" \
"\nUse 'make \033[0;36mtarget\033[0m' where \033[0;36mtarget\033[0m is one of the following:"
@awk -F ':|##' '/^[^\t].+?:.*?##/ { printf " \033[0;36m%-15s\033[0m %s\n", $$1, $$NF }' $(MAKEFILE_LIST)
# Production tools
install: ## Install the package
pip install .
uninstall: ## Uninstall the package
pip uninstall -y dotenvplus
reinstall: uninstall install ## Reinstall the package
# Development tools
install_dev: ## Install the package in development mode
pip install .[dev]
venv: ## Create a virtual environment
python -m venv .venv
test: ## Run tests
@python -m unittest discover -s tests -p '*.py'
flake8: ## Run flake8 on the package
@flake8 $(FLAKE8_CONFIG) dotenvplus
@echo -e "\033[0;32mNo errors found.\033[0m"
type: ## Run pyright on the package
@pyright dotenvplus --pythonversion 3.11
clean: ## Clean the project
@rm -rf build dist *.egg-info .venv
# Maintainer-only commands
upload_pypi: ## Maintainer only - Upload latest version to PyPi
@echo Uploading to PyPi...
pip install .
python -m build
twine upload dist/*
@echo Done!