diff --git a/pyproject.toml b/pyproject.toml index 300a9cc296..194c3e3a4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ [tool.black] line-length = 88 -target-version = ['py27', 'py35', 'py36', 'py37'] +target-version = ['py27', 'py35', 'py36', 'py37', 'py39'] include = '\.pyi?$' exclude = ''' /( diff --git a/scripts/Dockerfile-CentOS-6 b/scripts/Dockerfile-CentOS-6 index 73cfdc3408..8d1e72e125 100644 --- a/scripts/Dockerfile-CentOS-6 +++ b/scripts/Dockerfile-CentOS-6 @@ -155,6 +155,17 @@ RUN ./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared --enab ldconfig && \ rm -rf /src/Python-3.9.5* + # Install Python 3.10 from source +WORKDIR /src +RUN curl -O https://www.python.org/ftp/python/3.10.11/Python-3.10.11.tgz +RUN tar xf Python-3.10.11.tgz +WORKDIR /src/Python-3.10.11 +RUN ./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared --enable-loadable-sqlite-extensions && \ + make -j4 --quiet && \ + make install && \ + ldconfig && \ + rm -rf /src/Python-3.10.11* + ENV CC="/usr/local/bin/gcc" ENV CXX="/usr/local/bin/g++" @@ -173,17 +184,19 @@ RUN pip3.7 install virtualenv RUN python3.8 get-pip.py RUN pip3.8 install virtualenv RUN python3.9 get-pip.py -RUN pip3.9 install virtualenv +RUN pip3.9 install virtualenv \ +RUN python3.10 get-pip.py +RUN pip3.10 install virtualenv RUN rm -rf /src/get-pip.py ENV LD="/usr/local/lib64" -# So this is where the real magic happens. Clang has a flag to specify the +# So this is where the real magic happens. Clang has a flag to specify the # version of libstdc++ `--gcc-toolchain`. In turicreate we don't necessarily # have a flag to take care of this so we can re-create the expected directory # structure using the script below. This is effectively creating the structure # you'd expect when calling yum install gcc-4.* -# +# # Using `clang -v` you can see the version of gcc that clang picks up # automatically from `/usr`. If all goes well, this should be the `libstdc++` # from gcc-4.8.5 and turicreate can build. diff --git a/scripts/Dockerfile-Ubuntu-20.04 b/scripts/Dockerfile-Ubuntu-20.04 new file mode 100644 index 0000000000..8cf73ee702 --- /dev/null +++ b/scripts/Dockerfile-Ubuntu-20.04 @@ -0,0 +1,40 @@ +# vim: set ft=dockerfile: + +# This image is intended for testing Turi Create on Ubuntu 20.04. + +FROM ubuntu:focal +RUN echo HI +# Prevent apt-get from asking questions and expecting answers +ENV DEBIAN_FRONTEND noninteractive + +# Update package database +RUN apt-get update + +# Upgrade all possible packages +RUN apt-get -y upgrade + +# Install Python 3.6 and 3.7 with apt, as well as +# turicreate and upstream dependencies + +RUN apt-get -y install libgomp1 lsb-release npm nodejs doxygen zip + +# Install Python 3.8 +RUN apt-get -y install software-properties-common +RUN add-apt-repository -y ppa:deadsnakes/ppa +#RUN apt-get update +#RUN apt-get -y install python3.8 + +# Install Python 3.9 +RUN apt-get update +RUN apt-get -y install python3.9 python3.9-distutils + +# Install build-essential (needed by numpy, which tries to +# build itself from source on 3.6 and above) +RUN apt-get -y install build-essential libpython3.6-dev libpython3.7-dev libpython3.9-dev +RUN ln -s /usr/include/locale.h /usr/include/xlocale.h + +# Install pip and virtualenv +ADD https://bootstrap.pypa.io/get-pip.py /src/get-pip.py +WORKDIR /src +RUN python3.9 get-pip.py +RUN pip3.9 install virtualenv diff --git a/scripts/Dockerfile-Ubuntu-22.04 b/scripts/Dockerfile-Ubuntu-22.04 new file mode 100644 index 0000000000..ac0aea1c82 --- /dev/null +++ b/scripts/Dockerfile-Ubuntu-22.04 @@ -0,0 +1,40 @@ +# vim: set ft=dockerfile: + +# This image is intended for testing Turi Create on Ubuntu 22.04. + +FROM ubuntu:jammy + +# Prevent apt-get from asking questions and expecting answers +ENV DEBIAN_FRONTEND noninteractive + +# Update package database +RUN apt-get update + +# Upgrade all possible packages +RUN apt-get -y upgrade + +# Install Python 3.6 and 3.7 with apt, as well as +# turicreate and upstream dependencies + +RUN apt-get -y install libgomp1 lsb-release npm nodejs doxygen zip + +# Install Python 3.8 +RUN apt-get -y install software-properties-common +RUN add-apt-repository -y ppa:deadsnakes/ppa +#RUN apt-get update +#RUN apt-get -y install python3.8 + +# Install Python 3.9 +RUN apt-get update +RUN apt-get -y install python3.9 python3.9-distutils + +# Install build-essential (needed by numpy, which tries to +# build itself from source on 3.6 and above) +RUN apt-get -y install build-essential libpython3.6-dev libpython3.7-dev libpython3.9-dev +RUN ln -s /usr/include/locale.h /usr/include/xlocale.h + +# Install pip and virtualenv +ADD https://bootstrap.pypa.io/get-pip.py /src/get-pip.py +WORKDIR /src +RUN python3.9 get-pip.py +RUN pip3.9 install virtualenv diff --git a/scripts/create_docker_images.sh b/scripts/create_docker_images.sh index 7ee6ff50d9..08b5db7f63 100755 --- a/scripts/create_docker_images.sh +++ b/scripts/create_docker_images.sh @@ -15,6 +15,8 @@ cd ${WORKSPACE} TC_BUILD_IMAGE_CENTOS6=$(bash $WORKSPACE/scripts/get_docker_image.sh --centos=6) TC_BUILD_IMAGE_1404=$(bash $WORKSPACE/scripts/get_docker_image.sh --ubuntu=14.04) TC_BUILD_IMAGE_1804=$(bash $WORKSPACE/scripts/get_docker_image.sh --ubuntu=18.04) +TC_BUILD_IMAGE_2004=$(bash $WORKSPACE/scripts/get_docker_image.sh --ubuntu=20.04) +TC_BUILD_IMAGE_2204=$(bash $WORKSPACE/scripts/get_docker_image.sh --ubuntu=22.04) print_help() { echo "Creates Docker images for building and testing Turi Create." @@ -42,6 +44,8 @@ if [[ -n $PERSIST_TO_REPO_DIR ]]; then (test -f .docker_images/image-centos6.gz && docker load -i .docker_images/image-centos6.gz) || true (test -f .docker_images/image-14.04.gz && docker load -i .docker_images/image-14.04.gz) || true (test -f .docker_images/image-18.04.gz && docker load -i .docker_images/image-18.04.gz) || true + (test -f .docker_images/image-20.04.gz && docker load -i .docker_images/image-20.04.gz) || true + (test -f .docker_images/image-22.04.gz && docker load -i .docker_images/image-22.04.gz) || true fi # Load images from registry if possible @@ -49,14 +53,14 @@ fi (docker pull -q ${TC_BUILD_IMAGE_1404}) || true (docker pull ${TC_BUILD_IMAGE_1804}) || true + (docker image ls ${TC_BUILD_IMAGE_CENTOS6} | grep turicreate/build-image) || \ cat scripts/Dockerfile-CentOS-6 | docker build -t ${TC_BUILD_IMAGE_CENTOS6} - + (docker image ls ${TC_BUILD_IMAGE_1404} | grep turicreate/build-image) || \ cat scripts/Dockerfile-Ubuntu-14.04 | docker build -t ${TC_BUILD_IMAGE_1404} - -(docker image ls ${TC_BUILD_IMAGE_1804} | grep turicreate/build-image) || \ -cat scripts/Dockerfile-Ubuntu-18.04 | docker build -t ${TC_BUILD_IMAGE_1804} - # Save images back to repo directory so they can be re-used the next time this script is run. # (This assumes the build may run on another machine, but with the same directory contents. This setup is diff --git a/scripts/make_wheel.sh b/scripts/make_wheel.sh index f0ff23eb31..bb03e9e435 100755 --- a/scripts/make_wheel.sh +++ b/scripts/make_wheel.sh @@ -48,6 +48,8 @@ print_help() { echo echo " --docker-python3.9 Use docker to build for Python 3.9 in CentOS 6 with Clang 8." echo + echo " --docker-python3.10 Use docker to build for Python 3.10 in CentOS 6 with Clang 8." + echo echo " --num_procs=n Specify the number of proceses to run in parallel." echo echo " --target-dir=[dir] The directory where the wheel and associated files are put." @@ -76,6 +78,7 @@ while [ $# -gt 0 ] --docker-python3.7) USE_DOCKER=1;DOCKER_PYTHON=3.7;; --docker-python3.8) USE_DOCKER=1;DOCKER_PYTHON=3.8;; --docker-python3.9) USE_DOCKER=1;DOCKER_PYTHON=3.9;; + --docker-python3.10) USE_DOCKER=1;DOCKER_PYTHON=3.10;; --help) print_help ;; *) unknown_option $1 ;; esac @@ -389,7 +392,7 @@ function package_wheel() { } # Run the setup - package_wheel_helper 0 "" + #package_wheel_helper 0 "" package_wheel_helper 1 +minimal echo -e "\n\n================= Done Packaging Wheel ================\n\n" diff --git a/scripts/requirements-minimal.txt b/scripts/requirements-minimal.txt index effa5a0a86..2ee10b351d 100644 --- a/scripts/requirements-minimal.txt +++ b/scripts/requirements-minimal.txt @@ -1,6 +1,7 @@ numpy==1.16.4; python_version < '3.6' numpy==1.19.1; python_version >= '3.6' and python_version < '3.9' -numpy==1.21.1; python_version == '3.9' +numpy==1.20; python_version == '3.9' +numpy==1.21; python_version >= '3.10' cython==0.29.21 decorator==4.4.0 @@ -8,12 +9,14 @@ decorator==4.4.0 pandas==0.24.2; python_version <= '3.6' pandas==1.0.5; python_version > '3.6' and python_version < '3.9' pandas==1.3.1; python_version == '3.9' +pandas==2.0.2; python_version >= '3.10' pillow==6.2.2; python_version < '3.9' -pillow==8.3.1; python_version == '3.9' +pillow==8.3.1; python_version >= '3.9' prettytable==0.7.2 -pytz==2019.1 +pytz==2019.1 ; python_version <= '3.9' +pytz==2020.1 ; python_version >= '3.10' future==0.17.1 pyOpenSSL==19.0.0 ndg-httpsclient==0.5.1