From 8cfebc5a088724f61983cc5eece94f408fc2b1d0 Mon Sep 17 00:00:00 2001 From: Florian Maas Date: Wed, 3 Jul 2024 20:48:11 +0200 Subject: [PATCH 1/4] update makefile --- Makefile | 91 ++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 66 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index eb8fe839..4b8b6a28 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,4 @@ +<<<<<<< HEAD dev: python3 -m venv .venv ifeq ($(OS), Windows_NT) @@ -5,39 +6,79 @@ ifeq ($(OS), Windows_NT) else . .venv/bin/activate endif +======= +.PHONY: dev +dev: ## Create virtual environment and install development dependencies. + @echo "Creating virtual environment..." + @python3 -m venv .venv + @if [ "$(OS)" = "Windows_NT" ]; then \ + echo "🚀 Activating virtual environment on Windows"; \ + .venv\Scripts\activate; \ + else \ + echo "🚀 Activating virtual environment on Unix"; \ + . .venv/bin/activate; \ + fi && \ + echo "🚀 Installing development dependencies" && \ +>>>>>>> 9b7d99a (update makefile) pip install '.[dev]' -install: - pip install . +.PHONY: install +install: ## Install the package. + @echo "Installing the package..." + @pip install . -fmt: - yapf -pri databricks tests - autoflake -ri databricks tests - isort databricks tests +.PHONY: fmt +fmt: ## Format the code in 'databricks' and 'tests' directories. + @echo "Formatting code..." + @yapf -pri databricks tests + @autoflake -ri databricks tests + @isort databricks tests -fmte: - yapf -pri examples - autoflake -ri examples - isort examples +.PHONY: fmte +fmte: ## Format the code in 'examples' directory. + @echo "Formatting examples..." + @yapf -pri examples + @autoflake -ri examples + @isort examples -lint: - pycodestyle databricks - autoflake --check-diff --quiet --recursive databricks +.PHONY: lint +lint: ## Lint the code and check for unused imports in 'databricks' directory. + @echo "Linting code..." + @pycodestyle databricks + @autoflake --check-diff --quiet --recursive databricks -test: - pytest -m 'not integration and not benchmark' --cov=databricks --cov-report html tests +.PHONY: test +test: ## Run unit tests with coverage report. + @echo "Running unit tests..." + @pytest -m 'not integration and not benchmark' --cov=databricks --cov-report html tests -integration: - pytest -n auto -m 'integration and not benchmark' --reruns 2 --dist loadgroup --cov=databricks --cov-report html tests +.PHONY: integration +integration: ## Run integration tests in parallel with retry on failure. + @echo "Running integration tests..." + @pytest -n auto -m 'integration and not benchmark' --reruns 2 --dist loadgroup --cov=databricks --cov-report html tests -benchmark: - pytest -m 'benchmark' tests +.PHONY: benchmark +benchmark: ## Run benchmark tests. + @echo "Running benchmark tests..." + @pytest -m 'benchmark' tests -coverage: test - open htmlcov/index.html +.PHONY: coverage +coverage: test ## Generate and open the coverage report. + @echo "Opening coverage report..." + @open htmlcov/index.html -dist: - python3 setup.py bdist_wheel sdist +.PHONY: dist +dist: ## Build distribution packages. + @echo "Building distribution packages..." + @python3 setup.py bdist_wheel sdist -clean: - rm -fr dist *.egg-info .pytest_cache build htmlcov +.PHONY: clean +clean: ## Clean up build artifacts. + @echo "Cleaning up build artifacts..." + @rm -fr dist *.egg-info .pytest_cache build htmlcov + +.PHONY: help +help: ## Show help for the commands. + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' + +.DEFAULT_GOAL := help From af9f6e1b44c42540f1a895d386a5375c7e22cbc7 Mon Sep 17 00:00:00 2001 From: Florian Maas Date: Wed, 3 Jul 2024 20:53:02 +0200 Subject: [PATCH 2/4] fix --- Makefile | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 4b8b6a28..3ed03001 100644 --- a/Makefile +++ b/Makefile @@ -1,26 +1,15 @@ -<<<<<<< HEAD -dev: - python3 -m venv .venv -ifeq ($(OS), Windows_NT) - .venv\Scripts\activate -else - . .venv/bin/activate -endif -======= .PHONY: dev dev: ## Create virtual environment and install development dependencies. @echo "Creating virtual environment..." @python3 -m venv .venv + @echo "Activating virtual environment..." @if [ "$(OS)" = "Windows_NT" ]; then \ - echo "🚀 Activating virtual environment on Windows"; \ .venv\Scripts\activate; \ else \ - echo "🚀 Activating virtual environment on Unix"; \ . .venv/bin/activate; \ - fi && \ - echo "🚀 Installing development dependencies" && \ ->>>>>>> 9b7d99a (update makefile) - pip install '.[dev]' + fi + @echo "Installing development dependencies..." + @pip install '.[dev]' .PHONY: install install: ## Install the package. From 3e6318316719bade20273a859020ed5ad49d6000 Mon Sep 17 00:00:00 2001 From: Florian Maas Date: Wed, 3 Jul 2024 20:55:37 +0200 Subject: [PATCH 3/4] improve Makefile --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3ed03001..9c0f7901 100644 --- a/Makefile +++ b/Makefile @@ -31,18 +31,18 @@ fmte: ## Format the code in 'examples' directory. @isort examples .PHONY: lint -lint: ## Lint the code and check for unused imports in 'databricks' directory. +lint: ## Lint the code in 'databricks' directory. @echo "Linting code..." @pycodestyle databricks @autoflake --check-diff --quiet --recursive databricks .PHONY: test -test: ## Run unit tests with coverage report. +test: ## Run unit tests. @echo "Running unit tests..." @pytest -m 'not integration and not benchmark' --cov=databricks --cov-report html tests .PHONY: integration -integration: ## Run integration tests in parallel with retry on failure. +integration: ## Run integration tests. @echo "Running integration tests..." @pytest -n auto -m 'integration and not benchmark' --reruns 2 --dist loadgroup --cov=databricks --cov-report html tests From f4812dc433c7c89b787f733dbc7b6c3bfc0c5a65 Mon Sep 17 00:00:00 2001 From: Florian Maas Date: Wed, 3 Jul 2024 21:06:07 +0200 Subject: [PATCH 4/4] fix --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 9c0f7901..cef97851 100644 --- a/Makefile +++ b/Makefile @@ -3,11 +3,11 @@ dev: ## Create virtual environment and install development dependencies. @echo "Creating virtual environment..." @python3 -m venv .venv @echo "Activating virtual environment..." - @if [ "$(OS)" = "Windows_NT" ]; then \ - .venv\Scripts\activate; \ - else \ - . .venv/bin/activate; \ - fi +ifeq ($(OS), Windows_NT) + .venv\Scripts\activate +else + . .venv/bin/activate +endif @echo "Installing development dependencies..." @pip install '.[dev]'