Skip to content

Conversation

mattmoor
Copy link
Contributor

This also fixes a couple bugs I hit after regenerating piptool.par:

  • os.environ['PYTHONPATH'] may result in a KeyError
  • The cert expansion logic was removed, but things fail without it (after I ./update_tools.sh). I thought this was intentional (should the PAR changes have fixes this?), but I'm restoring for now to keep HEAD in a good state.

@mattmoor
Copy link
Contributor Author

@duggelz This makes bazel test ... clean after ./update_tools.sh (it is broken at HEAD). The subpar update is an artifact of me thinking that might fix the certs issue, but it didn't seem to.

I'd like to reach a point where we have this done, so that CI makes sure the above passes (since ./update_tools.sh should do nothing!).

LMK if you want to dig into this at all, I'm just trying to get HEAD into a good state.

WORKSPACE Outdated
name = "subpar",
remote = "https://github.com/google/subpar",
tag = "1.0.0",
commit = "b1b6bd13ff80ede09f57539031cfb20459c28237",
Copy link

Choose a reason for hiding this comment

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

I tagged 1.1.0 if you want to use that instead (You'll miss the CI changes which are irrelevant here).

os.environ['PYTHONPATH'] = ':'.join(dirs_to_add + existing_pythonpath)
existing_pythonpath = os.environ.get('PYTHONPATH')
if existing_pythonpath:
dirs_to_add.append(existing_pythonpath.split(':'))
Copy link

Choose a reason for hiding this comment

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

append will do the wrong thing here (adds the whole list as a single element of the first list), you want extend

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, good catch.

cert_path = os.path.join(tempfile.mkdtemp(), "cacert.pem")
with open(cert_path, "wb") as cert:
cert.write(pkgutil.get_data("pip._vendor.requests", "cacert.pem"))
argv = ["--disable-pip-version-check", "--cert", cert_path] + argv
Copy link

Choose a reason for hiding this comment

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

Yes, this shouldn't be necessary, but ok to add them back in while I investigate more.

@duggelz
Copy link

duggelz commented Nov 16, 2017

Oops, can I unapprove? See my comment about append.

This also fixes a couple bugs I hit after regenerating piptool.par:
 - os.environ['PYTHONPATH'] may result in a KeyError
 - The cert expansion logic was removed, but things fail without it (after I ./update_tools.sh).  I thought this was intentional (should the PAR changes have fixes this?), but I'm restoring for now to keep HEAD in a good state.
@mattmoor
Copy link
Contributor Author

Updated, thanks.

@mattmoor
Copy link
Contributor Author

@duggelz To be clear, I'll hold off until you re-approve :)

@duggelz
Copy link

duggelz commented Nov 16, 2017

LGTM to me, submit. (I still can't find any button to unapprove or re-approve).

@mattmoor mattmoor merged commit 72456c9 into bazel-contrib:master Nov 16, 2017
alexeagle pushed a commit to alexeagle/rules_python that referenced this pull request Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants