-
Notifications
You must be signed in to change notification settings - Fork 79
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
add support for python 3.12 #434
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #434 +/- ##
==========================================
+ Coverage 89.47% 89.49% +0.02%
==========================================
Files 34 34
Lines 2432 2438 +6
==========================================
+ Hits 2176 2182 +6
Misses 256 256 ☔ View full report in Codecov by Sentry. |
cc @wRAR |
cmd[-1] += '; sys.exit(99)' | ||
utils.run_cmd(cmd) | ||
|
||
def test_pwd_git_version_without_git(self): | ||
# Change into test dir to make sure we're within a repo | ||
os.chdir(os.path.dirname(__file__)) | ||
self.assertIsNotNone(utils.pwd_git_version()) | ||
with patch('shub.utils.find_executable', return_value=None): | ||
with patch('shub.utils.which', return_value=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be shub.utils.which
or shutil.which
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This confused me at first too, but because shub.utils
is already imported before applying the patch
we have to use the same object name that pwd_git_version
refers to (other tests also do this, see @patch('shub.utils.time.time')
right below)
self.assertLessEqual( | ||
{'key': 'value'}.items(), | ||
utils.latest_github_release(cache='./cache.txt').items(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL, nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Adds support for Python 3.12. Main changes:
NamedTemporaryFile
no longer has adelete
attribute, presumably this wasn't part of the public API: python/cpython@743453a#diff-6553a99f3ae04c9fc9c2349ac27037bfe3b274d5ca54d5800d9c5b5f11e29d21L470 (refactored to not rely on it)distutils
was removed (replaced version classes with equivalent one frompackaging
)pkg_resources
is no longer provided by default (was also deprecated, so replaced it withimportlib.metadata
)configparser.SafeConfigParser
was removed in favor ofConfigParser