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 .python-verson file #32323

Merged
merged 3 commits into from
Jul 13, 2022
Merged

add .python-verson file #32323

merged 3 commits into from
Jul 13, 2022

Conversation

belimawr
Copy link
Contributor

@belimawr belimawr commented Jul 12, 2022

What does this PR do?

Add .python-version file with the same version we're using on CI.

Why is it important?

It documents which Python version should be used an allows for the use of pyenv to manage the Python version automatically.
Currently our system tests are not compatible with Python >= 3.10.0

Checklist

  • [ ] My code follows the style guidelines of this project
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

## Author's Checklist

How to test this PR locally

Install Pyenv and run

pyenv version

The output should state that the Python version is set by the .python-version file on the root of this repository.

## Related issues

Use cases

Any engineer trying to run system tests on a system with Python >= 3.10

## Screenshots
## Logs

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 12, 2022
Add .python-version file with the same version we're using on CI.
@belimawr belimawr added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Jul 12, 2022
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 12, 2022
@belimawr belimawr marked this pull request as ready for review July 12, 2022 09:28
@belimawr belimawr requested a review from a team as a code owner July 12, 2022 09:28
@belimawr belimawr requested review from cmacknz and fearful-symmetry and removed request for a team July 12, 2022 09:28
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 12, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-07-12T13:50:03.987+0000

  • Duration: 25 min 33 sec

Test stats 🧪

Test Results
Failed 0
Passed 5008
Skipped 49
Total 5057

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@belimawr
Copy link
Contributor Author

I've just realised that pyenv is breaking with Python 3.6.9:

 tiago@millennium-falcon~/devel/kube/devel/beats % pyenv install    
Downloading Python-3.6.9.tar.xz...
-> https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tar.xz
Installing Python-3.6.9...
/home/tiago/.pyenv/plugins/python-build/bin/python-build: line 1710: 1072377 Segmentation fault      (core dumped) "$PYTHON_BIN" -c "import $1" > /dev/null 2>&1
WARNING: The Python ctypes extension was not compiled. Missing the libffi lib?
WARNING: The Python tkinter extension was not compiled and GUI subsystem has been detected. Missing the Tk toolkit?
/home/tiago/.pyenv/plugins/python-build/bin/python-build: line 1921: 1072398 Segmentation fault      (core dumped) "$PYTHON_BIN" -s -m ensurepip ${ensurepip_opts} > /dev/null 2>&1
Installing pip from https://bootstrap.pypa.io/pip/3.6/get-pip.py...
/home/tiago/.pyenv/plugins/python-build/bin/python-build: line 1902: 1072470 Segmentation fault      (core dumped) "${PYTHON_BIN}" -s "${get_pip}" ${GET_PIP_OPTS} 1>&4 2>&1
error: failed to install pip via get-pip.py

But it works file with Python 3.9.13

tiago@millennium-falcon~/devel/kube/devel/beats % pyenv install
Downloading Python-3.9.13.tar.xz...
-> https://www.python.org/ftp/python/3.9.13/Python-3.9.13.tar.xz
Installing Python-3.9.13...
WARNING: The Python tkinter extension was not compiled and GUI subsystem has been detected. Missing the Tk toolkit?
Installed Python-3.9.13 to /home/tiago/.pyenv/versions/3.9.13

 tiago@millennium-falcon~/devel/kube/devel/beats(filestream-input-id-bookkeeper-fix|✚5…) % python --version
Python 3.9.13

Should we set our Python version to 3.9.13?

@cmacknz Any thoughts here?

I'll update to 3.9.13 and see if it changes anything on CI.

@cmacknz
Copy link
Member

cmacknz commented Jul 12, 2022

Because this didn't change any of the source files I don't think it actually triggered any of the tests: https://beats-ci.elastic.co/blue/organizations/jenkins/Beats%2Fbeats/detail/PR-32323/4/pipeline

We probably have to do it manually. No opposition to this as long as it doesn't break anything.

@cmacknz
Copy link
Member

cmacknz commented Jul 12, 2022

/test

@cmacknz
Copy link
Member

cmacknz commented Jul 12, 2022

/test filebeat

@cmacknz
Copy link
Member

cmacknz commented Jul 12, 2022

/test libbeat

@belimawr
Copy link
Contributor Author

/package

@belimawr belimawr merged commit 08715cf into elastic:main Jul 13, 2022
@belimawr belimawr deleted the add-python-version branch July 13, 2022 08:09
chrisberkhout pushed a commit that referenced this pull request Jun 1, 2023
Add .python-version file pinning Python used on tests to 3.9.13.
.python-version is also removed from .gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants