Skip to content

Commit

Permalink
Separate development dependencies (#2835)
Browse files Browse the repository at this point in the history
  • Loading branch information
je-cook authored Aug 30, 2023
1 parent 16ff2c2 commit 9dd8261
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 16 deletions.
34 changes: 25 additions & 9 deletions cmake/pip.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# Check all Pip modules exist
# Author : K. Zarebski
# Date : last modified 2020-11-05
# Author : PROCESS Team (UKAEA)
# Date : last modified 2023-07-24
#
# Checks to see if all Python module requirements are satisfied else
# runs python pip on the requirements file

MACRO(PIP_INSTALL)
SET(PIP_NAME "pip_installs")

if ( RELEASE )
SET(RELEASE TRUE)
else()
SET(RELEASE FALSE)
endif()

EXECUTE_PROCESS(
COMMAND bash -c "${Python3_EXECUTABLE} -c \"import ford\""
OUTPUT_VARIABLE FORD_CHECK
Expand Down Expand Up @@ -35,6 +40,7 @@ MACRO(PIP_INSTALL)
ENDIF()

SET(MODULE_REQUIREMENTS_FILE ${CMAKE_SOURCE_DIR}/requirements.txt)
SET(DEVELOP_REQUIREMENTS_FILE ${CMAKE_SOURCE_DIR}/requirements_dev.txt)
STRING(REPLACE "/" "_" PIP_OUT_PREFIX ${Python3_EXECUTABLE})
SET(PIP_COMPLETE_FILE ${CMAKE_BINARY_DIR}/${PIP_OUT_PREFIX}.touch)
ADD_CUSTOM_TARGET(
Expand All @@ -44,12 +50,22 @@ MACRO(PIP_INSTALL)

# Manually install numpy as including it in requirements doesnt install it
# It is a pre-requisite to f90wrap install
ADD_CUSTOM_COMMAND(
OUTPUT ${PIP_COMPLETE_FILE}
COMMAND ${Python3_EXECUTABLE} -m pip install numpy
COMMAND ${Python3_EXECUTABLE} -m pip install -r ${MODULE_REQUIREMENTS_FILE}
COMMAND touch ${PIP_COMPLETE_FILE}
)
if (${RELEASE})
ADD_CUSTOM_COMMAND(
OUTPUT ${PIP_COMPLETE_FILE}
COMMAND ${Python3_EXECUTABLE} -m pip install numpy
COMMAND ${Python3_EXECUTABLE} -m pip install -r ${MODULE_REQUIREMENTS_FILE}
COMMAND touch ${PIP_COMPLETE_FILE}
)
else()
ADD_CUSTOM_COMMAND(
OUTPUT ${PIP_COMPLETE_FILE}
COMMAND ${Python3_EXECUTABLE} -m pip install numpy
COMMAND ${Python3_EXECUTABLE} -m pip install -r ${MODULE_REQUIREMENTS_FILE}
COMMAND ${Python3_EXECUTABLE} -m pip install -r ${DEVELOP_REQUIREMENTS_FILE}
COMMAND touch ${PIP_COMPLETE_FILE}
)
endif()

ADD_DEPENDENCIES(${PIP_NAME} ford_git)
ENDMACRO()
7 changes: 0 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,14 @@ matplotlib>=2.1.1
pillow>=5.1.0
Markdown>=3.2.2,<3.4
toposort>=1.5
pytest>=5.4.1
netCDF4>=1.5.4
wheel>=0.36.2
jupyter==1.0.0
pdf2image==1.16.0
pre-commit>=2.16.0
black>=22.3.0,<=23.0.0
flake8>=5.0.4
pytest-cov>=3.0.0
pytest-xdist>=2.5.0
numba>=0.55.2
pandas>=1.1.5
bokeh==2.4.0
mkdocstrings==0.18.0
flinter==0.3.0
PyVMCON>=2.1.0,<3.0.0
CoolProp>=6.4
Jinja2>=3.0
7 changes: 7 additions & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
black>=22.3.0,<=23.0.0
flake8>=5.0.4
flinter==0.3.0
pre-commit>=2.16.0
pytest>=5.4.1
pytest-cov>=3.0.0
pytest-xdist>=2.5.0

0 comments on commit 9dd8261

Please sign in to comment.