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 system install test for Amazon Linux #2403

Closed
wants to merge 1 commit into from
Closed

Add system install test for Amazon Linux #2403

wants to merge 1 commit into from

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Mar 13, 2024

Supersedes #1534

@zanieb zanieb added the testing Internal testing of behavior label Mar 13, 2024
@zanieb zanieb force-pushed the zb/amazon branch 3 times, most recently from 6ec143f to 27110a9 Compare March 13, 2024 03:31
@zanieb
Copy link
Member Author

zanieb commented Mar 13, 2024

@charliermarsh this looks legitimately wrong? https://github.com/astral-sh/uv/actions/runs/8259113036/job/22592520139

Same failure over in #2402

@charliermarsh
Copy link
Member

Not necessarily. It depends on what sys.path is. Where does pip install into? It's possible that that's the right place, and the directory just doesn't exist yet. (I genuinely don't know, I'm just saying it's possible we're wrong to assume the directory has to exist in advance.)

@zanieb
Copy link
Member Author

zanieb commented Mar 13, 2024

In CentOS (I just have the image around locally):

[root@bf9d80fad201 /]# python3 -c "import sys; print(sys.path)"
['', '/usr/lib64/python39.zip', '/usr/lib64/python3.9', '/usr/lib64/python3.9/lib-dynload', '/usr/lib64/python3.9/site-packages', '/usr/lib/python3.9/site-packages']
[root@d4f5af1c6ac6 /]# ls /usr/local/lib/python3.9/site-packages
ls: cannot access '/usr/local/lib/python3.9/site-packages': No such file or directory
[root@d4f5af1c6ac6 /]# python3 -m pip list
Package    Version
---------- -------
pip        20.2.4
setuptools 50.3.2
[root@bf9d80fad201 /]# python3 -m pip install pylint
WARNING: Running pip install with root privileges is generally not a good idea. Try `python3 -m pip install --user` instead.
Collecting pylint
  Downloading pylint-3.1.0-py3-none-any.whl (515 kB)
     |████████████████████████████████| 515 kB 2.2 MB/s 
Collecting mccabe<0.8,>=0.6
  Downloading mccabe-0.7.0-py2.py3-none-any.whl (7.3 kB)
Collecting astroid<=3.2.0-dev0,>=3.1.0
  Downloading astroid-3.1.0-py3-none-any.whl (275 kB)
     |████████████████████████████████| 275 kB 10.6 MB/s 
Collecting tomlkit>=0.10.1
  Downloading tomlkit-0.12.4-py3-none-any.whl (37 kB)
Collecting typing-extensions>=3.10.0; python_version < "3.10"
  Downloading typing_extensions-4.10.0-py3-none-any.whl (33 kB)
Collecting platformdirs>=2.2.0
  Downloading platformdirs-4.2.0-py3-none-any.whl (17 kB)
Collecting tomli>=1.1.0; python_version < "3.11"
  Downloading tomli-2.0.1-py3-none-any.whl (12 kB)
Collecting dill>=0.2; python_version < "3.11"
  Downloading dill-0.3.8-py3-none-any.whl (116 kB)
     |████████████████████████████████| 116 kB 11.4 MB/s 
Collecting isort!=5.13.0,<6,>=4.2.5
  Downloading isort-5.13.2-py3-none-any.whl (92 kB)
     |████████████████████████████████| 92 kB 662 kB/s 
Installing collected packages: mccabe, typing-extensions, astroid, tomlkit, platformdirs, tomli, dill, isort, pylint
Successfully installed astroid-3.1.0 dill-0.3.8 isort-5.13.2 mccabe-0.7.0 platformdirs-4.2.0 pylint-3.1.0 tomli-2.0.1 tomlkit-0.12.4 typing-extensions-4.10.0
[root@bf9d80fad201 /]# python3 -m pip show pylint
Name: pylint
Version: 3.1.0
Summary: python code static checker
Home-page: None
Author: None
Author-email: Python Code Quality Authority <[email protected]>
License: GPL-2.0-or-later
Location: /usr/local/lib/python3.9/site-packages
Requires: platformdirs, isort, tomli, dill, astroid, tomlkit, typing-extensions, mccabe
Required-by: 

Suggests you're right — #2404

@charliermarsh
Copy link
Member

Yeah it does look like pip is installing into the same place. Although why isn't /usr/local/lib/python3.9/site-packages on sys.path?

@zanieb
Copy link
Member Author

zanieb commented Mar 13, 2024

Oh yeah I read /usr/lib/python3.9/site-packages as /usr/local/lib/... umm I'm not sure :)

@charliermarsh
Copy link
Member

Can you check that import pylint or whatever works in that Python?

@charliermarsh
Copy link
Member

Or you can share the Dockerfile and I can debug it.

@zanieb
Copy link
Member Author

zanieb commented Mar 13, 2024

[root@d4f5af1c6ac6 /]# python3 -c "import pylint" works

I'm just copy-pasting the setup commands for CentOS from the CI workflow

@zanieb
Copy link
Member Author

zanieb commented Mar 13, 2024

Interestingly now the sys.path includes it

[root@d4f5af1c6ac6 /]# python3 -c "import sys; print(sys.path)" 
['', '/usr/lib64/python39.zip', '/usr/lib64/python3.9', '/usr/lib64/python3.9/lib-dynload', '/usr/local/lib/python3.9/site-packages', '/usr/lib64/python3.9/site-packages', '/usr/lib/python3.9/site-packages']

@zanieb
Copy link
Member Author

zanieb commented Mar 13, 2024

It gets added when you pip install something :)

@zanieb
Copy link
Member Author

zanieb commented Mar 13, 2024

Or, more concretely, when it exists

[root@f381759817d2 /]# python3 -c "import sys; print(sys.path)"
['', '/usr/lib64/python39.zip', '/usr/lib64/python3.9', '/usr/lib64/python3.9/lib-dynload', '/usr/lib64/python3.9/site-packages', '/usr/lib/python3.9/site-packages']
[root@f381759817d2 /]# mkdir -p '/usr/local/lib/python3.9/site-packages'
[root@f381759817d2 /]# python3 -c "import sys; print(sys.path)"
['', '/usr/lib64/python39.zip', '/usr/lib64/python3.9', '/usr/lib64/python3.9/lib-dynload', '/usr/local/lib/python3.9/site-packages', '/usr/lib64/python3.9/site-packages', '/usr/lib/python3.9/site-packages']

@zanieb
Copy link
Member Author

zanieb commented Mar 13, 2024

Done in #2413 instead

@zanieb zanieb closed this Mar 13, 2024
@charliermarsh
Copy link
Member

Thank you!

zanieb added a commit that referenced this pull request Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Internal testing of behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants