Best Python code snippet using ATX
setup.py
Source:setup.py
1from setuptools import setup2setup(3 name='markosim_reloaded',4 version='',5 packages=['venv.Lib.site-packages.pip', 'venv.Lib.site-packages.pip._vendor', 'venv.Lib.site-packages.pip._vendor.idna', 'venv.Lib.site-packages.pip._vendor.pep517', 'venv.Lib.site-packages.pip._vendor.pytoml',6 'venv.Lib.site-packages.pip._vendor.certifi', 'venv.Lib.site-packages.pip._vendor.chardet', 'venv.Lib.site-packages.pip._vendor.chardet.cli', 'venv.Lib.site-packages.pip._vendor.distlib',7 'venv.Lib.site-packages.pip._vendor.distlib._backport', 'venv.Lib.site-packages.pip._vendor.msgpack', 'venv.Lib.site-packages.pip._vendor.urllib3', 'venv.Lib.site-packages.pip._vendor.urllib3.util',8 'venv.Lib.site-packages.pip._vendor.urllib3.contrib', 'venv.Lib.site-packages.pip._vendor.urllib3.contrib._securetransport', 'venv.Lib.site-packages.pip._vendor.urllib3.packages',9 'venv.Lib.site-packages.pip._vendor.urllib3.packages.backports', 'venv.Lib.site-packages.pip._vendor.urllib3.packages.ssl_match_hostname', 'venv.Lib.site-packages.pip._vendor.colorama', 'venv.Lib.site-packages.pip._vendor.html5lib',10 'venv.Lib.site-packages.pip._vendor.html5lib._trie', 'venv.Lib.site-packages.pip._vendor.html5lib.filters', 'venv.Lib.site-packages.pip._vendor.html5lib.treewalkers', 'venv.Lib.site-packages.pip._vendor.html5lib.treeadapters',11 'venv.Lib.site-packages.pip._vendor.html5lib.treebuilders', 'venv.Lib.site-packages.pip._vendor.lockfile', 'venv.Lib.site-packages.pip._vendor.progress', 'venv.Lib.site-packages.pip._vendor.requests',12 'venv.Lib.site-packages.pip._vendor.packaging', 'venv.Lib.site-packages.pip._vendor.cachecontrol', 'venv.Lib.site-packages.pip._vendor.cachecontrol.caches', 'venv.Lib.site-packages.pip._vendor.webencodings',13 'venv.Lib.site-packages.pip._vendor.pkg_resources', 'venv.Lib.site-packages.pip._internal', 'venv.Lib.site-packages.pip._internal.cli', 'venv.Lib.site-packages.pip._internal.req', 'venv.Lib.site-packages.pip._internal.vcs',14 'venv.Lib.site-packages.pip._internal.utils', 'venv.Lib.site-packages.pip._internal.models', 'venv.Lib.site-packages.pip._internal.commands', 'venv.Lib.site-packages.pip._internal.operations', 'venv.Lib.site-packages.pytz',15 'venv.Lib.site-packages.numpy', 'venv.Lib.site-packages.numpy.ma', 'venv.Lib.site-packages.numpy.ma.tests', 'venv.Lib.site-packages.numpy.doc', 'venv.Lib.site-packages.numpy.fft', 'venv.Lib.site-packages.numpy.fft.tests',16 'venv.Lib.site-packages.numpy.lib', 'venv.Lib.site-packages.numpy.lib.tests', 'venv.Lib.site-packages.numpy.core', 'venv.Lib.site-packages.numpy.core.tests', 'venv.Lib.site-packages.numpy.f2py',17 'venv.Lib.site-packages.numpy.f2py.tests', 'venv.Lib.site-packages.numpy.tests', 'venv.Lib.site-packages.numpy.compat', 'venv.Lib.site-packages.numpy.compat.tests', 'venv.Lib.site-packages.numpy.linalg',18 'venv.Lib.site-packages.numpy.linalg.tests', 'venv.Lib.site-packages.numpy.random', 'venv.Lib.site-packages.numpy.random.tests', 'venv.Lib.site-packages.numpy.testing', 'venv.Lib.site-packages.numpy.testing.tests',19 'venv.Lib.site-packages.numpy.testing._private', 'venv.Lib.site-packages.numpy.distutils', 'venv.Lib.site-packages.numpy.distutils.tests', 'venv.Lib.site-packages.numpy.distutils.command',20 'venv.Lib.site-packages.numpy.distutils.fcompiler', 'venv.Lib.site-packages.numpy.matrixlib', 'venv.Lib.site-packages.numpy.matrixlib.tests', 'venv.Lib.site-packages.numpy.polynomial', 'venv.Lib.site-packages.numpy.polynomial.tests',21 'venv.Lib.site-packages.PyQt5', 'venv.Lib.site-packages.PyQt5.uic', 'venv.Lib.site-packages.PyQt5.uic.Loader', 'venv.Lib.site-packages.PyQt5.uic.port_v2', 'venv.Lib.site-packages.PyQt5.uic.port_v3',22 'venv.Lib.site-packages.PyQt5.uic.Compiler', 'venv.Lib.site-packages.scipy', 'venv.Lib.site-packages.scipy.io', 'venv.Lib.site-packages.scipy.io.arff', 'venv.Lib.site-packages.scipy.io.arff.tests',23 'venv.Lib.site-packages.scipy.io.tests', 'venv.Lib.site-packages.scipy.io.matlab', 'venv.Lib.site-packages.scipy.io.matlab.tests', 'venv.Lib.site-packages.scipy.io.harwell_boeing', 'venv.Lib.site-packages.scipy.io.harwell_boeing.tests',24 'venv.Lib.site-packages.scipy.odr', 'venv.Lib.site-packages.scipy.odr.tests', 'venv.Lib.site-packages.scipy._lib', 'venv.Lib.site-packages.scipy._lib.tests', 'venv.Lib.site-packages.scipy.misc',25 'venv.Lib.site-packages.scipy.misc.tests', 'venv.Lib.site-packages.scipy.stats', 'venv.Lib.site-packages.scipy.stats.tests', 'venv.Lib.site-packages.scipy.linalg', 'venv.Lib.site-packages.scipy.linalg.tests',26 'venv.Lib.site-packages.scipy.signal', 'venv.Lib.site-packages.scipy.signal.tests', 'venv.Lib.site-packages.scipy.signal.windows', 'venv.Lib.site-packages.scipy.sparse', 'venv.Lib.site-packages.scipy.sparse.tests',27 'venv.Lib.site-packages.scipy.sparse.linalg', 'venv.Lib.site-packages.scipy.sparse.linalg.eigen', 'venv.Lib.site-packages.scipy.sparse.linalg.eigen.arpack', 'venv.Lib.site-packages.scipy.sparse.linalg.eigen.arpack.tests',28 'venv.Lib.site-packages.scipy.sparse.linalg.eigen.lobpcg', 'venv.Lib.site-packages.scipy.sparse.linalg.eigen.lobpcg.tests', 'venv.Lib.site-packages.scipy.sparse.linalg.tests', 'venv.Lib.site-packages.scipy.sparse.linalg.dsolve',29 'venv.Lib.site-packages.scipy.sparse.linalg.dsolve.tests', 'venv.Lib.site-packages.scipy.sparse.linalg.isolve', 'venv.Lib.site-packages.scipy.sparse.linalg.isolve.tests', 'venv.Lib.site-packages.scipy.sparse.csgraph',30 'venv.Lib.site-packages.scipy.sparse.csgraph.tests', 'venv.Lib.site-packages.scipy.cluster', 'venv.Lib.site-packages.scipy.cluster.tests', 'venv.Lib.site-packages.scipy.fftpack', 'venv.Lib.site-packages.scipy.fftpack.tests',31 'venv.Lib.site-packages.scipy.ndimage', 'venv.Lib.site-packages.scipy.ndimage.tests', 'venv.Lib.site-packages.scipy.spatial', 'venv.Lib.site-packages.scipy.spatial.tests', 'venv.Lib.site-packages.scipy.spatial.transform',32 'venv.Lib.site-packages.scipy.spatial.transform.tests', 'venv.Lib.site-packages.scipy.special', 'venv.Lib.site-packages.scipy.special.tests', 'venv.Lib.site-packages.scipy.special._precompute', 'venv.Lib.site-packages.scipy.optimize',33 'venv.Lib.site-packages.scipy.optimize._lsq', 'venv.Lib.site-packages.scipy.optimize.tests', 'venv.Lib.site-packages.scipy.optimize._trlib', 'venv.Lib.site-packages.scipy.optimize._shgo_lib',34 'venv.Lib.site-packages.scipy.optimize._trustregion_constr', 'venv.Lib.site-packages.scipy.optimize._trustregion_constr.tests', 'venv.Lib.site-packages.scipy.constants', 'venv.Lib.site-packages.scipy.constants.tests',35 'venv.Lib.site-packages.scipy.integrate', 'venv.Lib.site-packages.scipy.integrate._ivp', 'venv.Lib.site-packages.scipy.integrate.tests', 'venv.Lib.site-packages.scipy.interpolate', 'venv.Lib.site-packages.scipy.interpolate.tests',36 'venv.Lib.site-packages.scipy._build_utils', 'venv.Lib.site-packages.pandas', 'venv.Lib.site-packages.pandas.io', 'venv.Lib.site-packages.pandas.io.sas', 'venv.Lib.site-packages.pandas.io.json',37 'venv.Lib.site-packages.pandas.io.formats', 'venv.Lib.site-packages.pandas.io.msgpack', 'venv.Lib.site-packages.pandas.io.clipboard', 'venv.Lib.site-packages.pandas.api', 'venv.Lib.site-packages.pandas.api.types',38 'venv.Lib.site-packages.pandas.api.extensions', 'venv.Lib.site-packages.pandas.core', 'venv.Lib.site-packages.pandas.core.util', 'venv.Lib.site-packages.pandas.core.tools', 'venv.Lib.site-packages.pandas.core.arrays',39 'venv.Lib.site-packages.pandas.core.dtypes', 'venv.Lib.site-packages.pandas.core.sparse', 'venv.Lib.site-packages.pandas.core.groupby', 'venv.Lib.site-packages.pandas.core.indexes', 'venv.Lib.site-packages.pandas.core.reshape',40 'venv.Lib.site-packages.pandas.core.internals', 'venv.Lib.site-packages.pandas.core.computation', 'venv.Lib.site-packages.pandas.util', 'venv.Lib.site-packages.pandas._libs', 'venv.Lib.site-packages.pandas._libs.tslibs',41 'venv.Lib.site-packages.pandas.tests', 'venv.Lib.site-packages.pandas.tests.io', 'venv.Lib.site-packages.pandas.tests.io.sas', 'venv.Lib.site-packages.pandas.tests.io.json', 'venv.Lib.site-packages.pandas.tests.io.parser',42 'venv.Lib.site-packages.pandas.tests.io.formats', 'venv.Lib.site-packages.pandas.tests.io.msgpack', 'venv.Lib.site-packages.pandas.tests.api', 'venv.Lib.site-packages.pandas.tests.util', 'venv.Lib.site-packages.pandas.tests.frame',43 'venv.Lib.site-packages.pandas.tests.tools', 'venv.Lib.site-packages.pandas.tests.arrays', 'venv.Lib.site-packages.pandas.tests.arrays.sparse', 'venv.Lib.site-packages.pandas.tests.arrays.interval',44 'venv.Lib.site-packages.pandas.tests.arrays.categorical', 'venv.Lib.site-packages.pandas.tests.dtypes', 'venv.Lib.site-packages.pandas.tests.dtypes.cast', 'venv.Lib.site-packages.pandas.tests.scalar',45 'venv.Lib.site-packages.pandas.tests.scalar.period', 'venv.Lib.site-packages.pandas.tests.scalar.interval', 'venv.Lib.site-packages.pandas.tests.scalar.timedelta', 'venv.Lib.site-packages.pandas.tests.scalar.timestamp',46 'venv.Lib.site-packages.pandas.tests.series', 'venv.Lib.site-packages.pandas.tests.series.indexing', 'venv.Lib.site-packages.pandas.tests.sparse', 'venv.Lib.site-packages.pandas.tests.sparse.frame',47 'venv.Lib.site-packages.pandas.tests.sparse.series', 'venv.Lib.site-packages.pandas.tests.tslibs', 'venv.Lib.site-packages.pandas.tests.generic', 'venv.Lib.site-packages.pandas.tests.groupby',48 'venv.Lib.site-packages.pandas.tests.groupby.aggregate', 'venv.Lib.site-packages.pandas.tests.indexes', 'venv.Lib.site-packages.pandas.tests.indexes.multi', 'venv.Lib.site-packages.pandas.tests.indexes.period',49 'venv.Lib.site-packages.pandas.tests.indexes.interval', 'venv.Lib.site-packages.pandas.tests.indexes.datetimes', 'venv.Lib.site-packages.pandas.tests.indexes.timedeltas', 'venv.Lib.site-packages.pandas.tests.reshape',50 'venv.Lib.site-packages.pandas.tests.reshape.merge', 'venv.Lib.site-packages.pandas.tests.tseries', 'venv.Lib.site-packages.pandas.tests.tseries.offsets', 'venv.Lib.site-packages.pandas.tests.indexing',51 'venv.Lib.site-packages.pandas.tests.indexing.interval', 'venv.Lib.site-packages.pandas.tests.indexing.multiindex', 'venv.Lib.site-packages.pandas.tests.plotting', 'venv.Lib.site-packages.pandas.tests.resample',52 'venv.Lib.site-packages.pandas.tests.extension', 'venv.Lib.site-packages.pandas.tests.extension.base', 'venv.Lib.site-packages.pandas.tests.extension.json', 'venv.Lib.site-packages.pandas.tests.extension.arrow',53 'venv.Lib.site-packages.pandas.tests.extension.decimal', 'venv.Lib.site-packages.pandas.tests.internals', 'venv.Lib.site-packages.pandas.tests.arithmetic', 'venv.Lib.site-packages.pandas.tests.reductions',54 'venv.Lib.site-packages.pandas.tests.computation', 'venv.Lib.site-packages.pandas.arrays', 'venv.Lib.site-packages.pandas.compat', 'venv.Lib.site-packages.pandas.compat.numpy', 'venv.Lib.site-packages.pandas.errors',55 'venv.Lib.site-packages.pandas.tseries', 'venv.Lib.site-packages.pandas.plotting', 'venv.Lib.site-packages.dateutil', 'venv.Lib.site-packages.dateutil.tz', 'venv.Lib.site-packages.dateutil.parser',56 'venv.Lib.site-packages.dateutil.zoneinfo', 'venv.Lib.site-packages.setuptools', 'venv.Lib.site-packages.setuptools.extern', 'venv.Lib.site-packages.setuptools._vendor', 'venv.Lib.site-packages.setuptools._vendor.packaging',57 'venv.Lib.site-packages.setuptools.command', 'venv.Lib.site-packages.xlsxwriter', 'venv.Lib.site-packages.pkg_resources', 'venv.Lib.site-packages.pkg_resources.extern', 'venv.Lib.site-packages.pkg_resources._vendor',58 'venv.Lib.site-packages.pkg_resources._vendor.packaging', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.idna',59 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.pytoml', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.certifi', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.chardet',60 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.chardet.cli', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.distlib', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.distlib._backport',61 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.msgpack', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.urllib3', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.urllib3.util',62 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.urllib3.contrib', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.urllib3.contrib._securetransport',63 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.urllib3.packages', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.urllib3.packages.backports',64 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.urllib3.packages.ssl_match_hostname', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.colorama', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.html5lib',65 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.html5lib._trie', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.html5lib.filters', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.html5lib.treewalkers',66 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.html5lib.treeadapters', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.html5lib.treebuilders', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.lockfile',67 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.progress', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.requests', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.packaging',68 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.cachecontrol', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.cachecontrol.caches', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.webencodings',69 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._vendor.pkg_resources', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._internal', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._internal.req',70 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._internal.vcs', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._internal.utils', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._internal.models',71 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._internal.commands', 'venv.Lib.site-packages.pip-10.0.1-py3.6.egg.pip._internal.operations'],72 url='',73 license='',74 author='MXS1113',75 author_email='',76 description='', install_requires=['numpy', 'pandas', 'xlsxwriter']...
install-build-deps.py
Source:install-build-deps.py
1#!/usr/bin/env python2# Copyright 2015 The Chromium Authors. All rights reserved.3# Use of this source code is governed by a BSD-style license that can be4# found in the LICENSE file.5import argparse6import operator7import os8import platform9import re10import subprocess11import sys12SUPPORTED_UBUNTU_VERSIONS = (13 {'number': '12.04', 'codename': 'precise'},14 {'number': '14.04', 'codename': 'trusty'},15 {'number': '14.10', 'codename': 'utopic'},16 {'number': '15.04', 'codename': 'vivid'},17 {'number': '15.10', 'codename': 'wily'},18)19# Packages needed for chromeos only.20_packages_chromeos_dev = (21 'libbluetooth-dev',22 'libxkbcommon-dev',23 'realpath',24)25# Packages needed for development.26_packages_dev = (27 'bison',28 'cdbs',29 'curl',30 'devscripts',31 'dpkg-dev',32 'elfutils',33 'fakeroot',34 'flex',35 'fonts-thai-tlwg',36 'g++',37 'git-core',38 'git-svn',39 'gperf',40 'language-pack-da',41 'language-pack-fr',42 'language-pack-he',43 'language-pack-zh-hant',44 'libapache2-mod-php5',45 'libasound2-dev',46 'libav-tools',47 'libbrlapi-dev',48 'libbz2-dev',49 'libcairo2-dev',50 'libcap-dev',51 'libcups2-dev',52 'libcurl4-gnutls-dev',53 'libdrm-dev',54 'libelf-dev',55 'libgconf2-dev',56 'libglib2.0-dev',57 'libglu1-mesa-dev',58 'libgnome-keyring-dev',59 'libgtk2.0-dev',60 'libkrb5-dev',61 'libnspr4-dev',62 'libnss3-dev',63 'libpam0g-dev',64 'libpci-dev',65 'libpulse-dev',66 'libsctp-dev',67 'libspeechd-dev',68 'libsqlite3-dev',69 'libssl-dev',70 'libudev-dev',71 'libwww-perl',72 'libxslt1-dev',73 'libxss-dev',74 'libxt-dev',75 'libxtst-dev',76 'openbox',77 'patch',78 'perl',79 'php5-cgi',80 'pkg-config',81 'python',82 'python-cherrypy3',83 'python-crypto',84 'python-dev',85 'python-numpy',86 'python-opencv',87 'python-openssl',88 'python-psutil',89 'python-yaml',90 'rpm',91 'ruby',92 'subversion',93 'ttf-dejavu-core',94 'ttf-indic-fonts',95 'ttf-kochi-gothic',96 'ttf-kochi-mincho',97 'wdiff',98 'zip',99)100# Run-time libraries required by chromeos only.101_packages_chromeos_lib = (102 'libbz2-1.0',103 'libpulse0',104)105# Full list of required run-time libraries.106_packages_lib = (107 'libasound2',108 'libatk1.0-0',109 'libc6',110 'libcairo2',111 'libcap2',112 'libcups2',113 'libexpat1',114 'libfontconfig1',115 'libfreetype6',116 'libglib2.0-0',117 'libgnome-keyring0',118 'libgtk2.0-0',119 'libpam0g',120 'libpango1.0-0',121 'libpci3',122 'libpcre3',123 'libpixman-1-0',124 'libpng12-0',125 'libspeechd2',126 'libsqlite3-0',127 'libstdc++6',128 'libx11-6',129 'libx11-xcb1',130 'libxau6',131 'libxcb1',132 'libxcomposite1',133 'libxcursor1',134 'libxdamage1',135 'libxdmcp6',136 'libxext6',137 'libxfixes3',138 'libxi6',139 'libxinerama1',140 'libxrandr2',141 'libxrender1',142 'libxtst6',143 'zlib1g',144)145# Debugging symbols for all of the run-time libraries.146_packages_dbg = (147 'libatk1.0-dbg',148 'libc6-dbg',149 'libcairo2-dbg',150 'libfontconfig1-dbg',151 'libglib2.0-0-dbg',152 'libgtk2.0-0-dbg',153 'libpango1.0-0-dbg',154 'libpcre3-dbg',155 'libpixman-1-0-dbg',156 'libsqlite3-0-dbg',157 'libx11-6-dbg',158 'libx11-xcb1-dbg',159 'libxau6-dbg',160 'libxcb1-dbg',161 'libxcomposite1-dbg',162 'libxcursor1-dbg',163 'libxdamage1-dbg',164 'libxdmcp6-dbg',165 'libxext6-dbg',166 'libxfixes3-dbg',167 'libxi6-dbg',168 'libxinerama1-dbg',169 'libxrandr2-dbg',170 'libxrender1-dbg',171 'libxtst6-dbg',172 'zlib1g-dbg',173)174# 32-bit libraries needed e.g. to compile V8 snapshot for Android or armhf.175_packages_lib32 = (176 'linux-libc-dev:i386',177)178# arm cross toolchain packages needed to build chrome on armhf.179_packages_arm = (180 'g++-arm-linux-gnueabihf',181 'libc6-dev-armhf-cross',182 'linux-libc-dev-armhf-cross',183)184# Packages to build NaCl, its toolchains, and its ports.185_packages_naclports = (186 'ant',187 'autoconf',188 'bison',189 'cmake',190 'gawk',191 'intltool',192 'xsltproc',193 'xutils-dev',194)195_packages_nacl = (196 'g++-mingw-w64-i686',197 'lib32ncurses5-dev',198 'lib32z1-dev',199 'libasound2:i386',200 'libcap2:i386',201 'libelf-dev:i386',202 'libfontconfig1:i386',203 'libgconf-2-4:i386',204 'libglib2.0-0:i386',205 'libgpm2:i386',206 'libgtk2.0-0:i386',207 'libncurses5:i386',208 'libnss3:i386',209 'libpango1.0-0:i386',210 'libssl1.0.0:i386',211 'libtinfo-dev',212 'libtinfo-dev:i386',213 'libtool',214 'libxcomposite1:i386',215 'libxcursor1:i386',216 'libxdamage1:i386',217 'libxi6:i386',218 'libxrandr2:i386',219 'libxss1:i386',220 'libxtst6:i386',221 'texinfo',222 'xvfb',223)224def is_userland_64_bit():225 return platform.architecture()[0] == '64bit'226def package_exists(pkg):227 return pkg in subprocess.check_output(['apt-cache', 'pkgnames']).splitlines()228def lsb_release_short_codename():229 return subprocess.check_output(230 ['lsb_release', '--codename', '--short']).strip()231def write_error(message):232 sys.stderr.write('ERROR: %s\n' % message)233 sys.stderr.flush()234def nonfatal_get_output(*popenargs, **kwargs):235 process = subprocess.Popen(236 stdout=subprocess.PIPE, stderr=subprocess.PIPE, *popenargs, **kwargs)237 stdout, stderr = process.communicate()238 retcode = process.poll()239 return retcode, stdout, stderr240def compute_dynamic_package_lists():241 global _packages_arm242 global _packages_dbg243 global _packages_dev244 global _packages_lib245 global _packages_lib32246 global _packages_nacl247 if is_userland_64_bit():248 # 64-bit systems need a minimum set of 32-bit compat packages249 # for the pre-built NaCl binaries.250 _packages_dev += (251 'lib32gcc1',252 'lib32stdc++6',253 'libc6-i386',254 )255 # When cross building for arm/Android on 64-bit systems the host binaries256 # that are part of v8 need to be compiled with -m32 which means257 # that basic multilib support is needed.258 # gcc-multilib conflicts with the arm cross compiler (at least in trusty)259 # but g++-X.Y-multilib gives us the 32-bit support that we need. Find out260 # the appropriate value of X and Y by seeing what version the current261 # distribution's g++-multilib package depends on.262 output = subprocess.check_output(['apt-cache', 'depends', 'g++-multilib'])263 multilib_package = re.search(r'g\+\+-[0-9.]+-multilib', output).group()264 _packages_lib32 += (multilib_package,)265 lsb_codename = lsb_release_short_codename()266 # Find the proper version of libstdc++6-4.x-dbg.267 if lsb_codename == 'precise':268 _packages_dbg += ('libstdc++6-4.6-dbg',)269 elif lsb_codename == 'trusty':270 _packages_dbg += ('libstdc++6-4.8-dbg',)271 else:272 _packages_dbg += ('libstdc++6-4.9-dbg',)273 # Work around for dependency issue Ubuntu/Trusty: http://crbug.com/435056 .274 if lsb_codename == 'trusty':275 _packages_arm += (276 'g++-4.8-multilib-arm-linux-gnueabihf',277 'gcc-4.8-multilib-arm-linux-gnueabihf',278 )279 # Find the proper version of libgbm-dev. We can't just install libgbm-dev as280 # it depends on mesa, and only one version of mesa can exists on the system.281 # Hence we must match the same version or this entire script will fail.282 mesa_variant = ''283 for variant in ('-lts-trusty', '-lts-utopic'):284 rc, stdout, stderr = nonfatal_get_output(285 ['dpkg-query', '-Wf\'{Status}\'', 'libgl1-mesa-glx' + variant])286 if 'ok installed' in output:287 mesa_variant = variant288 _packages_dev += (289 'libgbm-dev' + mesa_variant,290 'libgl1-mesa-dev' + mesa_variant,291 'libgles2-mesa-dev' + mesa_variant,292 'mesa-common-dev' + mesa_variant,293 )294 if package_exists('ttf-mscorefonts-installer'):295 _packages_dev += ('ttf-mscorefonts-installer',)296 else:297 _packages_dev += ('msttcorefonts',)298 if package_exists('libnspr4-dbg'):299 _packages_dbg += ('libnspr4-dbg', 'libnss3-dbg')300 _packages_lib += ('libnspr4', 'libnss3')301 else:302 _packages_dbg += ('libnspr4-0d-dbg', 'libnss3-1d-dbg')303 _packages_lib += ('libnspr4-0d', 'libnss3-1d')304 if package_exists('libjpeg-dev'):305 _packages_dev += ('libjpeg-dev',)306 else:307 _packages_dev += ('libjpeg62-dev',)308 if package_exists('libudev1'):309 _packages_dev += ('libudev1',)310 _packages_nacl += ('libudev1:i386',)311 else:312 _packages_dev += ('libudev0',)313 _packages_nacl += ('libudev0:i386',)314 if package_exists('libbrlapi0.6'):315 _packages_dev += ('libbrlapi0.6',)316 else:317 _packages_dev += ('libbrlapi0.5',)318 if package_exists('apache2-bin'):319 _packages_dev += ('apache2-bin',)320 else:321 _packages_dev += ('apache2.2-bin',)322 if package_exists('xfonts-mathml'):323 _packages_dev += ('xfonts-mathml',)324 # Some packages are only needed if the distribution actually supports325 # installing them.326 if package_exists('appmenu-gtk'):327 _packages_lib += ('appmenu-gtk',)328 _packages_dev += _packages_chromeos_dev329 _packages_lib += _packages_chromeos_lib330 _packages_nacl += _packages_naclports331def quick_check(packages):332 rc, stdout, stderr = nonfatal_get_output([333 'dpkg-query', '-W', '-f', '${PackageSpec}:${Status}\n'] + list(packages))334 if rc == 0 and not stderr:335 return 0336 print stderr337 return 1338def main(argv):339 parser = argparse.ArgumentParser()340 parser.add_argument('--quick-check', action='store_true',341 help='quickly try to determine if dependencies are '342 'installed (this avoids interactive prompts and '343 'sudo commands so might not be 100% accurate)')344 parser.add_argument('--unsupported', action='store_true',345 help='attempt installation even on unsupported systems')346 args = parser.parse_args(argv)347 lsb_codename = lsb_release_short_codename()348 if not args.unsupported and not args.quick_check:349 if lsb_codename not in map(350 operator.itemgetter('codename'), SUPPORTED_UBUNTU_VERSIONS):351 supported_ubuntus = ['%(number)s (%(codename)s)' % v352 for v in SUPPORTED_UBUNTU_VERSIONS]353 write_error('Only Ubuntu %s are currently supported.' %354 ', '.join(supported_ubuntus))355 return 1356 if platform.machine() not in ('i686', 'x86_64'):357 write_error('Only x86 architectures are currently supported.')358 return 1359 if os.geteuid() != 0 and not args.quick_check:360 print 'Running as non-root user.'361 print 'You might have to enter your password one or more times'362 print 'for \'sudo\'.'363 print364 compute_dynamic_package_lists()365 packages = (_packages_dev + _packages_lib + _packages_dbg + _packages_lib32 +366 _packages_arm + _packages_nacl)367 def packages_key(pkg):368 s = pkg.rsplit(':', 1)369 if len(s) == 1:370 return (s, '')371 return s372 packages = sorted(set(packages), key=packages_key)373 if args.quick_check:374 return quick_check(packages)375 return 0376if __name__ == '__main__':...
test_find_packages.py
Source:test_find_packages.py
1"""Tests for setuptools.find_packages()."""2import os3import sys4import shutil5import tempfile6import platform7import pytest8from . import py3_only9from setuptools.extern.six import PY310from setuptools import find_packages11if PY3:12 from setuptools import find_namespace_packages13# modeled after CPython's test.support.can_symlink14def can_symlink():15 TESTFN = tempfile.mktemp()16 symlink_path = TESTFN + "can_symlink"17 try:18 os.symlink(TESTFN, symlink_path)19 can = True20 except (OSError, NotImplementedError, AttributeError):21 can = False22 else:23 os.remove(symlink_path)24 globals().update(can_symlink=lambda: can)25 return can26def has_symlink():27 bad_symlink = (28 # Windows symlink directory detection is broken on Python 3.229 platform.system() == 'Windows' and sys.version_info[:2] == (3, 2)30 )31 return can_symlink() and not bad_symlink32class TestFindPackages:33 def setup_method(self, method):34 self.dist_dir = tempfile.mkdtemp()35 self._make_pkg_structure()36 def teardown_method(self, method):37 shutil.rmtree(self.dist_dir)38 def _make_pkg_structure(self):39 """Make basic package structure.40 dist/41 docs/42 conf.py43 pkg/44 __pycache__/45 nspkg/46 mod.py47 subpkg/48 assets/49 asset50 __init__.py51 setup.py52 """53 self.docs_dir = self._mkdir('docs', self.dist_dir)54 self._touch('conf.py', self.docs_dir)55 self.pkg_dir = self._mkdir('pkg', self.dist_dir)56 self._mkdir('__pycache__', self.pkg_dir)57 self.ns_pkg_dir = self._mkdir('nspkg', self.pkg_dir)58 self._touch('mod.py', self.ns_pkg_dir)59 self.sub_pkg_dir = self._mkdir('subpkg', self.pkg_dir)60 self.asset_dir = self._mkdir('assets', self.sub_pkg_dir)61 self._touch('asset', self.asset_dir)62 self._touch('__init__.py', self.sub_pkg_dir)63 self._touch('setup.py', self.dist_dir)64 def _mkdir(self, path, parent_dir=None):65 if parent_dir:66 path = os.path.join(parent_dir, path)67 os.mkdir(path)68 return path69 def _touch(self, path, dir_=None):70 if dir_:71 path = os.path.join(dir_, path)72 fp = open(path, 'w')73 fp.close()74 return path75 def test_regular_package(self):76 self._touch('__init__.py', self.pkg_dir)77 packages = find_packages(self.dist_dir)78 assert packages == ['pkg', 'pkg.subpkg']79 def test_exclude(self):80 self._touch('__init__.py', self.pkg_dir)81 packages = find_packages(self.dist_dir, exclude=('pkg.*',))82 assert packages == ['pkg']83 def test_exclude_recursive(self):84 """85 Excluding a parent package should not exclude child packages as well.86 """87 self._touch('__init__.py', self.pkg_dir)88 self._touch('__init__.py', self.sub_pkg_dir)89 packages = find_packages(self.dist_dir, exclude=('pkg',))90 assert packages == ['pkg.subpkg']91 def test_include_excludes_other(self):92 """93 If include is specified, other packages should be excluded.94 """95 self._touch('__init__.py', self.pkg_dir)96 alt_dir = self._mkdir('other_pkg', self.dist_dir)97 self._touch('__init__.py', alt_dir)98 packages = find_packages(self.dist_dir, include=['other_pkg'])99 assert packages == ['other_pkg']100 def test_dir_with_dot_is_skipped(self):101 shutil.rmtree(os.path.join(self.dist_dir, 'pkg/subpkg/assets'))102 data_dir = self._mkdir('some.data', self.pkg_dir)103 self._touch('__init__.py', data_dir)104 self._touch('file.dat', data_dir)105 packages = find_packages(self.dist_dir)106 assert 'pkg.some.data' not in packages107 def test_dir_with_packages_in_subdir_is_excluded(self):108 """109 Ensure that a package in a non-package such as build/pkg/__init__.py110 is excluded.111 """112 build_dir = self._mkdir('build', self.dist_dir)113 build_pkg_dir = self._mkdir('pkg', build_dir)114 self._touch('__init__.py', build_pkg_dir)115 packages = find_packages(self.dist_dir)116 assert 'build.pkg' not in packages117 @pytest.mark.skipif(not has_symlink(), reason='Symlink support required')118 def test_symlinked_packages_are_included(self):119 """120 A symbolically-linked directory should be treated like any other121 directory when matched as a package.122 Create a link from lpkg -> pkg.123 """124 self._touch('__init__.py', self.pkg_dir)125 linked_pkg = os.path.join(self.dist_dir, 'lpkg')126 os.symlink('pkg', linked_pkg)127 assert os.path.isdir(linked_pkg)128 packages = find_packages(self.dist_dir)129 assert 'lpkg' in packages130 def _assert_packages(self, actual, expected):131 assert set(actual) == set(expected)132 @py3_only133 def test_pep420_ns_package(self):134 packages = find_namespace_packages(135 self.dist_dir, include=['pkg*'], exclude=['pkg.subpkg.assets'])136 self._assert_packages(packages, ['pkg', 'pkg.nspkg', 'pkg.subpkg'])137 @py3_only138 def test_pep420_ns_package_no_includes(self):139 packages = find_namespace_packages(140 self.dist_dir, exclude=['pkg.subpkg.assets'])141 self._assert_packages(142 packages, ['docs', 'pkg', 'pkg.nspkg', 'pkg.subpkg'])143 @py3_only144 def test_pep420_ns_package_no_includes_or_excludes(self):145 packages = find_namespace_packages(self.dist_dir)146 expected = [147 'docs', 'pkg', 'pkg.nspkg', 'pkg.subpkg', 'pkg.subpkg.assets']148 self._assert_packages(packages, expected)149 @py3_only150 def test_regular_package_with_nested_pep420_ns_packages(self):151 self._touch('__init__.py', self.pkg_dir)152 packages = find_namespace_packages(153 self.dist_dir, exclude=['docs', 'pkg.subpkg.assets'])154 self._assert_packages(packages, ['pkg', 'pkg.nspkg', 'pkg.subpkg'])155 @py3_only156 def test_pep420_ns_package_no_non_package_dirs(self):157 shutil.rmtree(self.docs_dir)158 shutil.rmtree(os.path.join(self.dist_dir, 'pkg/subpkg/assets'))159 packages = find_namespace_packages(self.dist_dir)...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!