linkedin / oncall

Oncall is a calendar tool designed for scheduling and managing on-call shifts. It can be used as source of dynamic ownership info for paging systems like http://iris.claims.
http://oncall.tools
BSD 2-Clause "Simplified" License
1.15k stars 231 forks source link

Getting error while installing Oncall #251

Open avutu opened 5 years ago

avutu commented 5 years ago

During Oncall instalation top of the tree, it is bailing out. I tries on Ubuntu 18.04 and 16.04 LTS. Both have similar issues.

python setup.py develop

STACK TRACE BELOW:

sudo python setup.py develop running develop running egg_info writing requirements to src/oncall.egg-info/requires.txt writing src/oncall.egg-info/PKG-INFO writing top-level names to src/oncall.egg-info/top_level.txt writing dependency_links to src/oncall.egg-info/dependency_links.txt reading manifest file 'src/oncall.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'src/oncall.egg-info/SOURCES.txt' running build_ext Creating /usr/local/lib/python2.7/dist-packages/oncall.egg-link (link to src) oncall 1.1.0 is already the active version in easy-install.pth

Installed /home/avutuc/projects/oncall/src Processing dependencies for oncall==1.1.0 Searching for aiohttp>3.5.2 Reading https://pypi.python.org/simple/aiohttp/ Downloading https://files.pythonhosted.org/packages/ef/54/8926aef41c43f9126c65359eab8b0260fd53da29102ceeffe654e88215cc/aiohttp-4.0.0a0.tar.gz#sha256=371a5f1bb604fc262ba32893931f5aad3bb3e797dbebcf2b5b2c36f97603e4c7 Best match: aiohttp 4.0.0a0 Processing aiohttp-4.0.0a0.tar.gz Writing /tmp/easy_install-K4C3ZC/aiohttp-4.0.0a0/setup.cfg Running aiohttp-4.0.0a0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-K4C3ZC/aiohttp-4.0.0a0/egg-dist-tmp-Qbxxnc Traceback (most recent call last): Traceback (most recent call last): File "setup.py", line 35, in 'pymsteams' File "/usr/lib/python2.7/dist-packages/setuptools/init.py", line 129, in setup return distutils.core.setup(**attrs) File "/usr/lib/python2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib/python2.7/dist-packages/setuptools/command/develop.py", line 36, in run self.install_for_development() File "/usr/lib/python2.7/dist-packages/setuptools/command/develop.py", line 152, in install_for_development self.process_distribution(None, self.dist, not self.no_deps) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 771, in process_distribution [requirement], self.local_index, self.easy_install File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 774, in resolve replace_conflicting=replace_conflicting File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1057, in best_match return self.obtain(req, installer) File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1069, in obtain return installer(requirement) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 698, in easy_install return self.install_item(spec, dist.location, tmpdir, deps) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 724, in install_item dists = self.install_eggs(spec, download, tmpdir) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 909, in install_eggs return self.build_and_install(setup_script, setup_base) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1177, in build_and_install self.run_setup(setup_script, setup_base, args) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1163, in run_setup run_setup(setup_script, args) File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 253, in run_setup raise File "/usr/lib/python2.7/contextlib.py", line 35, in exit self.gen.throw(type, value, traceback) File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 195, in setup_context yield File "/usr/lib/python2.7/contextlib.py", line 35, in exit self.gen.throw(type, value, traceback) File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 166, in save_modules saved_exc.resume() File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 141, in resume six.reraise(type, exc, self._tb) File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 154, in save_modules yield saved File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 195, in setup_context yield File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 250, in run_setup _execfile(setup_script, ns) File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 44, in _execfile code = compile(script, filename, 'exec') File "/tmp/easy_install-K4C3ZC/aiohttp-4.0.0a0/setup.py", line 24 print("Install cython when building from git clone", file=sys.stderr) ^ SyntaxError: invalid syntax

eoinnoble commented 5 years ago

It looks like this might be because you’re using python 2.7 but the aiohttp library only supports python 3?

Linearhero commented 5 years ago

The slackclient python package is breaking the 'python setup.py develop" step of the build. It appears that in some builds if you don't specify a version for the slackclient package it will attempt to install version 2.0.1 which, since https://pypi.org/project/slackclient/2.0.0b1/ came out, requires Python >=3.6.

As 'slackclient 1.3.1' is the last version to support Python 2.7 you can fix this by modifying the setup.py file to read 'slackclient==1.3.1' instead of 'slackclient' (See below)

#!/usr/bin/env python
# -*- coding:utf-8 -*-

import setuptools
import re

with open('src/oncall/__init__.py', 'r') as fd:
    version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)

setuptools.setup(
    name='oncall',
    version=version,
    package_dir={'': 'src'},
    packages=setuptools.find_packages('src'),
    include_package_data=True,
    install_requires=[
        'falcon==1.1.0',
        'falcon-cors',
        'gevent',
        'ujson',
        'sqlalchemy',
        'PyYAML',
        'PyMYSQL',
        'phonenumbers',
        'jinja2',
        'streql',
        'webassets',
        'beaker',
        'cryptography',
        'python-ldap',
        'pytz',
        'irisclient', 
        'slackclient==1.3.1',
        'icalendar',
        'pymsteams'
    ],
    extras_require={
        'ldap': ['python-ldap'],
        'prometheus': ['prometheus_client'],
        'dev': [
            'pytest',
            'pytest-mock',
            'gunicorn',
            'flake8',
            'requests',
            'Sphinx==1.5.6',
            'sphinxcontrib-httpdomain',
            'sphinx_rtd_theme',
            'sphinx-autobuild',
        ],
    },
    entry_points={
        'console_scripts': [
            'oncall-dev = oncall.bin.run_server:main',
            'oncall-user-sync = oncall.bin.user_sync:main',
            'build_assets = oncall.bin.build_assets:main',
            'oncall-scheduler = oncall.bin.scheduler:main',
            'oncall-notifier = oncall.bin.notifier:main'
        ]
    }
)