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

Bump github python versions #14

Merged
merged 30 commits into from
Mar 1, 2024
Merged

Conversation

phildini
Copy link
Owner

No description provided.

MaggieFero and others added 11 commits August 15, 2023 22:17
Explicitly give codeql-analysis action the security-events: write permission so it still works even when the default GitHub Actions token is set to read-only.
* Bump versions

* Bump back Pillow due to test failure

* Bump setuptools
We missed Flower in our version upgrades earlier somehow, proposing the upgrade here.
pylint bookwyrm/

- uses: actions/checkout@v3
- name: Set up Python 3.9
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should change this line to match the version, since it now sets up Python 3.11.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem I ran into last time is not matching what upstream does. I don't know that I feel confident taking on the whole of upgrading a python version for this repo? Thoughts so, so welcome.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, the line after this actually sets the version, and it's already on 3.11 here, so this comment was more about updating the name to match what it does.

Upstream has changed everything significant that needs to change to support this upgrade already, though (that was part of the huge batch of changes we took recently). I think this would be fine for us at this point, and if we get have it working well in our prod that's a great argument to commit a similar upgrade to upstream.

Dockerfile Outdated
@@ -1,4 +1,4 @@
FROM python:3.9
FROM python:3.12.0b4-slim
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're currently on 3.11 in this file, but I think we should stay there?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, should this be using 3.11-bookworm? We're mostly using it but not always.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consistency is good; where are we using bookworm?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, saw below. Yeah, maybe try it and see what happens?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I don't know if there's a reason it's bookworm in one place but not the other, but since IIRC we are actually running this on the platform bookworm is meant for, I expect it should be a useful switch for us? I'll doublecheck the convo about where upstream started using bookworm for if there was a technical reason for the discrepancy versus just "one dockerfile is more hidden than the other".

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked upstream and they're using bookworm for dev-tools but not the main dockerfile. Let's stay aligned with them, and do regular 3.11 here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not able to find any discussion of why, because "bookworm" is a very common typo of "bookwyrm" and I'm not sure which python version Bookwyrm was on when Bookworm was introduced.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha! I found it after all. bookwyrm-social#3190 was fixed in bookwyrm-social#3216 by using Bookworm for dev-tools. Let's stay consistent with upstream, since that shouldn't be necessary here.

@@ -1,4 +1,4 @@
FROM python:3.9
FROM python:3.12.0b4-slim
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're currently on python:3.11-bookworm here, and I think we probably want to stay there.

I seem to have accidentally removed three dependencies while resolving merge conflicts. Putting them back now.
@MaggieFero
Copy link
Collaborator

I believe Pylint is failing because imghdr is deprecated in Python 3.11 (pursuant to PEP-0594) . However, there's no great-looking alternative available at the moment (though at least one is in progress) and it won't be actually removed until 3.13. Therefore, I propose we ask Pylint to ignore this module's deprecation for a bit, and revisit after Pycon, when it feels likely that somebody will have figured out a solution to this that doesn't involve adding ImageMagick and/or Perl dependencies.

After discussion of the deprecation of the imghdr module, we want Pylint to ignore it for now and will return to checking out alternatives after Pycon, because we expect there will be some better options by then.
I broke another linter with my linterignore by not putting a space where expected in a comment. Fixing that here.
Turns out there were TWO spaces the linter wanted that I didn't have! 🤣 This is what I get for reviewing PRs in the GitHub WebUI.
Please, Python Formatting, Have I Added Enough Whitespace Yet???? 😭
Now it's VERY terse, here's hoping this is enough to pass.
@@ -3,7 +3,9 @@
from abc import ABC, abstractmethod
from typing import Optional, TypedDict, Any, Callable, Union, Iterator
from urllib.parse import quote_plus
import imghdr

# pylint: disable-next=deprecated-module
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTTP_X_FORWARDED_PROTO: false
run: |
mypy bookwyrm celerywyrm
- uses: actions/checkout@v3
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like all whitespace changes that might have been intro'd by my editor... I kinda think we should... not? It's commit history churn if so

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bunch of linter changes that had been applied in between ended up bundled in here. We also ended up with some similar stuff in some of the security upgrades, but because we're using squash&merge I'm not super worried about it? We could get rid of it if you'd like, but I'm not super worried either way.

MaggieFero and others added 4 commits February 29, 2024 18:08
I miscounted characters, off by 5. This should actually be short enough now.
requests.get was missing a timeout; added a timeout of 15 as aligned to the timeout currently used in bookwyrm/utils/isni.py
@phildini phildini merged commit d714f3b into main Mar 1, 2024
10 checks passed
phildini added a commit that referenced this pull request Mar 1, 2024
MaggieFero added a commit that referenced this pull request Mar 2, 2024
@MaggieFero MaggieFero deleted the phildini-github-python-version branch March 2, 2024 23:38
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.

2 participants