diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b61a0da..7bed9bd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,9 +9,10 @@ jobs: run: | rm -rf ~/.conda/envs/miplearn-test yes | conda create --name miplearn-test python=3.6 - JULIA_DEPOT_PATH=/home/axavier/.julia:/opt/julia-1.3.0/depot julia --project=src/julia -e 'using Pkg; Pkg.instantiate()' (cd /opt/gurobi900/linux64 && ~/.conda/envs/miplearn-test/bin/python setup.py install) (cd /opt/cplex-12.8/cplex/python/3.6/x86-64_linux && ~/.conda/envs/miplearn-test/bin/python setup.py install) ~/.conda/envs/miplearn-test/bin/pip install -r src/python/requirements.txt + make install-python install-julia PYTHON=~/.conda/envs/miplearn-test/bin/python ~/.conda/envs/miplearn-test/bin/pytest src/python + make test-julia diff --git a/Makefile b/Makefile index 2ddc6d6..c13da22 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,17 @@ PYTHON := python3 PYTEST := pytest -PIP := pip3 -PYTEST_ARGS := -W ignore::DeprecationWarning -vv -x --log-level=DEBUG -JULIA := julia --color=yes --project=src/julia -JULIA_SYSIMAGE := $(JULIA) --sysimage build/sysimage.so +PIP := pip3 +JULIA := julia + +PYTEST_ARGS := -W ignore::DeprecationWarning -vv -x --log-level=DEBUG +JULIA_ARGS := --color=yes --project=src/julia +JULIA_SYSIMAGE_ARGS := $(JULIA_ARGS) --sysimage build/sysimage.so all: docs test build/sysimage.so: src/julia/Manifest.toml src/julia/Project.toml mkdir -p build - $(JULIA) src/julia/sysimage.jl + $(JULIA) $(JULIA_ARGS) src/julia/sysimage.jl develop: cd src/python && $(PYTHON) setup.py develop @@ -23,7 +25,7 @@ install-python: cd src/python && $(PYTHON) setup.py install install-julia: - $(JULIA) -e "using Pkg; Pkg.instantiate()" + $(JULIA) $(JULIA_ARGS) src/julia/setup.jl `which $(PYTHON)` uninstall: $(PIP) uninstall miplearn @@ -37,6 +39,6 @@ test-python-watch: cd src/python && pytest-watch -- $(PYTEST_ARGS) test-julia: build/sysimage.so - $(JULIA_SYSIMAGE) src/julia/test/runtests.jl + $(JULIA) $(JULIA_SYSIMAGE_ARGS) src/julia/test/runtests.jl .PHONY: test test-python test-julia test-watch docs install diff --git a/src/julia/setup.jl b/src/julia/setup.jl new file mode 100644 index 0000000..e8b911e --- /dev/null +++ b/src/julia/setup.jl @@ -0,0 +1,7 @@ +ENV["PYTHON"] = ARGS[1] + +using Pkg +Pkg.instantiate() +Pkg.build("CPLEX") +Pkg.build("Gurobi") +Pkg.build("PyCall") \ No newline at end of file diff --git a/src/python/requirements.txt b/src/python/requirements.txt index 6b61644..202af33 100644 --- a/src/python/requirements.txt +++ b/src/python/requirements.txt @@ -1,10 +1,13 @@ docopt matplotlib +mkdocs +mkdocs-cinder networkx numpy p_tqdm pandas pyomo +pytest python-markdown-math seaborn sklearn diff --git a/src/python/setup.py b/src/python/setup.py index 237a1ea..ad2aa6f 100644 --- a/src/python/setup.py +++ b/src/python/setup.py @@ -10,15 +10,11 @@ setup( install_requires=[ 'docopt', 'matplotlib', - 'mkdocs', - 'mkdocs-cinder', 'networkx', 'numpy', 'pandas', 'p_tqdm', 'pyomo', - 'pytest', - 'pytest-watch', 'python-markdown-math', 'seaborn', 'sklearn',