forked from algorithmicsuperintelligence/openevolve
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (33 loc) · 1023 Bytes
/
Copy pathMakefile
File metadata and controls
40 lines (33 loc) · 1023 Bytes
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
# 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: 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: venv
$(PYTHON) -m black openevolve examples tests
# Run tests using the virtual environment
.PHONY: test
test: venv
$(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