Skip to content

Commit ba0c27c

Browse files
authored
Remove support for Python 3.7 (#1198)
* Remove support for Python 3.7 * Update CI workflow * Manually update dependencies
1 parent 0e02799 commit ba0c27c

File tree

11 files changed

+42
-50
lines changed

11 files changed

+42
-50
lines changed

.github/ISSUE_TEMPLATE/BUG_REPORT.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ body:
5050
id: python
5151
attributes:
5252
label: Python Version
53-
placeholder: eg. 3.7.10
53+
placeholder: eg. 3.8.17
5454
validations:
5555
required: true
5656
- type: input

.github/workflows/ci.yaml

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
env:
1414
CACHE_VERSION: 1
15-
DEFAULT_PYTHON: 3.7
15+
DEFAULT_PYTHON: 3.8
1616

1717
jobs:
1818
lint-flake8:
@@ -28,17 +28,18 @@ jobs:
2828
with:
2929
python-version: ${{ env.DEFAULT_PYTHON }}
3030

31-
- name: Restore Python ${{ env.DEFAULT_PYTHON }} virtual environment
31+
- name: Restore Python ${{ steps.python.outputs.python-version }} virtual environment
3232
id: cache-venv
33-
uses: actions/cache@v3.3.1
33+
uses: actions/cache@v3
3434
with:
3535
path: venv
3636
key: >-
3737
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{
3838
steps.python.outputs.python-version }}-${{
3939
hashFiles('requirements_dev.txt') }}
40-
restore-keys: |
41-
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-
40+
restore-keys: >-
41+
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{
42+
steps.python.outputs.python-version }}-
4243
4344
- name: Create Python virtual environment
4445
if: steps.cache-venv.outputs.cache-hit != 'true'
@@ -59,7 +60,7 @@ jobs:
5960
6061
6162
pytest:
62-
name: pytest ${{ matrix.python-version }} (${{ matrix.plex }})
63+
name: pytest (${{ matrix.plex }})
6364
needs: lint-flake8
6465
runs-on: ubuntu-latest
6566
env:
@@ -70,7 +71,6 @@ jobs:
7071
fail-fast: false
7172
max-parallel: 3
7273
matrix:
73-
python-version: [3.7]
7474
plex: ['unclaimed', 'claimed']
7575
is-master:
7676
- ${{ github.ref == 'refs/heads/master' }}
@@ -81,23 +81,24 @@ jobs:
8181
- name: Check out code from Github
8282
uses: actions/checkout@v3
8383

84-
- name: Set up Python ${{ matrix.python-version }}
84+
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
8585
id: python
8686
uses: actions/setup-python@v4
8787
with:
88-
python-version: ${{ matrix.python-version }}
88+
python-version: ${{ env.DEFAULT_PYTHON }}
8989

90-
- name: Restore Python ${{ matrix.python-version }} virtual environment
90+
- name: Restore Python ${{ steps.python.outputs.python-version }} virtual environment
9191
id: cache-venv
92-
uses: actions/cache@v3.3.1
92+
uses: actions/cache@v3
9393
with:
9494
path: venv
9595
key: >-
9696
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{
9797
steps.python.outputs.python-version }}-${{
9898
hashFiles('requirements_dev.txt') }}
99-
restore-keys: |
100-
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-
99+
restore-keys: >-
100+
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{
101+
steps.python.outputs.python-version }}-
101102
102103
- name: Create Python virtual environment
103104
if: steps.cache-venv.outputs.cache-hit != 'true'
@@ -129,7 +130,7 @@ jobs:
129130
130131
- name: Cache PMS Docker image
131132
id: docker-cache
132-
uses: actions/cache@v3.3.1
133+
uses: actions/cache@v3
133134
with:
134135
path: ~/.cache/docker/plexinc
135136
key: ${{ runner.os }}-docker-pms-${{ steps.docker-digest.outputs.digest }}
@@ -184,7 +185,7 @@ jobs:
184185
- name: Upload coverage artifact
185186
uses: actions/upload-artifact@v3
186187
with:
187-
name: coverage-${{ matrix.plex }}-${{ matrix.python-version }}
188+
name: coverage-${{ matrix.plex }}-${{ steps.python.outputs.python-version }}
188189
path: .coverage
189190

190191

@@ -211,23 +212,19 @@ jobs:
211212
with:
212213
python-version: ${{ env.DEFAULT_PYTHON }}
213214

214-
- name: Restore Python ${{ env.DEFAULT_PYTHON }} virtual environment
215+
- name: Restore Python ${{ steps.python.outputs.python-version }} virtual environment
215216
id: cache-venv
216-
uses: actions/cache@v3.3.1
217+
uses: actions/cache@v3
217218
with:
218219
path: venv
219220
key: >-
220-
${{ env.CACHE_VERSION}}-${{ runner.os }}-venv-${{
221+
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{
221222
steps.python.outputs.python-version }}-${{
222223
hashFiles('requirements_dev.txt') }}
223-
restore-keys: |
224-
${{ env.CACHE_VERSION}}-${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-
225-
226-
- name: Fail job if Python cache restore failed
227-
if: steps.cache-venv.outputs.cache-hit != 'true'
228-
run: |
229-
echo "Failed to restore Python virtual environment from cache"
230-
exit 1
224+
restore-keys: >-
225+
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{
226+
steps.python.outputs.python-version }}-
227+
fail-on-cache-miss: true
231228

232229
- name: Download all coverage artifacts
233230
uses: actions/download-artifact@v3
@@ -240,6 +237,6 @@ jobs:
240237
coverage xml
241238
242239
- name: Upload ${{ matrix.plex }} coverage to Codecov
243-
uses: codecov/codecov-action@v3.1.4
240+
uses: codecov/codecov-action@v3
244241
with:
245242
flags: ${{ matrix.plex }}

.github/workflows/pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
types: [published]
1010

1111
env:
12-
DEFAULT_PYTHON: 3.7
12+
DEFAULT_PYTHON: 3.8
1313

1414
jobs:
1515
build:

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sphinx:
1111
formats: all
1212

1313
python:
14-
version: 3.7
14+
version: 3.8
1515
install:
1616
- requirements: requirements_dev.txt
1717
- method: pip

plexapi/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# -*- coding: utf-8 -*-
22
import re
33
import weakref
4+
from functools import cached_property
45
from urllib.parse import urlencode
56
from xml.etree import ElementTree
67

78
from plexapi import CONFIG, X_PLEX_CONTAINER_SIZE, log, utils
89
from plexapi.exceptions import BadRequest, NotFound, UnknownType, Unsupported
9-
from plexapi.utils import cached_property
1010

1111
USER_DONT_RELOAD_FOR_KEYS = set()
1212
_DONT_RELOAD_FOR_KEYS = {'key'}

plexapi/library.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- coding: utf-8 -*-
22
import re
33
from datetime import datetime
4+
from functools import cached_property
45
from urllib.parse import parse_qs, quote_plus, urlencode, urlparse
56

67
from plexapi import log, media, utils
@@ -11,7 +12,7 @@
1112
ArtistEditMixins, AlbumEditMixins, TrackEditMixins, PhotoalbumEditMixins, PhotoEditMixins
1213
)
1314
from plexapi.settings import Setting
14-
from plexapi.utils import cached_property, deprecated
15+
from plexapi.utils import deprecated
1516

1617

1718
class Library(PlexObject):

plexapi/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: utf-8 -*-
22
import os
3+
from functools import cached_property
34
from urllib.parse import urlencode
45
from xml.etree import ElementTree
56

@@ -17,7 +18,7 @@
1718
from plexapi.playlist import Playlist
1819
from plexapi.playqueue import PlayQueue
1920
from plexapi.settings import Settings
20-
from plexapi.utils import cached_property, deprecated
21+
from plexapi.utils import deprecated
2122
from requests.status_codes import _codes as codes
2223

2324
# Need these imports to populate utils.PLEXOBJECTS

plexapi/utils.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@
2626
except ImportError:
2727
tqdm = None
2828

29-
try:
30-
from functools import cached_property
31-
except ImportError:
32-
from backports.cached_property import cached_property # noqa: F401
33-
3429
log = logging.getLogger('plexapi')
3530

3631
# Search Types - Plex uses these to filter specific media types when searching.

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
# pip install -r requirements.txt
44
#---------------------------------------------------------
55
requests
6-
backports.cached-property; python_version<="3.7"

requirements_dev.txt

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
# PlexAPI requirements to run py.test.
33
# pip install -r requirements_dev.txt
44
#---------------------------------------------------------
5-
backports.cached-property==1.0.2; python_version<="3.7"
65
coveralls==3.3.1
7-
flake8==5.0.4
8-
pillow==9.5.0
9-
pytest==7.3.1
6+
flake8==6.0.0
7+
pillow==10.0.0
8+
pytest==7.4.0
109
pytest-cache==1.0
11-
pytest-cov==4.0.0
12-
pytest-mock<3.10.1
10+
pytest-cov==4.1.0
11+
pytest-mock==3.11.1
1312
recommonmark==0.7.1
1413
requests==2.31.0
15-
requests-mock==1.10.0
16-
sphinx==4.3.2
17-
sphinx-rtd-theme==1.2.1
14+
requests-mock==1.11.0
15+
sphinx==6.2.1
16+
sphinx-rtd-theme==1.2.2
1817
tqdm==4.65.0
19-
websocket-client==1.5.2
18+
websocket-client==1.6.1

0 commit comments

Comments
 (0)