<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import ast
import sys
import os
import re
import z0lib


__version__ = '0.3.6.30'


REQVERSION = {
    'acme_tiny': {'7.0': '>=4.0.3'},
    'astroid': {'7.0': '==1.4.8'},
    'Babel': {'7.0': '==1.3', '8.0': '==2.3.4'},
    'beautifulsoup': {'7.0': '==3.2.1'},
    'codicefiscale': {'7.0': '==0.9'},
    'cryptography': {'7.0': '2.2.2'},
    'decorator': {'7.0': '==3.4.0', '10.0': '==4.0.10'},
    'docutils': {'7.0': '==0.12'},
    'ebaysdk': {'7.0': '==2.1.4'},
    'feedparser': {'7.0': '==5.1.3', '10.0': '==5.2.1'},
    'flake8': {'7.0': '>=3.4.1'},
    'gdata': {'7.0': '==2.0.18'},
    'gevent': {'7.0': '==1.0.2', '10.0': '==1.1.2'},
    'greenlet': {'7.0': '==0.4.10'},
    'ipy': {'7.0': '>=0.83'},
    'jcconv': {'7.0': '==0.2.3'},
    'Jinja2': {'7.0': '==2.7.3', '10.0': '==2.8'},
    'lxml': {'7.0': '>=3.4.1', '10.0': '==3.5.0'},      # Tested 4.2.1
    'Mako':  {'7.0': '==1.0.1', '8.0': '==1.0.4'},
    'MarkupSafe': {'7.0': '>=0.23'},                    # Tested 1.0
    'mock': {'7.0': '==1.0.1', '8.0': '==2.0.0',},
    'ofxparse': {'7.0': '==0.16'},
    'passlib': {'7.0': '==1.6.2', '10.0': '==1.6.5'},
    'Pillow': {'7.0': '==3.4.2', '8.0': '==3.4.1'},     # Tested 3.4.2
    'psutil': {'7.0': '==2.2.0', '8.0': '==4.3.1'},
    'psycogreen': {'7.0': '==1.0'},
    'psycopg2': {'7.0': '>=2.0.0',
                 '8.0': '==2.5.4',
                 '10.0': '==2.6.2'},                    # Tested 2.7.4
    'pydot': {'7.0': '==1.0.2', '8.0': '==1.2.3'},
    'pygments': {'7.0': '==2.0.2'},
    'pylint': {'7.0': '==1.6.4'},
    'pylint-plugin-utils': {'7.0': '==0.2.4', '8.0': '==0.3.5.11'},
    'pysftp': {'7.0': '>=0.2.9'},
    'pyparsing': {'7.0': '==2.0.3', '10.0': '==2.1.10'},
    'pyPdf': {'7.0': '==1.13'},
    'pyserial':  {'7.0': '==2.7', '10.0': '==3.1.1'},
    'Python-Chart': {'7.0': '==1.39'},
    'python-dateutil': {'7.0': '==2.4.0', '8.0': '==2.5.3'},
    'python-ldap': {'7.0': '==2.4.19',
                    '10.0': '==2.4.25'},        # warning OCA declare 2.4.27!?
    'python-openid': {'7.0': '==2.2.5'},
    'python-stdnum': {'7.0': '>=1.8.1'},
    'pytz': {'7.0': '==2014.10', '10.0': '==2016.7'},
    'pyusb': {'7.0': '>=1.0.0b1', '10.0': '==1.0.0'},
    'pyxb': {'7.0':  '==1.2.4'},
    'PyYAML': {'7.0': '==3.11', '8.0': '==3.12'},
    'qrcode': {'7.0': '==5.1', '10.0': '==5.3'},
    'restructuredtext_lint': {'7.0': '==0.12.2'},
    'reportlab': {'7.0': '==3.1.44', '10.0': '==3.3.0'},
    'requests': {'7.0': '==2.6.0', '10.0': '==2.11.1',},
    'simplejson': {'7.0': '==3.5.3'},
    'six': {'7.0': '==1.9.0',  '10.0': '==1.10.0'},
    'suds': {'7.0': '==0.4'},
    'suds-jurko': {'7.0': '==0.6'},
    'unicodecsv': {'7.0': '>=0.14.1'},
    'unidecode': {'7.0': '==0.4.17'},
    'unittest2': {'7.0': '==0.5.1'},
    'validate_email': {'7.0': '>=1.3'},
    'vatnumber': {'7.0': '==1.2'},
    'vobject': {'7.0': '==0.9.3'},                      # Tested 0.9.5
    'Werkzeug': {'7.0': '==0.9.6', '10.0': '==0.11.11'},
    'wkhtmltopdf': {'7.0': '==0.12.1', '10.0': '==0.12.4'},
    'wsgiref': {'7.0': '==0.1.2'},
    'XlsxWriter': {'7.0': '==0.9.3'},                   # Tested 1.0.2
    'xlrd': {'7.0': '==1.0.0'},
    'xlwt': {'7.0': '==0.7.5', '10.0': '==1.1.2'},
}
ALIAS = {
    'dateutil': 'python-dateutil',
    'stdnum': 'python-stdnum',
    'ldap': 'python-ldap',
    'openid': 'python-openid',
    'usb': 'pyusb',
    'lxml': 'lxml',
    'babel': 'Babel',
    'jinja2': 'Jinja2',
    'mako': 'Mako',
    'markupsafe': 'MarkupSafe',
    'pillow': 'Pillow',
    # 'psycopg2': 'psycopg2-binary',
    'pypdf': 'pyPdf',
    'python-chart': 'Python-Chart',
    'pyyaml': 'PyYAML',
    'werkzeug': 'Werkzeug',
    'xlsxwriter': 'XlsxWriter',
}
PIP_TEST_PACKAGES = ['astroid',
                     'click',
                     'configparser',
                     'coveralls',
                     'flake8',
                     'lazy_object_proxy',
                     'MarkupSafe',
                     'mock',
                     'pbr',
                     'pyflakes',
                     'pylint',
                     'pylint-mccabe',
                     'pylint_odoo',
                     'PyYAML',
                     'QUnitSuite',
                     'restructuredtext_lint',
                     'unittest2',
                     'wrapt',
                     'zerobug',
                     ]
