Skip to content

feat: Upgrade to python 3.10#274

Merged
lucyb merged 6 commits into
mainfrom
lucyb/upgrade-python
Jul 2, 2026
Merged

feat: Upgrade to python 3.10#274
lucyb merged 6 commits into
mainfrom
lucyb/upgrade-python

Conversation

@lucyb

@lucyb lucyb commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

The applications that use this library run python 3.10 and python 3.12. The outdated version of python is also stopping us from merging dependency updates.

This change should also make it easier for us to do #269.

@lucyb
lucyb force-pushed the lucyb/upgrade-python branch 3 times, most recently from 7e42280 to d32c34c Compare June 22, 2026 13:59
@StevenMaude

StevenMaude commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

thought: It's not essential, but we could rebuild the requirements; it drops one dependency (importlib-metadata which was used for Python 3.9 support alone).

Edit: actually two, because there was another transitive one.

diff --git a/requirements.dev.txt b/requirements.dev.txt
index 2269502..f31214d 100644
--- a/requirements.dev.txt
+++ b/requirements.dev.txt
@@ -1,5 +1,5 @@
 #
-# This file is autogenerated by pip-compile with Python 3.9
+# This file is autogenerated by pip-compile with Python 3.10
 # by the following command:
 #
 #    pip-compile --allow-unsafe --generate-hashes --output-file=requirements.dev.txt requirements.dev.in
@@ -173,10 +173,6 @@ identify==2.6.15 \
     --hash=sha256:1181ef7608e00704db228516541eb83a88a9f94433a8c80bb9b5bd54b1d81757 \
     --hash=sha256:e4f4864b96c6557ef2a1e1c951771838f4edc9df3a72ec7118b338801b11c7bf
     # via pre-commit
-importlib-metadata==8.7.1 \
-    --hash=sha256:49fef1ae6440c182052f407c8d34a68f72efc36db9ca90dc0113398f2fdde8bb \
-    --hash=sha256:5a1f80bf1daa489495071efbb095d75a634cf28a8bc299581244063b53176151
-    # via build
 iniconfig==2.1.0 \
     --hash=sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7 \
     --hash=sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760
@@ -205,9 +201,9 @@ pip-tools==7.5.3 \
     --hash=sha256:3aac0c473240ae90db7213c033401f345b05197293ccbdd2704e52e7a783785e \
     --hash=sha256:8fa364779ebc010cbfe17cb9de404457ac733e100840423f28f6955de7742d41
     # via -r requirements.dev.in
-platformdirs==4.4.0 \
-    --hash=sha256:abd01743f24e5287cd7a5db3752faf1a2d65353f38ec26d98e25a6db65958c85 \
-    --hash=sha256:ca753cf4d81dc309bc67b0ea38fd15dc97bc30ce419a7f58d13eb3bf14c4febf
+platformdirs==4.10.0 \
+    --hash=sha256:31e761a6a0ca04faf7353ea759bdba55652be214725111e5aac52dfa29d4bef7 \
+    --hash=sha256:fb516cdb12eb0d857d0cd85a7c57cea4d060bee4578d6cf5a14dfdf8cbf8784a
     # via
     #   -c requirements.prod.txt
     #   black
@@ -459,10 +455,6 @@ wheel==0.47.0 \
     --hash=sha256:212281cab4dff978f6cedd499cd893e1f620791ca6ff7107cf270781e587eced \
     --hash=sha256:cc72bd1009ba0cf63922e28f94d9d83b920aa2bb28f798a31d0691b02fa3c9b3
     # via pip-tools
-zipp==3.23.1 \
-    --hash=sha256:0b3596c50a5c700c9cb40ba8d86d9f2cc4807e9bedb06bcdf7fac85633e444dc \
-    --hash=sha256:32120e378d32cd9714ad503c1d024619063ec28aad2248dc6672ad13edfa5110
-    # via importlib-metadata
 
 # The following packages are considered to be unsafe in a requirements file:
 pip==26.0.1 \
