Skip to content

Commit 5959092

Browse files
committed
Update Python Version and Enhance Venv Creation
- Upgrade Python version from 3.9 to 3.10 for virtual environment creation. - Implement check for Python version availability before virtual environment setup. - Add informative messages for successful virtual environment creation and activation instructions. - Include guidance on installing dependencies after virtual environment activation.
1 parent da637b7 commit 5959092

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ SHELL :=/bin/bash
22
CWD := $(PWD)
33
TMP_PATH := $(CWD)/.tmp
44
VENV_PATH := $(CWD)/venv
5-
PYTHON_VERSION := python3.9
5+
PYTHON_VERSION = python3.10
66
docker_image := good-first-issues
77

88
.PHONY: test clean
@@ -26,7 +26,17 @@ test: # Run pytest
2626
@pytest -vvv
2727

2828
venv: # Create a virtual environment
29-
@$(PYTHON_VERSION) -m venv venv
29+
@if ! command -v $(PYTHON_VERSION) > /dev/null; then \
30+
echo "❌ Error: $(PYTHON_VERSION) not found in your system."; \
31+
echo "Please specify the python version available in your system that is >= 'Python3.9'"; \
32+
echo ">>> Example:"; \
33+
echo "make venv PYTHON_VERSION=python3.11"; \
34+
exit 0; \
35+
else \
36+
echo "📦 Creating virtual env at: $(VENV_PATH)"; \
37+
$(PYTHON_VERSION) -m venv venv; \
38+
echo -e "✅ Done.\n\n🎉 Run the following commands to activate the virtual environment:\n ➡️ source $(VENV_PATH)/bin/activate\n\nThen run the following command to install dependencies:\n ➡️ make setup"; \
39+
fi
3040

3141
format: # Format code base with black
3242
@ruff format good_first_issues

0 commit comments

Comments
 (0)