forked from algorithmicsuperintelligence/openevolve
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (43 loc) · 1.42 KB
/
Makefile
File metadata and controls
51 lines (43 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Variables
PROJECT_DIR := $(shell pwd)
DOCKER_IMAGE := openevolve
VENV_DIR := $(PROJECT_DIR)/env
PYTHON := $(VENV_DIR)/bin/python
PIP := $(VENV_DIR)/bin/pip
# Default target
.PHONY: help
help:
@echo "Available targets:"
@echo " all - Install dependencies and run tests"
@echo " venv - Create a virtual environment"
@echo " install - Install Python dependencies"
@echo " lint - Run Black code formatting"
@echo " test - Run tests"
@echo " docker-build - Build the Docker image"
@echo " docker-run - Run the Docker container with the example"
.PHONY: all
all: install test
# Create and activate the virtual environment
.PHONY: venv
venv:
python3 -m venv $(VENV_DIR)
# Install Python dependencies in the virtual environment
.PHONY: install
install: venv
$(PIP) install -e .
# Run Black code formatting
.PHONY: lint
lint:
$(PYTHON) -m black openevolve examples tests
# Run tests using the virtual environment
.PHONY: test
test:
$(PYTHON) -m unittest discover -s tests -p "test_*.py"
# Build the Docker image
.PHONY: docker-build
docker-build:
docker build -t $(DOCKER_IMAGE) .
# Run the Docker container with the example
.PHONY: docker-run
docker-run:
docker run --rm -v $(PROJECT_DIR):/app $(DOCKER_IMAGE) examples/function_minimization/initial_program.py examples/function_minimization/evaluator.py --config examples/function_minimization/config.yaml --iterations 1000