vturrisi / solo-learn

solo-learn: a library of self-supervised methods for visual representation learning powered by Pytorch Lightning
MIT License
1.38k stars 182 forks source link

Use syntax updated with Python 3.8 #343

Closed bryant1410 closed 1 year ago

bryant1410 commented 1 year ago

Update the syntax with what Python 3.7 supports. I ran (and reviewed the changes):

pyupgrade $(find . -name "*.py" -type f) --py37-plus

I also manually changed 3 unnecessary list creations (one using a join and 2 using len).

vturrisi commented 1 year ago

@bryant1410 I've added your changes to #344 together with other changes.

bryant1410 commented 1 year ago

Okay, I merged the latest changes and made sure it works the syntax is updated for Python 3.8 (nothing changed):

pyupgrade $(find . -name "*.py" -type f) --py38-plus

I also removed some remaining references to Python 3.7 and added explicit support for Python 3.10 and Python 3.11 (let's see if the tests pass to see if all the dependencies are correctly supported.).

And I updated some GitHub actions, hopefully the CI runs faster.

What do you think of these changes?

codecov[bot] commented 1 year ago

Codecov Report

Merging #343 (08e1089) into main (66cad5b) will decrease coverage by 0.03%. The diff coverage is 0.00%.

Additional details and impacted files | Flag | Coverage Δ | | *Carryforward flag | |---|---|---|---| | cpu | `80.94% <0.00%> (ø)` | | | | dali | `39.49% <ø> (-0.02%)` | :arrow_down: | Carriedforward from [66cad5b](https://app.codecov.io/gh/vturrisi/solo-learn/commit/66cad5b879e8062b813b3fdedfc518262143ab4b?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Victor+Turrisi) | *This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Victor+Turrisi) to find out more. | [Impacted Files](https://app.codecov.io/gh/vturrisi/solo-learn/pull/343?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Victor+Turrisi) | Coverage Δ | | |---|---|---| | [solo/data/dali\_dataloader.py](https://app.codecov.io/gh/vturrisi/solo-learn/pull/343?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Victor+Turrisi#diff-c29sby9kYXRhL2RhbGlfZGF0YWxvYWRlci5weQ==) | `60.78% <0.00%> (-0.21%)` | :arrow_down: |