Skip to content
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

ci: pin Numpy version in random CI versions job #456

Merged
merged 3 commits into from
Jul 9, 2024
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
4 changes: 1 addition & 3 deletions .github/workflows/random_ci_pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: random-versions

on:
pull_request:
push:
branches: [main]

jobs:
tox:
Expand All @@ -23,7 +21,7 @@ jobs:
- name: generate-random-versions
run: python utils/generate_random_versions.py
- name: install-random-verions
run: python -m pip install -r random-requirements.txt "numpy<2.0"
run: python -m pip install -r random-requirements.txt
- name: install-reqs
run: python -m pip install --upgrade tox virtualenv setuptools pip && python -m pip install -r requirements-dev.txt
- name: show versions
Expand Down
1 change: 1 addition & 0 deletions tests/expr/cast_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from narwhals.utils import parse_version


@pytest.mark.filterwarnings("ignore:casting period[M] values to int64:FutureWarning")
def test_cast(constructor_with_pyarrow: Any, request: Any) -> None:
if "table" in str(constructor_with_pyarrow) and parse_version(pa.__version__) <= (
15,
Expand Down
26 changes: 12 additions & 14 deletions utils/generate_random_versions.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import random

PANDAS_VERSION = [
"1.0.5",
"1.1.5",
"1.2.5",
"1.3.5",
"1.4.4",
"1.5.3",
"2.0.3",
"2.1.4",
"2.2.2",
PANDAS_AND_NUMPY_VERSION = [
("1.0.5", "1.18.5"),
("1.1.5", "1.19.5"),
("1.2.5", "1.20.3"),
("1.3.5", "1.21.6"),
("1.4.4", "1.22.4"),
("1.5.3", "1.23.5"),
("2.0.3", "1.24.4"),
("2.1.4", "1.25.2"),
("2.2.2", "1.26.4"),
]
POLARS_VERSION = [
"0.20.3",
Expand Down Expand Up @@ -52,13 +52,11 @@
"16.1.0",
]

pandas_version = random.choice(PANDAS_VERSION)
pandas_version, numpy_version = random.choice(PANDAS_AND_NUMPY_VERSION)
polars_version = random.choice(POLARS_VERSION)
pyarrow_version = random.choice(PYARROW_VERSION)

content = (
f"pandas=={pandas_version}\npolars=={polars_version}\npyarrow=={pyarrow_version}\n"
)
content = f"pandas=={pandas_version}\nnumpy=={numpy_version}\npolars=={polars_version}\npyarrow=={pyarrow_version}\n"
with open("random-requirements.txt", "w") as fd:
fd.write(content)

Expand Down
Loading