Skip to content

Commit

Permalink
Generate python 3.11 bundle for 1.5 and 1.6 (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenyuLInx authored Dec 15, 2023
1 parent e491263 commit 9e58349
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/supported_python_versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ minor_version="$2"
if [[ ${minor_version} == 0 && ${major_version} == 0 ]]
then
py_versions='["3.8", "3.9", "3.10", "3.11"]'
elif [[ ${minor_version} < 7 && ${major_version} == 1 ]]
elif [[ ${minor_version} < 5 && ${major_version} == 1 ]]
then
py_versions='["3.8", "3.9", "3.10"]'
else
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Python setup
run: |
python -m pip install --upgrade pip
python -m pip install tox
python -m pip install tox cython
- name: Run Unit Tests
run: tox -e unit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dbt-snowflake~=1.6.0
dbt-bigquery~=1.6.0
dbt-redshift~=1.6.0
dbt-postgres~=1.6.0
dbt-spark[PyHive,ODBC]~=1.6.0
dbt-spark[PyHive,ODBC]~=1.6.2
dbt-databricks~=1.6.0
dbt-trino~=1.6.0
dbt-fabric==1.6.0
Expand Down
17 changes: 11 additions & 6 deletions test/integration/bundle/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,21 @@
import zipfile


@pytest.mark.parametrize("python_version", [sys.version_info])
@pytest.mark.parametrize(
argnames="test_version",
argvalues=["0.0.0", "1.3.0", "1.4.0", "1.5.0", "1.6.0", "1.7.0b1", "1.7.0"],
)
def test_generate_bundle_creates_a_bundle_with_valid_version(test_version, python_version):
if python_version >= (3, 11) and Version.coerce(test_version) < Version.coerce("1.7.0"):
pytest.skip("Python 3.11+ requires at least version 1.7.0 of the bundle")
if python_version == (3, 10) and Version.coerce(test_version) >= Version.coerce("1.7.0"):
pytest.skip("We run test for Python 3.11 with version 1.7.0 of the bundle")
def test_generate_bundle_creates_a_bundle_with_valid_version(
test_version
):
if sys.version_info >= (3, 11) and Version.coerce(test_version) < Version.coerce(
"1.5.0"
):
pytest.skip("Python 3.11+ requires at least version 1.5.0 of the bundle")
if sys.version_info == (3, 10) and Version.coerce(test_version) >= Version.coerce(
"1.5.0"
):
pytest.skip("We run test for Python 3.11 with version 1.5.0+ of the bundle")
created_assets = generate_bundle(Version.coerce(test_version))
for asset_name, asset_location in created_assets.items():
# check if the file exists
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import sys
import platform

import pytest
from semantic_version import Version

Expand All @@ -6,6 +9,10 @@

@pytest.mark.parametrize("version", ["1.2.0b1", "1.4.0pre", "1.2.0", "1.3.0a1"])
def test_get_latest_bundle_release_gets_latest_release(version):
if platform.system() == "Darwin" and sys.version_info <= (3, 11):
pytest.skip("Only test for Python 3.11 on macOS")
if platform.system() == "Linux" and sys.version_info not in [(3, 8), (3.11)]:
pytest.skip("Only test for Python 3.8 and 3.11 on Linux")
input_version = Version.coerce(version)
latest_version, is_draft, latest_release = get_latest_bundle_release(str(input_version))
assert (not input_version.prerelease) == (not latest_version.prerelease)
Expand Down

0 comments on commit 9e58349

Please sign in to comment.