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

ci: remove python3.8, which is eol #8115

Merged
merged 1 commit into from
Jan 10, 2025
Merged

ci: remove python3.8, which is eol #8115

merged 1 commit into from
Jan 10, 2025

Conversation

Mic92
Copy link
Contributor

@Mic92 Mic92 commented Oct 11, 2024

  • also see https://devguide.python.org/versions/
  • python3.8 doesn't support subscribed types, which makes it difficult to use with typing
  • many Linux distribution won't offer this python version anymore, because it no longer receives any security fixes
  • even Debian oldstable has python3.9 as default

@tdesveaux
Copy link
Contributor

Not related to dropping support for py3.8.

python3.8 doesn't support subscribed types, which makes it difficult to use with typing

I see no reason not to use from __future__ import annotations (https://docs.python.org/3/library/__future__.html https://peps.python.org/pep-0563/). It makes type hinting easier to work with.

@Mic92
Copy link
Contributor Author

Mic92 commented Oct 11, 2024

One thing to consider when supporting these old python versions is, that one is basically expect from contributors to install unmaintained, potentially insecure libraries.

@Mic92
Copy link
Contributor Author

Mic92 commented Oct 11, 2024

Not related to dropping support for py3.8.

python3.8 doesn't support subscribed types, which makes it difficult to use with typing

I see no reason not to use from __future__ import annotations (https://docs.python.org/3/library/__future__.html https://peps.python.org/pep-0563/). It makes type hinting easier to work with.

The only disadvantage I found so far is that it might break libraries that try to introspect on type hints. Likely not used in this project. i.e. if you get member field types from a dataclass it would than return a string instead of the type object.

@tdesveaux
Copy link
Contributor

The only disadvantage I found so far is that it might break libraries that try to introspect on type hints. Likely not used in this project. i.e. if you get member field types from a dataclass it would than return a string instead of the type object.

From https://peps.python.org/pep-0563/#resolving-type-hints-at-runtime

For code that uses type hints, the typing.get_type_hints(obj, globalns=None, localns=None) function correctly evaluates expressions back from its string form. Note that all valid code currently using annotations should already be doing that since a type annotation can be expressed as a string literal.

Since:

def func() -> "int":
    return 0

is the same as:

from __future__ import annotations

def func() -> int:
    return 0

Since string types are already used (example here), any library that does not correctly introspect would be already broken.

There are other advantages to the annotations future, but I'll stop here as it's not really the subject of this PR.
I'll open an issue or PR to continue on this discussion.

.bbtravis.yml Outdated Show resolved Hide resolved
.bbtravis.yml Show resolved Hide resolved
worker/setup.py Outdated Show resolved Hide resolved
@p12tic
Copy link
Member

p12tic commented Oct 11, 2024

I would weakly prefer to keep python 3.8, because Ubuntu 20.04 LTS still supports it. Maybe using from __future__ import annotations is enough to make python 3.8 not as painful?

@Mic92
Copy link
Contributor Author

Mic92 commented Oct 11, 2024

I guess the annotations stuff is enough to continue to support version-impaired distributions for now.

@Mic92 Mic92 closed this Oct 11, 2024
@Mic92
Copy link
Contributor Author

Mic92 commented Oct 11, 2024

But how long do we want to keep supporting this? Ubuntu 20.04 goes EOL in 2030-04. I am hoping to use newer python features before that.

@Mic92 Mic92 deleted the python-38 branch October 12, 2024 11:46
@p12tic
Copy link
Member

p12tic commented Oct 12, 2024

I think waiting until the standard support ends at around 2025-04 would make sense.

@p12tic
Copy link
Member

p12tic commented Oct 12, 2024

In reality buildbot 4.1 will be released sometime this month and buildbot 4.2 will be released around end of the year. So after that we can already merge this PR.

@p12tic
Copy link
Member

p12tic commented Dec 12, 2024

Master parts of this PR could go in, but the branch has been removed :/

@Mic92
Copy link
Contributor Author

Mic92 commented Dec 12, 2024

I will try to restore.

@Mic92 Mic92 restored the python-38 branch December 12, 2024 13:20
@Mic92 Mic92 reopened this Dec 12, 2024
@Mic92
Copy link
Contributor Author

Mic92 commented Dec 12, 2024

@p12tic feel free edit as you want. Might be short of time till end of the year for this line of work.

@Mic92 Mic92 force-pushed the python-38 branch 3 times, most recently from ce74ad2 to 07762d5 Compare December 26, 2024 09:49
@Mic92
Copy link
Contributor Author

Mic92 commented Dec 26, 2024

Rebased.

- also see https://devguide.python.org/versions/
- python3.8 doesn't support subscribed types, which makes it difficult
to use with typing
- many linux distribution won't offer this python version anymore,
because it no longer receives any security fixes
- even debian oldstable has ptyhon3.9 as default

Modified-by: Povilas Kanapickas <povilas@radix.lt>
@p12tic
Copy link
Member

p12tic commented Jan 10, 2025

Rebased and fixed a couple of errors

@p12tic p12tic merged commit d248560 into buildbot:master Jan 10, 2025
36 checks passed
@Mic92 Mic92 deleted the python-38 branch January 10, 2025 22:24
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.

3 participants