Skip to content

Commit d4df603

Browse files
committed
Add python virtual environment
Signed-off-by: Jeff Goeders <[email protected]>
1 parent 6aa5209 commit d4df603

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ ODIN_II/usefull_tools/**/track_completed
104104
#Python
105105
#
106106
*.pyc
107+
/.venv
107108

108109
#
109110
#Vim

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,3 +451,9 @@ list(APPEND DIRS_TO_FORMAT_PY "${CMAKE_CURRENT_SOURCE_DIR}/vpr")
451451
list(APPEND DIRS_TO_FORMAT_PY "${CMAKE_CURRENT_SOURCE_DIR}/vtr_flow")
452452

453453
include(AutoPyFormat)
454+
455+
456+
#
457+
# Python Environment setup
458+
#
459+
include(PyEnv)

cmake/modules/PyEnv.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Create a python virtual environment using venv and install all necessary packages
2+
# wheel should be installed before the requirements.txt list to prevent errors.
3+
add_custom_target(env
4+
COMMAND python3 -m venv ../.venv
5+
COMMAND . ../.venv/bin/activate && pip3 install wheel
6+
COMMAND . ../.venv/bin/activate && pip3 install -r ../requirements.txt
7+
)

0 commit comments

Comments
 (0)