Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
docker:
image: gcr.io/repo-automation-bots/owlbot-python:latest
digest: sha256:99d90d097e4a4710cc8658ee0b5b963f4426d0e424819787c3ac1405c9a26719
digest: sha256:5ff7446edeaede81c3ed58b23a4e76a5403fba1350ce28478045657303b6479d
35 changes: 2 additions & 33 deletions .kokoro/docker/docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ RUN apt-get update \
libssl-dev \
libsqlite3-dev \
portaudio19-dev \
python3-distutils \
redis-server \
software-properties-common \
ssh \
Expand All @@ -59,40 +60,8 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /var/cache/apt/archives/*.deb


COPY fetch_gpg_keys.sh /tmp
# Install the desired versions of Python.
RUN set -ex \
&& export GNUPGHOME="$(mktemp -d)" \
&& echo "disable-ipv6" >> "${GNUPGHOME}/dirmngr.conf" \
&& /tmp/fetch_gpg_keys.sh \
&& for PYTHON_VERSION in 3.7.8 3.8.5; do \
wget --no-check-certificate -O python-${PYTHON_VERSION}.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
&& wget --no-check-certificate -O python-${PYTHON_VERSION}.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
&& gpg --batch --verify python-${PYTHON_VERSION}.tar.xz.asc python-${PYTHON_VERSION}.tar.xz \
&& rm -r python-${PYTHON_VERSION}.tar.xz.asc \
&& mkdir -p /usr/src/python-${PYTHON_VERSION} \
&& tar -xJC /usr/src/python-${PYTHON_VERSION} --strip-components=1 -f python-${PYTHON_VERSION}.tar.xz \
&& rm python-${PYTHON_VERSION}.tar.xz \
&& cd /usr/src/python-${PYTHON_VERSION} \
&& ./configure \
--enable-shared \
# This works only on Python 2.7 and throws a warning on every other
# version, but seems otherwise harmless.
--enable-unicode=ucs4 \
--with-system-ffi \
--without-ensurepip \
&& make -j$(nproc) \
&& make install \
&& ldconfig \
; done \
&& rm -rf "${GNUPGHOME}" \
&& rm -rf /usr/src/python* \
&& rm -rf ~/.cache/

RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
&& python3.7 /tmp/get-pip.py \
&& python3.8 /tmp/get-pip.py \
&& rm /tmp/get-pip.py

CMD ["python3.7"]
CMD ["python3.8"]
45 changes: 0 additions & 45 deletions .kokoro/docker/docs/fetch_gpg_keys.sh

This file was deleted.

6 changes: 3 additions & 3 deletions .kokoro/test-samples-impl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ set -eo pipefail
# Enables `**` to include files nested inside sub-folders
shopt -s globstar

# Exit early if samples directory doesn't exist
if [ ! -d "./samples" ]; then
echo "No tests run. `./samples` not found"
# Exit early if samples don't exist
if ! find samples -name 'requirements.txt' | grep -q .; then
echo "No tests run. './samples/**/requirements.txt' not found"
exit 0
fi

Expand Down
34 changes: 18 additions & 16 deletions tests/system/test_alembic.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ def test_alembic_scenario(alembic_table):
Column("description", String(200)),
)
assert alembic_table("account", "schema") == [
"SchemaField('id', 'INTEGER', 'REQUIRED')",
"SchemaField('name', 'STRING(50)', 'REQUIRED', 'The name')",
"SchemaField('description', 'STRING(200)', 'NULLABLE')",
"SchemaField('id', 'INTEGER', 'REQUIRED', None, (), ())",
"SchemaField('name', 'STRING(50)', 'REQUIRED', 'The name', (), ())",
"SchemaField('description', 'STRING(200)', 'NULLABLE', None, (), ())",
]

op.bulk_insert(
Expand All @@ -107,10 +107,11 @@ def test_alembic_scenario(alembic_table):
)

assert alembic_table("account", "schema") == [
"SchemaField('id', 'INTEGER', 'REQUIRED')",
"SchemaField('name', 'STRING(50)', 'REQUIRED', 'The name')",
"SchemaField('description', 'STRING(200)', 'NULLABLE')",
"SchemaField('last_transaction_date', 'DATETIME', 'NULLABLE', 'when updated')",
"SchemaField('id', 'INTEGER', 'REQUIRED', None, (), ())",
"SchemaField('name', 'STRING(50)', 'REQUIRED', 'The name', (), ())",
"SchemaField('description', 'STRING(200)', 'NULLABLE', None, (), ())",
"SchemaField('last_transaction_date', 'DATETIME', 'NULLABLE', 'when updated'"
", (), ())",
]

op.create_table(
Expand All @@ -126,8 +127,8 @@ def test_alembic_scenario(alembic_table):

op.drop_column("account_w_comment", "description")
assert alembic_table("account_w_comment", "schema") == [
"SchemaField('id', 'INTEGER', 'REQUIRED')",
"SchemaField('name', 'STRING(50)', 'REQUIRED', 'The name')",
"SchemaField('id', 'INTEGER', 'REQUIRED', None, (), ())",
"SchemaField('name', 'STRING(50)', 'REQUIRED', 'The name', (), ())",
]

op.drop_table("account_w_comment")
Expand All @@ -136,10 +137,11 @@ def test_alembic_scenario(alembic_table):
op.rename_table("account", "accounts")
assert alembic_table("account") is None
assert alembic_table("accounts", "schema") == [
"SchemaField('id', 'INTEGER', 'REQUIRED')",
"SchemaField('name', 'STRING(50)', 'REQUIRED', 'The name')",
"SchemaField('description', 'STRING(200)', 'NULLABLE')",
"SchemaField('last_transaction_date', 'DATETIME', 'NULLABLE', 'when updated')",
"SchemaField('id', 'INTEGER', 'REQUIRED', None, (), ())",
"SchemaField('name', 'STRING(50)', 'REQUIRED', 'The name', (), ())",
"SchemaField('description', 'STRING(200)', 'NULLABLE', None, (), ())",
"SchemaField('last_transaction_date', 'DATETIME', 'NULLABLE', 'when updated'"
", (), ())",
]
op.drop_table("accounts")
assert alembic_table("accounts") is None
Expand All @@ -159,9 +161,9 @@ def test_alembic_scenario(alembic_table):
# nullable:
op.alter_column("transactions", "amount", True)
assert alembic_table("transactions", "schema") == [
"SchemaField('account', 'INTEGER', 'REQUIRED')",
"SchemaField('transaction_time', 'DATETIME', 'REQUIRED')",
"SchemaField('amount', 'NUMERIC(11, 2)', 'NULLABLE')",
"SchemaField('account', 'INTEGER', 'REQUIRED', None, (), ())",
"SchemaField('transaction_time', 'DATETIME', 'REQUIRED', None, (), ())",
"SchemaField('amount', 'NUMERIC(11, 2)', 'NULLABLE', None, (), ())",
]

op.create_table_comment("transactions", "Transaction log")
Expand Down