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

Remove support for Python 3.7 #1198

Merged
merged 3 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/BUG_REPORT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ body:
id: python
attributes:
label: Python Version
placeholder: eg. 3.7.10
placeholder: eg. 3.8.17
validations:
required: true
- type: input
Expand Down
51 changes: 24 additions & 27 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

env:
CACHE_VERSION: 1
DEFAULT_PYTHON: 3.7
DEFAULT_PYTHON: 3.8

jobs:
lint-flake8:
Expand All @@ -28,17 +28,18 @@ jobs:
with:
python-version: ${{ env.DEFAULT_PYTHON }}

- name: Restore Python ${{ env.DEFAULT_PYTHON }} virtual environment
- name: Restore Python ${{ steps.python.outputs.python-version }} virtual environment
id: cache-venv
uses: actions/cache@v3.3.1
uses: actions/cache@v3
with:
path: venv
key: >-
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{
steps.python.outputs.python-version }}-${{
hashFiles('requirements_dev.txt') }}
restore-keys: |
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-
restore-keys: >-
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{
steps.python.outputs.python-version }}-

- name: Create Python virtual environment
if: steps.cache-venv.outputs.cache-hit != 'true'
Expand All @@ -59,7 +60,7 @@ jobs:


pytest:
name: pytest ${{ matrix.python-version }} (${{ matrix.plex }})
name: pytest (${{ matrix.plex }})
needs: lint-flake8
runs-on: ubuntu-latest
env:
Expand All @@ -70,7 +71,6 @@ jobs:
fail-fast: false
max-parallel: 3
matrix:
python-version: [3.7]
plex: ['unclaimed', 'claimed']
is-master:
- ${{ github.ref == 'refs/heads/master' }}
Expand All @@ -81,23 +81,24 @@ jobs:
- name: Check out code from Github
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ env.DEFAULT_PYTHON }}

- name: Restore Python ${{ matrix.python-version }} virtual environment
- name: Restore Python ${{ steps.python.outputs.python-version }} virtual environment
id: cache-venv
uses: actions/cache@v3.3.1
uses: actions/cache@v3
with:
path: venv
key: >-
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{
steps.python.outputs.python-version }}-${{
hashFiles('requirements_dev.txt') }}
restore-keys: |
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-
restore-keys: >-
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{
steps.python.outputs.python-version }}-

- name: Create Python virtual environment
if: steps.cache-venv.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -129,7 +130,7 @@ jobs:

- name: Cache PMS Docker image
id: docker-cache
uses: actions/cache@v3.3.1
uses: actions/cache@v3
with:
path: ~/.cache/docker/plexinc
key: ${{ runner.os }}-docker-pms-${{ steps.docker-digest.outputs.digest }}
Expand Down Expand Up @@ -184,7 +185,7 @@ jobs:
- name: Upload coverage artifact
uses: actions/upload-artifact@v3
with:
name: coverage-${{ matrix.plex }}-${{ matrix.python-version }}
name: coverage-${{ matrix.plex }}-${{ steps.python.outputs.python-version }}
path: .coverage


Expand All @@ -211,23 +212,19 @@ jobs:
with:
python-version: ${{ env.DEFAULT_PYTHON }}

- name: Restore Python ${{ env.DEFAULT_PYTHON }} virtual environment
- name: Restore Python ${{ steps.python.outputs.python-version }} virtual environment
id: cache-venv
uses: actions/cache@v3.3.1
uses: actions/cache@v3
with:
path: venv
key: >-
${{ env.CACHE_VERSION}}-${{ runner.os }}-venv-${{
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{
steps.python.outputs.python-version }}-${{
hashFiles('requirements_dev.txt') }}
restore-keys: |
${{ env.CACHE_VERSION}}-${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-

- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
restore-keys: >-
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{
steps.python.outputs.python-version }}-
fail-on-cache-miss: true

- name: Download all coverage artifacts
uses: actions/download-artifact@v3
Expand All @@ -240,6 +237,6 @@ jobs:
coverage xml

- name: Upload ${{ matrix.plex }} coverage to Codecov
uses: codecov/codecov-action@v3.1.4
uses: codecov/codecov-action@v3
with:
flags: ${{ matrix.plex }}
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
types: [published]

env:
DEFAULT_PYTHON: 3.7
DEFAULT_PYTHON: 3.8

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sphinx:
formats: all

python:
version: 3.7
version: 3.8
install:
- requirements: requirements_dev.txt
- method: pip
Expand Down
2 changes: 1 addition & 1 deletion plexapi/base.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
import re
import weakref
from functools import cached_property
from urllib.parse import urlencode
from xml.etree import ElementTree

from plexapi import CONFIG, X_PLEX_CONTAINER_SIZE, log, utils
from plexapi.exceptions import BadRequest, NotFound, UnknownType, Unsupported
from plexapi.utils import cached_property

USER_DONT_RELOAD_FOR_KEYS = set()
_DONT_RELOAD_FOR_KEYS = {'key'}
Expand Down
3 changes: 2 additions & 1 deletion plexapi/library.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import re
from datetime import datetime
from functools import cached_property
from urllib.parse import parse_qs, quote_plus, urlencode, urlparse

from plexapi import log, media, utils
Expand All @@ -11,7 +12,7 @@
ArtistEditMixins, AlbumEditMixins, TrackEditMixins, PhotoalbumEditMixins, PhotoEditMixins
)
from plexapi.settings import Setting
from plexapi.utils import cached_property, deprecated
from plexapi.utils import deprecated


class Library(PlexObject):
Expand Down
3 changes: 2 additions & 1 deletion plexapi/server.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import os
from functools import cached_property
from urllib.parse import urlencode
from xml.etree import ElementTree

Expand All @@ -17,7 +18,7 @@
from plexapi.playlist import Playlist
from plexapi.playqueue import PlayQueue
from plexapi.settings import Settings
from plexapi.utils import cached_property, deprecated
from plexapi.utils import deprecated
from requests.status_codes import _codes as codes

# Need these imports to populate utils.PLEXOBJECTS
Expand Down
5 changes: 0 additions & 5 deletions plexapi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@
except ImportError:
tqdm = None

try:
from functools import cached_property
except ImportError:
from backports.cached_property import cached_property # noqa: F401

log = logging.getLogger('plexapi')

# Search Types - Plex uses these to filter specific media types when searching.
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
# pip install -r requirements.txt
#---------------------------------------------------------
requests
backports.cached-property; python_version<="3.7"
19 changes: 9 additions & 10 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@
# PlexAPI requirements to run py.test.
# pip install -r requirements_dev.txt
#---------------------------------------------------------
backports.cached-property==1.0.2; python_version<="3.7"
coveralls==3.3.1
flake8==5.0.4
pillow==9.5.0
pytest==7.3.1
flake8==6.0.0
pillow==10.0.0
pytest==7.4.0
pytest-cache==1.0
pytest-cov==4.0.0
pytest-mock<3.10.1
pytest-cov==4.1.0
pytest-mock==3.11.1
recommonmark==0.7.1
requests==2.31.0
requests-mock==1.10.0
sphinx==4.3.2
sphinx-rtd-theme==1.2.1
requests-mock==1.11.0
sphinx==6.2.1
sphinx-rtd-theme==1.2.2
tqdm==4.65.0
websocket-client==1.5.2
websocket-client==1.6.1
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
url='https://github.com/pkkid/python-plexapi',
packages=['plexapi'],
install_requires=requirements,
python_requires='>=3.7',
python_requires='>=3.8',
long_description=readme,
keywords=['plex', 'api'],
classifiers=[
Expand Down