-
Notifications
You must be signed in to change notification settings - Fork 294
Move CI to GitHub Actions & split python versions into jobs #603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
38bc588
c3f7a81
fa19c71
04991b2
7dc0a0a
c95330b
9954b44
5a2d8e2
741f383
9b49043
c7b5b47
92d08f4
6e580cb
1d50290
efb02b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
|
||
concurrency: | ||
group: ${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
versions: | ||
- python: "2.6" | ||
- python: "2.7" | ||
- python: "3.3" | ||
- python: "3.4" | ||
- python: "3.5" | ||
- python: "3.6" | ||
- python: "3.7" | ||
- python: "3.8" | ||
- python: "3.9" | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- if: ${{ matrix.versions.python != '2.6' }} | ||
run: | | ||
docker build \ | ||
. \ | ||
--build-arg PYTHON_VERSION=${{ matrix.versions.python }} \ | ||
-t jmadler/python-future-builder:${{ matrix.versions.python }} | ||
- if: ${{ matrix.versions.python == '2.6' }} | ||
run: | | ||
docker build \ | ||
. \ | ||
-f 2.6.Dockerfile \ | ||
-t jmadler/python-future-builder:${{ matrix.versions.python }} | ||
- run: | | ||
docker run \ | ||
-e PYTHON_VERSION=${{ matrix.versions.python }} \ | ||
jmadler/python-future-builder:${{ matrix.versions.python }} \ | ||
/root/python-future/test.sh |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM mrupgrade/deadsnakes:2.6 | ||
sfdye marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
RUN mkdir -p ~/.pip/ && echo '[global] \n\ | ||
trusted-host = pypi.python.org\n\ | ||
pypi.org\n\ | ||
files.pythonhosted.org\n\ | ||
' >> ~/.pip/pip.conf | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y curl | ||
|
||
RUN mkdir -p /root/pip && \ | ||
cd /root/pip && \ | ||
curl -O https://files.pythonhosted.org/packages/8a/e9/8468cd68b582b06ef554be0b96b59f59779627131aad48f8a5bce4b13450/wheel-0.29.0-py2.py3-none-any.whl && \ | ||
curl -O https://files.pythonhosted.org/packages/31/77/3781f65cafe55480b56914def99022a5d2965a4bb269655c89ef2f1de3cd/importlib-1.0.4.zip && \ | ||
curl -O https://files.pythonhosted.org/packages/ef/41/d8a61f1b2ba308e96b36106e95024977e30129355fd12087f23e4b9852a1/pytest-3.2.5-py2.py3-none-any.whl && \ | ||
curl -O https://files.pythonhosted.org/packages/f2/94/3af39d34be01a24a6e65433d19e107099374224905f1e0cc6bbe1fd22a2f/argparse-1.4.0-py2.py3-none-any.whl && \ | ||
curl -O https://files.pythonhosted.org/packages/72/20/7f0f433060a962200b7272b8c12ba90ef5b903e218174301d0abfd523813/unittest2-1.1.0-py2.py3-none-any.whl && \ | ||
curl -O https://files.pythonhosted.org/packages/53/67/9620edf7803ab867b175e4fd23c7b8bd8eba11cb761514dcd2e726ef07da/py-1.4.34-py2.py3-none-any.whl && \ | ||
curl -O https://files.pythonhosted.org/packages/53/25/ef88e8e45db141faa9598fbf7ad0062df8f50f881a36ed6a0073e1572126/ordereddict-1.1.tar.gz && \ | ||
curl -O https://files.pythonhosted.org/packages/17/0a/6ac05a3723017a967193456a2efa0aa9ac4b51456891af1e2353bb9de21e/traceback2-1.4.0-py2.py3-none-any.whl && \ | ||
curl -O https://files.pythonhosted.org/packages/65/26/32b8464df2a97e6dd1b656ed26b2c194606c16fe163c695a992b36c11cdf/six-1.13.0-py2.py3-none-any.whl && \ | ||
curl -O https://files.pythonhosted.org/packages/c7/a3/c5da2a44c85bfbb6eebcfc1dde24933f8704441b98fdde6528f4831757a6/linecache2-1.0.0-py2.py3-none-any.whl | ||
|
||
WORKDIR /root/python-future | ||
ADD . /root/python-future |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,7 @@ | ||
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 | ||
ARG PYTHON_VERSION | ||
FROM python:${PYTHON_VERSION}-slim | ||
|
||
ENV LC_ALL=C.UTF-8 | ||
ENV LANG=C.UTF-8 | ||
|
||
WORKDIR /root/python-future | ||
ADD . /root/python-future |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
from __future__ import absolute_import | ||
from future.utils import PY3 | ||
from future.utils import PY3, PY39_PLUS | ||
|
||
if PY3: | ||
if PY39_PLUS: | ||
# _dummy_thread and dummy_threading modules | ||
# have both been removed in Python 3.9 | ||
from _thread import * | ||
Comment on lines
+5
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
elif PY3: | ||
from _dummy_thread import * | ||
else: | ||
__future_module__ = True | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set -exo pipefail | ||
|
||
python --version | ||
|
||
if [ -e "/root/pip" ] | ||
then | ||
pip install /root/pip/*.zip /root/pip/*.whl /root/pip/*tar.gz | ||
else | ||
pip install pytest unittest2 | ||
fi | ||
|
||
pytag="py${PYTHON_VERSION//./}" | ||
|
||
python setup.py bdist_wheel --python-tag="${pytag}" | ||
pip install dist/future-*-${pytag}-none-any.whl | ||
pytest tests/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1303,8 +1303,15 @@ def test_pow(self): | |
self.assertAlmostEqual(pow(-1, 0.5), 1j) | ||
self.assertAlmostEqual(pow(-1, 1/3), 0.5 + 0.8660254037844386j) | ||
|
||
# Raises TypeError in Python < v3.5, ValueError in v3.5: | ||
self.assertRaises((TypeError, ValueError), pow, -1, -2, 3) | ||
if sys.version_info < (3, 8): | ||
# Raises TypeError in Python < v3.5, ValueError in v3.5: | ||
self.assertRaises((TypeError, ValueError), pow, -1, -2, 3) | ||
else: | ||
# Changed in version 3.8: For int operands, the three-argument form | ||
# of pow now allows the second argument to be negative, permitting | ||
# computation of modular inverses. | ||
self.assertEqual(pow(-1, -2, 3), 1) | ||
Comment on lines
+1310
to
+1313
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
self.assertRaises(ValueError, pow, 1, 2, 0) | ||
|
||
self.assertRaises(TypeError, pow) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -691,10 +691,6 @@ def connect_ftp(self, user, passwd, host, port, dirs, | |
h = NullFTPHandler(data) | ||
h.parent = MockOpener() | ||
|
||
# MIME guessing works in Python 3.8! | ||
guessed_mime = None | ||
if sys.hexversion >= 0x03080000: | ||
guessed_mime = "image/gif" | ||
Comment on lines
-694
to
-697
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's no longer working apparently There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it's a problem with the condition: the My "no longer working" was referring to the code comment:
|
||
for url, host, port, user, passwd, type_, dirs, filename, mimetype in [ | ||
("ftp://localhost/foo/bar/baz.html", | ||
"localhost", ftplib.FTP_PORT, "", "", "I", | ||
|
@@ -713,7 +709,7 @@ def connect_ftp(self, user, passwd, host, port, dirs, | |
["foo", "bar"], "", None), | ||
("ftp://localhost/baz.gif;type=a", | ||
"localhost", ftplib.FTP_PORT, "", "", "A", | ||
[], "baz.gif", guessed_mime), | ||
[], "baz.gif", None), | ||
]: | ||
req = Request(url) | ||
req.timeout = None | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to push the images to dockerhub, you might want to use this GitHub action, but it'll require a maintainer to setup the credentials.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM. @edschofield you may also want to retag as under the PythonCharmers org instead of under my personal profile.