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

add support for python 3.12 #434

Merged
merged 2 commits into from
Jan 15, 2024
Merged

Conversation

branchvincent
Copy link
Contributor

Adds support for Python 3.12. Main changes:

shub/utils.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Dec 18, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (ae3ab8e) 89.47% compared to head (7263931) 89.49%.

Files Patch % Lines
shub/image/run/wrapper.py 50.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

shub/utils.py Outdated Show resolved Hide resolved
@Gallaecio Gallaecio requested a review from kmike December 18, 2023 10:42
@Gallaecio
Copy link
Member

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):
Copy link
Member

@wRAR wRAR Dec 25, 2023

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?

Copy link
Contributor Author

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)

Comment on lines +278 to +280
self.assertLessEqual(
{'key': 'value'}.items(),
utils.latest_github_release(cache='./cache.txt').items(),
Copy link
Member

@Gallaecio Gallaecio Dec 28, 2023

Choose a reason for hiding this comment

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

TIL, nice.

tests/test_utils.py Outdated Show resolved Hide resolved
Copy link
Member

@wRAR wRAR left a comment

Choose a reason for hiding this comment

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

Thanks!

@Gallaecio Gallaecio merged commit 03c7993 into scrapinghub:master Jan 15, 2024
33 checks passed
@branchvincent branchvincent deleted the py312 branch January 15, 2024 15:52
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