nutanix / calm-dsl

Keep Calm and DSL On!
https://nutanix.github.io/calm-dsl/
Apache License 2.0
33 stars 51 forks source link

[Improvement] add functionality for Windows specific Makefile targets #229

Open glover-chris opened 2 years ago

glover-chris commented 2 years ago

Describe the request There are more and more Windows users utilizing Calm DSL and the current Makefile "dev" target is specific to Linux/Darwin python installations. Windows Python has different OS paths for binaries. Current behaviour Running "make dev" fails for Windows users configuring DSL. Expected behaviour Running "make dev" should work on windows.

A possible workaroound could be something like as follows: this example merely shows the "dev" target but all occurences of "venv/bin" should use the ${VENV_PATH} variable within the Makefile targets.

ifeq ($(OS),Windows_NT) VENV_PATH = venv/Scripts else ifeq ($(UNAME_S),Linux) VENV_PATH = venv/bin endif ifeq ($(UNAME_S),Darwin) VENV_PATH = venv/bin endif endif

dev:

Setup our python3 based virtualenv

# This step assumes python3 is installed on your dev machine
[ -f ${VENV_PATH}/Scripts/python ] || (python -m venv venv && \
    ${VENV_PATH}/pip install --upgrade pip setuptools)
${VENV_PATH}/pip install --no-cache -r requirements.txt -r dev-requirements.txt
${VENV_PATH}/python setup.py develop