BIN_TEST_PACKAGES = ['expect-dev',
                     'python-dev',
                     'python-setuptools',
                     ]
RPC_PACKAGES = ['clodoo',
                'odoorpc',
                'oerplib',
                'os0',
                ]
PIP_BASE_PACKAGES = ['Babel',
                     'configparser',
                     'decorator',
                     'docutils',
                     'feedparser',
                     'gdata',
                     'gevent',
                     'Jinja2',
                     'lxml',
                     'Mako',
                     'passlib',
                     'Pillow',
                     'psutil',
                     'psycogreen',
                     'psycopg2',
                     'psycopg2-binary',
                     'Python-Chart',
                     'python-dateutil',
                     'python-openid',
                     'pydot',
                     'pyparsing',
                     'pypdf',
                     'pyserial',
                     'pytz',
                     'reportlab',
                     'stdnum',
                     'vatnumber',
                     'Werkzeug',
                     ]
BIN_BASE_PACKAGES = ['simplejson',
                     'python-ldap',
                     'wkhtmltopdf',
                     ]
BIN_PACKAGES = ['git',
                'cups',
                ]

def parse_requirements(reqfile):
    lines = open(reqfile, 'rbU').read().split('\n')
    reqlist = []
    for line in lines:
        if line and line[0] != '#':
            items = line.split(';')
            if len(items) == 1 or eval(items[1].strip().replace('_','.')):
                item = items[0].strip()
                reqlist.append(item)
    return reqlist

<commit_msg>[IMP] New enhancements in order to manage Odoo 11<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import ast
import sys
import os
import re
import z0lib


__version__ = '0.3.6.30'


