8000 matplotlib/setup.py at master · Mrngilles/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
{"payload":{"allShortcutsEnabled":false,"fileTree":{"":{"items":[{"name":".github","path":".github","contentType":"directory"},{"name":"LICENSE","path":"LICENSE","contentType":"directory"},{"name":"ci","path":"ci","contentType":"directory"},{"name":"doc","path":"doc","contentType":"directory"},{"name":"examples","path":"examples","contentType":"directory"},{"name":"extern","path":"extern","contentType":"directory"},{"name":"lib","path":"lib","contentType":"directory"},{"name":"release","path":"release","contentType":"directory"},{"name":"src","path":"src","contentType":"directory"},{"name":"tools","path":"tools","contentType":"directory"},{"name":"unit","path":"unit","contentType":"directory"},{"name":".coveragerc","path":".coveragerc","contentType":"file"},{"name":".gitattributes","path":".gitattributes","contentType":"file"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":".mailmap","path":".mailmap","contentType":"file"},{"name":".travis.yml","path":".travis.yml","contentType":"file"},{"name":"CHANGELOG","path":"CHANGELOG","contentType":"file"},{"name":"CONTRIBUTING.md","path":"CONTRIBUTING.md","contentType":"file"},{"name":"INSTALL","path":"INSTALL","contentType":"file"},{"name":"MANIFEST.in","path":"MANIFEST.in","contentType":"file"},{"name":"Makefile","path":"Makefile","contentType":"file"},{"name":"README.osx","path":"README.osx","contentType":"file"},{"name":"README.rst","path":"README.rst","contentType":"file"},{"name":"README.win.md","path":"README.win.md","contentType":"file"},{"name":"appveyor.yml","path":"appveyor.yml","contentType":"file"},{"name":"boilerplate.py","path":"boilerplate.py","contentType":"file"},{"name":"build_alllocal.cmd","path":"build_alllocal.cmd","contentType":"file"},{"name":"conftest.py","path":"conftest.py","contentType":"file"},{"name":"distribute_setup.py","path":"distribute_setup.py","contentType":"file"},{"name":"doc-requirements.txt","path":"doc-requirements.txt","contentType":"file"},{"name":"license.py","path":"license.py","contentType":"file"},{"name":"matplotlibrc.template","path":"matplotlibrc.template","contentType":"file"},{"name":"pytest.ini","path":"pytest.ini","contentType":"file"},{"name":"setup.cfg.template","path":"setup.cfg.template","contentType":"file"},{"name":"setup.py","path":"setup.py","contentType":"file"},{"name":"setup_external_compile.py","path":"setup_external_compile.py","contentType":"file"},{"name":"setupext.py","path":"setupext.py","contentType":"file"},{"name":"test_only.py","path":"test_only.py","contentType":"file"},{"name":"tests.py","path":"tests.py","contentType":"file"},{"name":"tox.ini","path":"tox.ini","contentType":"file"},{"name":"versioneer.py","path":"versioneer.py","contentType":"file"},{"name":"visual_tests.py","path":"visual_tests.py","contentType":"file"}],"totalCount":42}},"fileTreeProcessingTime":11.22973,"foldersToFetch":[],"incompleteFileTree":false,"repo":{"id":31761873,"defaultBranch":"master","name":"matplotlib","ownerLogin":"Mrngilles","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2015-03-06T09:23:02.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/6099267?v=4","public":true,"private":false,"isOrgOwned":false},"codeLineWrapEnabled":false,"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"master","listCacheKey":"v0:1438378601.0","canEdit":false,"refType":"branch","currentOid":"3235300c3fa79e3a1ef417e89ec9e19c75fde3ae"},"path":"setup.py","currentUser":null,"blob":{"rawLines":["\"\"\"","The matplotlib build options can be modified with a setup.cfg file. See","setup.cfg.template for more information.","\"\"\"","","from __future__ import print_function, absolute_import","from string import Template","# This needs to be the very first thing to use distribute","from distribute_setup import use_setuptools","use_setuptools()","from setuptools.command.test import test as TestCommand","from setuptools.command.build_ext import build_ext as BuildExtCommand","","import sys","","# distutils is breaking our sdists for files in symlinked dirs.","# distutils will copy if os.link is not available, so this is a hack","# to force copying","import os","try:"," del os.link","except AttributeError:"," pass","","# This 'if' statement is needed to prevent spawning infinite processes","# on Windows","if __name__ == '__main__':"," # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly"," # update it when the contents of directories change."," if os.path.exists('MANIFEST'):"," os.remove('MANIFEST')","","try:"," from setuptools import setup","except ImportError:"," try:"," from setuptools.core import setup"," except ImportError:"," from distutils.core import setup","","# The setuptools version of sdist adds a setup.cfg file to the tree.","# We don't want that, so we simply remove it, and it will fall back to","# vanilla distutils.","try:"," from setuptools.command import sdist","except ImportError:"," pass","else:"," del sdist.sdist.make_release_tree","","from distutils.dist import Distribution","","import setupext","from setupext import print_line, print_raw, print_message, print_status","","# Get the version from versioneer","import versioneer","__version__ = versioneer.get_version()","","","# These are the packages in the order we want to display them. This","# list may contain strings to create section headers for the display.","mpl_packages = ["," 'Building Matplotlib',"," setupext.Matplotlib(),"," setupext.Python(),"," setupext.Platform(),"," 'Required dependencies and extensions',"," setupext.Numpy(),"," setupext.Six(),"," setupext.Dateutil(),"," setupext.FuncTools32(),"," setupext.Subprocess32(),"," setupext.Pytz(),"," setupext.Cycler(),"," setupext.Tornado(),"," setupext.Pyparsing(),"," setupext.LibAgg(),"," setupext.FreeType(),"," setupext.FT2Font(),"," setupext.Png(),"," setupext.Qhull(),"," setupext.Image(),"," setupext.TTConv(),"," setupext.Path(),"," setupext.ContourLegacy(),"," setupext.Contour(),"," setupext.QhullWrap(),"," setupext.Tri(),"," 'Optional subpackages',"," setupext.SampleData(),"," setupext.Toolkits(),"," setupext.Tests(),"," setupext.Toolkits_Tests(),"," 'Optional backend extensions',"," # These backends are listed in order of preference, the first"," # being the most preferred. The first one that looks like it will"," # work will be selected as the default backend."," setupext.BackendMacOSX(),"," setupext.BackendQt5(),"," setupext.BackendQt4(),"," setupext.BackendGtk3Agg(),"," setupext.BackendGtk3Cairo(),"," setupext.BackendGtkAgg(),"," setupext.BackendTkAgg(),"," setupext.BackendWxAgg(),"," setupext.BackendGtk(),"," setupext.BackendAgg(),"," setupext.BackendCairo(),"," setupext.Windowing(),"," 'Optional LaTeX dependencies',"," setupext.DviPng(),"," setupext.Ghostscript(),"," setupext.LaTeX(),"," setupext.PdfToPs(),"," 'Optional package data',"," setupext.Dlls(),"," ]","","","classifiers = ["," 'Development Status :: 5 - Production/Stable',"," 'Intended Audience :: Science/Research',"," 'License :: OSI Approved :: Python Software Foundation License',"," 'Programming Language :: Python',"," 'Programming Language :: Python :: 2.7',"," 'Programming Language :: Python :: 3',"," 'Programming Language :: Python :: 3.3',"," 'Programming Language :: Python :: 3.4',"," 'Programming Language :: Python :: 3.5',"," 'Topic :: Scientific/Engineering :: Visualization',"," ]","","","class NoopTestCommand(TestCommand):"," def run(self):"," print(\"Matplotlib does not support running tests with \""," \"'python setup.py test'. Please run 'python tests.py'\")","","","class BuildExtraLibraries(BuildExtCommand):"," def run(self):"," for package in good_packages:"," package.do_custom_build()",""," return BuildExtCommand.run(self)","","","cmdclass = versioneer.get_cmdclass()","cmdclass['test'] = NoopTestCommand","cmdclass['build_ext'] = BuildExtraLibraries","","# One doesn't normally see `if __name__ == '__main__'` blocks in a setup.py,","# however, this is needed on Windows to avoid creating infinite subprocesses","# when using multiprocessing.","if __name__ == '__main__':"," # These are distutils.setup parameters that the various packages add"," # things to."," packages = []"," namespace_packages = []"," py_modules = []"," ext_modules = []"," package_data = {}"," package_dir = {'': 'lib'}"," install_requires = []"," setup_requires = []"," default_backend = None",""," # If the user just queries for information, don't bother figuring out which"," # packages to build or install."," if (any('--' + opt in sys.argv for opt in"," Distribution.display_option_names + ['help']) or"," 'clean' in sys.argv):"," setup_requires = []"," else:"," # Go through all of the packages and figure out which ones we are"," # going to build/install."," print_line()"," print_raw(\"Edit setup.cfg to change the build options\")",""," required_failed = []"," good_packages = []"," for package in mpl_packages:"," if isinstance(package, str):"," print_raw('')"," print_raw(package.upper())"," else:"," try:"," result = package.check()"," if result is not None:"," message = 'yes [%s]' % result"," print_status(package.name, message)"," except setupext.CheckFailed as e:"," msg = str(e).strip()"," if len(msg):"," print_status(package.name, 'no [%s]' % msg)"," else:"," print_status(package.name, 'no')"," if not package.optional:"," required_failed.append(package)"," else:"," good_packages.append(package)"," if (isinstance(package, setupext.OptionalBackendPackage) and"," package.runtime_check() and"," default_backend is None):"," default_backend = package.name"," print_raw('')",""," # Abort if any of the required packages can not be built."," if required_failed:"," print_line()"," message = (\"The following required packages can not \""," \"be built: %s\" %"," \", \".join(x.name for x in required_failed))"," for pkg in required_failed:"," pkg_help = pkg.install_help_msg()"," if pkg_help:"," message += \"\\n* \" + pkg_help"," print_message(message)"," sys.exit(1)",""," # Now collect all of the information we need to build all of the"," # packages."," for package in good_packages:"," packages.extend(package.get_packages())"," namespace_packages.extend(package.get_namespace_packages())"," py_modules.extend(package.get_py_modules())"," ext = package.get_extension()"," if ext is not None:"," ext_modules.append(ext)"," data = package.get_package_data()"," for key, val in data.items():"," package_data.setdefault(key, [])"," package_data[key] = list(set(val + package_data[key]))"," install_requires.extend(package.get_install_requires())"," setup_requires.extend(package.get_setup_requires())",""," # Write the default matplotlibrc file"," if default_backend is None:"," default_backend = 'svg'"," if setupext.options['backend']:"," default_backend = setupext.options['backend']"," with open('matplotlibrc.template') as fd:"," template = fd.read()"," template = Template(template)"," with open('lib/matplotlib/mpl-data/matplotlibrc', 'w') as fd:"," fd.write(template.safe_substitute(TEMPLATE_BACKEND=default_backend))",""," # Build in verbose mode if requested"," if setupext.options['verbose']:"," for mod in ext_modules:"," mod.extra_compile_args.append('-DVERBOSE')",""," # Finalize the extension modules so they can get the Numpy include"," # dirs"," for mod in ext_modules:"," mod.finalize()",""," extra_args = {}",""," # Finally, pass this all along to distutils to do the heavy lifting."," distrib = setup("," name=\"matplotlib\","," version=__version__,"," description=\"Python plotting package\","," author=\"John D. Hunter, Michael Droettboom\","," author_email=\"matplotlib-users@python.org\","," url=\"http://matplotlib.org\","," long_description=\"\"\""," matplotlib strives to produce publication quality 2D graphics"," for interactive graphing, scientific publishing, user interface"," development and web application servers targeting multiple user"," interfaces and hardcopy output formats. There is a 'pylab' mode"," which emulates matlab graphics."," \"\"\","," license=\"BSD\","," packages=packages,"," namespace_packages=namespace_packages,"," platforms='any',"," py_modules=py_modules,"," ext_modules=ext_modules,"," package_dir=package_dir,"," package_data=package_data,"," include_package_data=True,"," data_files=["," ('share/jupyter/nbextensions/matplotlib', ["," 'lib/matplotlib/backends/web_backend/js/extension.js',"," 'lib/matplotlib/backends/web_backend/js/nbagg_mpl.js',"," 'lib/matplotlib/backends/web_backend/js/mpl.js',"," ]),"," ],"," classifiers=classifiers,"," download_url=\"http://matplotlib.org/users/installing.html\",",""," # List third-party Python packages that we require"," install_requires=install_requires,"," setup_requires=setup_requires,",""," # matplotlib has C/C++ extensions, so it's not zip safe."," # Telling setuptools this prevents it from doing an automatic"," # check for zip safety."," zip_safe=False,"," cmdclass=cmdclass,"," **extra_args"," )"],"stylingDirectives":null,"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/Mrngilles/matplotlib/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"setup.py","displayUrl":"https://github.com/Mrngilles/matplotlib/blob/master/setup.py?raw=true","headerInfo":{"blobSize":"10.2 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":"https://desktop.github.com","isGitLfs":false,"onBranch":true,"shortPath":"fd93516","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2FMrngilles%2Fmatplotlib%2Fblob%2Fmaster%2Fsetup.py","isCSV":false,"isRichtext":false,"toc":null,"lineInfo":{"truncatedLoc":"305","truncatedSloc":"273"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"Python","languageID":303,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/Mrngilles/matplotlib/blob/master/setup.py","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/Mrngilles/matplotlib/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/Mrngilles/matplotlib/raw/refs/heads/master/setup.py","renderImageOrRaw":false,"richText":null,"renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":{"timed_out":false,"not_analyzed":false,"symbols":[{"name":"__version__","kind":"constant","ident_start":1629,"ident_end":1640,"extent_start":1629,"extent_end":1667,"fully_qualified_name":"__version__","ident_utf16":{"start":{"line_number":57,"utf16_col":0},"end":{"line_number":57,"utf16_col":11}},"extent_utf16":{"start":{"line_number":57,"utf16_col":0},"end":{"line_number":57,"utf16_col":38}}},{"name":"mpl_packages","kind":"constant","ident_start":1809,"ident_end":1821,"extent_start":1809,"extent_end":3359,"fully_qualified_name":"mpl_packages","ident_utf16":{"start":{"line_number":62,"utf16_col":0},"end":{"line_number":62,"utf16_col":12}},"extent_utf16":{"start":{"line_number":62,"utf16_col":0},"end":{"line_number":117,"utf16_col":5}}},{"name":"classifiers","kind":"constant","ident_start":3362,"ident_end":3373,"extent_start":3362,"extent_end":3865,"fully_qualified_name":"classifiers","ident_utf16":{"start":{"line_number":120,"utf16_col":0},"end":{"line_number":120,"utf16_col":11}},"extent_utf16":{"start":{"line_number":120,"utf16_col":0},"end":{"line_number":131,"utf16_col":5}}},{"name":"NoopTestCommand","kind":"class","ident_start":3874,"ident_end":3889,"extent_start":3868,"extent_end":4056,"fully_qualified_name":"NoopTestCommand","ident_utf16":{"start":{"line_number":134,"utf16_col":6},"end":{"line_number":134,"utf16_col":21}},"extent_utf16":{"start":{"line_number":134,"utf16_col":0},"end":{"line_number":137,"utf16_col":69}}},{"name":"run","kind":"function","ident_start":3912,"ident_end":3915,"extent_start":3908,"extent_end":4056,"fully_qualified_name":"NoopTestCommand.run","ident_utf16":{"start":{"line_number":135,"utf16_col":8},"end":{"line_number":135,"utf16_col":11}},"extent_utf16":{"start":{"line_number":135,"utf16_col":4},"end":{"line_number":137,"utf16_col":69}}},{"name":"BuildExtraLibraries","kind":"class","ident_start":4065,"ident_end":4084,"extent_start":4059,"extent_end":4239,"fully_qualified_name":"BuildExtraLibraries","ident_utf16":{"start":{"line_number":140,"utf16_col":6},"end":{"line_number":140,"utf16_col":25}},"extent_utf16":{"start":{"line_number":140,"utf16_col":0},"end":{"line_number":145,"utf16_col":40}}},{"name":"run","kind":"function","ident_start":4111,"ident_end":4114,"extent_start":4107,"extent_end":4239,"fully_qualified_name":"BuildExtraLibraries.run","ident_utf16":{"start":{"line_number":141,"utf16_col":8},"end":{"line_number":141,"utf16_col":11}},"extent_utf16":{"start":{"line_number":141,"utf16_col":4},"end":{"line_number":145,"utf16_col":40}}},{"name":"cmdclass","kind":"constant","ident_start":4242,"ident_end":4250,"extent_start":4242,"extent_end":4278,"fully_qualified_name":"cmdclass","ident_utf16":{"start":{"line_number":148,"utf16_col":0},"end":{"line_number":148,"utf16_col":8}},"extent_utf16":{"start":{"line_number":148,"utf16_col":0},"end":{"line_number":148,"utf16_col":36}}}]}},"copilotInfo":null,"copilotAccessAllowed":false,"modelsAccessAllowed":false,"modelsRepoIntegrationEnabled":false,"csrf_tokens":{"/Mrngilles/matplotlib/branches":{"post":"Mr-iSBCiylRxetHKFkYvJAHtMdnWbmzzC-Fuv6gzvXo0cF5M3XpwtgUgGwQSgRDWvF7_qwi9s55wsEzSaHEN4w"},"/repos/preferences":{"post":"yb6S3Xi0bAWPbS-jBLKH2vxe84cxYYrXSaHBYAZwPseoZ5o1qjxomF7SFzvP9CnOmDiQUEqnzpPI5iyfdSgWLw"}}},"title":"matplotlib/setup.py at master · Mrngilles/matplotlib","appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-7d7eb7c71814.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-1ae9fa256942.js","githubDevUrl":null,"enabled_features":{"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true,"github_models_repo_integration":false}}}
0