Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Make whltool python version configurable #216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

df-stripe
Copy link

As part of the whl_library rule, we run a python script (packaged here as whltool.par) to generate py_library instances for each wheel. One of the functions of running that script is to parse the wheels' declared dependencies. In some cases, the sets of dependencies may vary depending on what python version is being used, even for a wheel file that is compatible with both python 2 and 3. This pull request adds an argument to the whl_library rule allowing the user to specify the desired version of python to run the whltool script - in my case, I pass the value python3. It defaults to the original behavior of just running python by itself.

To give a concrete example of where this can come up, the cryptography package relies on a backported package when used under python<3.4, but does not require that backport for newer python versions: https://github.com/pyca/cryptography/blob/master/setup.py#L239-L240 . When attempting to install this library with python 3.7, it's not possible to find that backported library, and so we can't resolve the dependencies.

I'm very open to renaming things here if desired, or to (say) attempt to resolve the path to the python interpreter using something like https://docs.bazel.build/versions/master/skylark/lib/repository_ctx.html#which. I elected to use python_target so that the user would understand that this should correspond to the target python version that will eventually run whatever code relies on the whl_library.

@ptarjan
Copy link
Contributor

ptarjan commented Aug 12, 2019

ping @brandjon any chance you can take a look at this soon please?

@cristifalcas
Copy link

Hi @brandjon. Please let us know if this project is maintained, or we should move to something else. There are multiple PRs and issues that are not answered for months.

Importing pip packages doesn't work, using python3 is even in a worst state.

@brandjon
Copy link
Contributor

Thanks for the PR @df-stripe! We recently merged analogous behavior in from PR #252. You can also follow #256.

@brandjon brandjon closed this Nov 12, 2019
@brandjon brandjon mentioned this pull request Nov 13, 2019
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.

5 participants