summaryrefslogtreecommitdiff
path: root/astroid/modutils.py
Commit message (Collapse)AuthorAgeFilesLines
* Move from % syntax to format or f-stringsPierre Sassoulas2021-02-171-2/+2
| | | | This is possible with python 3.6
* Remove the # coding, since PEP3120 the default is UTF8Pierre Sassoulas2021-02-171-1/+0
|
* Removes insecable whitespaceshippo912020-12-291-8/+8
|
* Formatting according to blackhippo912020-12-281-8/+8
|
* Adds copyright noticehippo912020-12-281-0/+1
|
* Adds comment to explain the use of sys.base_prefixhippo912020-12-281-3/+11
|
* Seems like the only way to have a valid get_python_lib(standard_lib=True) ↵hippo912020-12-281-0/+1
| | | | with pypy is to specifiy the prefix = sys.base_prefix
* sys.real_prefix doesn't exist anymore with recent version of venv. Use ↵hippo912020-12-281-1/+1
| | | | base_prefix instead
* Adds print to debug travis failure with pyphippo912020-12-281-0/+3
|
* New copyright noticeshippo912020-12-271-0/+1
|
* Remove dependency on imp.Peter Kolbus2020-11-271-79/+29
|
* Add missing copyright annotations for the past releasesClaudiu Popa2020-04-271-1/+5
|
* Add an optional `path` parameter to `modpath_from_file`Claudiu Popa2020-03-111-16/+21
| | | | | | | Because we'll no longer have the current working directory, nor the module's directory in `sys.path`, we need to be able to pass additional paths to be checked against when trying to load a module. Most of the functions in this module already accepted a `path` parameter, except `modpath_from_file`.
* Kill `extrapath` from various `modutils` functions as it was not usedClaudiu Popa2020-03-111-25/+8
|
* Remove redundant compatibility code (#693)Hugo van Kemenade2019-09-101-4/+0
|
* make is_standard_module() properly classify extensions (#659)markmcclain2019-03-291-3/+4
| | | | | | | | | | | | Extensions can be installed in either a platform independent or specific location[1]. The search is updated to include both paths. Previously, an extension in the platform specific location would be misclassified because only the independent location was considered and the platform specific location shared a prefix with the standard lib. [1] http://docs.python.org/3/distutils/apiref.html#distutils.sysconfig.get_python_lib Fixes Issue: #658 Co-authored-by: Matt Story <s.matt.story@gmail.com>
* Optimize _is_python_file check using tuple (#657)BasPH2019-03-271-4/+1
|
* Initial formatting of astroidClaudiu Popa2018-10-021-60/+73
|
* Spelling fixesVille Skyttä2018-07-241-1/+1
|
* Update the copyright noticesastroid-2.0Claudiu Popa2018-07-151-1/+9
|
* Include abspath of sys.path on searches at load_from_moduleMario Corchero2018-07-051-2/+4
| | | | | | | | | | At the moment `load_from_module` is resolving all paths in `sys.path` to validate that the module being import is in a folder part of the path. This is done to resolve symlinks. This can be an issue though it both the file being imported and the path in `sys.path` resolve to different locations. Even if the symlinks are importable, the resolution of the paths in `sys.path` might not.
* Fix lintingClaudiu Popa2018-06-141-4/+3
|
* Remove six from a couple of filesClaudiu Popa2018-05-311-4/+2
|
* pyupgrade (#549)Anthony Sottile2018-05-221-2/+2
|
* Fix import of symlinks outside of path with modutils (#546)Mario Corchero2018-05-151-12/+49
| | | | | | | | | Makes load_module_from_file able to import files within the path that are just a symlink to a file outside of the path. modutils is using realpath at the moment which will resolve the symlink and don't allow the import as the file is detected outside of the available paths. By checking both abspath and realpath this patches add support for such scenarios.
* Ignore directories found in blacklistClaudiu Popa2017-10-121-0/+2
| | | | Close PyCQA/pylint#1700
* Remove pylint errorsDerek Gustafson2016-12-031-8/+3
|
* Use sys.base_exec_prefix in case sys.real_prefix is not definedClaudiu Popa2016-12-031-2/+10
| | | | | | | | sys.real_prefix is an addition of the *virtualenv* library, but it is not added when a virtual environment is created with the builtin *venv* library. In the latter's case, sys.base_exec_prefix is the one pointing to the original installation of Python. Now, in case sys.real_prefix is not defined, we fallback to sys.base_exec_prefix.
* Use the correct _replace member. Thanks to @dirthead for finding the bug. ↵Claudiu Popa2016-10-241-1/+1
| | | | Close #368
* Export two helpers for verifying the type of a spec.Claudiu Popa2016-08-241-0/+7
|
* Move the spec finder under a new namespace, interpreter._import.Claudiu Popa2016-08-241-261/+21
|
* Add support for discovering .pth file created by certain namespace packages.Claudiu Popa2016-08-241-4/+25
|
* Even more granular copyrights (thanks to copyrite)Claudiu Popa2016-07-221-2/+7
|
* Keep a consistent copyright notice across the board.Claudiu Popa2016-07-191-0/+2
|
* Fix typosJakub Wilk2016-06-021-10/+10
|
* Try to canonicalize the lookup paths as well.Claudiu Popa2016-06-011-2/+9
|
* Canonicalize file paths in modpath_from_file, this should help when ↵Claudiu Popa2016-05-311-1/+2
| | | | | | receiving symlinks and whatnot. Close PyCQA/pylint#791
* Remove superfluous boilerplate the first regex missedCeridwen2016-05-171-17/+0
|
* Convert all files to new license headerCeridwen2016-05-161-0/+3
|
* Don't look for namespace packages implicitly into functions doing concrete ↵Claudiu Popa2016-05-101-21/+26
| | | | imports.
* Implicit namespace package support for modpath_from_file for Python 3.3+.Claudiu Popa2016-05-091-2/+4
|
* Improve the message.Claudiu Popa2016-05-081-3/+1
|
* Support namespace packages only for versions with the module spec feature ↵Claudiu Popa2016-05-081-1/+1
| | | | implemented.
* Don't introduce empty values for non-zip importers in path_importer_cache ↵Claudiu Popa2016-05-081-2/+2
| | | | and add a test for implicit namespace packages.
* Switch to a spec finder protocol for finding files or packagesClaudiu Popa2016-05-081-106/+209
|
* Add /usr/lib and /usr/lib64 to the list of stdlib pathsClaudiu Popa2015-12-211-6/+23
|
* Add lib_pypy from the real installation of PythonClaudiu Popa2015-12-151-0/+5
| | | | | | | This solves a problem with pypy and virtualenv, the latter deciding not to copy some of the modules into the virtual environment, such as datetime, which means that STD_LIB_DIRS needs to be updated in order to look there as well.
* Move code which doesn't trigger DistutilsPlatformError outside of the try block.Claudiu Popa2015-12-151-11/+12
|
* Improve the detection of lib_pypy, which was faulty.Claudiu Popa2015-12-151-2/+3
|
* Add lib_pypy into the list of standard library modules for PyPyClaudiu Popa2015-12-151-0/+3
| | | | | | Unfortunately it is not detected in any way by distutils.sysconfig.get_python_lib. This can detect datetime as a builtin module on PyPy.