Skip to content

Commit a3997bf

Browse files
authored
update versions for pre-commit (mediacms-io#741)
1 parent 4b0718c commit a3997bf

15 files changed

+21
-19
lines changed

.github/workflows/pre-commit.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
pre-commit:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-python@v3
15+
- uses: pre-commit/[email protected]
16+
with:
17+
token: ${{ secrets.GITHUB_TOKEN }}

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
repos:
22
- repo: https://github.com/pycqa/flake8
3-
rev: 3.7.9
3+
rev: 6.0.0
44
hooks:
55
- id: flake8
66
- repo: https://github.com/pycqa/isort
7-
rev: 5.5.4
7+
rev: 5.12.0
88
hooks:
99
- id: isort
1010
args: ["--profile", "black"]
1111
- repo: https://github.com/psf/black
12-
rev: 22.3.0
12+
rev: 23.1.0
1313
hooks:
1414
- id: black
1515
language_version: python3

actions/migrations/0001_initial.py

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55

66
class Migration(migrations.Migration):
7-
87
initial = True
98

109
dependencies = []

actions/migrations/0002_mediaaction_media.py

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
class Migration(migrations.Migration):
8-
98
initial = True
109

1110
dependencies = [

actions/migrations/0003_auto_20201201_0712.py

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77

88
class Migration(migrations.Migration):
9-
109
initial = True
1110

1211
dependencies = [

cms/custom_pagination.py

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class FastPaginationWithoutCount(PageNumberPagination):
1818
django_paginator_class = FasterDjangoPaginator
1919

2020
def get_paginated_response(self, data):
21-
2221
return Response(
2322
OrderedDict(
2423
[

files/feeds.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class SearchRSSFeed(Feed):
102102
description = "Latest Media RSS feed"
103103

104104
def link(self, obj):
105-
return f"/rss/search"
105+
return "/rss/search"
106106

107107
def get_object(self, request):
108108
category = request.GET.get("c", "")

files/methods.py

-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ def show_related_media_author(media, request, limit):
305305

306306

307307
def show_related_media_calculated(media, request, limit):
308-
309308
"""Return a list of related media based on ML recommendations
310309
A big todo!
311310
"""

files/migrations/0001_initial.py

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
class Migration(migrations.Migration):
13-
1413
initial = True
1514

1615
dependencies = []

files/migrations/0002_auto_20201201_0712.py

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
class Migration(migrations.Migration):
11-
1211
initial = True
1312

1413
dependencies = [

files/migrations/0003_auto_20210927_1245.py

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55

66
class Migration(migrations.Migration):
7-
87
dependencies = [
98
('files', '0002_auto_20201201_0712'),
109
]

files/models.py

-4
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ def __init__(self, *args, **kwargs):
314314
self.__original_uploaded_poster = self.uploaded_poster
315315

316316
def save(self, *args, **kwargs):
317-
318317
if not self.title:
319318
self.title = self.media_file.path.split("/")[-1]
320319

@@ -372,7 +371,6 @@ def save(self, *args, **kwargs):
372371
# will run only when a poster is uploaded for the first time
373372
if self.uploaded_poster and self.uploaded_poster != self.__original_uploaded_poster:
374373
with open(self.uploaded_poster.path, "rb") as f:
375-
376374
# set this otherwise gets to infinite loop
377375
self.__original_uploaded_poster = self.uploaded_poster
378376

@@ -580,9 +578,7 @@ def encode(self, profiles=[], force=True, chunkize=True):
580578

581579
# attempt to break media file in chunks
582580
if self.duration > settings.CHUNKIZE_VIDEO_DURATION and chunkize:
583-
584581
for profile in profiles:
585-
586582
if profile.extension == "gif":
587583
profiles.remove(profile)
588584
encoding = Encoding(media=self, profile=profile)

files/tasks.py

-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ def encode_media(
268268
# return False
269269

270270
with tempfile.TemporaryDirectory(dir=settings.TEMP_DIRECTORY) as temp_dir:
271-
272271
tf = create_temp_file(suffix=".{0}".format(profile.extension), dir=temp_dir)
273272
tfpass = create_temp_file(suffix=".{0}".format(profile.extension), dir=temp_dir)
274273
ffmpeg_commands = produce_ffmpeg_commands(

users/migrations/0001_initial.py

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
class Migration(migrations.Migration):
13-
1413
initial = True
1514

1615
dependencies = [

users/views.py

-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ def contact_user(request, username):
176176

177177

178178
class UserList(APIView):
179-
180179
permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
181180
parser_classes = (JSONParser, MultiPartParser, FormParser, FileUploadParser)
182181

0 commit comments

Comments
 (0)