Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
APP := redisolar
PORT := 8081
PYTHON3_8 := $(shell command -v python3.8 2> /dev/null)
VALID_PYTHON_FOUND := $(shell command -v python3.8 2> /dev/null)
ifndef VALID_PYTHON_FOUND
VALID_PYTHON_FOUND := $(shell command -v python3.9 2> /dev/null)
PYTHON_COMMAND := "python3.9"
else
PYTHON_COMMAND := "python3.8"
endif
ifndef VALID_PYTHON_FOUND
VALID_PYTHON_FOUND := $(shell command -v python3.10 2> /dev/null)
PYTHON_COMMAND := "python3.10"
endif
ifndef VALID_PYTHON_FOUND
VALID_PYTHON_FOUND := $(shell command -v python3.11 2> /dev/null)
PYTHON_COMMAND := "python3.11"
endif

ifndef PYTHON3_8
$(error "Python 3.8 is not installed! See README.md")
ifndef VALID_PYTHON_FOUND
$(error "Python 3.8-11 is not installed! See README.md")
endif

ifeq (${IS_CI}, true)
Expand All @@ -19,7 +33,7 @@ all: env mypy lint test
env: env/bin/activate

env/bin/activate: requirements.txt
test -d env || python3.8 -m venv env
test -d env || ${PYTHON_COMMAND} -m venv env
. env/bin/activate; pip install --upgrade pip; pip install pip-tools wheel -e .; pip-sync requirements.txt requirements-dev.txt
touch env/bin/activate

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This is the sample application codebase for the Redis University course [RU102PY

To start and run this application, you will need:

* [Python 3.8](https://www.python.org/downloads/) (**Note**: It must be version 3.8)
* [Python 3.8 or higher](https://www.python.org/downloads/) (**Note**: It must be version 3.8 or higher)
* Access to a local or remote installation of [Redis](https://redis.io/download) version 5 or newer
* Your Redis installation should have the RedisTimeSeries module installed. You can find the installation instructions at: https://oss.redis.com/redistimeseries/#setup

Expand Down Expand Up @@ -44,6 +44,8 @@ following command from the base directory of the project:

python3.8 -m venv env

Substitute `python3.8` for your version of Python if you're running Python 3.9 or 3.10.

#### Dependencies

Before installing dependencies, activate the virtualenv:
Expand Down