Repository navigation
Refactor/py312 compat - #898
Closed
prathamesh920 wants to merge 2 commits into
Closed
prathamesh920 wants to merge 2 commits into
prathamesh920 wants to merge 2 commits into
Conversation
django.conf.urls.ur() was deprecated in Django in 3.1 and removed in Django 4.0. re_path() is the same function under its new name, so every URL pattern is unchanged.
length_is was deprecated in Django 4.2 and removed in 5.1.
distutils was removed in Python 3.12. shutil.copytree with
dirs_exist_ok=True and shutil.copy2 do what distutils' copy_tree and
copy_file did: copy into an existing folder, overwrite files, keep
modes and times.
nose is unmaintained and does not import on Python 3.12+ (it uses the
removed 'imp' module). Python test cases get 'from nose.tools import *'
in their scope, so existing questions use assert_equal, ok_, eq_ etc.
yaksh/nose_tools.py builds the same names the same way nose did (each
unittest.TestCase.assertXxx as assert_xxx, plus ok_ and eq_), so the
names and assertion messages are unchanged. It also keeps the aliases
unittest removed in 3.12 (assert_equals, assert_regexp_matches,
assert_dict_contains_subset, ...).
If nose itself cannot be imported, test cases that import it explicitly
('from nose.tools import assert_equal') get this module instead.
nose stays in the requirements for now; will remove it with the Python 3.12
upgrade.
ruamel.yaml 0.18 removed the old module-level functions
(round_trip_dump, safe_load_all, safe_dump_all). The YAML() object API
does the same and already exists in the pinned 0.16.10:
Comparing to a literal with 'is' is a SyntaxWarning and not guaranteed to work.
raw string for the tag-split regex (same pattern).
Tests: assertEquals -> assertEqual (alias removed in Python 3.12).
Test nose-style test cases against yaksh/nose_tools.py
prathamesh920
force-pushed
the
refactor/py312-compat
branch
from
November 26, 2026 02:41
118e967 to
f9cefa0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.