InQuest / ThreatIngestor

Extract and aggregate threat intelligence.
https://inquest.readthedocs.io/projects/threatingestor/
GNU General Public License v2.0
821 stars 135 forks source link

Setup fails: 'extras_require' must be a dictionary #100

Closed blueteamzone closed 2 years ago

blueteamzone commented 4 years ago

When I try to start develop by running

python setup.py develop

I get this error: error in threatingestor setup command: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.

I managed to fix it by completely removing extras_require in the setup file. I don't think it's the best way however.

cmmorrow commented 3 years ago

Hello @blueteamzone, thanks for submitting the issue. I created a new python3.7 environment, cloned ThreatIngestor and ran python setup.py develop, but wasn't able to reproduce the issue. Can you tell me which version of Python and ThreatIngestor are you trying to install in developer mode?

patribo commented 3 years ago

I have the same problem I'm using python Python 3.9.5, don't know about ThreatIngestor. I have to add: I get the error by running python setup.py install

ynvtlmr commented 3 years ago

I wasn't able to reproduce this error either. Looking at the code, extras_require is defined here.

    extras_require={
        'twitter': ['twitter'],
        'rss': ['feedparser'],
        'misp': ['PyMISP'],
        'threatkb': ['threatkb'],
        'beanstalk': ['greenstalk'],
        'sqs': ['boto3'],
        'mysql': ['pymysql'],
        'extras': ['hug', 'boto3', 'greenstalk', 'watchdog'],
        'all': extra_requires,
    },

The issue may be with the last line: 'all': extra_requires, It should be a list that is generated by parsing 'requirements-testing.txt' Code here:

extra_requirements = open(os.path.join(os.path.dirname(__file__),
            'requirements-testing.txt')).read()
extra_requires = extra_requirements.strip().split('\n')

If that requirements file does not exist, or cannot be parsed for some reason, the script will fail here.