diff --git a/requirements.prod.txt b/requirements.prod.txt
index 4eb8b8e..d1b7f17 100644
--- a/requirements.prod.txt
+++ b/requirements.prod.txt
@@ -1,5 +1,5 @@
 #
-# This file is autogenerated by pip-compile with Python 3.9
+# This file is autogenerated by pip-compile with Python 3.10
 # by the following command:
 #
 #    pip-compile --allow-unsafe --generate-hashes --output-file=requirements.prod.txt requirements.prod.in
@@ -10,13 +10,13 @@ attrs==26.1.0 \
     # via
     #   cattrs
     #   requests-cache
-cattrs==25.3.0 \
-    --hash=sha256:1ac88d9e5eda10436c4517e390a4142d88638fe682c436c93db7ce4a277b884a \
-    --hash=sha256:9896e84e0a5bf723bc7b4b68f4481785367ce07a8a02e7e9ee6eb2819bc306ff
+cattrs==26.1.0 \
+    --hash=sha256:d1e0804c42639494d469d08d4f26d6b9de9b8ab26b446db7b5f8c2e97f7c3096 \
+    --hash=sha256:fa239e0f0ec0715ba34852ce813986dfed1e12117e209b816ab87401271cdd40
     # via requests-cache
-certifi==2026.5.20 \
-    --hash=sha256:3c52e209ba0a4ad7aebe60436a4ab349c39e1e602e8c134221e546902ad25897 \
-    --hash=sha256:69dea482ab64caa7b9f6aba1c6bf48bb6a5448d1c0f1b17ab42ad8c763a5344d
+certifi==2026.6.17 \
+    --hash=sha256:024c88eeec92ca068db80f02b8b07c9cef7b9fe261d1d535abfd5abd6f6af432 \
+    --hash=sha256:2227dcbaafe0d2f59279d1762ddddc37783ed4354594f194ffc31d20f41fc3db
     # via requests
 charset-normalizer==3.4.7 \
     --hash=sha256:007d05ec7321d12a40227aae9e2bc6dca73f3cb21058999a1df9e193555a9dcc \
@@ -157,9 +157,9 @@ furl==2.1.4 \
     --hash=sha256:877657501266c929269739fb5f5980534a41abd6bbabcb367c136d1d3b2a6015 \
     --hash=sha256:da34d0b34e53ffe2d2e6851a7085a05d96922b5b578620a37377ff1dbeeb11c8
     # via -r requirements.prod.in
-idna==3.15 \
-    --hash=sha256:048adeaf8c2d788c40fee287673ccaa74c24ffd8dcf09ffa555a2fbb59f10ac8 \
-    --hash=sha256:ca962446ea538f7092a95e057da437618e886f4d349216d2b1e294abfdb65fdc
+idna==3.18 \
+    --hash=sha256:7f952cbe720b688055e3f87de14f5c3e5fdaa8bc3928985c4077ca689de849a2 \
+    --hash=sha256:ffb385a7e039654cef1ab9ef32c6fafe283c0c0467bba1d9029738ce4a14a848
     # via
     #   requests
     #   url-normalize
@@ -167,13 +167,13 @@ orderedmultidict==1.0.2 \
     --hash=sha256:16a7ae8432e02cc987d2d6d5af2df5938258f87c870675c73ee77a0920e6f4a6 \
     --hash=sha256:ab5044c1dca4226ae4c28524cfc5cc4c939f0b49e978efa46a6ad6468049f79b
     # via furl
-platformdirs==4.4.0 \
-    --hash=sha256:abd01743f24e5287cd7a5db3752faf1a2d65353f38ec26d98e25a6db65958c85 \
-    --hash=sha256:ca753cf4d81dc309bc67b0ea38fd15dc97bc30ce419a7f58d13eb3bf14c4febf
+platformdirs==4.10.0 \
+    --hash=sha256:31e761a6a0ca04faf7353ea759bdba55652be214725111e5aac52dfa29d4bef7 \
+    --hash=sha256:fb516cdb12eb0d857d0cd85a7c57cea4d060bee4578d6cf5a14dfdf8cbf8784a
     # via requests-cache
