question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unhelpful error message related to unresolvable python version

See original GitHub issue

Description: When neither python-version or python-version-file is set, and there is no version file matching python-version-file’s default (.python-version), the error message could use an improvement. Currently it is not helpful, and even somewhat confusing.

Action version: v4.0.0

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

All.

Repro steps:
https://github.com/scop/bash-completion/runs/6798283007?check_suite_focus=true#step:3:1

Expected behavior: Helpful error message. For example:

Error: Could not determine Python version to set up. Please either specify a version using python-version in the action configuration, or path to a valid version file using python-version-file. The version file currently in effect, /home/runner/work/bash-completion/bash-completion/.python-version, does not exist.

Actual behavior: Unhelpful error message:

Error: The specified python version file at: /home/runner/work/bash-completion/bash-completion/.python-version does not exist

There are two problems with this:

  1. I did not specify a python version file
  2. It’s kind of an unexpected change coming from setup-python v3, and does not point towards a good way to fix it. The only hint is towards pointing to .python-version which isn’t arguably good advice, because those files in many workflows are not something that are supposed to be checked in to git in the first place, because they are expected to contain for example pyenv virtual env names which are specific to developer local setups, not something to share. In that sense, it is also a quite unfortunate default.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:9
  • Comments:22 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
hairmarecommented, Jun 9, 2022

Is there any reason why it can’t just default to the previous behavior when no python-version is provided and the .python-version file does not exist?

I see myself touching a lot of repositories to get this merged otherwise since i tend to just use the latest version provided by the action when i’m using it in the context of having to run some generic python tooling rather than working on an actual python project.

Would the recommended solution be to just use the system python that is provided by the runner?

5reactions
brettcannoncommented, Jun 14, 2022

Regardless of whether the semantics get brought back to v3, having a clearer error message about needing to specify one of python-version or python-version-file would help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error message about unresolved dependencies when running ...
I'm running a zsh shell on Manjaro-stable with a Conda (4.10.1) virtual environment activated with Python 3.9.2 And when I try to install...
Read more >
Ubuntu 18.04 to 20.04 - Unresolved issue occured while ...
Run sudo do-release-upgrade again if it throws the error message below: ... An unresolvable problem occurred while calculating the upgrade.
Read more >
Settings Reference for Python - Visual Studio Code
Python settings reference. The Python Extension for Visual Studio Code is highly configurable. This page describes the key settings you can work with....
Read more >
Changelog — Python 3.11.1 documentation
In pre-release versions of 3.11, some tracing events might have been lost when turning on tracing in a __del__ method or interrupt. gh-96572:...
Read more >
The mypy command line - mypy 0.991 documentation
By default, mypy will suppress any error messages generated within PEP 561 ... For more information on how to use these flags, see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found