How to use iter_package_paths method in prospector

Best Python code snippet using prospector_python

finder.py

Source:finder.py Github

copy

Full Screen

...27 return self._check(filepath, abspath)28 def iter_file_paths(self, abspath=True, include_ignored=False):29 for filepath in self.files:30 yield os.path.abspath(filepath) if abspath else filepath31 def iter_package_paths(self, abspath=True, include_ignored=False):32 for filepath in self.files:33 yield os.path.abspath(filepath) if abspath else filepath34 def iter_directory_paths(self, abspath=True, include_ignored=False):35 for filepath in self.files:36 filepath = os.path.dirname(filepath)37 yield os.path.abspath(filepath) if abspath else filepath38 def iter_module_paths(self, abspath=True, include_ignored=False):39 for filepath in self.files:40 yield os.path.abspath(filepath) if abspath else filepath41 def to_absolute_path(self, path):42 return os.path.abspath(os.path.join(self.rootpath, path))43 def get_minimal_syspath(self, absolute_paths=True):44 paths = list(set(map(os.path.dirname, self.files)))45 if absolute_paths:46 paths = list(map(os.path.abspath, paths))47 return [self.rootpath] + paths48class FoundFiles(object):49 def __init__(self, rootpath, files, modules, packages, directories, ignores):50 self.rootpath = rootpath51 self._files = files52 self._modules = modules53 self._packages = packages54 self._directories = directories55 self._ignores = ignores56 def _check(self, filepath, pathlist, abspath=True, even_if_ignored=False):57 path = os.path.relpath(filepath, self.rootpath) if abspath else filepath58 for checkpath, ignored in pathlist:59 if path == checkpath:60 if ignored and not even_if_ignored:61 break62 return True63 return False64 def check_module(self, filepath, abspath=True, even_if_ignored=False):65 return self._check(filepath, self._modules, abspath, even_if_ignored)66 def check_package(self, filepath, abspath=True, even_if_ignored=False):67 return self._check(filepath, self._packages, abspath, even_if_ignored)68 def check_file(self, filepath, abspath=True, even_if_ignored=False):69 return self._check(filepath, self._files, abspath, even_if_ignored)70 def _iter_paths(self, pathlist, abspath=True, include_ignored=False):71 for path, ignored in pathlist:72 if ignored and not include_ignored:73 continue74 if abspath:75 path = self.to_absolute_path(path)76 yield path77 def iter_file_paths(self, abspath=True, include_ignored=False):78 return self._iter_paths(self._files, abspath, include_ignored)79 def iter_package_paths(self, abspath=True, include_ignored=False):80 return self._iter_paths(self._packages, abspath, include_ignored)81 def iter_directory_paths(self, abspath=True, include_ignored=False):82 return self._iter_paths(self._directories, abspath, include_ignored)83 def iter_module_paths(self, abspath=True, include_ignored=False):84 return self._iter_paths(self._modules, abspath, include_ignored)85 def to_absolute_path(self, path):86 return os.path.abspath(os.path.join(self.rootpath, path))87 def get_minimal_syspath(self, absolute_paths=True):88 """89 Provide a list of directories that, when added to sys.path, would enable90 any of the discovered python modules to be found91 """92 # firstly, gather a list of the minimum path to each package93 package_list = set()...

Full Screen

Full Screen

setup.py

Source:setup.py Github

copy

Full Screen

...29 """30 Converts path to a package name.31 """32 return path.replace(os.path.sep, '.')33def iter_package_paths() -> Iterable[str]:34 """35 Yields all package paths to install.36 """37 for dirpath, dirnames, filenames in os.walk(PACKAGE):38 if '__init__.py' in filenames:39 yield dirpath40def iter_package_names() -> Iterable[str]:41 """42 Yields all package names to install.43 """44 for dirpath in iter_package_paths():45 yield to_name(dirpath)46def iter_package_data() -> Iterable[Tuple[str, List[str]]]:47 """48 Yields all package data to install.49 """50 for dirpath in iter_package_paths():51 filenames = [52 filename for filename in os.listdir(dirpath)53 if os.path.isfile(os.path.join(dirpath, filename))54 and not filename.endswith('.py')55 ]56 if filenames:57 yield to_name(dirpath), filenames58setup(59 name="fimfarchive",60 version=__version__,61 license=__license__,62 author=__author__,63 author_email='fimfarchive@gmail.com',64 url='http://www.fimfarchive.net/',...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run prospector automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful