Skip to content

Support non-interactive use of ensureVenv script#13881

Merged
feerrenrut merged 5 commits into
nvaccess:masterfrom
LeonarddeR:noninteractiveVenv
Jul 14, 2022
Merged

Support non-interactive use of ensureVenv script#13881
feerrenrut merged 5 commits into
nvaccess:masterfrom
LeonarddeR:noninteractiveVenv

Conversation

@LeonarddeR

Copy link
Copy Markdown
Collaborator

Link to issue number:

#13048 (comment)

Summary of the issue:

#13048 introduced another prompt to adres when dependencies in requirements.txt have changed. This blocks non-interactive use of the ensureVenv script, e.g. when running "scons source" non-interactively.

Description of user facing changes

As proposed by @feerrenrut in #13048 (comment), just use defaults when running in non-interactive mode.

Description of development approach

See #13048 (comment). Note that isatty is not always avaliable on sys.stdout, e.g. when it is set to the NVDA python console.

Testing strategy:

Tested running scons source > d:\output and observed that the venv was dropped and recreated.

Known issues with pull request:

Do we want to present the question and also print that the question has been answered as default due to running in non-interactive, I figured it would be a bit overkill for that purpose.

Change log entries:

None needed

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English

@LeonarddeR LeonarddeR requested a review from a team as a code owner July 8, 2022 19:21
@LeonarddeR LeonarddeR requested review from feerrenrut and seanbudd and removed request for seanbudd July 8, 2022 19:21
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 19942e5520

Comment thread venvUtils/ensureVenv.py Outdated


def askYesNoQuestion(message: str) -> bool:
def askYesNoQuestion(message: str, default: bool = True) -> bool:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the default should be explicit. There are only two usages.

@feerrenrut

Copy link
Copy Markdown
Contributor

Do we want to present the question and also print that the question has been answered as default due to running in non-interactive, I figured it would be a bit overkill for that purpose.

I think it would be a good idea to have a record of this in the build output. If this does the wrong thing in some situation it will be much easier to track it down.

@AppVeyorBot

This comment was marked as outdated.

Comment thread venvUtils/ensureVenv.py Outdated
@AppVeyorBot

This comment was marked as outdated.

@AppVeyorBot

This comment was marked as outdated.

@feerrenrut feerrenrut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for your work here @LeonarddeR

@feerrenrut feerrenrut merged commit c9d9ec3 into nvaccess:master Jul 14, 2022
@nvaccessAuto nvaccessAuto added this to the 2022.3 milestone Jul 14, 2022
@LeonarddeR LeonarddeR deleted the noninteractiveVenv branch August 23, 2025 06:27
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.

4 participants