-requests==2.32.5 \
-    --hash=sha256:2462f94637a34fd532264295e186976db0f5d453d1cdd31473c85a6a161affb6 \
-    --hash=sha256:dbba0bac56e100853db0ea71b82b4dfd5fe2bf6d3754a8893c3af500cec7d7cf
+requests==2.34.2 \
+    --hash=sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0 \
+    --hash=sha256:f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed
     # via
     #   -r requirements.prod.in
     #   requests-cache
@@ -193,13 +193,13 @@ typing-extensions==4.15.0 \
     # via
     #   cattrs
     #   exceptiongroup
-url-normalize==2.2.1 \
-    --hash=sha256:3deb687587dc91f7b25c9ae5162ffc0f057ae85d22b1e15cf5698311247f567b \
-    --hash=sha256:74a540a3b6eba1d95bdc610c24f2c0141639f3ba903501e61a52a8730247ff37
+url-normalize==3.0.0 \
+    --hash=sha256:0552cbf2831a32a28994a13d29bca58a60e10ff6c0380e343ec6d1c2a0d232d8 \
+    --hash=sha256:95234bd359f86831c1fd87c248877f2a6887db2f3b5087120083f2fffcba4889
     # via requests-cache
-urllib3==2.6.3 \
-    --hash=sha256:1b62b6884944a57dbe321509ab94fd4d3b307075e0c2eae991ac71ee15ad38ed \
-    --hash=sha256:bf272323e553dfb2e87d9bfd225ca7b0f467b919d7bbd355436d3fd37cb0acd4
+urllib3==2.7.0 \
+    --hash=sha256:231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c \
+    --hash=sha256:9fb4c81ebbb1ce9531cce37674bbc6f1360472bc18ca9a553ede278ef7276897
     # via
     #   requests
     #   requests-cache

lucyb added 4 commits July 1, 2026 16:20
The applications that use this library run python 3.10 and python 3.12. The
outdated version of python is also stopping us from merging dependency updates.

This change should also make it easier for us to do #269.
@lucyb
lucyb force-pushed the lucyb/upgrade-python branch from 37af499 to 259aa2c Compare July 1, 2026 15:24
@lucyb

lucyb commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

thought: It's not essential, but we could rebuild the requirements; it drops one dependency (importlib-metadata which was used for Python 3.9 support alone).

That's a really good point, thank you. Unfortunately, upgrading has broken something. I'll try to come back to it tomorrow, but if it's obvious to you or you have time, please do step in.

The Black formatter was conflicting with Ruff.

```
$ just fix
…
"/usr/bin/just" _compile requirements.prod.in requirements.prod.txt
"/usr/bin/just" _compile requirements.dev.in requirements.dev.txt
$BIN/black .
All done! ✨ 🍰 ✨
6 files left unchanged.
$BIN/ruff check --fix .
Found 2 errors (2 fixed, 0 remaining).
```

then:

```
$ just check
…
$BIN/black --check .
would reformat /workspaces/osgithub/osgithub/__init__.py
would reformat /workspaces/osgithub/setup.py

Oh no! 💥 💔 💥
2 files would be reformatted, 4 files would be left unchanged.
error: Recipe `black` failed on line 98 with exit code 1
```

It's possible that maybe we could tweak the settings of one or other to
match. But it's preferable to simplify things here.

Let's just remove Black because using Ruff alone:

* fixes this issue
* removes several dependencies
* is faster
* is how we work with other repositories
@StevenMaude

StevenMaude commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@lucyb: it wasn't immediately obvious, but a case where Black and Ruff formatting conflicted 🙃

I removed Black, and did that in a separate branch with a PR into this branch, just because that felt tidier than unexpectedly adding to your branch.

Feel free to just cherry-pick/squash my commit here, and close my PR 😃

…x-python-upgrade

Remove use of Black entirely
@lucyb
lucyb merged commit 8a42b7f into main Jul 2, 2026
7 checks passed
@lucyb
lucyb deleted the lucyb/upgrade-python branch July 2, 2026 08:23
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