mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-24 06:55:21 -07:00
Merge pull request #1921 from clinton-hall/packaging
Add PEP-517 and PEP-518 support and use `setup.cfg`
This commit is contained in:
commit
9e178f0a94
7 changed files with 68 additions and 92 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -6,6 +6,8 @@
|
||||||
*.pid
|
*.pid
|
||||||
*.db
|
*.db
|
||||||
*.dbm
|
*.dbm
|
||||||
|
.coverage
|
||||||
|
/build/
|
||||||
/userscripts/
|
/userscripts/
|
||||||
/logs/
|
/logs/
|
||||||
/.idea/
|
/.idea/
|
||||||
|
|
|
@ -68,5 +68,5 @@ jobs:
|
||||||
versionSpec: '3.x'
|
versionSpec: '3.x'
|
||||||
architecture: 'x64'
|
architecture: 'x64'
|
||||||
|
|
||||||
- script: python setup.py sdist
|
- script: pip install .
|
||||||
displayName: 'Build sdist'
|
displayName: 'Pip install'
|
||||||
|
|
|
@ -58,9 +58,6 @@ class RegistrableExtensionManager(ExtensionManager):
|
||||||
raise ValueError('Extension already registered')
|
raise ValueError('Extension already registered')
|
||||||
|
|
||||||
ep = EntryPoint.parse(entry_point)
|
ep = EntryPoint.parse(entry_point)
|
||||||
if ep.name in self.names():
|
|
||||||
raise ValueError('An extension with the same name already exist')
|
|
||||||
|
|
||||||
ext = self._load_one_plugin(ep, False, (), {}, False)
|
ext = self._load_one_plugin(ep, False, (), {}, False)
|
||||||
self.extensions.append(ext)
|
self.extensions.append(ext)
|
||||||
if self._extensions_by_name is not None:
|
if self._extensions_by_name is not None:
|
||||||
|
|
|
@ -231,7 +231,7 @@ class Addic7edProvider(Provider):
|
||||||
def query(self, show_id, series, season, year=None, country=None):
|
def query(self, show_id, series, season, year=None, country=None):
|
||||||
# get the page of the season of the show
|
# get the page of the season of the show
|
||||||
logger.info('Getting the page of show id %d, season %d', show_id, season)
|
logger.info('Getting the page of show id %d, season %d', show_id, season)
|
||||||
r = self.session.get(self.server_url + 'show/%d' % show_id, params={'season': season}, timeout=10)
|
r = self.session.get(self.server_url + 'show/%d' % show_id, params={'season': season}, timeout=10)
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
|
|
||||||
if not r.content:
|
if not r.content:
|
||||||
|
|
58
pyproject.toml
Normal file
58
pyproject.toml
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
[build-system]
|
||||||
|
requires = [
|
||||||
|
"setuptools>=45",
|
||||||
|
"setuptools_scm[toml]>=6.2",
|
||||||
|
]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "nzbToMedia"
|
||||||
|
description = "Efficient on demand post processing"
|
||||||
|
readme = {content-type = "utf-8", text = """hello"""}
|
||||||
|
license = {file = "license.txt"}
|
||||||
|
authors = [
|
||||||
|
{name = "Clinton Hall", email="fock_wulf@hotmail.com"}
|
||||||
|
]
|
||||||
|
dependencies =[
|
||||||
|
'pywin32;platform_system=="Windows"'
|
||||||
|
]
|
||||||
|
requires-python = ">=3.7"
|
||||||
|
classifiers =[
|
||||||
|
# complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers
|
||||||
|
"Development Status :: 5 - Production/Stable",
|
||||||
|
"Intended Audience :: End Users/Desktop",
|
||||||
|
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
||||||
|
"Operating System :: MacOS",
|
||||||
|
"Operating System :: MacOS :: MacOS X",
|
||||||
|
"Operating System :: Microsoft",
|
||||||
|
"Operating System :: Microsoft :: Windows",
|
||||||
|
"Operating System :: POSIX",
|
||||||
|
"Operating System :: Unix",
|
||||||
|
"Programming Language :: Python",
|
||||||
|
"Programming Language :: Python :: 3",
|
||||||
|
"Programming Language :: Python :: 3.7",
|
||||||
|
"Programming Language :: Python :: 3.8",
|
||||||
|
"Programming Language :: Python :: 3.9",
|
||||||
|
"Programming Language :: Python :: 3.10",
|
||||||
|
"Programming Language :: Python :: 3.11",
|
||||||
|
"Topic :: Games/Entertainment",
|
||||||
|
"Topic :: Multimedia",
|
||||||
|
"Topic :: Multimedia :: Sound/Audio",
|
||||||
|
"Topic :: Multimedia :: Video",
|
||||||
|
"Topic :: Utilities",
|
||||||
|
]
|
||||||
|
dynamic = ["version"]
|
||||||
|
|
||||||
|
[project.urls]
|
||||||
|
repository = "https://github.com/clinton-hall/nzbToMedia.git"
|
||||||
|
documentation = "https://github.com/clinton-hall/nzbToMedia/wiki"
|
||||||
|
|
||||||
|
[tools.setuptools]
|
||||||
|
zip_safe = false
|
||||||
|
include_package_data = true
|
||||||
|
|
||||||
|
[tool.setuptools.packages.find]
|
||||||
|
where = [""]
|
||||||
|
include = ["core", "libs", "nzbTo*", "TorrentToMedia", "eol", "cleanup"]
|
||||||
|
|
||||||
|
[tool.setuptools_scm]
|
82
setup.py
82
setup.py
|
@ -1,82 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import io
|
|
||||||
import os.path
|
|
||||||
|
|
||||||
from setuptools import setup
|
|
||||||
|
|
||||||
|
|
||||||
def read(*names, **kwargs):
|
|
||||||
with open(
|
|
||||||
os.path.join(os.path.dirname(__file__), *names),
|
|
||||||
encoding=kwargs.get('encoding', 'utf8'),
|
|
||||||
) as fh:
|
|
||||||
return fh.read()
|
|
||||||
|
|
||||||
|
|
||||||
setup(
|
|
||||||
name='nzbToMedia',
|
|
||||||
version='12.1.11',
|
|
||||||
license='GPLv3',
|
|
||||||
description='Efficient on demand post processing',
|
|
||||||
long_description="""
|
|
||||||
nzbToMedia
|
|
||||||
==========
|
|
||||||
|
|
||||||
Efficient on demand post processing
|
|
||||||
-----------------------------------
|
|
||||||
|
|
||||||
A PVR app needs to know when a download is ready for post-processing. There are two methods:
|
|
||||||
|
|
||||||
1. On-demand post-processing script (e.g. sabToSickBeard.py or nzbToMedia.py): A script in the downloader runs once at the end of the download job and notifies the PVR app that the download is complete.
|
|
||||||
|
|
||||||
2. Continuous folder scanning: The PVR app frequently polls download folder(s) for completed downloads.
|
|
||||||
|
|
||||||
On-demand is superior, for several reasons:
|
|
||||||
|
|
||||||
1. The PVR app is notified only once, exactly when the download is ready for post-processing
|
|
||||||
2. The PVR app does not have to wait for the next poll interval before it starts processing
|
|
||||||
3. Continuous polling is not as efficient and is more stressful on low performance hardware
|
|
||||||
4. Continuously polling a folder for changes can prevent the drive from going to sleep
|
|
||||||
5. Continuous polling may encounter file access/permissions issues
|
|
||||||
6. Continuous polling may miss a folder change, causing the PVR app to wait forever
|
|
||||||
7. An on-demand post-processing script is able to utilize additional functionality such as ffprobe media checking to test for bad video files.
|
|
||||||
8. On-demand scripts can be tweaked to allow for delays with slow hardware
|
|
||||||
|
|
||||||
nzbToMedia is an on-demand post-processing script and was created out of a demand for more efficient post-processing on low-performance hardware. Many features have been added so higher performance hardware can benefit too.
|
|
||||||
|
|
||||||
Many issues that users have with folder scanning can be fixed by switching to on-demand. A whole class of support issues can be eliminated by using nzbToMedia.
|
|
||||||
""",
|
|
||||||
author='Clinton Hall',
|
|
||||||
author_email='fock_wulf@hotmail.com',
|
|
||||||
url='https://github.com/clinton-hall/nzbToMedia',
|
|
||||||
packages=['core'],
|
|
||||||
install_requires=[
|
|
||||||
'pywin32;platform_system=="Windows"',
|
|
||||||
],
|
|
||||||
classifiers=[
|
|
||||||
# complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers
|
|
||||||
'Development Status :: 5 - Production/Stable',
|
|
||||||
'Intended Audience :: End Users/Desktop',
|
|
||||||
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
|
|
||||||
'Operating System :: MacOS',
|
|
||||||
'Operating System :: MacOS :: MacOS X',
|
|
||||||
'Operating System :: Microsoft',
|
|
||||||
'Operating System :: Microsoft :: Windows',
|
|
||||||
'Operating System :: POSIX',
|
|
||||||
'Operating System :: Unix',
|
|
||||||
'Programming Language :: Python',
|
|
||||||
'Programming Language :: Python :: 3',
|
|
||||||
'Programming Language :: Python :: 3.7',
|
|
||||||
'Programming Language :: Python :: 3.8',
|
|
||||||
'Programming Language :: Python :: 3.9',
|
|
||||||
'Programming Language :: Python :: 3.10',
|
|
||||||
'Programming Language :: Python :: 3.11',
|
|
||||||
'Topic :: Games/Entertainment',
|
|
||||||
'Topic :: Multimedia',
|
|
||||||
'Topic :: Multimedia :: Sound/Audio',
|
|
||||||
'Topic :: Multimedia :: Video',
|
|
||||||
'Topic :: Utilities',
|
|
||||||
],
|
|
||||||
)
|
|
9
tox.ini
9
tox.ini
|
@ -28,7 +28,7 @@ deps =
|
||||||
pytest-cov
|
pytest-cov
|
||||||
pywin32 ; sys.platform == 'win32'
|
pywin32 ; sys.platform == 'win32'
|
||||||
commands =
|
commands =
|
||||||
{posargs:pytest --cov --cov-report=term-missing tests}
|
{posargs:pytest --cov --cov-report=term-missing --cov-branch tests}
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
max-line-length = 79
|
max-line-length = 79
|
||||||
|
@ -39,13 +39,15 @@ min-version = 2.7
|
||||||
require-code = True
|
require-code = True
|
||||||
exclude =
|
exclude =
|
||||||
.github/
|
.github/
|
||||||
.tox/
|
|
||||||
.pytest_cache/
|
.pytest_cache/
|
||||||
|
.tox/
|
||||||
|
.venv*/
|
||||||
|
build/
|
||||||
htmlcov/
|
htmlcov/
|
||||||
logs/
|
|
||||||
libs/common
|
libs/common
|
||||||
libs/win
|
libs/win
|
||||||
libs/py2
|
libs/py2
|
||||||
|
logs/
|
||||||
ignore =
|
ignore =
|
||||||
; -- flake8 --
|
; -- flake8 --
|
||||||
; E501 line too long
|
; E501 line too long
|
||||||
|
@ -101,7 +103,6 @@ deps =
|
||||||
flake8-comprehensions
|
flake8-comprehensions
|
||||||
flake8-docstrings
|
flake8-docstrings
|
||||||
flake8-future-import
|
flake8-future-import
|
||||||
flake8-quotes
|
|
||||||
skip_install = true
|
skip_install = true
|
||||||
commands =
|
commands =
|
||||||
; ** PRIMARY TESTS **
|
; ** PRIMARY TESTS **
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue