mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-24 12:43:06 +00:00
Migrate to pyproject.toml
and bump minimum Python version to 3.9 (#1459)
* Migrate to pyproject.toml * Add .venv to .gitignore * Exclude tests in MANIFEST.in * Move pytest into pyproject.toml * Remove unused coveralls * Restore requirements_dev.txt Needed for CI venv cache and readthedocs. * Exclude .venv for flake8 * Bump minimum Python version to 3.9
This commit is contained in:
parent
99205d3b86
commit
60e8c6a6c7
14 changed files with 49 additions and 92 deletions
19
.coveragerc
19
.coveragerc
|
@ -1,19 +0,0 @@
|
|||
[run]
|
||||
omit = */site-packages/plexapi/*
|
||||
|
||||
|
||||
|
||||
[report]
|
||||
exclude_lines =
|
||||
pragma: no cover
|
||||
raise NotImplementedError
|
||||
raise Unsupported
|
||||
raise Exception
|
||||
except ImportError
|
||||
except BadRequest
|
||||
def __repr__
|
||||
def __bool__
|
||||
def __iter__
|
||||
def __hash__
|
||||
def __len__
|
||||
if __name__ == .__main__.:
|
2
.flake8
2
.flake8
|
@ -9,7 +9,7 @@
|
|||
# W605: invalid escape sequence
|
||||
[flake8]
|
||||
ignore=E128,E701,E702,E731,W503,W605
|
||||
exclude=compat.py,venv
|
||||
exclude=compat.py,venv,.venv
|
||||
per-file-ignores =
|
||||
tests/payloads.py:E501
|
||||
max-complexity = -1
|
||||
|
|
2
.github/ISSUE_TEMPLATE/BUG_REPORT.yml
vendored
2
.github/ISSUE_TEMPLATE/BUG_REPORT.yml
vendored
|
@ -50,7 +50,7 @@ body:
|
|||
id: python
|
||||
attributes:
|
||||
label: Python Version
|
||||
placeholder: eg. 3.8.17
|
||||
placeholder: eg. 3.9.20
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
|
|
2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
|
@ -12,7 +12,7 @@ on:
|
|||
|
||||
env:
|
||||
CACHE_VERSION: 1
|
||||
DEFAULT_PYTHON: 3.8
|
||||
DEFAULT_PYTHON: 3.9
|
||||
|
||||
jobs:
|
||||
lint-flake8:
|
||||
|
|
7
.github/workflows/pypi.yml
vendored
7
.github/workflows/pypi.yml
vendored
|
@ -9,7 +9,7 @@ on:
|
|||
types: [published]
|
||||
|
||||
env:
|
||||
DEFAULT_PYTHON: 3.8
|
||||
DEFAULT_PYTHON: 3.9
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
@ -27,9 +27,8 @@ jobs:
|
|||
- name: Install dependencies and build
|
||||
run: |
|
||||
pip install -U pip
|
||||
pip install -r requirements.txt
|
||||
pip install setuptools twine wheel
|
||||
python setup.py sdist bdist_wheel
|
||||
pip install build twine
|
||||
python -m build
|
||||
|
||||
- name: Verify README
|
||||
# https://packaging.python.org/guides/making-a-pypi-friendly-readme/#validating-restructuredtext-markup
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -26,6 +26,7 @@ pip-selfcheck.json
|
|||
pyvenv.cfg
|
||||
MANIFEST
|
||||
venv/
|
||||
.venv/
|
||||
|
||||
# path for the test lib.
|
||||
plex/
|
||||
|
|
|
@ -5,7 +5,7 @@ version: 2
|
|||
build:
|
||||
os: ubuntu-22.04
|
||||
tools:
|
||||
python: "3.8"
|
||||
python: "3.9"
|
||||
|
||||
sphinx:
|
||||
configuration: docs/conf.py
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
include README.rst
|
||||
include requirements.txt
|
||||
recursive-exclude tests *
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"scripts": {
|
||||
"pypi": "python setup.py sdist upload"
|
||||
}
|
||||
}
|
39
pyproject.toml
Normal file
39
pyproject.toml
Normal file
|
@ -0,0 +1,39 @@
|
|||
[project]
|
||||
name = "PlexAPI"
|
||||
authors = [
|
||||
{ name = "Michael Shepanski", email = "michael.shepanski@gmail.com" }
|
||||
]
|
||||
description = "Python bindings for the Plex API."
|
||||
readme = "README.rst"
|
||||
requires-python = ">=3.9"
|
||||
keywords = ["plex", "api"]
|
||||
license = {file = "LICENSE.txt"}
|
||||
classifiers = [
|
||||
"Operating System :: OS Independent",
|
||||
"Programming Language :: Python :: 3",
|
||||
"License :: OSI Approved :: BSD License",
|
||||
]
|
||||
dependencies = ["requests"]
|
||||
dynamic = ["version"]
|
||||
|
||||
[project.optional-dependencies]
|
||||
alert = ["websocket-client>=1.3.3"]
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/pkkid/python-plexapi"
|
||||
Documentation = "https://python-plexapi.readthedocs.io"
|
||||
|
||||
[tool.setuptools.dynamic]
|
||||
version = {attr = "plexapi.const.__version__"}
|
||||
|
||||
[build-system]
|
||||
requires = ["setuptools", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
markers = [
|
||||
"client: this is a client test.",
|
||||
"req_client: require a client to run this test.",
|
||||
"anonymously: test plexapi anonymously.",
|
||||
"authenticated: test plexapi authenticated.",
|
||||
]
|
|
@ -1,6 +0,0 @@
|
|||
[pytest]
|
||||
markers =
|
||||
client: this is a client test.
|
||||
req_client: require a client to run this test.
|
||||
anonymously: test plexapi anonymously.
|
||||
authenticated: test plexapi authenticated.
|
|
@ -1,5 +0,0 @@
|
|||
#---------------------------------------------------------
|
||||
# PlexAPI core requirements.
|
||||
# pip install -r requirements.txt
|
||||
#---------------------------------------------------------
|
||||
requests
|
|
@ -2,10 +2,9 @@
|
|||
# PlexAPI requirements to run py.test.
|
||||
# pip install -r requirements_dev.txt
|
||||
#---------------------------------------------------------
|
||||
coveralls==4.0.1
|
||||
flake8==7.1.1
|
||||
pillow==10.4.0
|
||||
pytest==8.3.3
|
||||
pytest==8.3.2
|
||||
pytest-cache==1.0
|
||||
pytest-cov==5.0.0
|
||||
pytest-mock==3.14.0
|
||||
|
|
46
setup.py
46
setup.py
|
@ -1,46 +0,0 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Install PlexAPI
|
||||
"""
|
||||
from pkg_resources import parse_requirements
|
||||
try:
|
||||
from setuptools import setup
|
||||
except ImportError:
|
||||
from distutils.core import setup
|
||||
|
||||
# Get version
|
||||
version = {}
|
||||
with open('plexapi/const.py') as handle:
|
||||
exec(handle.read(), version)
|
||||
|
||||
# Get README.rst contents
|
||||
with open('README.rst') as handle:
|
||||
readme = handle.read()
|
||||
|
||||
# Get requirements
|
||||
with open('requirements.txt') as handle:
|
||||
requirements = [str(req) for req in parse_requirements(handle)]
|
||||
|
||||
setup(
|
||||
name='PlexAPI',
|
||||
version=version['__version__'],
|
||||
description='Python bindings for the Plex API.',
|
||||
author='Michael Shepanski',
|
||||
author_email='michael.shepanski@gmail.com',
|
||||
url='https://github.com/pkkid/python-plexapi',
|
||||
packages=['plexapi'],
|
||||
install_requires=requirements,
|
||||
extras_require={
|
||||
'alert': ["websocket-client>=1.3.3"],
|
||||
},
|
||||
python_requires='>=3.8',
|
||||
long_description=readme,
|
||||
long_description_content_type='text/x-rst',
|
||||
keywords=['plex', 'api'],
|
||||
classifiers=[
|
||||
'Operating System :: OS Independent',
|
||||
'Programming Language :: Python :: 3',
|
||||
'License :: OSI Approved :: BSD License',
|
||||
]
|
||||
)
|
Loading…
Reference in a new issue