Skip to content

Commit

Permalink
separate pypi modules across linux distributions
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurent Perron committed Jul 14, 2017
1 parent b5b7b08 commit 4a1a7c7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 22 deletions.
5 changes: 3 additions & 2 deletions makefiles/Makefile.python.mk
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ python_examples_archive:
$(COPY) LICENSE-2.0.txt temp$Sortools_examples
$(COPY) tools$Ssetup_data.py temp$Sortools_examples$Ssetup.py
$(SED) -i -e 's/VVVV/$(OR_TOOLS_VERSION)/' temp$Sortools_examples$Ssetup.py
$(SED) -i -e 's/XXXX/$(PYPI_OS)/' temp$Sortools_examples$Ssetup.py
$(COPY) tools$Scheck_python_deps.py temp$Sortools_examples
$(SED) -i -e 's/VVVV/$(OR_TOOLS_VERSION)/' temp$Sortools_examples$Scheck_python_deps.py
$(SED) -i -e 's/PROTOBUF_TAG/$(PROTOBUF_TAG)/' temp$Sortools_examples$Scheck_python_deps.py
Expand Down Expand Up @@ -274,9 +275,9 @@ $(PYPI_ARCHIVE_TEMP_DIR) : $(OR_TOOLS_PYTHON_GEN_SCRIPTS) $(PATCHELF)
$(COPY) LICENSE-2.0.txt $(PYPI_ARCHIVE_TEMP_DIR)$Sortools
$(COPY) tools$Ssetup.py $(PYPI_ARCHIVE_TEMP_DIR)$Sortools
ifeq ($(PYTHON3),true)
$(SED) -i -e 's/ORTOOLS_PYTHON_VERSION/py3-ortools/' $(PYPI_ARCHIVE_TEMP_DIR)$Sortools$Ssetup.py
$(SED) -i -e 's/ORTOOLS_PYTHON_VERSION/py3-ortools$(PYPI_OS)/' $(PYPI_ARCHIVE_TEMP_DIR)$Sortools$Ssetup.py
else
$(SED) -i -e 's/ORTOOLS_PYTHON_VERSION/ortools/' $(PYPI_ARCHIVE_TEMP_DIR)$Sortools$Ssetup.py
$(SED) -i -e 's/ORTOOLS_PYTHON_VERSION/ortools$(PYPI_OS)/' $(PYPI_ARCHIVE_TEMP_DIR)$Sortools$Ssetup.py
endif
$(SED) -i -e 's/VVVV/$(OR_TOOLS_VERSION)/' $(PYPI_ARCHIVE_TEMP_DIR)$Sortools$Ssetup.py
$(SED) -i -e 's/PROTOBUF_TAG/$(PROTOBUF_TAG)/' $(PYPI_ARCHIVE_TEMP_DIR)$Sortools$Ssetup.py
Expand Down
42 changes: 24 additions & 18 deletions tools/docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,20 @@ archives: \
ubuntu-16.04-archive \
ubuntu-17.04-archive

delivery: \
ubuntu-14.04-archive \
ubuntu-14.04-pypi \
ubuntu-14.04-pypi3 \
ubuntu-16.04-archive \
ubuntu-16.04-pypi \
ubuntu-16.04-pypi3 \
ubuntu-17.04-archive
pypi: \
centos-7-pypi \
debian-9-pypi \
ubuntu-14.04-pypi \
ubuntu-16.04-pypi \
ubuntu-17.04-pypi

pypi3: \
debian-9-pypi3 \
ubuntu-14.04-pypi3 \
ubuntu-16.04-pypi3 \
ubuntu-17.04-pyp3i

delivery: archive pypi pypy3

# Ubuntu 14.04 images

Expand All @@ -41,13 +47,13 @@ ubuntu-14.04-image-no-cache:
docker build --no-cache -f ubuntu-14.04.Dockerfile -t or-tools-ubuntu-14.04-image .

ubuntu-14.04-archive: export ubuntu-14.04-image
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-ubuntu-14.04-image:latest /bin/bash -c "git pull; make clean; make all -j 5; make test; make archive python_examples_archive; cp *.tar.gz /export"
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-ubuntu-14.04-image:latest /bin/bash -c "git pull; make clean; make all -j 5; make test; make archive; cp *.tar.gz /export"

ubuntu-14.04-pypi: export ubuntu-14.04-image
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-ubuntu-14.04-image:latest /bin/bash -c "git pull; make clean; make python -j 5; make test_python; make pypi_export"
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-ubuntu-14.04-image:latest /bin/bash -c "git pull; make clean; make python -j 5; make test_python; PYPI_OS=-ubuntu-14.04 make pypi_export python_examples_archive"

ubuntu-14.04-pypi3: export ubuntu-14.04-image
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-ubuntu-14.04-image:latest /bin/bash -c "git pull; sed -i -e 's/2.7/3.4/g' Makefile.local; make clean; make python -j 5; make test_python; make pypi_export"
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-ubuntu-14.04-image:latest /bin/bash -c "git pull; sed -i -e 's/2.7/3.4/g' Makefile.local; make clean; make python -j 5; make test_python; PYPI_OS=-ubuntu-14.04 make pypi_export"

# Ubuntu 16.06 images

Expand All @@ -61,10 +67,10 @@ ubuntu-16.04-archive: export ubuntu-16.04-image
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-ubuntu-16.04-image:latest /bin/bash -c "git pull; make clean; make all -j 5; make test; make archive python_examples_archive; cp *.tar.gz /export"

ubuntu-16.04-pypi: export ubuntu-16.04-image
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-ubuntu-16.04-image:latest /bin/bash -c "git pull; make clean; make python -j 5; make test_python; make pypi_export"
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-ubuntu-16.04-image:latest /bin/bash -c "git pull; make clean; make python -j 5; make test_python; PYPI_OS=-ubuntu-16.04 make pypi_export python_examples_archive"

ubuntu-16.04-pypi3: export ubuntu-16.04-image
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-ubuntu-16.04-image:latest /bin/bash -c "git pull; sed -i -e 's/2.7/3.5/g' Makefile.local; make clean; make python -j 5; make test_python; make pypi_export"
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-ubuntu-16.04-image:latest /bin/bash -c "git pull; sed -i -e 's/2.7/3.5/g' Makefile.local; make clean; make python -j 5; make test_python; PYPI_OS=-ubuntu-16.04 make pypi_export"

ubuntu-16.04-bash: ubuntu-16.04-image
docker run -w /root/or-tools -v `pwd`/export:/export -it or-tools-ubuntu-16.04-image:latest /bin/bash
Expand All @@ -81,10 +87,10 @@ ubuntu-17.04-archive: export ubuntu-17.04-image
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-ubuntu-17.04-image:latest /bin/bash -c "git pull; pwd; make clean; make all -j 5; make test; make archive; cp *.tar.gz /export"

ubuntu-17.04-pypi: export ubuntu-17.04-image
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-ubuntu-17.04-image:latest /bin/bash -c "git pull; make clean; make python -j 5; make test_python; make pypi_export"
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-ubuntu-17.04-image:latest /bin/bash -c "git pull; make clean; make python -j 5; make test_python; PYPI_OS=-ubuntu-17.04 make pypi_export python_examples_archive"

ubuntu-17.04-pypi3: export ubuntu-17.04-image
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-ubuntu-17.04-image:latest /bin/bash -c "git pull; sed -i -e 's/2.7/3.5/g' Makefile.local; make clean; make python -j 5; make test_python; make pypi_export"
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-ubuntu-17.04-image:latest /bin/bash -c "git pull; sed -i -e 's/2.7/3.5/g' Makefile.local; make clean; make python -j 5; make test_python; PYPI_OS=-ubuntu-17.04 make pypi_export"

# Debian 9 images

Expand All @@ -98,10 +104,10 @@ debian-9-archive: export debian-9-image
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-debian-9-image:latest /bin/bash -c "git pull; pwd; make clean; make all -j 5; make test; make archive; cp *.tar.gz /export"

debian-9-pypi: export debian-9-image
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-debian-9-image:latest /bin/bash -c "git pull; make clean; make python -j 5; make test_python; make pypi_export"
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-debian-9-image:latest /bin/bash -c "git pull; make clean; make python -j 5; make test_python; PYPI_OS=-debian-9 make pypi_export python_examples_archive"

debian-9-pypi3: export debian-9-image
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-debian-9-image:latest /bin/bash -c "git pull; sed -i -e 's/2.7/3.5/g' Makefile.local; make clean; make python -j 5; make test_python; make pypi_export"
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-debian-9-image:latest /bin/bash -c "git pull; sed -i -e 's/2.7/3.5/g' Makefile.local; make clean; make python -j 5; make test_python; PYPI_OS=-debian-9 make pypi_export"

# Centos 7 images

Expand All @@ -115,7 +121,7 @@ centos-7-archive: export centos-7-image
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-centos-7-image:latest /bin/bash -c "git pull; make clean; make all -j 5; make test; make archive python_examples_archive; cp *.tar.gz /export"

centos-7-pypi: export centos-7-image
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-centos-7-image:latest /bin/bash -c "git pull; make clean; make python -j 5; make test_python; make pypi_export"
docker run -w /root/or-tools -v `pwd`/export:/export or-tools-centos-7-image:latest /bin/bash -c "git pull; make clean; make python -j 5; make test_python; PYPI_OS=-centos-7 make pypi_export python_examples_archive"

centos-7-bash: centos-7-image
docker run -w /root/or-tools -v `pwd`/export:/export -it or-tools-centos-7-image:latest /bin/bash
4 changes: 2 additions & 2 deletions tools/setup_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ def read(fname):
return open(pjoin(dirname(__file__), fname)).read()

if version_info[0] >= 3:
install_requires = ["py3-ortools == VVVV"]
install_requires = ["py3-ortoolsXXXX == VVVV"]
else:
install_requires = ["ortools == VVVV"]
install_requires = ["ortoolsXXXX == VVVV"]

setup(
name='ortools_examples',
Expand Down

0 comments on commit 4a1a7c7

Please sign in to comment.