conda-build icon indicating copy to clipboard operation
conda-build copied to clipboard

Bugfix: Show the setup_file parameter in the debug info when ImportError happens

Open sugatoray opened this issue 3 years ago • 5 comments

The code in jinja_context.py:load_setup_py_data() was hard coded and not showing the user provided setup_file parameter, in the event of ImportError + permit_undefined_jinja=True. This PR fixes that.

A summary of what changed

  • The debug statement now prints the user-provided setup_file parameter, instead of a hard-coded setup.py.
  • Changed in: jinja_context.py:load_setup_py_data()

DIFF

See here.

         except ImportError as e:
             if permit_undefined_jinja:
                 log = get_logger(__name__)
-                log.debug("Reading setup.py failed due to missing modules.  This is probably OK, "
+                log.debug(f"Reading {setup_file} failed due to missing modules.  This is probably OK, "
                           "since it may succeed in later passes.  Watch for incomplete recipe "
                           "info, though.")

sugatoray avatar Nov 20 '21 23:11 sugatoray

We require contributors to sign our Contributor License Agreement, and we don't have one on file for @sugatoray. In order for us to review and merge your code, please e-sign the PDF at https://conda.io/en/latest/contributing.html#conda-contributor-license-agreement. We then need to manually verify your signature. We will ping the bot to refresh the PR status when we have confirmed your signature.

anaconda-issue-bot avatar Nov 20 '21 23:11 anaconda-issue-bot

pre-commit.ci autofix

sugatoray avatar Nov 21 '21 00:11 sugatoray

cc: @msarahan @conda-bot @anaconda-issue-bot It's a small change. I am not sure why so many CI's are failing.

Also, I have signed up the CLA. Does it take some time before it passes the verification/cla-signed step?

sugatoray avatar Nov 21 '21 00:11 sugatoray

We recently enabled pre-commit, please wait for #4327 to be merged which will resolve all of these issues. Thanks.

kenodegard avatar Nov 21 '21 02:11 kenodegard

@anaconda-issue-bot check

kenodegard avatar Nov 21 '21 02:11 kenodegard

Hi there, thank you for your contribution!

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this pull request to remain open please:

  1. Rebase and verify the changes still work
  2. Leave a comment with the current status

NOTE: If this pull request was closed prematurely, please leave a comment.

Thanks!

github-actions[bot] avatar Aug 01 '23 04:08 github-actions[bot]