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

enh(dev): Don't force holoviews to be installed for test-example and docs-build #6497

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hoxbro
Copy link
Member

@hoxbro hoxbro commented Jan 27, 2025

Right now, if we want to pixi run test-example and pixi run docs-build, it will fail because 'HoloViews' is not installed, and for new developers give a weird error message like holoviews is not installed. It is stated in the docs that you need to run pixi run install before doing anything, but people forget or don't read the docs.

I can't currently think of a reason why this should be done, as holoviews is doing anything weird as installing/downloading doing the build step.

Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.79%. Comparing base (d9861ae) to head (a1eed31).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6497   +/-   ##
=======================================
  Coverage   88.79%   88.79%           
=======================================
  Files         323      323           
  Lines       68731    68731           
=======================================
  Hits        61028    61028           
  Misses       7703     7703           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

system = platform.system()
py_version = sys.version_info[:2]
PANDAS_GE_2_0_0 = Version(pd.__version__).release >= (2, 0, 0)

# Having "OMP_NUM_THREADS"=1, set as an environment variable, can be needed
Copy link
Member Author

Choose a reason for hiding this comment

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

This is currently set in the pixi_install task and no longer in the test.yaml itself.

@hoxbro hoxbro marked this pull request as ready for review January 27, 2025 10:37
@hoxbro hoxbro requested a review from maximlt January 27, 2025 10:37
Copy link
Member

@maximlt maximlt left a comment

Choose a reason for hiding this comment

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

Wondering if prefixing the commands (pytest ..., nbsite ...) with python -m wouldn't do the trick?

FWIW I've done it a bit differently in hvPlot with the following as I prefer to make sure the package is installed.

[feature.required.tasks]
download-data = 'python scripts/download_data.py'
install = 'python -m pip install --no-deps --disable-pip-version-check -e .'
install-dev = { cmd = "pre-commit install", depends-on = ["install", "download-data"] }

and

[feature.doc.tasks]
docs-build = 'sphinx-build -b html doc builtdocs'
# docs-build-dev = { cmd = "pre-commit install", depends-on = ["install", "docs-build"] }
_docs-install = 'python -m pip install --no-deps --disable-pip-version-check -e .'
docs-build-dev = { depends-on = ["_docs-install", "docs-build"] }

@hoxbro
Copy link
Member Author

hoxbro commented Jan 28, 2025

Wondering if prefixing the commands (pytest ..., nbsite ...) with python -m wouldn't do the trick?

I tested it locally, and it did not do the trick.

FWIW I've done it a bit differently in hvPlot with the following as I prefer to make sure the package is installed.

I like the idea behind the install-dev command; I would maybe call it something like setup-dev, as I don't think it only needs to install stuff, and some would argue that downloading data is already more than what the name suggests.

I don't like docs-build-dev mainly because it can be confusing to have two so similar tasks. For example, should I use docs-build or docs-build-dev? Oh, docs-build did not work at first, and docs-build-dev did. I would rather see 100% commitment to ensure the package is installed, so there only is docs-build, which does what docs-build-dev currently does. Though, this discussion is out of scope for this PR 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants