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

Unpin test requirements #5019

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f356c8a
Unpin test requirements and use the same requirements for all python …
marthacryan Feb 7, 2025
27c0e9d
Remove extra requirements files
marthacryan Feb 7, 2025
fab49c7
remove plotly-geo install and orca tests from circleci config
marthacryan Feb 7, 2025
397b1ef
pin fiona version for python<=3.8
emilykl Feb 7, 2025
24fe0ee
Only install vaex for python<=3.9
marthacryan Feb 10, 2025
c2af57b
Prevent running vaex tests if vaex isn't installed
marthacryan Feb 10, 2025
7855fa6
Code formatting
marthacryan Feb 10, 2025
508135f
Update tests/test_optional/test_px/test_px_input.py
marthacryan Feb 11, 2025
7ca7295
try only running vaex with python 3.9
marthacryan Feb 11, 2025
71c6a95
Merge branch 'unpin-requirements' of github.com:plotly/plotly.py into…
marthacryan Feb 11, 2025
d282c49
Set vaex tests to run on only python 3.9
marthacryan Feb 11, 2025
ef4abb8
Only run vaex tests if vaex is installed
marthacryan Feb 11, 2025
f06ed71
Merge with master
marthacryan Feb 11, 2025
fe3740e
Fix handling of vaex not being present
marthacryan Feb 11, 2025
719292e
remove extraneous import of ipython display
marthacryan Feb 11, 2025
cae9d77
remove unnecessary py parameter and add numpy_installed parameter
marthacryan Feb 12, 2025
bcdc224
Update conditional in circleci config
marthacryan Feb 12, 2025
c493669
Fix syntax of conditional
marthacryan Feb 13, 2025
1367fa4
Fix conditional
marthacryan Feb 13, 2025
7095710
Parameterize jobs
marthacryan Feb 13, 2025
acc61b4
Fix python versions
marthacryan Feb 13, 2025
8c3bb2e
Fix indentation
marthacryan Feb 13, 2025
707bf68
Rename job for readability of CI output
marthacryan Feb 13, 2025
777e376
Switch to uv for other tests
marthacryan Feb 13, 2025
19e2c9a
Merge branch 'main' of github.com:plotly/plotly.py into unpin-require…
marthacryan Feb 13, 2025
f780164
Revert to pip for pandas downgrade
marthacryan Feb 13, 2025
f140060
Address review
marthacryan Feb 13, 2025
c9215f0
Revert changes to black version
marthacryan Feb 13, 2025
4664d15
Add pandas version as parameter
marthacryan Feb 13, 2025
d9c9c5e
Use pip for downgrade
marthacryan Feb 13, 2025
36c0437
Use easier to read name for jobs
marthacryan Feb 13, 2025
29f984b
Try different pandas version
marthacryan Feb 13, 2025
2a63724
Remove numpy config
marthacryan Feb 13, 2025
954db31
Prevent pandas install step if default
marthacryan Feb 18, 2025
396b066
Merge branch 'main' of github.com:plotly/plotly.py into unpin-require…
marthacryan Feb 18, 2025
60d8682
Remove narwhals from dependencies
marthacryan Feb 18, 2025
5e90e7d
Remove narwhals from core requirements
marthacryan Feb 20, 2025
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
279 changes: 84 additions & 195 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ version: 2.1
orbs:
browser-tools: circleci/[email protected]

commands:
test_core:
executors:
docker-container:
parameters:
py:
default: "310"
python_version:
description: "python version"
default: "3.10"
type: string
docker:
- image: cimg/python:<<parameters.python_version>>-browsers

commands:
test_core:
steps:
- checkout
- browser-tools/install-chrome
Expand All @@ -19,7 +25,7 @@ commands:
python -m venv venv
. venv/bin/activate
pip install -e .
pip install -r ./test_requirements/requirements_<<parameters.py>>_core.txt
pip install -r ./test_requirements/requirements_core.txt
- run:
name: Test core
command: |
Expand All @@ -29,8 +35,7 @@ commands:

test_optional:
parameters:
py:
default: "310"
pandas_version:
type: string
steps:
- checkout
Expand All @@ -43,15 +48,20 @@ commands:
uv venv
source .venv/bin/activate
uv pip install .
uv pip install -r ./test_requirements/requirements_<<parameters.py>>_optional.txt
uv pip install -r ./test_requirements/requirements_optional.txt
cd js
npm ci
npm run build
- run:
name: Install plotly-geo
command: |
source .venv/bin/activate
uv pip install plotly-geo

- when:
condition: <<parameters.pandas_version>>
steps:
- run:
name: Install pandas
command: |
source .venv/bin/activate
pip install pandas==<<parameters.pandas_version>>

- run:
name: Test core
command: |
Expand Down Expand Up @@ -86,42 +96,6 @@ commands:
command: |
source .venv/bin/activate
python -m pytest -x test_init/test_lazy_imports.py
test_orca:
parameters:
py:
default: "310"
type: string
steps:
- checkout
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- run:
name: Install dependencies
command: |
python -m venv venv
. venv/bin/activate
pip install -r ./test_requirements/requirements_<<parameters.py>>_optional.txt
- run:
name: Install plotly-geo
command: |
. venv/bin/activate
pip install plotly-geo
- run:
name: Install orca
command: |
npm install [email protected]
npm install orca
sudo apt-get update
sudo apt-get install -y poppler-utils libxtst6 xvfb libgtk2.0-0 libgconf-2-4 libnss3 libasound2 rename
echo 'export PATH="/home/circleci/project/node_modules/.bin:$PATH"' >> $BASH_ENV
- run:
name: Test orca
command: |
. venv/bin/activate
pytest tests/test_orca
no_output_timeout: 20m
- store_artifacts:
path: tests/test_orca/images/linux/failed

jobs:
check-code-formatting:
Expand All @@ -142,110 +116,31 @@ jobs:
. venv/bin/activate
black --check . --exclude venv

# Core
python_38_core:
docker:
- image: cimg/python:3.8-browsers
steps:
- test_core:
py: "38"

python_39_core:
docker:
- image: cimg/python:3.9-browsers
steps:
- test_core:
py: "39"

python_310_core:
docker:
- image: cimg/python:3.10-browsers
steps:
- test_core:
py: "310"

python_311_core:
docker:
- image: cimg/python:3.11-browsers
steps:
- test_core:
py: "311"

python_312_core:
docker:
- image: cimg/python:3.12-browsers
steps:
- test_core:
py: "312"

# Optional

python_38_optional:
docker:
- image: cimg/python:3.8-browsers
steps:
- test_optional:
py: "38"

python_39_optional:
docker:
- image: cimg/python:3.9-browsers
steps:
- test_optional:
py: "39"

python_310_optional:
docker:
- image: cimg/python:3.10-browsers
steps:
- test_optional:
py: "310"

python_311_optional:
docker:
- image: cimg/python:3.11-browsers
steps:
- test_optional:
py: "311"

python_312_optional:
docker:
- image: cimg/python:3.12-browsers
steps:
- test_optional:
py: "312"

# Pandas

python_39_pandas_2_optional:
docker:
- image: cimg/python:3.9-browsers
steps:
- test_optional:
py: "39_pandas_2"

# No numpy
python_312_no_numpy:
docker:
- image: cimg/python:3.12-browsers
test_core_py:
parameters:
python_version:
default: "3.10"
type: string
executor:
name: docker-container
python_version: <<parameters.python_version>>
steps:
- run:
name: Check that numpy is not installed
command: |
if pip list | grep numpy > /dev/null 2>&1
then exit 1
else exit 0
fi
- test_optional:
py: "312_no_numpy"
- test_core

python_312_np2:
docker:
- image: cimg/python:3.12-browsers
test_optional_py:
parameters:
python_version:
default: "3.10"
type: string
pandas_version:
default: "2"
type: string
executor:
name: docker-container
python_version: <<parameters.python_version>>
steps:
- test_optional:
py: "312_np2"

pandas_version: <<parameters.pandas_version>>

# Percy
python_39_percy:
Expand All @@ -267,21 +162,21 @@ jobs:
- run:
name: Install requirements
command: |
python -m venv venv
. venv/bin/activate
pip install -e .
pip install plotly-geo
pip install -r test_requirements/requirements_39_pandas_2_optional.txt
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
uv pip install -e .
uv pip install -r test_requirements/requirements_optional.txt

- run:
name: Build html figures (Pandas 2)
command: |
. venv/bin/activate
source .venv/bin/activate
python tests/percy/plotly-express.py
- run:
name: Build html figures (Pandas 1) and compare
command: |
. venv/bin/activate
source .venv/bin/activate
mkdir tests/percy/pandas2
mv tests/percy/*.html tests/percy/pandas2/
# 1.1 is the earliest minor with Py3.9 wheels
Expand All @@ -308,36 +203,28 @@ jobs:
- run:
name: Install dependencies
command: |
python -m venv venv
. venv/bin/activate
pip install -e .
pip install -r ./test_requirements/requirements_311_core.txt black inflect
pip install jupyterlab
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
uv pip install -e .
uv pip install -r ./test_requirements/requirements_core.txt black inflect jupyterlab
- run:
name: Update plotly.js to dev
command: |
. venv/bin/activate
source .venv/bin/activate
python commands.py updateplotlyjsdev
- run:
name: Test core
command: |
. venv/bin/activate
source .venv/bin/activate
locale
pytest -k 'not nodev' tests/test_core
no_output_timeout: 20m
- run:
name: Commit
command: |
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
git add -A
git commit -m "Codegen"
when: always
- run:
name: Build source distribution packages
command: |
. venv/bin/activate
pip install build
source .venv/bin/activate
uv pip install build
python -m build --sdist --wheel -o dist
when: always
- store_artifacts:
Expand Down Expand Up @@ -397,7 +284,7 @@ jobs:
- browser-tools/install-chromedriver

- run:
name: install dependencies
name: Install dependencies
command: |
cd doc
curl -LsSf https://astral.sh/uv/install.sh | sh
Expand All @@ -414,14 +301,6 @@ jobs:
cd ../doc
fi
cd ..
- run:
name: Install orca
command: |
npm install [email protected]
npm install orca
sudo apt-get update
sudo apt-get install -y poppler-utils libxtst6 xvfb libgtk2.0-0 libgconf-2-4 libnss3 libasound2 rename
echo 'export PATH="/home/circleci/project/node_modules/.bin:$PATH"' >> $BASH_ENV

- run:
name: make html
Expand Down Expand Up @@ -516,18 +395,28 @@ workflows:

build:
jobs:
- python_38_core
- python_39_core
- python_310_core
- python_311_core
- python_312_core
- python_38_optional
- python_39_optional
- python_310_optional
- python_311_optional
- python_312_optional
- python_39_pandas_2_optional
- test_core_py:
matrix:
parameters:
python_version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- test_optional_py:
matrix:
parameters:
python_version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
name: "Test optional with python << parameters.python_version >>"
- test_optional_py:
name: "Test optional with pandas 1.2.4"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: "Test optional with pandas 1.2.4"
name: "Test optional with python << parameters.python_version >> and pandas << parameters.pandas_version >>"

(does this work?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately it doesn't look like the other one is working so I don't think we can actually use this here :(

python_version: "3.9"
pandas_version: "1.2.4"
- python_39_percy
- python_312_no_numpy
- python_312_np2
- build-doc
3 changes: 0 additions & 3 deletions plotly/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ def warning_on_one_line(message, category, filename, lineno, file=None, line=Non

warnings.formatwarning = warning_on_one_line

ipython_core_display = optional_imports.get_module("IPython.core.display")
sage_salvus = optional_imports.get_module("sage_salvus")


### mpl-related tools ###
def mpl_to_plotly(fig, resize=False, strip_style=False, verbose=False):
Expand Down
3 changes: 0 additions & 3 deletions test_requirements/requirements_310_core.txt

This file was deleted.

Loading