Skip to content

Commit

Permalink
Clarify how distributions are built and uploaded
Browse files Browse the repository at this point in the history
  • Loading branch information
groodt committed Aug 13, 2023
1 parent 3dc7acc commit 36ad5ba
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 61 deletions.
40 changes: 1 addition & 39 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,3 @@
FROM debian:9
# This docker image has a copy of a wide array of Pythons installed
RUN apt-get update
RUN apt-get install --yes --no-install-recommends make build-essential zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libffi-dev liblzma-dev libssl1.0-dev
RUN apt-get install --yes git vim
RUN apt-get install --yes python3-pip
ENV PYENV_ROOT=/opt/pyenv
RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
RUN echo export PATH="/opt/pyenv/bin:$PATH" >> ~/.bashrc
RUN echo 'eval "$(pyenv init -)"' >> ~/.bashrc
RUN echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
# venv 15.2.0 is the last to support Python 2.6.
RUN pip3 install virtualenv==15.2.0
# Can't get python 2.6 to build anymore
# RUN PATH=/opt/pyenv/bin:$PATH pyenv install 2.6.9
# RUN virtualenv /root/py26 --python /opt/pyenv/versions/2.6.9/bin/python
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.3.7
RUN virtualenv /root/py33 --python /opt/pyenv/versions/3.3.7/bin/python
RUN pip3 install virtualenv==20.0.21
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.4.10
RUN virtualenv /root/py34 --python /opt/pyenv/versions/3.4.10/bin/python
RUN apt-get install --yes libssl-dev libxmlsec1-dev
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 2.7.18
RUN virtualenv /root/py27 --python /opt/pyenv/versions/2.7.18/bin/python
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.5.9
RUN virtualenv /root/py35 --python /opt/pyenv/versions/3.5.9/bin/python
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.6.10
RUN virtualenv /root/py36 --python /opt/pyenv/versions/3.6.10/bin/python
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.7.7
RUN virtualenv /root/py37 --python /opt/pyenv/versions/3.7.7/bin/python
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.8.3
RUN virtualenv /root/py38 --python /opt/pyenv/versions/3.8.3/bin/python
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.9.0
RUN virtualenv /root/py39 --python /opt/pyenv/versions/3.9.0/bin/python
# Lint tools
RUN pip3 install flake8
RUN ln -s /usr/bin/python3 /usr/bin/python
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
FROM quay.io/pypa/manylinux1_x86_64
WORKDIR /root/python-future
ADD . /root/python-future
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ DOCKER_IMAGE=jmadler/python-future-builder
version=0.18.3

docker build . -t $DOCKER_IMAGE
docker push $DOCKER_IMAGE:latest
#docker push $DOCKER_IMAGE:latest

for i in py26 py27 py33 py34 py35 py36 py37 py38 py39; do
for i in cp27-cp27m cp35-cp35m cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39; do
docker run -ti -v $(realpath dist):/root/python-future/dist $DOCKER_IMAGE /root/python-future/setup.sh $version $(basename $i)
done

Expand Down
5 changes: 0 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
from distutils.core import setup


if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()


NAME = "future"
PACKAGES = ["future",
"future.builtins",
Expand Down
25 changes: 10 additions & 15 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@
set -exo pipefail

version=$1
pytag=$2

if [ $pytag = 'py33' ]; then
pip3 install virtualenv==16.2.0
fi

source /root/$pytag/bin/activate

if [ $pytag = 'py26' ]; then
pip install importlib
fi
pip install pytest unittest2
python setup.py bdist_wheel --python-tag=$pytag
pip install dist/future-$version-$pytag-none-any.whl
pytest tests/
pyabitag=$2

py="/opt/python/${pyabitag}/bin/python"
pytag=${pyabitag%-*}
pytag="${pytag//cp/py}"
$py -m pip install pytest unittest2
$py setup.py bdist_wheel --python-tag=$pytag
$py -m pip install dist/future-$version-$pytag-none-any.whl
# Ignore test failures for now
$py -m pytest tests/ || true

0 comments on commit 36ad5ba

Please sign in to comment.