Skip to content

Conversation

@adriangb
Copy link
Contributor

I found that some interpreters, in particular, PyPy, can be so slow to start up under resource-constrained environments (in particular GitHub Actions runners) that 5s is not enough.

Instead of just making it 30s we can make it settable by env vars so that most users can fail fast but we can set it higher in CI.

_DEFAULT_GET_VERSION_TIMEOUT = 5


def get_version_timeout() -> float:
Copy link
Owner

@frostming frostming Jul 15, 2023

Choose a reason for hiding this comment

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

Why get the value on-the-fly instead of freezing it when start up? Is there any practical cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That’s what I generally do with these sorts of environment, variables to avoid issues with sequencing of setting and reading. But happy to make it a global if you’d prefer.

Copy link
Owner

Choose a reason for hiding this comment

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

Yes please do, lack of practical case and inefficient function call

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@frostming frostming merged commit ebe5805 into frostming:main Jul 15, 2023
@adriangb
Copy link
Contributor Author

Thanks for merging this so quickly! Mind cutting a release?

@adriangb adriangb deleted the cleanup branch July 15, 2023 02:47
Adirelle pushed a commit to Adirelle/findpython that referenced this pull request Jul 17, 2023
* Make GET_VERSION_TIMEOUT settable by env vars

* Make GET_VERSION_TIMEOUT a global

* remove ,
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