diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index e75e85e7..00000000 --- a/.coveragerc +++ /dev/null @@ -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__.: diff --git a/.flake8 b/.flake8 index 70b9e9ce..1eb16ebc 100644 --- a/.flake8 +++ b/.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 diff --git a/.github/ISSUE_TEMPLATE/BUG_REPORT.yml b/.github/ISSUE_TEMPLATE/BUG_REPORT.yml index 2a5c2162..110b3354 100644 --- a/.github/ISSUE_TEMPLATE/BUG_REPORT.yml +++ b/.github/ISSUE_TEMPLATE/BUG_REPORT.yml @@ -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 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 800b8ad0..f4b86675 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,7 +12,7 @@ on: env: CACHE_VERSION: 1 - DEFAULT_PYTHON: 3.8 + DEFAULT_PYTHON: 3.9 jobs: lint-flake8: diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index a366a887..ed4cf107 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -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 diff --git a/.gitignore b/.gitignore index 64dabf95..d55a5c2e 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ pip-selfcheck.json pyvenv.cfg MANIFEST venv/ +.venv/ # path for the test lib. plex/ diff --git a/.readthedocs.yml b/.readthedocs.yml index e817dd19..a2646ce1 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -5,7 +5,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.8" + python: "3.9" sphinx: configuration: docs/conf.py diff --git a/MANIFEST.in b/MANIFEST.in index 36c6bd73..955396f9 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,2 @@ include README.rst -include requirements.txt \ No newline at end of file +recursive-exclude tests * \ No newline at end of file diff --git a/package.json b/package.json deleted file mode 100644 index 9257a660..00000000 --- a/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "scripts": { - "pypi": "python setup.py sdist upload" - } -} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..452faee0 --- /dev/null +++ b/pyproject.toml @@ -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.", +] diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index a6a6e371..00000000 --- a/pytest.ini +++ /dev/null @@ -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. diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index ac8922b4..00000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -#--------------------------------------------------------- -# PlexAPI core requirements. -# pip install -r requirements.txt -#--------------------------------------------------------- -requests diff --git a/requirements_dev.txt b/requirements_dev.txt index 5d8e7a4a..2eaf00d6 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -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 diff --git a/setup.py b/setup.py deleted file mode 100644 index 7e87e129..00000000 --- a/setup.py +++ /dev/null @@ -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', - ] -)