kr8s-org / kr8s

A batteries-included Python client library for Kubernetes that feels familiar for folks who already know how to use kubectl
https://kr8s.org
BSD 3-Clause "New" or "Revised" License
839 stars 45 forks source link

Python versions in CI are being incorrectly tested #461

Closed jacobtomlinson closed 3 months ago

jacobtomlinson commented 3 months ago

Which project are you reporting a bug for?

kr8s

What happened?

It seems that when installing hatch with pipx the Python version is being changed somehow.

Run actions/setup-python@v2
Successfully setup CPython (3.8.18)
6s

Run pipx install hatch
  pipx install hatch
  shell: /usr/bin/bash -e {0}
  env:
    KUBECONFIG: .pytest-kind/pytest-kind/kubeconfig
    pythonLocation: /opt/hostedtoolcache/Python/3.8.18/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.8.18/x64/lib
creating virtual environment...
installing hatch...
done! ✨ 🌟 ✨
  installed package hatch 1.12.0, installed using Python 3.10.12
  These apps are now globally available
    - hatch

Despite the Python local being set correctly pipx is reporting hatch being installed with Python 3.10.12 which I assume is the system Python.

Then when tests are running 3.10.12 is being used.

Run hatch run test:run
Creating environment: test
Installing project in development mode
Checking dependencies
============================= test session starts ==============================
platform linux -- Python 3.10.12, pytest-8.3.2, pluggy-1.5.0 -- /home/runner/.local/share/hatch/env/virtual/kr8s/NUqxDfBT/test/bin/python

As a result bugs like #459 are being missed in CI.

Anything else?

No response