Skip to content

Conversation

@lucascolley
Copy link
Collaborator

Description

This PR fixes newline printing for some situations in the CLI.

Before (spaces):

✨ Pixi task (build in build): spin build --setup-args=-Dblas=blas --setup-args=-Dlapack=lapack --setup-args=-Duse-g77-abi=true: (Build SciPy (default settings))
$ meson compile -j 8 -C build
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /Users/lucascolley/ghq/github.com/scipy/scipy/.pixi/envs/build/bin/ninja -C /Users/lucascolley/ghq/github.com/scipy/scipy/build -j 8
ninja: Entering directory `/Users/lucascolley/ghq/github.com/scipy/scipy/build'
[2/356] Generating subprojects/highs/highs/HConfig.h with a custom command
$ meson install --only-changed -C build --destdir ../build-install --tags=runtime,python-runtime,tests,devel --skip-subprojects
                                                                                                                             ✨ Pixi task (ipython in ipython): spin ipython --no-build: (Launch IPython)                                                 $ export PYTHONPATH="/Users/lucascolley/ghq/github.com/scipy/scipy/build-install/usr/lib/python3.14/site-packages"
💻 Launching IPython with PYTHONPATH="/Users/lucascolley/ghq/github.com/scipy/scipy/build-install/usr/lib/python3.14/site-packages"

After (newlines):

✨ Pixi task (build in build): spin build --setup-args=-Dblas=blas --setup-args=-Dlapack=lapack --setup-args=-Duse-g77-abi=true: (Build SciPy (default settings))
$ meson compile -j 8 -C build
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /Users/lucascolley/ghq/github.com/scipy/scipy/.pixi/envs/build/bin/ninja -C /Users/lucascolley/ghq/github.com/scipy/scipy/build -j 8
ninja: Entering directory `/Users/lucascolley/ghq/github.com/scipy/scipy/build'
[2/356] Generating subprojects/highs/highs/HConfig.h with a custom command
$ meson install --only-changed -C build --destdir ../build-install --tags=runtime,python-runtime,tests,devel --skip-subprojects

✨ Pixi task (ipython in ipython): spin ipython --no-build: (Launch IPython)
$ export PYTHONPATH="/Users/lucascolley/ghq/github.com/scipy/scipy/build-install/usr/lib/python3.14/site-packages"
💻 Launching IPython with PYTHONPATH="/Users/lucascolley/ghq/github.com/scipy/scipy/build-install/usr/lib/python3.14/site-packages"

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: ChatGPT

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.
  • I have verified that changes that would impact the JSON schema have been made in schema/model.py.

@lucascolley lucascolley added bug Something isn't working cli Issue related to CLI labels Feb 6, 2026
@baszalmstra
Copy link
Contributor

I dont see how this fixes the issue? This is doing essentially the same thing? Should we not also deal with the hidden case?

@lucascolley
Copy link
Collaborator Author

lucascolley commented Feb 6, 2026

I dont see how this fixes the issue? This is doing essentially the same thing?

mp.println prints spaces rather than a new line, this avoids that

Should we not also deal with the hidden case?

I think the mp.suspend just becomes an 'identity'/'null' closure (sorry I don't know the word) in the hidden case

@lucascolley
Copy link
Collaborator Author

but yeah I'm not sure if this breaks anything where we are calling pixi_progress::println! in the context of multiple progress bars. If it does then I guess we want to introduce a new macro like pixi_progress::printnewln!?

@lucascolley
Copy link
Collaborator Author

Should we not also deal with the hidden case?

I think the mp.suspend just becomes an 'identity'/'null' closure (sorry I don't know the word) in the hidden case

or maybe it is still necessary, looking at https://docs.rs/indicatif/latest/indicatif/struct.ProgressBar.html#method.println

@baszalmstra
Copy link
Contributor

Maybe just change the mp.println to mp.suspend then?

@lucascolley
Copy link
Collaborator Author

lucascolley commented Feb 7, 2026

Maybe just change the mp.println to mp.suspend then?

I think the current implementation is more concise and probably effectively equivalent, but feel free to push a change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cli Issue related to CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants