openlawlibrary / pygls

A pythonic generic language server
https://pygls.readthedocs.io/en/latest/
Apache License 2.0
568 stars 103 forks source link

ci: Test against Python 3.12 #358

Closed alcarney closed 1 year ago

alcarney commented 1 year ago

Description (e.g. "Related to ...", etc.)

It won't be long now before Python 3.12 becomes available (see schedule)

By making use of the allow-prereleases flag to actions/setup-python, we should be able to start testing on the pre-release version of Python now and have the pipeline automatically upgrade to the real thing when it becomes available

Code review checklist (for code reviewer to complete)

alcarney commented 1 year ago

@tombh any ideas why all the CI pipelines would be running against Python 3.9.17? e.g here is the Python 3.8 pipline https://github.com/openlawlibrary/pygls/actions/runs/5813873464/job/15762361442?pr=358#step:7:16

tombh commented 1 year ago

Oh 😲 Literally the entire matrix is running against 3.9.17, wow.

My hunch is that this is a cache key not capturing the Python version from the matrix. There's a line above in the CI logs, that says the cache key is this: venv-Linux--24170221692f39b8a4570480d97e20d9bf32d65427c4446b210f7445a31547b3. That double hyphen betrays the missing token value from our workflow yaml that defines the key: key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}.

I wonder if steps.setup-python.outputs.python-version could just be replaced with matrix.python-version?

alcarney commented 1 year ago

I wonder if steps.setup-python.outputs.python-version could just be replaced with matrix.python-version?

Good spot! That looks like it did the trick! :smile:

tombh commented 1 year ago

Nice spot from you to see it in the first place! 🤓