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 min Python to 3.9 #1117

Closed
wants to merge 2 commits into from
Closed

Bump min Python to 3.9 #1117

wants to merge 2 commits into from

Conversation

flying-sheep
Copy link
Member

@flying-sheep flying-sheep commented Aug 31, 2023

Currently, this adds all checks I think are very useful, minus the following that require more substantive changes:

The following stylistic rulesets are useful enough to go for but also need quite some changes

  • D/pydocstyle
  • RET/[return style] Clarifies early returns (if thing: return\nelse: ...if thing: return\...)

Instead of FA we just add from __future__ import annotations automatically everywhere.

The idea is that before the 0.10 release, we

  1. git reset --hard <first commit in this PR> and then git rebase main this branch
  2. re-create the “pre-commit autofixes” commit or let pre-commit handle that
  3. maybe fix up some things that got less pretty, e.g.
  • wrap braces arount this type:
    indexer: slice
    | np.integer
    | int
    | str
    | Sequence[int | np.integer]
    | np.ndarray
    | pd.Index,
  • manually switch from cabc.??? to from collections.abc import ???
  1. profitmerge

@flying-sheep flying-sheep added this to the 0.10.0 milestone Aug 31, 2023
@flying-sheep flying-sheep changed the title Test auto update Bump min Python to 3.9 Aug 31, 2023
@codecov
Copy link

codecov bot commented Aug 31, 2023

Codecov Report

Merging #1117 (d801da6) into main (8c00a29) will decrease coverage by 3.30%.
The diff coverage is 62.88%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1117      +/-   ##
==========================================
- Coverage   84.97%   81.67%   -3.30%     
==========================================
  Files          36       36              
  Lines        5197     5305     +108     
==========================================
- Hits         4416     4333      -83     
- Misses        781      972     +191     
Flag Coverage Δ
gpu-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
anndata/experimental/merge.py 82.60% <27.27%> (-4.96%) ⬇️
anndata/experimental/pytorch/_annloader.py 22.22% <45.45%> (+1.60%) ⬆️
anndata/_core/file_backing.py 86.59% <50.00%> (-3.73%) ⬇️
anndata/compat/exceptiongroups.py 85.71% <50.00%> (+2.38%) ⬆️
anndata/tests/helpers.py 85.09% <50.00%> (-10.92%) ⬇️
anndata/_core/anndata.py 81.56% <54.54%> (-2.04%) ⬇️
anndata/experimental/multi_files/_anncollection.py 71.25% <56.66%> (+0.68%) ⬆️
anndata/_core/index.py 92.02% <57.89%> (-2.59%) ⬇️
anndata/_core/merge.py 81.26% <58.13%> (-12.85%) ⬇️
anndata/__init__.py 72.00% <60.00%> (-0.73%) ⬇️
... and 26 more
📢 Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scverse).

@flying-sheep flying-sheep force-pushed the pyupgrade-auto branch 4 times, most recently from 282125a to 9dbb96d Compare September 8, 2023 11:36
@flying-sheep flying-sheep marked this pull request as ready for review September 8, 2023 11:39
@flying-sheep flying-sheep force-pushed the pyupgrade-auto branch 2 times, most recently from 129db88 to dd4f7dc Compare September 8, 2023 14:09
@ivirshup
Copy link
Member

ivirshup commented Sep 8, 2023

I've merged a version of this PR closer to the set of changes from when I reviewed last week. I did include a few more of the rules you added here.

Could you open an issue for follow up?

From time spent investigating these changes:

  • "ICN" I would actually like to go a little further than this rule set goes, and be able to define our own import patterns. I think this would be useful when dealing with all the libraries that define a sparse or linalg module. I would also like to have rules that make import from anndata in the tests more like how we recommend people use them, so it's easier to copy and past code out of the tests into a repl or notebook.
  • "SIM", I think I'm against this one. Some things it made better, some things it made worse. I think these should be almost always better.
  • For the things around typing, I'm a little curious about them. I think I'd like to have type checking actually run before doing too much here though.
  • One of the rules was replacing any instance of k in x.keys() with x in k, which can be different things – especially if we aren't runtime type checking the inputs

@ivirshup ivirshup closed this Sep 8, 2023
@flying-sheep flying-sheep deleted the pyupgrade-auto branch November 23, 2023 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drop python 3.8 support
2 participants