Skip to content

Commit

Permalink
Bump requests and tox/docker (#2094)
Browse files Browse the repository at this point in the history
* Bump requests and tox/docker

* Bump requests and tox/docker
  • Loading branch information
m1n0 authored Jun 5, 2024
1 parent 7e631d5 commit 552a716
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 35 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/main.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ jobs:
sudo apt-get update
ACCEPT_EULA=Y sudo apt-get install -y libsasl2-dev msodbcsql18
python -m pip install --upgrade pip
pip install requests==2.31.0
cat dev-requirements.in | grep tox | xargs pip install
- name: Test with tox
Expand Down Expand Up @@ -132,7 +131,6 @@ jobs:
sudo apt-get update
sudo apt-get install -y libsasl2-dev
python -m pip install --upgrade pip
pip install requests==2.31.0
cat dev-requirements.in | grep tox | xargs pip install
- name: Test with tox
Expand Down Expand Up @@ -167,7 +165,6 @@ jobs:
sudo apt-get update
sudo apt-get install -y libsasl2-dev
python -m pip install --upgrade pip
pip install requests==2.31.0
cat dev-requirements.in | grep tox | xargs pip install
- name: Test with tox
Expand Down Expand Up @@ -196,7 +193,6 @@ jobs:
sudo apt-get update
sudo apt-get install -y libsasl2-dev
python -m pip install --upgrade pip
pip install requests==2.31.0
cat dev-requirements.in | grep tox | xargs pip install
- name: Test with tox
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/pr.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ jobs:
sudo apt-get update
ACCEPT_EULA=Y sudo apt-get install -y libsasl2-dev msodbcsql18
python -m pip install --upgrade pip
pip install requests==2.31.0
cat dev-requirements.in | grep tox | xargs pip install
- name: Test with tox
Expand Down Expand Up @@ -110,7 +109,6 @@ jobs:
sudo apt-get update
sudo apt-get install -y libsasl2-dev
python -m pip install --upgrade pip
pip install requests==2.31.0
cat dev-requirements.in | grep tox | xargs pip install
- name: Test with tox
Expand Down Expand Up @@ -143,7 +141,6 @@ jobs:
sudo apt-get update
sudo apt-get install -y libsasl2-dev
python -m pip install --upgrade pip
pip install requests==2.31.0
cat dev-requirements.in | grep tox | xargs pip install
- name: Test with tox
Expand Down Expand Up @@ -173,7 +170,6 @@ jobs:
sudo apt-get update
sudo apt-get install -y libsasl2-dev
python -m pip install --upgrade pip
pip install requests==2.31.0
cat dev-requirements.in | grep tox | xargs pip install
- name: Test with tox
Expand Down
6 changes: 3 additions & 3 deletions dev-requirements.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pip-tools~=7.3
pytest~=7.0
python-dotenv~=1.0
tox~=3.24
tox-docker~=4.1
tox~=4.12
tox-docker~=5.0
pytest-html~=3.1
pytest-cov~=3.0
faker~=13.3
Expand All @@ -16,5 +16,5 @@ certifi>=2022.12.07
wheel>=0.38.1
docutils<0.21 # 0.21 dropped py38 support, remove this after py38 support is gone
pre-commit<3.6 # 3.6 dropped py38, remove this after py38 support is gone
requests==2.31.0 # 2.32.0 is broken, does not support docker. Remove this after new version is out
requests>=2.32.3

36 changes: 20 additions & 16 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ bleach==6.1.0
# via readme-renderer
build==1.2.1
# via pip-tools
certifi==2024.2.2
cachetools==5.3.3
# via tox
certifi==2024.6.2
# via
# -r dev-requirements.in
# requests
cfgv==3.4.0
# via pre-commit
chardet==5.2.0
# via tox
charset-normalizer==3.3.2
# via requests
cli-ui==0.17.2
Expand All @@ -28,12 +32,14 @@ click==8.1.7
# black
# pip-tools
colorama==0.4.6
# via cli-ui
# via
# cli-ui
# tox
coverage[toml]==7.5.3
# via pytest-cov
distlib==0.3.8
# via virtualenv
docker==6.1.3
docker==7.1.0
# via tox-docker
docopt==0.6.2
# via tbump
Expand All @@ -57,22 +63,22 @@ iniconfig==2.0.0
# via pytest
mypy-extensions==1.0.0
# via black
nodeenv==1.9.0
nodeenv==1.9.1
# via pre-commit
packaging==24.0
# via
# build
# docker
# pyproject-api
# pytest
# tox
# tox-docker
pathspec==0.12.1
# via black
pip-tools==7.4.1
# via -r dev-requirements.in
platformdirs==4.2.2
# via
# black
# tox
# virtualenv
pluggy==1.5.0
# via
Expand All @@ -81,13 +87,13 @@ pluggy==1.5.0
pre-commit==3.5.0
# via -r dev-requirements.in
py==1.11.0
# via
# pytest-html
# tox
# via pytest-html
pygments==2.18.0
# via
# -r dev-requirements.in
# readme-renderer
pyproject-api==1.6.1
# via tox
pyproject-hooks==1.1.0
# via
# build
Expand All @@ -112,7 +118,7 @@ pyyaml==6.0.1
# via pre-commit
readme-renderer==32.0
# via -r dev-requirements.in
requests==2.31.0
requests==2.32.3
# via
# -r dev-requirements.in
# docker
Expand All @@ -122,7 +128,6 @@ six==1.16.0
# via
# bleach
# python-dateutil
# tox
tabulate==0.8.10
# via cli-ui
tbump==6.11.0
Expand All @@ -133,17 +138,18 @@ tomli==2.0.1
# build
# coverage
# pip-tools
# pyproject-api
# pytest
# tox
tomlkit==0.11.8
# via tbump
tox==3.28.0
tox==4.15.0
# via
# -r dev-requirements.in
# tox-docker
tox-docker==4.1.0
tox-docker==5.0.0
# via -r dev-requirements.in
typing-extensions==4.12.0
typing-extensions==4.12.1
# via -r dev-requirements.in
unidecode==1.3.8
# via cli-ui
Expand All @@ -158,8 +164,6 @@ virtualenv==20.26.2
# tox
webencodings==0.5.1
# via bleach
websocket-client==1.8.0
# via docker
wheel==0.43.0
# via
# -r dev-requirements.in
Expand Down
5 changes: 5 additions & 0 deletions soda/contracts/tests/contracts/helpers/test_warehouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@


class TestVerificationWarehouse(VerificationWarehouse):
__test__ = False

def __init__(self, warehouse: Warehouse):
super().__init__()
self.warehouse = warehouse
Expand All @@ -29,6 +31,7 @@ def requires_with_block(self) -> bool:


class TestContractVerificationBuilder(ContractVerificationBuilder):
__test__ = False

def __init__(self):
super().__init__()
Expand All @@ -43,6 +46,7 @@ def build(self) -> TestContractVerification:


class TestContractVerification(ContractVerification):
__test__ = False

@classmethod
def builder(cls) -> TestContractVerificationBuilder:
Expand All @@ -62,6 +66,7 @@ def _parse_verification_warehouses(self, contract_verification_builder) -> Verif


class TestWarehouse(Warehouse):
__test__ = False

def __init__(self, data_source_fixture: DataSourceFixture):
super().__init__()
Expand Down
3 changes: 3 additions & 0 deletions soda/contracts/tests/contracts/other/test_contract_api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import logging
import os
from datetime import date
from textwrap import dedent

Expand Down Expand Up @@ -35,6 +36,7 @@ def test_contract_verification_api(test_warehouse: TestWarehouse, environ: dict)
table_name: str = test_warehouse.ensure_test_table(contracts_api_test_table)

environ["USERNAME"] = "sodasql"
environ["PORT"] = os.getenv("POSTGRES_PORT", "5432")

warehouse_yaml_str = dedent(
"""
Expand All @@ -44,6 +46,7 @@ def test_contract_verification_api(test_warehouse: TestWarehouse, environ: dict)
host: localhost
database: sodasql
username: ${USERNAME}
port: ${PORT}
"""
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def test_warehouse_file_variable_resolving(environ):
assert "sodasql" == resolved_connection_properties["username"]


def test_invalid_database():
def test_invalid_database(environ: dict):
environ["PORT"] = os.getenv("POSTGRES_PORT", "5432")

warehouse_yaml_str = dedent(
"""
name: postgres_ds
Expand All @@ -36,6 +38,7 @@ def test_invalid_database():
host: localhost
database: invalid_db
username: sodasql
port: ${PORT}
"""
)

Expand All @@ -46,7 +49,9 @@ def test_invalid_database():
assert 'database "invalid_db" does not exist' in contract_verification_str


def test_invalid_username():
def test_invalid_username(environ: dict):
environ["PORT"] = os.getenv("POSTGRES_PORT", "5432")

warehouse_yaml_str = dedent(
"""
name: postgres_ds
Expand All @@ -55,6 +60,7 @@ def test_invalid_username():
host: localhost
database: sodasql
username: invalid_usr
port: ${PORT}
"""
)

Expand Down
2 changes: 1 addition & 1 deletion soda/core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"Jinja2>=2.11,<4.0",
"click~=8.0",
"ruamel.yaml>=0.17.0,<0.18.0",
"requests~=2.28",
"requests~=2.30",
"antlr4-python3-runtime~=4.11.1",
"opentelemetry-api>=1.16.0,<1.23.0", # 1.23.0 removes Python 3.7 support
"opentelemetry-exporter-otlp-proto-http>=1.16.0,<1.23.0",
Expand Down
2 changes: 2 additions & 0 deletions soda/core/tests/cli/test_cli_scan.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from textwrap import dedent

import pytest
Expand Down Expand Up @@ -26,6 +27,7 @@ def test_imports(data_source_fixture: DataSourceFixture, mock_file_system: MockF
username: sodasql
database: sodasql
schema: {data_source_fixture.schema_name}
port: {int(os.getenv("POSTGRES_PORT", 5432))}
"""
).strip(),
f"{user_home_dir}/configuration2.yml": "",
Expand Down
1 change: 1 addition & 0 deletions soda/mysql/tests/mysql_data_source_fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def _build_configuration_dict(self, schema_name: str | None = None) -> dict:
"username": os.getenv("MYSQL_USERNAME", "root"),
"password": os.getenv("MYSQL_PASSWORD", "sodacore"),
"database": schema_name if schema_name else os.getenv("MYSQL_DATABASE", "sodacore"),
"port": int(os.getenv("MYSQL_PORT", 3306)),
}
}

Expand Down
1 change: 1 addition & 0 deletions soda/postgres/tests/postgres_data_source_fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def _build_configuration_dict(self, schema_name: str | None = None) -> dict:
"password": os.getenv("POSTGRES_PASSWORD"),
"database": os.getenv("POSTGRES_DATABASE", "sodasql"),
"schema": schema_name if schema_name else os.getenv("POSTGRES_SCHEMA", "public"),
"port": int(os.getenv("POSTGRES_PORT", "5432")),
}
}

Expand Down
2 changes: 2 additions & 0 deletions soda/sqlserver/tests/sqlserver_data_source_fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def _build_configuration_dict(self, schema_name: str | None = None) -> dict:
# Local docker compose has self-signed certificate
"trust_server_certificate": "true",
"schema": schema_name or os.getenv("SQLSERVER_SCHEMA", "dbo"),
"port": int(os.getenv("SQLSERVER_PORT", 1433)),
"driver": os.getenv("SQLSERVER_DRIVER", "ODBC Driver 18 for SQL Server"),
}
}

Expand Down
13 changes: 8 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ environment =
POSTGRES_USER=sodasql
POSTGRES_DB=sodasql
POSTGRES_HOST_AUTH_METHOD=trust
ports = 5432:5432/tcp
expose =
POSTGRES_PORT=5432/tcp
healthcheck_cmd = psql \
--user=$POSTGRES_USER --dbname=$POSTGRES_DB \
--host=127.0.0.1 --quiet --no-align --tuples-only \
--host=127.0.0.1 --port=$POSTGRES_PORT --quiet --no-align --tuples-only \
-1 --command="SELECT 1"
healthcheck_timeout = 1
healthcheck_retries = 30
Expand All @@ -46,7 +47,8 @@ image=mcr.microsoft.com/mssql/server:2022-latest
environment =
ACCEPT_EULA=Y
SA_PASSWORD=Password1!
ports = 1433:1433/tcp
expose =
SQLSERVER_PORT=1433/tcp
healthcheck_cmd = /opt/mssql-tools/bin/sqlcmd \
-S localhost -U sa -P $SA_PASSWORD -Q "SELECT 1"
healthcheck_timeout = 2
Expand All @@ -61,8 +63,9 @@ environment =
MYSQL_USER=sodacore
MYSQL_PASSWORD=sodacore
MYSQL_ROOT_PASSWORD=sodacore
ports = 3306:3306/tcp
healthcheck_cmd = mysql --user=root --password=sodacore --execute "SHOW DATABASES;"
expose =
MYSQL_PORT=3306/tcp
healthcheck_cmd = mysql -P $MYSQL_PORT --user=root --password=sodacore --execute "SHOW DATABASES;"
healthcheck_timeout = 2
healthcheck_retries = 30
healthcheck_interval = 10
Expand Down

0 comments on commit 552a716

Please sign in to comment.