Skip to content
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

Add tests for rez_pip and drop support for installing Python 2 packages #39

Merged
merged 1 commit into from
Jul 2, 2023

Conversation

JeanChristopheMorinPerso
Copy link
Owner

@JeanChristopheMorinPerso JeanChristopheMorinPerso commented Jun 11, 2023

Add tests for rez_pip and drop support for installing Python 2 packages.

We had to drop support for installing Python 2 packages because when running pip with --python-version and all the other flags (--platform, etc), pip doesn't evaluate the markers on the dependencies based on the information provided. It uses the current interpreter's values... In other words, if we run <sys.executable> pip.pyz install <package> --python-version 2.7 where sys.executable is a Python 3 executable, we will get the dependencies for Python 3 and not 2! See pypa/pip#11664 for more details.

We could potentially hack a solution together, for example by creating a sitecustomize or usercustomize file, or maybe even a .pth file that would override the sys and os values used by markers... But that would be quite fragile.

Lastly, the version of pip we need isn't compatible with Python 2.

This means that dropping support for installing Python 2 packages is our only option right now.

@codecov
Copy link

codecov bot commented Jun 11, 2023

Codecov Report

Merging #39 (30b4566) into main (093ae3d) will increase coverage by 2.75%.
The diff coverage is 100.00%.

❗ Current head 30b4566 differs from pull request most recent head d8b16ff. Consider uploading reports for the commit d8b16ff to get more accurate results

@@            Coverage Diff             @@
##             main      #39      +/-   ##
==========================================
+ Coverage   70.87%   73.63%   +2.75%     
==========================================
  Files           8        8              
  Lines         618      622       +4     
  Branches      123      124       +1     
==========================================
+ Hits          438      458      +20     
+ Misses        170      154      -16     
  Partials       10       10              
Impacted Files Coverage Δ
src/rez_pip/pip.py 100.00% <100.00%> (+34.37%) ⬆️

... and 2 files with indirect coverage changes

@JeanChristopheMorinPerso JeanChristopheMorinPerso force-pushed the test_pip branch 20 times, most recently from ec58c36 to 1e9eba6 Compare June 18, 2023 20:28
@JeanChristopheMorinPerso JeanChristopheMorinPerso changed the title Add tests for rez_pip Add tests for rez_pip and drop support for Installing Python 2 packages Jul 2, 2023
@JeanChristopheMorinPerso JeanChristopheMorinPerso changed the title Add tests for rez_pip and drop support for Installing Python 2 packages Add tests for rez_pip and drop support for installing Python 2 packages Jul 2, 2023
@JeanChristopheMorinPerso JeanChristopheMorinPerso force-pushed the test_pip branch 2 times, most recently from c900fed to 466dee6 Compare July 2, 2023 16:08
…ip.pip

Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
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.

1 participant