REQVERSION = {
    'acme_tiny': {'7.0': '>=4.0.3'},
    'astroid': {'7.0': '==1.4.8'},
    'Babel': {'7.0': '==1.3', '8.0': '==2.3.4'},
    'beautifulsoup': {'7.0': '==3.2.1'},
    'codicefiscale': {'7.0': '==0.9'},
    'cryptography': {'7.0': '2.2.2'},
    'decorator': {'7.0': '==3.4.0', '10.0': '==4.0.10'},
    'docutils': {'7.0': '==0.12'},
    'ebaysdk': {'7.0': '==2.1.4'},
    'feedparser': {'7.0': '==5.1.3', '10.0': '==5.2.1'},
    'flake8': {'7.0': '>=3.4.1'},
    'gdata': {'7.0': '==2.0.18'},
    'gevent': {'7.0': '==1.0.2', '10.0': '==1.1.2'},
    'greenlet': {'7.0': '==0.4.10'},
    'ipy': {'7.0': '>=0.83'},
    'jcconv': {'7.0': '==0.2.3'},
    'Jinja2': {'7.0': '==2.7.3', '10.0': '==2.8'},
    'lxml': {'7.0': '>=3.4.1', '10.0': '==3.5.0'},      # Tested 4.2.1
    'Mako':  {'7.0': '==1.0.1', '8.0': '==1.0.4'},
    'MarkupSafe': {'7.0': '>=0.23'},                    # Tested 1.0
    'mock': {'7.0': '==1.0.1', '8.0': '==2.0.0',},
    'ofxparse': {'7.0': '==0.16'},
    'passlib': {'7.0': '==1.6.2', '10.0': '==1.6.5'},
    'Pillow': {'7.0': '==3.4.2', '8.0': '==3.4.1'},     # Tested 3.4.2
    'psutil': {'7.0': '==2.2.0', '8.0': '==4.3.1'},
    'psycogreen': {'7.0': '==1.0'},
    'psycopg2': {'7.0': '>=2.0.0',
                 '8.0': '==2.5.4',
                 '10.0': '==2.6.2'},                    # Tested 2.7.4
    'pydot': {'7.0': '==1.0.2', '8.0': '==1.2.3'},
    'pygments': {'7.0': '==2.0.2'},
    'pylint': {'7.0': '==1.6.4'},
    'pylint-plugin-utils': {'7.0': '==0.2.4', '8.0': '==0.3.5.11'},
    'pysftp': {'7.0': '>=0.2.9'},
    'pyparsing': {'7.0': '==2.0.3', '10.0': '==2.1.10'},
    'pyPdf': {'7.0': '==1.13'},
    'pyserial':  {'7.0': '==2.7', '10.0': '==3.1.1'},
    'Python-Chart': {'7.0': '==1.39'},
    'python-dateutil': {'7.0': '==2.4.0', '8.0': '==2.5.3'},
    'python-ldap': {'7.0': '==2.4.19',
                    '10.0': '==2.4.25'},        # warning OCA declare 2.4.27!?
    'python-openid': {'7.0': '==2.2.5'},
    'python-stdnum': {'7.0': '>=1.8.1'},
    'pytz': {'7.0': '==2014.10', '10.0': '==2016.7'},
    'pyusb': {'7.0': '>=1.0.0b1', '10.0': '==1.0.0'},
    'pyxb': {'7.0':  '==1.2.4'},
    'PyYAML': {'7.0': '==3.11', '8.0': '==3.12'},
    'qrcode': {'7.0': '==5.1', '10.0': '==5.3'},
    'restructuredtext_lint': {'7.0': '==0.12.2'},
    'reportlab': {'7.0': '==3.1.44', '10.0': '==3.3.0'},
    'requests': {'7.0': '==2.6.0', '10.0': '==2.11.1',},
    'simplejson': {'7.0': '==3.5.3'},
    'six': {'7.0': '==1.9.0',  '10.0': '==1.10.0'},
    'suds': {'7.0': '==0.4'},
    'suds-jurko': {'7.0': '==0.6'},
    'unicodecsv': {'7.0': '>=0.14.1'},
    'unidecode': {'7.0': '==0.4.17'},
    'unittest2': {'7.0': '==0.5.1'},
    'validate_email': {'7.0': '>=1.3'},
    'vatnumber': {'7.0': '==1.2'},
    'vobject': {'7.0': '==0.9.3'},                      # Tested 0.9.5
    'Werkzeug': {'7.0': '==0.9.6', '10.0': '==0.11.11'},
    'wkhtmltopdf': {'7.0': '==0.12.1', '10.0': '==0.12.4'},
    'wsgiref': {'7.0': '==0.1.2'},
    'XlsxWriter': {'7.0': '==0.9.3'},                   # Tested 1.0.2
    'xlrd': {'7.0': '==1.0.0'},
    'xlwt': {'7.0': '==0.7.5', '10.0': '==1.1.2'},
}
ALIAS = {
    'dateutil': 'python-dateutil',
    'stdnum': 'python-stdnum',
    'ldap': 'python-ldap',
    'openid': 'python-openid',
    'usb': 'pyusb',
    'lxml': 'lxml',
    'babel': 'Babel',
    'jinja2': 'Jinja2',
    'mako': 'Mako',
    'markupsafe': 'MarkupSafe',
    'pillow': 'Pillow',
    # 'psycopg2': 'psycopg2-binary',
    'pypdf': 'pyPdf',
    'python-chart': 'Python-Chart',
    'pyyaml': 'PyYAML',
    'werkzeug': 'Werkzeug',
    'xlsxwriter': 'XlsxWriter',
}
PIP_TEST_PACKAGES = ['astroid',
                     'click',
                     'configparser',
                     'coveralls',
                     'flake8',
                     'lazy_object_proxy',
                     'MarkupSafe',
                     'mock',
                     'pbr',
                     'pyflakes',
                     'pylint',
                     'pylint-mccabe',
                     'pylint_odoo',
                     'PyYAML',
                     'QUnitSuite',
                     'restructuredtext_lint',
                     'unittest2',
                     'urllib3[secure]',
                     'wrapt',
                     'zerobug',
                     ]
BIN_TEST_PACKAGES = ['expect-dev',
                     'python-dev',
                     'python-setuptools',
                     ]
RPC_PACKAGES = ['clodoo',
                'odoorpc',
                'oerplib',
                'os0',
                ]
PIP_BASE_PACKAGES = ['Babel',
                     'configparser',
                     'decorator',
                     'docutils',
                     'feedparser',
                     'gdata',
                     'gevent',
                     'Jinja2',
                     'lxml',
                     'Mako',
                     'passlib',
                     'Pillow',
                     'psutil',
                     'psycogreen',
                     'psycopg2',
                     'psycopg2-binary',
                     'Python-Chart',
                     'python-dateutil',
                     'python-openid',
                     'pydot',
                     'pyparsing',
                     'pypdf',
                     'pyserial',
                     'pytz',
                     'reportlab',
                     'stdnum',
                     'urllib3[secure]',
                     'vatnumber',
                     'Werkzeug',
                     ]
BIN_BASE_PACKAGES = ['simplejson',
                     'python-ldap',
                     'wkhtmltopdf',
                     ]
BIN_PACKAGES = ['git',
                'cups',
                ]

def parse_requirements(reqfile):
    lines = open(reqfile, 'rbU').read().split('\n')
    reqlist = []
    for line in lines:
        if line and line[0] != '#':
            items = line.split(';')
            if len(items) == 1 or eval(items[1].strip().replace('_','.')):
                item = items[0].strip()
                reqlist.append(item)
    return reqlist


{'fraction_non_alphanumeric': 0.2824524988024908, 'fraction_numerical': 0.08701900047900367, 'mean_word_length': 1.4471576479781207, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1331871', 'n_tokens_mistral': 5410, 'n_tokens_neox': 5108, 'n_words': 828}