Fix setup's requirements

Move the startup script so that its name does not
conflict with the openlp namespace.
Codify scripts/check_dependencies.py in setup.py.
The name on PyPI is used to declare the dependencies.
This is a first step to enable OpenLP distribution via
PyPI.

The differences are:
* pyenchant and pyodbc are declared optional because
  they are optional in the code and pyenchant is not
  maintained anymore.
* pyenchant's required version is set to 1.6 not only
  for windows. This version is quite old.
* The 5.0 version checks for PyQt5 are left out because
  this is the first version anyway.
* LibreOffice's uno does not exist on PyPI
* sqlite3, asyncio and mock are available in Python
  >= 3.4 anyway and not noted as dependencies.
* six is not defined as dependency because the code
  should be py3 only.

The situation with regards to platform wheels being
published looks quite promising.
As Linux users typically install via their package
manager wheel availability is not as import for them
as for Win or Mac users.
Both of them are available for most dependencies with
native extensions.
The few exceptions:
* PyICU does not publish any platform wheels.
  More info: https://github.com/ovalhub/pyicu/issues/79
* mysql-connector-python does not publish win32 wheels.
* pyenchant does not publish win64 wheels.

The wheels are typically available for Py=2.7 and Py>=3.4,
although some (mysql-connector-python, PyQt5, pywin32)
need Py>=3.5
This commit is contained in:
Bastian Germann 2018-10-03 01:19:49 +02:00
parent 5c4ae0a9e6
commit 0b1ba4ba6d
2 changed files with 46 additions and 12 deletions

View File

@ -42,7 +42,7 @@ def set_up_fault_handling():
faulthandler.enable((AppLocation.get_directory(AppLocation.CacheDir) / 'error.log').open('wb')) faulthandler.enable((AppLocation.get_directory(AppLocation.CacheDir) / 'error.log').open('wb'))
if __name__ == '__main__': def start():
""" """
Instantiate and run the application. Instantiate and run the application.
""" """
@ -58,3 +58,6 @@ if __name__ == '__main__':
if is_macosx(): if is_macosx():
sys.argv = [x for x in sys.argv if not x.startswith('-psn')] sys.argv = [x for x in sys.argv if not x.startswith('-psn')]
main() main()
if __name__ == '__main__':
start()

View File

@ -1,3 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
@ -21,6 +22,7 @@
############################################################################### ###############################################################################
import re import re
import sys
from setuptools import setup, find_packages from setuptools import setup, find_packages
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
@ -109,6 +111,32 @@ except Exception:
finally: finally:
ver_file.close() ver_file.close()
requires = [
'alembic',
'beautifulsoup4',
'chardet',
'lxml',
'Mako',
'PyQt5',
'QtAwesome',
'requests',
'SQLAlchemy >= 0.5',
'waitress',
'WebOb',
'websockets'
]
if sys.platform.startswith('win'):
requires.extend([
'PyICU',
'pywin32'
])
elif sys.platform.startswith('darwin'):
requires.extend([
'pyobjc',
'pyobjc-framework-Cocoa'
])
elif sys.platform.startswith('linux'):
requires.append('dbus-python')
setup( setup(
name='OpenLP', name='OpenLP',
@ -156,18 +184,21 @@ using a computer and a data projector.""",
keywords='open source church presentation lyrics projection song bible display project', keywords='open source church presentation lyrics projection song bible display project',
author='Raoul Snyman', author='Raoul Snyman',
author_email='raoulsnyman@openlp.org', author_email='raoulsnyman@openlp.org',
url='http://openlp.org/', url='https://openlp.org/',
license='GNU General Public License', license='GNU General Public License',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), packages=find_packages(exclude=['ez_setup', 'tests*']),
scripts=['openlp.py'],
include_package_data=True, include_package_data=True,
zip_safe=False, zip_safe=False,
install_requires=[ python_requires='>=3.4',
# -*- Extra requirements: -*- install_requires=requires,
'sqlalchemy', extras_require={
'alembic' 'jenkins': ['python-jenkins'],
], 'mysql': ['mysql-connector-python'],
entry_points=""" 'odbc': ['pyodbc'],
# -*- Entry points: -*- 'postgresql': ['psycopg2'],
""" 'spellcheck': ['pyenchant >= 1.6'],
'sword-bibles': ['pysword']
},
tests_require=['nose2', 'pylint'],
entry_points={'gui_scripts': ['openlp = openlp.__main__:start']}
) )