diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/bdist.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/bdist.py new file mode 100644 index 0000000000000000000000000000000000000000..60309e1ff2fce3a50f2c5bcd79c0b8f0f642226d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/bdist.py @@ -0,0 +1,138 @@ +"""distutils.command.bdist + +Implements the Distutils 'bdist' command (create a built [binary] +distribution).""" + +import os +from distutils.core import Command +from distutils.errors import * +from distutils.util import get_platform + + +def show_formats(): + """Print list of available formats (arguments to "--format" option). + """ + from distutils.fancy_getopt import FancyGetopt + formats = [] + for format in bdist.format_commands: + formats.append(("formats=" + format, None, + bdist.format_command[format][1])) + pretty_printer = FancyGetopt(formats) + pretty_printer.print_help("List of available distribution formats:") + + +class bdist(Command): + + description = "create a built (binary) distribution" + + user_options = [('bdist-base=', 'b', + "temporary directory for creating built distributions"), + ('plat-name=', 'p', + "platform name to embed in generated filenames " + "(default: %s)" % get_platform()), + ('formats=', None, + "formats for distribution (comma-separated list)"), + ('dist-dir=', 'd', + "directory to put final built distributions in " + "[default: dist]"), + ('skip-build', None, + "skip rebuilding everything (for testing/debugging)"), + ('owner=', 'u', + "Owner name used when creating a tar file" + " [default: current user]"), + ('group=', 'g', + "Group name used when creating a tar file" + " [default: current group]"), + ] + + boolean_options = ['skip-build'] + + help_options = [ + ('help-formats', None, + "lists available distribution formats", show_formats), + ] + + # The following commands do not take a format option from bdist + no_format_option = ('bdist_rpm',) + + # This won't do in reality: will need to distinguish RPM-ish Linux, + # Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS. + default_format = {'posix': 'gztar', + 'nt': 'zip'} + + # Establish the preferred order (for the --help-formats option). + format_commands = ['rpm', 'gztar', 'bztar', 'xztar', 'ztar', 'tar', 'zip'] + + # And the real information. + format_command = {'rpm': ('bdist_rpm', "RPM distribution"), + 'gztar': ('bdist_dumb', "gzip'ed tar file"), + 'bztar': ('bdist_dumb', "bzip2'ed tar file"), + 'xztar': ('bdist_dumb', "xz'ed tar file"), + 'ztar': ('bdist_dumb', "compressed tar file"), + 'tar': ('bdist_dumb', "tar file"), + 'zip': ('bdist_dumb', "ZIP file"), + } + + def initialize_options(self): + self.bdist_base = None + self.plat_name = None + self.formats = None + self.dist_dir = None + self.skip_build = 0 + self.group = None + self.owner = None + + def finalize_options(self): + # have to finalize 'plat_name' before 'bdist_base' + if self.plat_name is None: + if self.skip_build: + self.plat_name = get_platform() + else: + self.plat_name = self.get_finalized_command('build').plat_name + + # 'bdist_base' -- parent of per-built-distribution-format + # temporary directories (eg. we'll probably have + # "build/bdist./dumb", "build/bdist./rpm", etc.) + if self.bdist_base is None: + build_base = self.get_finalized_command('build').build_base + self.bdist_base = os.path.join(build_base, + 'bdist.' + self.plat_name) + + self.ensure_string_list('formats') + if self.formats is None: + try: + self.formats = [self.default_format[os.name]] + except KeyError: + raise DistutilsPlatformError( + "don't know how to create built distributions " + "on platform %s" % os.name) + + if self.dist_dir is None: + self.dist_dir = "dist" + + def run(self): + # Figure out which sub-commands we need to run. + commands = [] + for format in self.formats: + try: + commands.append(self.format_command[format][0]) + except KeyError: + raise DistutilsOptionError("invalid format '%s'" % format) + + # Reinitialize and run each command. + for i in range(len(self.formats)): + cmd_name = commands[i] + sub_cmd = self.reinitialize_command(cmd_name) + if cmd_name not in self.no_format_option: + sub_cmd.format = self.formats[i] + + # passing the owner and group names for tar archiving + if cmd_name == 'bdist_dumb': + sub_cmd.owner = self.owner + sub_cmd.group = self.group + + # If we're going to need to run this command again, tell it to + # keep its temporary files around so subsequent runs go faster. + if cmd_name in commands[i+1:]: + sub_cmd.keep_temp = 1 + self.run_command(cmd_name) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/bdist_dumb.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/bdist_dumb.py new file mode 100644 index 0000000000000000000000000000000000000000..f0d6b5b8cd8ab3ceb772a6e9f962bbce0bc8c1d2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/bdist_dumb.py @@ -0,0 +1,123 @@ +"""distutils.command.bdist_dumb + +Implements the Distutils 'bdist_dumb' command (create a "dumb" built +distribution -- i.e., just an archive to be unpacked under $prefix or +$exec_prefix).""" + +import os +from distutils.core import Command +from distutils.util import get_platform +from distutils.dir_util import remove_tree, ensure_relative +from distutils.errors import * +from distutils.sysconfig import get_python_version +from distutils import log + +class bdist_dumb(Command): + + description = "create a \"dumb\" built distribution" + + user_options = [('bdist-dir=', 'd', + "temporary directory for creating the distribution"), + ('plat-name=', 'p', + "platform name to embed in generated filenames " + "(default: %s)" % get_platform()), + ('format=', 'f', + "archive format to create (tar, gztar, bztar, xztar, " + "ztar, zip)"), + ('keep-temp', 'k', + "keep the pseudo-installation tree around after " + + "creating the distribution archive"), + ('dist-dir=', 'd', + "directory to put final built distributions in"), + ('skip-build', None, + "skip rebuilding everything (for testing/debugging)"), + ('relative', None, + "build the archive using relative paths " + "(default: false)"), + ('owner=', 'u', + "Owner name used when creating a tar file" + " [default: current user]"), + ('group=', 'g', + "Group name used when creating a tar file" + " [default: current group]"), + ] + + boolean_options = ['keep-temp', 'skip-build', 'relative'] + + default_format = { 'posix': 'gztar', + 'nt': 'zip' } + + def initialize_options(self): + self.bdist_dir = None + self.plat_name = None + self.format = None + self.keep_temp = 0 + self.dist_dir = None + self.skip_build = None + self.relative = 0 + self.owner = None + self.group = None + + def finalize_options(self): + if self.bdist_dir is None: + bdist_base = self.get_finalized_command('bdist').bdist_base + self.bdist_dir = os.path.join(bdist_base, 'dumb') + + if self.format is None: + try: + self.format = self.default_format[os.name] + except KeyError: + raise DistutilsPlatformError( + "don't know how to create dumb built distributions " + "on platform %s" % os.name) + + self.set_undefined_options('bdist', + ('dist_dir', 'dist_dir'), + ('plat_name', 'plat_name'), + ('skip_build', 'skip_build')) + + def run(self): + if not self.skip_build: + self.run_command('build') + + install = self.reinitialize_command('install', reinit_subcommands=1) + install.root = self.bdist_dir + install.skip_build = self.skip_build + install.warn_dir = 0 + + log.info("installing to %s", self.bdist_dir) + self.run_command('install') + + # And make an archive relative to the root of the + # pseudo-installation tree. + archive_basename = "%s.%s" % (self.distribution.get_fullname(), + self.plat_name) + + pseudoinstall_root = os.path.join(self.dist_dir, archive_basename) + if not self.relative: + archive_root = self.bdist_dir + else: + if (self.distribution.has_ext_modules() and + (install.install_base != install.install_platbase)): + raise DistutilsPlatformError( + "can't make a dumb built distribution where " + "base and platbase are different (%s, %s)" + % (repr(install.install_base), + repr(install.install_platbase))) + else: + archive_root = os.path.join(self.bdist_dir, + ensure_relative(install.install_base)) + + # Make the archive + filename = self.make_archive(pseudoinstall_root, + self.format, root_dir=archive_root, + owner=self.owner, group=self.group) + if self.distribution.has_ext_modules(): + pyversion = get_python_version() + else: + pyversion = 'any' + self.distribution.dist_files.append(('bdist_dumb', pyversion, + filename)) + + if not self.keep_temp: + remove_tree(self.bdist_dir, dry_run=self.dry_run) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/bdist_rpm.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/bdist_rpm.py new file mode 100644 index 0000000000000000000000000000000000000000..550cbfa1e28a2376fe1b4f994bce86b446c0916e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/bdist_rpm.py @@ -0,0 +1,579 @@ +"""distutils.command.bdist_rpm + +Implements the Distutils 'bdist_rpm' command (create RPM source and binary +distributions).""" + +import subprocess, sys, os +from distutils.core import Command +from distutils.debug import DEBUG +from distutils.file_util import write_file +from distutils.errors import * +from distutils.sysconfig import get_python_version +from distutils import log + +class bdist_rpm(Command): + + description = "create an RPM distribution" + + user_options = [ + ('bdist-base=', None, + "base directory for creating built distributions"), + ('rpm-base=', None, + "base directory for creating RPMs (defaults to \"rpm\" under " + "--bdist-base; must be specified for RPM 2)"), + ('dist-dir=', 'd', + "directory to put final RPM files in " + "(and .spec files if --spec-only)"), + ('python=', None, + "path to Python interpreter to hard-code in the .spec file " + "(default: \"python\")"), + ('fix-python', None, + "hard-code the exact path to the current Python interpreter in " + "the .spec file"), + ('spec-only', None, + "only regenerate spec file"), + ('source-only', None, + "only generate source RPM"), + ('binary-only', None, + "only generate binary RPM"), + ('use-bzip2', None, + "use bzip2 instead of gzip to create source distribution"), + + # More meta-data: too RPM-specific to put in the setup script, + # but needs to go in the .spec file -- so we make these options + # to "bdist_rpm". The idea is that packagers would put this + # info in setup.cfg, although they are of course free to + # supply it on the command line. + ('distribution-name=', None, + "name of the (Linux) distribution to which this " + "RPM applies (*not* the name of the module distribution!)"), + ('group=', None, + "package classification [default: \"Development/Libraries\"]"), + ('release=', None, + "RPM release number"), + ('serial=', None, + "RPM serial number"), + ('vendor=', None, + "RPM \"vendor\" (eg. \"Joe Blow \") " + "[default: maintainer or author from setup script]"), + ('packager=', None, + "RPM packager (eg. \"Jane Doe \") " + "[default: vendor]"), + ('doc-files=', None, + "list of documentation files (space or comma-separated)"), + ('changelog=', None, + "RPM changelog"), + ('icon=', None, + "name of icon file"), + ('provides=', None, + "capabilities provided by this package"), + ('requires=', None, + "capabilities required by this package"), + ('conflicts=', None, + "capabilities which conflict with this package"), + ('build-requires=', None, + "capabilities required to build this package"), + ('obsoletes=', None, + "capabilities made obsolete by this package"), + ('no-autoreq', None, + "do not automatically calculate dependencies"), + + # Actions to take when building RPM + ('keep-temp', 'k', + "don't clean up RPM build directory"), + ('no-keep-temp', None, + "clean up RPM build directory [default]"), + ('use-rpm-opt-flags', None, + "compile with RPM_OPT_FLAGS when building from source RPM"), + ('no-rpm-opt-flags', None, + "do not pass any RPM CFLAGS to compiler"), + ('rpm3-mode', None, + "RPM 3 compatibility mode (default)"), + ('rpm2-mode', None, + "RPM 2 compatibility mode"), + + # Add the hooks necessary for specifying custom scripts + ('prep-script=', None, + "Specify a script for the PREP phase of RPM building"), + ('build-script=', None, + "Specify a script for the BUILD phase of RPM building"), + + ('pre-install=', None, + "Specify a script for the pre-INSTALL phase of RPM building"), + ('install-script=', None, + "Specify a script for the INSTALL phase of RPM building"), + ('post-install=', None, + "Specify a script for the post-INSTALL phase of RPM building"), + + ('pre-uninstall=', None, + "Specify a script for the pre-UNINSTALL phase of RPM building"), + ('post-uninstall=', None, + "Specify a script for the post-UNINSTALL phase of RPM building"), + + ('clean-script=', None, + "Specify a script for the CLEAN phase of RPM building"), + + ('verify-script=', None, + "Specify a script for the VERIFY phase of the RPM build"), + + # Allow a packager to explicitly force an architecture + ('force-arch=', None, + "Force an architecture onto the RPM build process"), + + ('quiet', 'q', + "Run the INSTALL phase of RPM building in quiet mode"), + ] + + boolean_options = ['keep-temp', 'use-rpm-opt-flags', 'rpm3-mode', + 'no-autoreq', 'quiet'] + + negative_opt = {'no-keep-temp': 'keep-temp', + 'no-rpm-opt-flags': 'use-rpm-opt-flags', + 'rpm2-mode': 'rpm3-mode'} + + + def initialize_options(self): + self.bdist_base = None + self.rpm_base = None + self.dist_dir = None + self.python = None + self.fix_python = None + self.spec_only = None + self.binary_only = None + self.source_only = None + self.use_bzip2 = None + + self.distribution_name = None + self.group = None + self.release = None + self.serial = None + self.vendor = None + self.packager = None + self.doc_files = None + self.changelog = None + self.icon = None + + self.prep_script = None + self.build_script = None + self.install_script = None + self.clean_script = None + self.verify_script = None + self.pre_install = None + self.post_install = None + self.pre_uninstall = None + self.post_uninstall = None + self.prep = None + self.provides = None + self.requires = None + self.conflicts = None + self.build_requires = None + self.obsoletes = None + + self.keep_temp = 0 + self.use_rpm_opt_flags = 1 + self.rpm3_mode = 1 + self.no_autoreq = 0 + + self.force_arch = None + self.quiet = 0 + + def finalize_options(self): + self.set_undefined_options('bdist', ('bdist_base', 'bdist_base')) + if self.rpm_base is None: + if not self.rpm3_mode: + raise DistutilsOptionError( + "you must specify --rpm-base in RPM 2 mode") + self.rpm_base = os.path.join(self.bdist_base, "rpm") + + if self.python is None: + if self.fix_python: + self.python = sys.executable + else: + self.python = "python3" + elif self.fix_python: + raise DistutilsOptionError( + "--python and --fix-python are mutually exclusive options") + + if os.name != 'posix': + raise DistutilsPlatformError("don't know how to create RPM " + "distributions on platform %s" % os.name) + if self.binary_only and self.source_only: + raise DistutilsOptionError( + "cannot supply both '--source-only' and '--binary-only'") + + # don't pass CFLAGS to pure python distributions + if not self.distribution.has_ext_modules(): + self.use_rpm_opt_flags = 0 + + self.set_undefined_options('bdist', ('dist_dir', 'dist_dir')) + self.finalize_package_data() + + def finalize_package_data(self): + self.ensure_string('group', "Development/Libraries") + self.ensure_string('vendor', + "%s <%s>" % (self.distribution.get_contact(), + self.distribution.get_contact_email())) + self.ensure_string('packager') + self.ensure_string_list('doc_files') + if isinstance(self.doc_files, list): + for readme in ('README', 'README.txt'): + if os.path.exists(readme) and readme not in self.doc_files: + self.doc_files.append(readme) + + self.ensure_string('release', "1") + self.ensure_string('serial') # should it be an int? + + self.ensure_string('distribution_name') + + self.ensure_string('changelog') + # Format changelog correctly + self.changelog = self._format_changelog(self.changelog) + + self.ensure_filename('icon') + + self.ensure_filename('prep_script') + self.ensure_filename('build_script') + self.ensure_filename('install_script') + self.ensure_filename('clean_script') + self.ensure_filename('verify_script') + self.ensure_filename('pre_install') + self.ensure_filename('post_install') + self.ensure_filename('pre_uninstall') + self.ensure_filename('post_uninstall') + + # XXX don't forget we punted on summaries and descriptions -- they + # should be handled here eventually! + + # Now *this* is some meta-data that belongs in the setup script... + self.ensure_string_list('provides') + self.ensure_string_list('requires') + self.ensure_string_list('conflicts') + self.ensure_string_list('build_requires') + self.ensure_string_list('obsoletes') + + self.ensure_string('force_arch') + + def run(self): + if DEBUG: + print("before _get_package_data():") + print("vendor =", self.vendor) + print("packager =", self.packager) + print("doc_files =", self.doc_files) + print("changelog =", self.changelog) + + # make directories + if self.spec_only: + spec_dir = self.dist_dir + self.mkpath(spec_dir) + else: + rpm_dir = {} + for d in ('SOURCES', 'SPECS', 'BUILD', 'RPMS', 'SRPMS'): + rpm_dir[d] = os.path.join(self.rpm_base, d) + self.mkpath(rpm_dir[d]) + spec_dir = rpm_dir['SPECS'] + + # Spec file goes into 'dist_dir' if '--spec-only specified', + # build/rpm. otherwise. + spec_path = os.path.join(spec_dir, + "%s.spec" % self.distribution.get_name()) + self.execute(write_file, + (spec_path, + self._make_spec_file()), + "writing '%s'" % spec_path) + + if self.spec_only: # stop if requested + return + + # Make a source distribution and copy to SOURCES directory with + # optional icon. + saved_dist_files = self.distribution.dist_files[:] + sdist = self.reinitialize_command('sdist') + if self.use_bzip2: + sdist.formats = ['bztar'] + else: + sdist.formats = ['gztar'] + self.run_command('sdist') + self.distribution.dist_files = saved_dist_files + + source = sdist.get_archive_files()[0] + source_dir = rpm_dir['SOURCES'] + self.copy_file(source, source_dir) + + if self.icon: + if os.path.exists(self.icon): + self.copy_file(self.icon, source_dir) + else: + raise DistutilsFileError( + "icon file '%s' does not exist" % self.icon) + + # build package + log.info("building RPMs") + rpm_cmd = ['rpmbuild'] + + if self.source_only: # what kind of RPMs? + rpm_cmd.append('-bs') + elif self.binary_only: + rpm_cmd.append('-bb') + else: + rpm_cmd.append('-ba') + rpm_cmd.extend(['--define', '__python %s' % self.python]) + if self.rpm3_mode: + rpm_cmd.extend(['--define', + '_topdir %s' % os.path.abspath(self.rpm_base)]) + if not self.keep_temp: + rpm_cmd.append('--clean') + + if self.quiet: + rpm_cmd.append('--quiet') + + rpm_cmd.append(spec_path) + # Determine the binary rpm names that should be built out of this spec + # file + # Note that some of these may not be really built (if the file + # list is empty) + nvr_string = "%{name}-%{version}-%{release}" + src_rpm = nvr_string + ".src.rpm" + non_src_rpm = "%{arch}/" + nvr_string + ".%{arch}.rpm" + q_cmd = r"rpm -q --qf '%s %s\n' --specfile '%s'" % ( + src_rpm, non_src_rpm, spec_path) + + out = os.popen(q_cmd) + try: + binary_rpms = [] + source_rpm = None + while True: + line = out.readline() + if not line: + break + l = line.strip().split() + assert(len(l) == 2) + binary_rpms.append(l[1]) + # The source rpm is named after the first entry in the spec file + if source_rpm is None: + source_rpm = l[0] + + status = out.close() + if status: + raise DistutilsExecError("Failed to execute: %s" % repr(q_cmd)) + + finally: + out.close() + + self.spawn(rpm_cmd) + + if not self.dry_run: + if self.distribution.has_ext_modules(): + pyversion = get_python_version() + else: + pyversion = 'any' + + if not self.binary_only: + srpm = os.path.join(rpm_dir['SRPMS'], source_rpm) + assert(os.path.exists(srpm)) + self.move_file(srpm, self.dist_dir) + filename = os.path.join(self.dist_dir, source_rpm) + self.distribution.dist_files.append( + ('bdist_rpm', pyversion, filename)) + + if not self.source_only: + for rpm in binary_rpms: + rpm = os.path.join(rpm_dir['RPMS'], rpm) + if os.path.exists(rpm): + self.move_file(rpm, self.dist_dir) + filename = os.path.join(self.dist_dir, + os.path.basename(rpm)) + self.distribution.dist_files.append( + ('bdist_rpm', pyversion, filename)) + + def _dist_path(self, path): + return os.path.join(self.dist_dir, os.path.basename(path)) + + def _make_spec_file(self): + """Generate the text of an RPM spec file and return it as a + list of strings (one per line). + """ + # definitions and headers + spec_file = [ + '%define name ' + self.distribution.get_name(), + '%define version ' + self.distribution.get_version().replace('-','_'), + '%define unmangled_version ' + self.distribution.get_version(), + '%define release ' + self.release.replace('-','_'), + '', + 'Summary: ' + self.distribution.get_description(), + ] + + # Workaround for #14443 which affects some RPM based systems such as + # RHEL6 (and probably derivatives) + vendor_hook = subprocess.getoutput('rpm --eval %{__os_install_post}') + # Generate a potential replacement value for __os_install_post (whilst + # normalizing the whitespace to simplify the test for whether the + # invocation of brp-python-bytecompile passes in __python): + vendor_hook = '\n'.join([' %s \\' % line.strip() + for line in vendor_hook.splitlines()]) + problem = "brp-python-bytecompile \\\n" + fixed = "brp-python-bytecompile %{__python} \\\n" + fixed_hook = vendor_hook.replace(problem, fixed) + if fixed_hook != vendor_hook: + spec_file.append('# Workaround for http://bugs.python.org/issue14443') + spec_file.append('%define __os_install_post ' + fixed_hook + '\n') + + # put locale summaries into spec file + # XXX not supported for now (hard to put a dictionary + # in a config file -- arg!) + #for locale in self.summaries.keys(): + # spec_file.append('Summary(%s): %s' % (locale, + # self.summaries[locale])) + + spec_file.extend([ + 'Name: %{name}', + 'Version: %{version}', + 'Release: %{release}',]) + + # XXX yuck! this filename is available from the "sdist" command, + # but only after it has run: and we create the spec file before + # running "sdist", in case of --spec-only. + if self.use_bzip2: + spec_file.append('Source0: %{name}-%{unmangled_version}.tar.bz2') + else: + spec_file.append('Source0: %{name}-%{unmangled_version}.tar.gz') + + spec_file.extend([ + 'License: ' + self.distribution.get_license(), + 'Group: ' + self.group, + 'BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot', + 'Prefix: %{_prefix}', ]) + + if not self.force_arch: + # noarch if no extension modules + if not self.distribution.has_ext_modules(): + spec_file.append('BuildArch: noarch') + else: + spec_file.append( 'BuildArch: %s' % self.force_arch ) + + for field in ('Vendor', + 'Packager', + 'Provides', + 'Requires', + 'Conflicts', + 'Obsoletes', + ): + val = getattr(self, field.lower()) + if isinstance(val, list): + spec_file.append('%s: %s' % (field, ' '.join(val))) + elif val is not None: + spec_file.append('%s: %s' % (field, val)) + + + if self.distribution.get_url() != 'UNKNOWN': + spec_file.append('Url: ' + self.distribution.get_url()) + + if self.distribution_name: + spec_file.append('Distribution: ' + self.distribution_name) + + if self.build_requires: + spec_file.append('BuildRequires: ' + + ' '.join(self.build_requires)) + + if self.icon: + spec_file.append('Icon: ' + os.path.basename(self.icon)) + + if self.no_autoreq: + spec_file.append('AutoReq: 0') + + spec_file.extend([ + '', + '%description', + self.distribution.get_long_description() + ]) + + # put locale descriptions into spec file + # XXX again, suppressed because config file syntax doesn't + # easily support this ;-( + #for locale in self.descriptions.keys(): + # spec_file.extend([ + # '', + # '%description -l ' + locale, + # self.descriptions[locale], + # ]) + + # rpm scripts + # figure out default build script + def_setup_call = "%s %s" % (self.python,os.path.basename(sys.argv[0])) + def_build = "%s build" % def_setup_call + if self.use_rpm_opt_flags: + def_build = 'env CFLAGS="$RPM_OPT_FLAGS" ' + def_build + + # insert contents of files + + # XXX this is kind of misleading: user-supplied options are files + # that we open and interpolate into the spec file, but the defaults + # are just text that we drop in as-is. Hmmm. + + install_cmd = ('%s install -O1 --root=$RPM_BUILD_ROOT ' + '--record=INSTALLED_FILES') % def_setup_call + + script_options = [ + ('prep', 'prep_script', "%setup -n %{name}-%{unmangled_version}"), + ('build', 'build_script', def_build), + ('install', 'install_script', install_cmd), + ('clean', 'clean_script', "rm -rf $RPM_BUILD_ROOT"), + ('verifyscript', 'verify_script', None), + ('pre', 'pre_install', None), + ('post', 'post_install', None), + ('preun', 'pre_uninstall', None), + ('postun', 'post_uninstall', None), + ] + + for (rpm_opt, attr, default) in script_options: + # Insert contents of file referred to, if no file is referred to + # use 'default' as contents of script + val = getattr(self, attr) + if val or default: + spec_file.extend([ + '', + '%' + rpm_opt,]) + if val: + with open(val) as f: + spec_file.extend(f.read().split('\n')) + else: + spec_file.append(default) + + + # files section + spec_file.extend([ + '', + '%files -f INSTALLED_FILES', + '%defattr(-,root,root)', + ]) + + if self.doc_files: + spec_file.append('%doc ' + ' '.join(self.doc_files)) + + if self.changelog: + spec_file.extend([ + '', + '%changelog',]) + spec_file.extend(self.changelog) + + return spec_file + + def _format_changelog(self, changelog): + """Format the changelog correctly and convert it to a list of strings + """ + if not changelog: + return changelog + new_changelog = [] + for line in changelog.strip().split('\n'): + line = line.strip() + if line[0] == '*': + new_changelog.extend(['', line]) + elif line[0] == '-': + new_changelog.append(line) + else: + new_changelog.append(' ' + line) + + # strip trailing newline inserted by first changelog entry + if not new_changelog[0]: + del new_changelog[0] + + return new_changelog diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/build.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/build.py new file mode 100644 index 0000000000000000000000000000000000000000..a86df0bc7f921889bc0b28eeee6600a9bab41ebc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/build.py @@ -0,0 +1,157 @@ +"""distutils.command.build + +Implements the Distutils 'build' command.""" + +import sys, os +from distutils.core import Command +from distutils.errors import DistutilsOptionError +from distutils.util import get_platform + + +def show_compilers(): + from distutils.ccompiler import show_compilers + show_compilers() + + +class build(Command): + + description = "build everything needed to install" + + user_options = [ + ('build-base=', 'b', + "base directory for build library"), + ('build-purelib=', None, + "build directory for platform-neutral distributions"), + ('build-platlib=', None, + "build directory for platform-specific distributions"), + ('build-lib=', None, + "build directory for all distribution (defaults to either " + + "build-purelib or build-platlib"), + ('build-scripts=', None, + "build directory for scripts"), + ('build-temp=', 't', + "temporary build directory"), + ('plat-name=', 'p', + "platform name to build for, if supported " + "(default: %s)" % get_platform()), + ('compiler=', 'c', + "specify the compiler type"), + ('parallel=', 'j', + "number of parallel build jobs"), + ('debug', 'g', + "compile extensions and libraries with debugging information"), + ('force', 'f', + "forcibly build everything (ignore file timestamps)"), + ('executable=', 'e', + "specify final destination interpreter path (build.py)"), + ] + + boolean_options = ['debug', 'force'] + + help_options = [ + ('help-compiler', None, + "list available compilers", show_compilers), + ] + + def initialize_options(self): + self.build_base = 'build' + # these are decided only after 'build_base' has its final value + # (unless overridden by the user or client) + self.build_purelib = None + self.build_platlib = None + self.build_lib = None + self.build_temp = None + self.build_scripts = None + self.compiler = None + self.plat_name = None + self.debug = None + self.force = 0 + self.executable = None + self.parallel = None + + def finalize_options(self): + if self.plat_name is None: + self.plat_name = get_platform() + else: + # plat-name only supported for windows (other platforms are + # supported via ./configure flags, if at all). Avoid misleading + # other platforms. + if os.name != 'nt': + raise DistutilsOptionError( + "--plat-name only supported on Windows (try " + "using './configure --help' on your platform)") + + plat_specifier = ".%s-%d.%d" % (self.plat_name, *sys.version_info[:2]) + + # Make it so Python 2.x and Python 2.x with --with-pydebug don't + # share the same build directories. Doing so confuses the build + # process for C modules + if hasattr(sys, 'gettotalrefcount'): + plat_specifier += '-pydebug' + + # 'build_purelib' and 'build_platlib' just default to 'lib' and + # 'lib.' under the base build directory. We only use one of + # them for a given distribution, though -- + if self.build_purelib is None: + self.build_purelib = os.path.join(self.build_base, 'lib') + if self.build_platlib is None: + self.build_platlib = os.path.join(self.build_base, + 'lib' + plat_specifier) + + # 'build_lib' is the actual directory that we will use for this + # particular module distribution -- if user didn't supply it, pick + # one of 'build_purelib' or 'build_platlib'. + if self.build_lib is None: + if self.distribution.ext_modules: + self.build_lib = self.build_platlib + else: + self.build_lib = self.build_purelib + + # 'build_temp' -- temporary directory for compiler turds, + # "build/temp." + if self.build_temp is None: + self.build_temp = os.path.join(self.build_base, + 'temp' + plat_specifier) + if self.build_scripts is None: + self.build_scripts = os.path.join(self.build_base, + 'scripts-%d.%d' % sys.version_info[:2]) + + if self.executable is None and sys.executable: + self.executable = os.path.normpath(sys.executable) + + if isinstance(self.parallel, str): + try: + self.parallel = int(self.parallel) + except ValueError: + raise DistutilsOptionError("parallel should be an integer") + + def run(self): + # Run all relevant sub-commands. This will be some subset of: + # - build_py - pure Python modules + # - build_clib - standalone C libraries + # - build_ext - Python extensions + # - build_scripts - (Python) scripts + for cmd_name in self.get_sub_commands(): + self.run_command(cmd_name) + + + # -- Predicates for the sub-command list --------------------------- + + def has_pure_modules(self): + return self.distribution.has_pure_modules() + + def has_c_libraries(self): + return self.distribution.has_c_libraries() + + def has_ext_modules(self): + return self.distribution.has_ext_modules() + + def has_scripts(self): + return self.distribution.has_scripts() + + + sub_commands = [('build_py', has_pure_modules), + ('build_clib', has_c_libraries), + ('build_ext', has_ext_modules), + ('build_scripts', has_scripts), + ] diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/build_clib.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/build_clib.py new file mode 100644 index 0000000000000000000000000000000000000000..3e20ef23cd81e0d4fb54898f2b642882d3d0d5ef --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/build_clib.py @@ -0,0 +1,209 @@ +"""distutils.command.build_clib + +Implements the Distutils 'build_clib' command, to build a C/C++ library +that is included in the module distribution and needed by an extension +module.""" + + +# XXX this module has *lots* of code ripped-off quite transparently from +# build_ext.py -- not surprisingly really, as the work required to build +# a static library from a collection of C source files is not really all +# that different from what's required to build a shared object file from +# a collection of C source files. Nevertheless, I haven't done the +# necessary refactoring to account for the overlap in code between the +# two modules, mainly because a number of subtle details changed in the +# cut 'n paste. Sigh. + +import os +from distutils.core import Command +from distutils.errors import * +from distutils.sysconfig import customize_compiler +from distutils import log + +def show_compilers(): + from distutils.ccompiler import show_compilers + show_compilers() + + +class build_clib(Command): + + description = "build C/C++ libraries used by Python extensions" + + user_options = [ + ('build-clib=', 'b', + "directory to build C/C++ libraries to"), + ('build-temp=', 't', + "directory to put temporary build by-products"), + ('debug', 'g', + "compile with debugging information"), + ('force', 'f', + "forcibly build everything (ignore file timestamps)"), + ('compiler=', 'c', + "specify the compiler type"), + ] + + boolean_options = ['debug', 'force'] + + help_options = [ + ('help-compiler', None, + "list available compilers", show_compilers), + ] + + def initialize_options(self): + self.build_clib = None + self.build_temp = None + + # List of libraries to build + self.libraries = None + + # Compilation options for all libraries + self.include_dirs = None + self.define = None + self.undef = None + self.debug = None + self.force = 0 + self.compiler = None + + + def finalize_options(self): + # This might be confusing: both build-clib and build-temp default + # to build-temp as defined by the "build" command. This is because + # I think that C libraries are really just temporary build + # by-products, at least from the point of view of building Python + # extensions -- but I want to keep my options open. + self.set_undefined_options('build', + ('build_temp', 'build_clib'), + ('build_temp', 'build_temp'), + ('compiler', 'compiler'), + ('debug', 'debug'), + ('force', 'force')) + + self.libraries = self.distribution.libraries + if self.libraries: + self.check_library_list(self.libraries) + + if self.include_dirs is None: + self.include_dirs = self.distribution.include_dirs or [] + if isinstance(self.include_dirs, str): + self.include_dirs = self.include_dirs.split(os.pathsep) + + # XXX same as for build_ext -- what about 'self.define' and + # 'self.undef' ? + + + def run(self): + if not self.libraries: + return + + # Yech -- this is cut 'n pasted from build_ext.py! + from distutils.ccompiler import new_compiler + self.compiler = new_compiler(compiler=self.compiler, + dry_run=self.dry_run, + force=self.force) + customize_compiler(self.compiler) + + if self.include_dirs is not None: + self.compiler.set_include_dirs(self.include_dirs) + if self.define is not None: + # 'define' option is a list of (name,value) tuples + for (name,value) in self.define: + self.compiler.define_macro(name, value) + if self.undef is not None: + for macro in self.undef: + self.compiler.undefine_macro(macro) + + self.build_libraries(self.libraries) + + + def check_library_list(self, libraries): + """Ensure that the list of libraries is valid. + + `library` is presumably provided as a command option 'libraries'. + This method checks that it is a list of 2-tuples, where the tuples + are (library_name, build_info_dict). + + Raise DistutilsSetupError if the structure is invalid anywhere; + just returns otherwise. + """ + if not isinstance(libraries, list): + raise DistutilsSetupError( + "'libraries' option must be a list of tuples") + + for lib in libraries: + if not isinstance(lib, tuple) and len(lib) != 2: + raise DistutilsSetupError( + "each element of 'libraries' must a 2-tuple") + + name, build_info = lib + + if not isinstance(name, str): + raise DistutilsSetupError( + "first element of each tuple in 'libraries' " + "must be a string (the library name)") + + if '/' in name or (os.sep != '/' and os.sep in name): + raise DistutilsSetupError("bad library name '%s': " + "may not contain directory separators" % lib[0]) + + if not isinstance(build_info, dict): + raise DistutilsSetupError( + "second element of each tuple in 'libraries' " + "must be a dictionary (build info)") + + + def get_library_names(self): + # Assume the library list is valid -- 'check_library_list()' is + # called from 'finalize_options()', so it should be! + if not self.libraries: + return None + + lib_names = [] + for (lib_name, build_info) in self.libraries: + lib_names.append(lib_name) + return lib_names + + + def get_source_files(self): + self.check_library_list(self.libraries) + filenames = [] + for (lib_name, build_info) in self.libraries: + sources = build_info.get('sources') + if sources is None or not isinstance(sources, (list, tuple)): + raise DistutilsSetupError( + "in 'libraries' option (library '%s'), " + "'sources' must be present and must be " + "a list of source filenames" % lib_name) + + filenames.extend(sources) + return filenames + + + def build_libraries(self, libraries): + for (lib_name, build_info) in libraries: + sources = build_info.get('sources') + if sources is None or not isinstance(sources, (list, tuple)): + raise DistutilsSetupError( + "in 'libraries' option (library '%s'), " + "'sources' must be present and must be " + "a list of source filenames" % lib_name) + sources = list(sources) + + log.info("building '%s' library", lib_name) + + # First, compile the source code to object files in the library + # directory. (This should probably change to putting object + # files in a temporary build directory.) + macros = build_info.get('macros') + include_dirs = build_info.get('include_dirs') + objects = self.compiler.compile(sources, + output_dir=self.build_temp, + macros=macros, + include_dirs=include_dirs, + debug=self.debug) + + # Now "link" the object files together into a static library. + # (On Unix at least, this isn't really linking -- it just + # builds an archive. Whatever.) + self.compiler.create_static_lib(objects, lib_name, + output_dir=self.build_clib, + debug=self.debug) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..609f83bb5e9f3a4f39d2ec202e24bef25a6f59d7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/_encoded_words.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/_encoded_words.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..259f523de2442647a48f7ea41098ae1a00498fc9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/_encoded_words.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/_parseaddr.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/_parseaddr.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..94c6bd0f9ed3621a3cf04e97240bef16f61c3185 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/_parseaddr.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/_policybase.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/_policybase.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f812fe8f7b4c9e7c52b33ce6c1e6af8ba7708c56 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/_policybase.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/base64mime.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/base64mime.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..88fb80370494eb19b2dcac131482eb9a3f1245f5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/base64mime.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/charset.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/charset.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ac1ffc556450ac4bb37d15dc98a05c8b14f3d37d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/charset.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/contentmanager.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/contentmanager.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..604e7dfec3ab5b8ebeaea90fc6ba1d37728a532e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/contentmanager.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/encoders.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/encoders.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..96a2a1a2e80c0f226c8c627726dd67e01fc48c47 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/encoders.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/errors.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/errors.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2bab9220e2b1f52b918a5c6f62222b540c0be6ca Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/errors.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/feedparser.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/feedparser.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5fd3bf8e7835b6e0b627e5a6326f7dd40eb59042 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/feedparser.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/generator.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/generator.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ca309a2492edea21ecca88240392ec651a45af2a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/generator.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/header.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/header.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..01f5bec1ca10cecc97ebd279f0229cc864dc8e86 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/header.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/headerregistry.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/headerregistry.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bacdc077692c21b7c752d2e557707802fba105c3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/headerregistry.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/iterators.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/iterators.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..21142f5e32b4dc81aaa0d7c9c3ad00ac88869908 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/iterators.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/message.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/message.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ecc5b0e8fcad583fbc90bd5f00d828d24b377ea5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/message.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/parser.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/parser.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7baf58758963bee898c11d205f45bbef6d5f2da4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/parser.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/policy.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/policy.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e9e7636844a374a32004d1d7e3b4559ae18ab72f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/policy.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/quoprimime.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/quoprimime.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..642254b03250bf31c97bd330df8a295a04ab5c77 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/quoprimime.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/utils.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/utils.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5a4898f9221de10d04bbb279f0cf7415eb331e65 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/utils.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0390cbd9339faabb0c5993600d4a46a72296a5b2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/application.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/application.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..97af85b6ea19f205dfd554ac46fd9a95ccd48425 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/application.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/audio.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/audio.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e303f89c41d9bc50ab68e6f9b1cbfe1219bd87ea Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/audio.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/base.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/base.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e09fa31ed32067e4b0964982c2095367ee7fd535 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/base.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/image.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/image.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7d7f1651717d459341ad71c7909a4c45febb2c78 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/image.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/message.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/message.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fd0dbda5b7e0e009ba14f359806c404fd9f7b54a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/message.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/multipart.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/multipart.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..177036252771b568b4f38088b17e0e1f3a3bc741 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/multipart.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/nonmultipart.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/nonmultipart.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4d753e91e112eb9a4e43161252d8f646f00025d0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/nonmultipart.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/text.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/text.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3ea06c038ded366bec025d1f5ddbc50a3ee4f4ae Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/text.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/application.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/application.py new file mode 100644 index 0000000000000000000000000000000000000000..f67cbad3f03407618de8f7ae1b2a86fc913e62f8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/application.py @@ -0,0 +1,37 @@ +# Copyright (C) 2001-2006 Python Software Foundation +# Author: Keith Dart +# Contact: email-sig@python.org + +"""Class representing application/* type MIME documents.""" + +__all__ = ["MIMEApplication"] + +from email import encoders +from email.mime.nonmultipart import MIMENonMultipart + + +class MIMEApplication(MIMENonMultipart): + """Class for generating application/* MIME documents.""" + + def __init__(self, _data, _subtype='octet-stream', + _encoder=encoders.encode_base64, *, policy=None, **_params): + """Create an application/* type MIME document. + + _data contains the bytes for the raw application data. + + _subtype is the MIME content type subtype, defaulting to + 'octet-stream'. + + _encoder is a function which will perform the actual encoding for + transport of the application data, defaulting to base64 encoding. + + Any additional keyword arguments are passed to the base class + constructor, which turns them into parameters on the Content-Type + header. + """ + if _subtype is None: + raise TypeError('Invalid application MIME subtype') + MIMENonMultipart.__init__(self, 'application', _subtype, policy=policy, + **_params) + self.set_payload(_data) + _encoder(self) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/audio.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/audio.py new file mode 100644 index 0000000000000000000000000000000000000000..065819b2a2101d05f6624a45b6477c75b7a436d3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/audio.py @@ -0,0 +1,100 @@ +# Copyright (C) 2001-2007 Python Software Foundation +# Author: Anthony Baxter +# Contact: email-sig@python.org + +"""Class representing audio/* type MIME documents.""" + +__all__ = ['MIMEAudio'] + +from io import BytesIO +from email import encoders +from email.mime.nonmultipart import MIMENonMultipart + + +class MIMEAudio(MIMENonMultipart): + """Class for generating audio/* MIME documents.""" + + def __init__(self, _audiodata, _subtype=None, + _encoder=encoders.encode_base64, *, policy=None, **_params): + """Create an audio/* type MIME document. + + _audiodata contains the bytes for the raw audio data. If this data + can be decoded as au, wav, aiff, or aifc, then the + subtype will be automatically included in the Content-Type header. + Otherwise, you can specify the specific audio subtype via the + _subtype parameter. If _subtype is not given, and no subtype can be + guessed, a TypeError is raised. + + _encoder is a function which will perform the actual encoding for + transport of the image data. It takes one argument, which is this + Image instance. It should use get_payload() and set_payload() to + change the payload to the encoded form. It should also add any + Content-Transfer-Encoding or other headers to the message as + necessary. The default encoding is Base64. + + Any additional keyword arguments are passed to the base class + constructor, which turns them into parameters on the Content-Type + header. + """ + if _subtype is None: + _subtype = _what(_audiodata) + if _subtype is None: + raise TypeError('Could not find audio MIME subtype') + MIMENonMultipart.__init__(self, 'audio', _subtype, policy=policy, + **_params) + self.set_payload(_audiodata) + _encoder(self) + + +_rules = [] + + +# Originally from the sndhdr module. +# +# There are others in sndhdr that don't have MIME types. :( +# Additional ones to be added to sndhdr? midi, mp3, realaudio, wma?? +def _what(data): + # Try to identify a sound file type. + # + # sndhdr.what() had a pretty cruddy interface, unfortunately. This is why + # we re-do it here. It would be easier to reverse engineer the Unix 'file' + # command and use the standard 'magic' file, as shipped with a modern Unix. + hdr = data[:512] + fakefile = BytesIO(hdr) + for testfn in _rules: + if res := testfn(hdr, fakefile): + return res + else: + return None + + +def rule(rulefunc): + _rules.append(rulefunc) + return rulefunc + + +@rule +def _aiff(h, f): + if not h.startswith(b'FORM'): + return None + if h[8:12] in {b'AIFC', b'AIFF'}: + return 'x-aiff' + else: + return None + + +@rule +def _au(h, f): + if h.startswith(b'.snd'): + return 'basic' + else: + return None + + +@rule +def _wav(h, f): + # 'RIFF' 'WAVE' 'fmt ' + if not h.startswith(b'RIFF') or h[8:12] != b'WAVE' or h[12:16] != b'fmt ': + return None + else: + return "x-wav" diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/base.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/base.py new file mode 100644 index 0000000000000000000000000000000000000000..f601f621cec3933d1668cbe22bb10b9c94daf55e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/base.py @@ -0,0 +1,29 @@ +# Copyright (C) 2001-2006 Python Software Foundation +# Author: Barry Warsaw +# Contact: email-sig@python.org + +"""Base class for MIME specializations.""" + +__all__ = ['MIMEBase'] + +import email.policy + +from email import message + + +class MIMEBase(message.Message): + """Base class for MIME specializations.""" + + def __init__(self, _maintype, _subtype, *, policy=None, **_params): + """This constructor adds a Content-Type: and a MIME-Version: header. + + The Content-Type: header is taken from the _maintype and _subtype + arguments. Additional parameters for this header are taken from the + keyword arguments. + """ + if policy is None: + policy = email.policy.compat32 + message.Message.__init__(self, policy=policy) + ctype = '%s/%s' % (_maintype, _subtype) + self.add_header('Content-Type', ctype, **_params) + self['MIME-Version'] = '1.0' diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/image.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/image.py new file mode 100644 index 0000000000000000000000000000000000000000..4b7f2f9cbad425222a3f56f56511e9920149a2d6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/image.py @@ -0,0 +1,152 @@ +# Copyright (C) 2001-2006 Python Software Foundation +# Author: Barry Warsaw +# Contact: email-sig@python.org + +"""Class representing image/* type MIME documents.""" + +__all__ = ['MIMEImage'] + +from email import encoders +from email.mime.nonmultipart import MIMENonMultipart + + +class MIMEImage(MIMENonMultipart): + """Class for generating image/* type MIME documents.""" + + def __init__(self, _imagedata, _subtype=None, + _encoder=encoders.encode_base64, *, policy=None, **_params): + """Create an image/* type MIME document. + + _imagedata contains the bytes for the raw image data. If the data + type can be detected (jpeg, png, gif, tiff, rgb, pbm, pgm, ppm, + rast, xbm, bmp, webp, and exr attempted), then the subtype will be + automatically included in the Content-Type header. Otherwise, you can + specify the specific image subtype via the _subtype parameter. + + _encoder is a function which will perform the actual encoding for + transport of the image data. It takes one argument, which is this + Image instance. It should use get_payload() and set_payload() to + change the payload to the encoded form. It should also add any + Content-Transfer-Encoding or other headers to the message as + necessary. The default encoding is Base64. + + Any additional keyword arguments are passed to the base class + constructor, which turns them into parameters on the Content-Type + header. + """ + _subtype = _what(_imagedata) if _subtype is None else _subtype + if _subtype is None: + raise TypeError('Could not guess image MIME subtype') + MIMENonMultipart.__init__(self, 'image', _subtype, policy=policy, + **_params) + self.set_payload(_imagedata) + _encoder(self) + + +_rules = [] + + +# Originally from the imghdr module. +def _what(data): + for rule in _rules: + if res := rule(data): + return res + else: + return None + + +def rule(rulefunc): + _rules.append(rulefunc) + return rulefunc + + +@rule +def _jpeg(h): + """JPEG data with JFIF or Exif markers; and raw JPEG""" + if h[6:10] in (b'JFIF', b'Exif'): + return 'jpeg' + elif h[:4] == b'\xff\xd8\xff\xdb': + return 'jpeg' + + +@rule +def _png(h): + if h.startswith(b'\211PNG\r\n\032\n'): + return 'png' + + +@rule +def _gif(h): + """GIF ('87 and '89 variants)""" + if h[:6] in (b'GIF87a', b'GIF89a'): + return 'gif' + + +@rule +def _tiff(h): + """TIFF (can be in Motorola or Intel byte order)""" + if h[:2] in (b'MM', b'II'): + return 'tiff' + + +@rule +def _rgb(h): + """SGI image library""" + if h.startswith(b'\001\332'): + return 'rgb' + + +@rule +def _pbm(h): + """PBM (portable bitmap)""" + if len(h) >= 3 and \ + h[0] == ord(b'P') and h[1] in b'14' and h[2] in b' \t\n\r': + return 'pbm' + + +@rule +def _pgm(h): + """PGM (portable graymap)""" + if len(h) >= 3 and \ + h[0] == ord(b'P') and h[1] in b'25' and h[2] in b' \t\n\r': + return 'pgm' + + +@rule +def _ppm(h): + """PPM (portable pixmap)""" + if len(h) >= 3 and \ + h[0] == ord(b'P') and h[1] in b'36' and h[2] in b' \t\n\r': + return 'ppm' + + +@rule +def _rast(h): + """Sun raster file""" + if h.startswith(b'\x59\xA6\x6A\x95'): + return 'rast' + + +@rule +def _xbm(h): + """X bitmap (X10 or X11)""" + if h.startswith(b'#define '): + return 'xbm' + + +@rule +def _bmp(h): + if h.startswith(b'BM'): + return 'bmp' + + +@rule +def _webp(h): + if h.startswith(b'RIFF') and h[8:12] == b'WEBP': + return 'webp' + + +@rule +def _exr(h): + if h.startswith(b'\x76\x2f\x31\x01'): + return 'exr' diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/message.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/message.py new file mode 100644 index 0000000000000000000000000000000000000000..61836b5a7861fca712c57dc70d5b32e597dc16bf --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/message.py @@ -0,0 +1,33 @@ +# Copyright (C) 2001-2006 Python Software Foundation +# Author: Barry Warsaw +# Contact: email-sig@python.org + +"""Class representing message/* MIME documents.""" + +__all__ = ['MIMEMessage'] + +from email import message +from email.mime.nonmultipart import MIMENonMultipart + + +class MIMEMessage(MIMENonMultipart): + """Class representing message/* MIME documents.""" + + def __init__(self, _msg, _subtype='rfc822', *, policy=None): + """Create a message/* type MIME document. + + _msg is a message object and must be an instance of Message, or a + derived class of Message, otherwise a TypeError is raised. + + Optional _subtype defines the subtype of the contained message. The + default is "rfc822" (this is defined by the MIME standard, even though + the term "rfc822" is technically outdated by RFC 2822). + """ + MIMENonMultipart.__init__(self, 'message', _subtype, policy=policy) + if not isinstance(_msg, message.Message): + raise TypeError('Argument is not an instance of Message') + # It's convenient to use this base class method. We need to do it + # this way or we'll get an exception + message.Message.attach(self, _msg) + # And be sure our default type is set correctly + self.set_default_type('message/rfc822') diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/multipart.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/multipart.py new file mode 100644 index 0000000000000000000000000000000000000000..94d81c771a474eb27e4e5aa1575a0d198014d439 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/multipart.py @@ -0,0 +1,47 @@ +# Copyright (C) 2002-2006 Python Software Foundation +# Author: Barry Warsaw +# Contact: email-sig@python.org + +"""Base class for MIME multipart/* type messages.""" + +__all__ = ['MIMEMultipart'] + +from email.mime.base import MIMEBase + + +class MIMEMultipart(MIMEBase): + """Base class for MIME multipart/* type messages.""" + + def __init__(self, _subtype='mixed', boundary=None, _subparts=None, + *, policy=None, + **_params): + """Creates a multipart/* type message. + + By default, creates a multipart/mixed message, with proper + Content-Type and MIME-Version headers. + + _subtype is the subtype of the multipart content type, defaulting to + `mixed'. + + boundary is the multipart boundary string. By default it is + calculated as needed. + + _subparts is a sequence of initial subparts for the payload. It + must be an iterable object, such as a list. You can always + attach new subparts to the message by using the attach() method. + + Additional parameters for the Content-Type header are taken from the + keyword arguments (or passed into the _params argument). + """ + MIMEBase.__init__(self, 'multipart', _subtype, policy=policy, **_params) + + # Initialise _payload to an empty list as the Message superclass's + # implementation of is_multipart assumes that _payload is a list for + # multipart messages. + self._payload = [] + + if _subparts: + for p in _subparts: + self.attach(p) + if boundary: + self.set_boundary(boundary) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/nonmultipart.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/nonmultipart.py new file mode 100644 index 0000000000000000000000000000000000000000..a41386eb148c0c835b789526bb343b01efab4709 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/nonmultipart.py @@ -0,0 +1,21 @@ +# Copyright (C) 2002-2006 Python Software Foundation +# Author: Barry Warsaw +# Contact: email-sig@python.org + +"""Base class for MIME type messages that are not multipart.""" + +__all__ = ['MIMENonMultipart'] + +from email import errors +from email.mime.base import MIMEBase + + +class MIMENonMultipart(MIMEBase): + """Base class for MIME non-multipart type messages.""" + + def attach(self, payload): + # The public API prohibits attaching multiple subparts to MIMEBase + # derived subtypes since none of them are, by definition, of content + # type multipart/* + raise errors.MultipartConversionError( + 'Cannot attach additional subparts to non-multipart/*') diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/text.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/text.py new file mode 100644 index 0000000000000000000000000000000000000000..dfe53c426b2ac4071393720515be0f3c4864f6de --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/text.py @@ -0,0 +1,41 @@ +# Copyright (C) 2001-2006 Python Software Foundation +# Author: Barry Warsaw +# Contact: email-sig@python.org + +"""Class representing text/* type MIME documents.""" + +__all__ = ['MIMEText'] + +from email.charset import Charset +from email.mime.nonmultipart import MIMENonMultipart + + +class MIMEText(MIMENonMultipart): + """Class for generating text/* type MIME documents.""" + + def __init__(self, _text, _subtype='plain', _charset=None, *, policy=None): + """Create a text/* type MIME document. + + _text is the string for this message object. + + _subtype is the MIME sub content type, defaulting to "plain". + + _charset is the character set parameter added to the Content-Type + header. This defaults to "us-ascii". Note that as a side-effect, the + Content-Transfer-Encoding header will also be set. + """ + + # If no _charset was specified, check to see if there are non-ascii + # characters present. If not, use 'us-ascii', otherwise use utf-8. + # XXX: This can be removed once #7304 is fixed. + if _charset is None: + try: + _text.encode('us-ascii') + _charset = 'us-ascii' + except UnicodeEncodeError: + _charset = 'utf-8' + + MIMENonMultipart.__init__(self, 'text', _subtype, policy=policy, + **{'charset': str(_charset)}) + + self.set_payload(_text, _charset) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9fa54f8914dd5ab6adb8b3929e2899d7af16ce89 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/aliases.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/aliases.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8e845bc88c99d52cfe8f459449b02f8ba5792597 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/aliases.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/ascii.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/ascii.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..487a90e972ad499601bddb98113c87f721923f28 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/ascii.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/base64_codec.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/base64_codec.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ebcbee02d08956fbcb078120664ead8c3f00c6e3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/base64_codec.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/big5.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/big5.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1373ebe169d04da2752c025ac573fc4c3dcdb0bf Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/big5.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/big5hkscs.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/big5hkscs.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2700490a1975bfcd0d288a0f7c6ff3dc49f6bee2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/big5hkscs.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/bz2_codec.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/bz2_codec.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..23596e0b866f86efacd5496f47a6cf581d087bc1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/bz2_codec.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/charmap.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/charmap.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e171e37e284cecb9db0656b6f175c6c54fe357ca Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/charmap.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp037.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp037.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bf004f3c3fa17a8c46136e26e4aa77dfeae29ffd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp037.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1006.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1006.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d5c37e3b5110b1ad49124076fae61ab03d9745ff Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1006.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1026.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1026.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8443afdefba52a5c55629213929faec6d5059c7e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1026.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1125.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1125.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..50fe835aa21ff940c924f18bdf5cbe52eec421a6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1125.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1140.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1140.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..427ccd6266e4dd5bea6e10605c14f396d13851ee Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1140.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1250.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1250.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..843c95be6bf102c533f56f8cde206ae0e250c808 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1250.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1251.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1251.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..791895a99b533f1fcda6303a87105be9be8d3f29 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1251.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1252.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1252.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7c80e5a62768295b06239d8b9e8a9556069ce524 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1252.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1253.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1253.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0426444a122c4c55f12df069b908134a9b985967 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1253.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1254.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1254.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..48d4db02036cc7ba69b504b89bae4616afea21a7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1254.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1255.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1255.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..36c9d567a58e58d3c5a0f01d2ab25d9081f3825b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1255.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1256.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1256.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c9a8fb2d3ce81af022157d90610ecdd6283bb096 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1256.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1257.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1257.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bc3baf331f460b0dfd204470a557f84567fa2446 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1257.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1258.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1258.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c314cf519e9be673a3f2ee274a26b50cb045b11a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp1258.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp273.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp273.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3e140221cf95fc57f3dcca8e6356629365bf8896 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp273.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp424.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp424.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..176dd8acb0018fbb430dedef9d581bb8f59eccba Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp424.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp437.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp437.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bd52900ed2bcc5756d927cba65ab82bf8d959771 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp437.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp500.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp500.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8c52466dc3989785b4715bffe45a864c65085933 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp500.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp720.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp720.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e1a6e3049769f45eac795a36c5a761b5fbbb28ba Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp720.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp737.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp737.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ea91d64abaad0a915f0e5bac7191e3b6a133f544 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp737.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp775.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp775.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..52e62b40b7576731eec3355091a404c66ca8c49e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp775.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp850.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp850.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..864f5da24ca3ad3a5ef37f5aff9ed9d27eb60d56 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp850.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp852.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp852.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..108e6332cbb7d33c3554d25aa67fc4ad36c7b96f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp852.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp855.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp855.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a47c7ebb09fafcbdb21e14f0d4b0869522bf940b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp855.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp856.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp856.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0df438091b960563becf13cf850ecc043876dec2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp856.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp857.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp857.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..be38355ced04a37738a3afc3173da7153bc96699 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp857.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp858.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp858.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9daa4436757c0c502560d0d5cef73f144f8ae0bb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp858.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp860.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp860.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..02ac689834e2805e142619cccf8f564145ef27e3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp860.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp861.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp861.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0892177037065b690d16cdddaf16bbd779d65fd5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp861.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp862.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp862.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a527837414715d0b2a7585cb05d2faac8c8e4dc4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp862.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp863.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp863.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6f0e611c1b681bfcb5f597fcc2feefae12ed1307 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp863.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp864.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp864.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..12238016a0fa03d7129ef2a51431c00af60b5e69 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp864.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp865.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp865.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4fc3d769d2ea786acda6d7ee1ad489b30e0889d7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp865.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp866.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp866.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..631b30203851c88d7bd24d637ee5448a6b9120aa Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp866.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp869.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp869.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..549f2a430b939244d718b098cd7b87906da6523e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp869.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp874.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp874.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5d8c1dc50fc9938bce2a2d75c2bdf6cced38ec05 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp874.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp875.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp875.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fed15791bbe3ba64a3e2c27ac9a12e6be106aad0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp875.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp932.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp932.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dbbbbac35cc54ebfbcf19d4294c95cfe4fb81c9e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp932.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp949.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp949.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..26377b82bc19fac011f0f18d70a42ac555ef745e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp949.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp950.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp950.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6534ef19595ba712952e1cfa5827bcce993addd7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/cp950.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/euc_jis_2004.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/euc_jis_2004.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6ee2c232a73f9ada99b52a12412b6ac99a9ccf77 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/euc_jis_2004.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/euc_jisx0213.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/euc_jisx0213.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dea7a0ba1112a652b7095c8ee41ae281cba81da5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/euc_jisx0213.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/euc_jp.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/euc_jp.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b05383181b03a6a0ec13a59176e45fb79544f40 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/euc_jp.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/euc_kr.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/euc_kr.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..917af07b2c3af434eadeccf488e3005f4f632fcf Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/euc_kr.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/gb18030.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/gb18030.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..96e4673c89e0ba990e7b15afa4d173a685230722 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/gb18030.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/gb2312.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/gb2312.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..11d7b5d67130a14878f5e0f729ffc6e430efd894 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/gb2312.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/gbk.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/gbk.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8448f0b3ffddb4d0bc9b7c63b14615e1d7c94db8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/gbk.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/hex_codec.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/hex_codec.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..33f328a0b536bd4eea5fb2144e6e0b6d066399a7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/hex_codec.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/hp_roman8.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/hp_roman8.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2f009bec28bd0c3cca9a934a2e16de9990998cb4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/hp_roman8.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/hz.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/hz.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e03c7cc327b715f69949057c6b47689052122051 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/hz.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/idna.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/idna.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a06b35f98ff162cc2cb774d772aaac5123fc231b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/idna.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_jp.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_jp.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8aeb4dd33a8843cff722e86bd8926b1be2b76331 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_jp.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_jp_1.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_jp_1.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6b3945bee3709101d79f4f7287ddcfa668a49673 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_jp_1.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_jp_2.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_jp_2.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..08510c811bd189839e944765050a9396de488fc3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_jp_2.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_jp_2004.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_jp_2004.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..39cf10269bc9e08d46045d0cad600b9d7fbfdbdf Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_jp_2004.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_jp_3.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_jp_3.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..93ee3b1099215416a11eb4eb40cf494bdb9cf794 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_jp_3.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_jp_ext.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_jp_ext.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..80528a66b31286e611e11b448d16c01050c30602 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_jp_ext.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_kr.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_kr.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..67ee3711afbf64d178288f626c74217694cf2ccf Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso2022_kr.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_1.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_1.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..651c404b829cfe84af5f93b394e7f67d6a646aca Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_1.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_10.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_10.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ac5b6f184a67acec57fd760755d46e6275e32278 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_10.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_11.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_11.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d607ee555704b74886d0e57b488ec079333c8b9f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_11.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_13.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_13.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b1e5ef5a7b182b79f1b2a285f6cab827036f2f06 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_13.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_14.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_14.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..83263b256857cac53a7bd9f9cf1d50a5da228e04 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_14.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_15.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_15.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9bc18f992cf17d0ae29a95de43647b6833d1d89e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_15.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_16.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_16.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..585009c712d22fe3d01236340aea2ebd735b2271 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_16.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_2.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_2.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4103f3c1d2bdff914e7f6f910c95fc3b7d1fbc20 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_2.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_3.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_3.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0ad4d5b3dbeafca7dd42e13bf1d4683f0e81a4f5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_3.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_4.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_4.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..772b0ff82afe7d2829927f878689deaf4b6ebb69 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_4.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_5.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_5.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..20b92f69cd59893cfad2030cdcdb8ccd4c30070a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_5.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_6.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_6.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0ea184103b2fcce6f3f9c6a76a267c32c6c27779 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_6.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_7.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_7.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4af1769a80baf96e4e2318be8f372de814e01161 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_7.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_8.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_8.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f22a23132c29adf9d950d3d0b02258395c29f0ec Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_8.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_9.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_9.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0637843ec55a55bb2a4a0bada1ad669af1ea07e0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/iso8859_9.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/johab.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/johab.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..158c914ee115129d86b867d212f21cb7f4b74136 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/johab.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/koi8_r.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/koi8_r.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a678b3c94299ab1f690564453382d1a6cc110893 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/koi8_r.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/koi8_t.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/koi8_t.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..722e4bb2fe552d077f56bc749e011f4b745c1b8d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/koi8_t.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/koi8_u.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/koi8_u.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6c64d9213cca0fad45a5bb43bb7de3baa66cbbc2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/koi8_u.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/kz1048.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/kz1048.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d5a41b727caeec3b5821dec8e17a1d54cee4040b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/kz1048.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/latin_1.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/latin_1.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fc76f532db385b022a8e198f144689b88f52dcce Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/latin_1.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_arabic.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_arabic.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7957631740935c05cd0d9b52d043d0a58f0586fd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_arabic.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_croatian.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_croatian.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cb394aa245f56c9dffa1d50ee3db2fc3a9818a47 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_croatian.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_cyrillic.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_cyrillic.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..88d30c618170c14fe42adce8e3ac91db72866f5a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_cyrillic.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_farsi.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_farsi.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..79a165a60ff49d88b152a90c15ca15b255963011 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_farsi.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_greek.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_greek.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..96730a6b6a4819f8aacf2ff0ebbe4592c28c51bd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_greek.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_iceland.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_iceland.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e88c6ae32c82e061475d4bd6b160298bd9feb1a9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_iceland.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_latin2.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_latin2.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..64b33888f82d2e7ca7df219c906931956d66868d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_latin2.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_roman.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_roman.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..68fee22ecdd1d361e8162f1e317c78776d727001 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_roman.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_romanian.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_romanian.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f9a85e09ef551c84638dfb9673b6d0c85b566fb9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_romanian.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_turkish.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_turkish.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5644ab148bb594c522f4fb43d96dcc0c393b9972 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mac_turkish.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mbcs.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mbcs.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b84b727fd7199dd038f65579dafead9f3a78328e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/mbcs.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/oem.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/oem.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..988096ed7f3f9844105c13a256b931ebdbf4e92e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/oem.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/palmos.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/palmos.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d3d1ce9a516c84900584cfd6565001a19345dd7a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/palmos.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/ptcp154.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/ptcp154.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..556f0004f7acc8ec9bb4d4949329b25b99d00f4b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/ptcp154.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/punycode.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/punycode.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0c5260967ce1a503878bfc45d784d4cbc09720f6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/punycode.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/quopri_codec.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/quopri_codec.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0375cce0bfbbe8b1cbef673f692da895fc9cc26b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/quopri_codec.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/raw_unicode_escape.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/raw_unicode_escape.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..54a184b2478c9500a480da2cb03fee9a74c2e9f7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/raw_unicode_escape.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/rot_13.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/rot_13.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d4c6b73fc67104c199b395f64a733b82d8507e2b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/rot_13.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/shift_jis.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/shift_jis.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0e6ce170b1c6195b702adfd8b8f3ba9a488d0ff9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/shift_jis.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/shift_jis_2004.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/shift_jis_2004.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4de5e97c1017ec9650d7657c4aa29e848939f320 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/shift_jis_2004.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/shift_jisx0213.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/shift_jisx0213.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b6e38fb3f685b064d9214b53335b0d8781255708 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/shift_jisx0213.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/tis_620.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/tis_620.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..76390dd2421ecc5a2910d17ec09f8a64a10ec7f3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/tis_620.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/undefined.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/undefined.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c6435f633bfaa5e1598c47d28924ea2625346b50 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/undefined.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/unicode_escape.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/unicode_escape.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1271d7c7f7ecb18805f53a4a4e6b105aba803a4d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/unicode_escape.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_16.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_16.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7b531cb2e34a15d195b35502b11dc13899b4ff21 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_16.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_16_be.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_16_be.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9f31f7e00b6a59a8600207d1f83893f0478d8989 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_16_be.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_16_le.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_16_le.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7356e9d216c4106e8787463f38be1b841a633393 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_16_le.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_32.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_32.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6049ed79ff68e52fbe76b58a822009da286a0c58 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_32.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_32_be.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_32_be.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e644eeb5671a6211e7073d405d482bb03c2e1232 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_32_be.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_32_le.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_32_le.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ae5dfab0bdd7f2051f55660f5d80b20b0c3d306b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_32_le.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_7.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_7.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4a614c83eab168f031dfb9b2f84112aae501a173 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_7.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_8.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_8.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3ef40c19cfef0185d40543cca5ebce438d25af98 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_8.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_8_sig.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_8_sig.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4ac7d3570450e5eada91c9b3d5aa39b118a482f9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/utf_8_sig.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/uu_codec.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/uu_codec.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7db051ab0c59171bbdd66c200dd504508e16b1b4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/uu_codec.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/zlib_codec.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/zlib_codec.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0f58148b8f1f7f79d2c5c756b0038e9e66295cbd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/zlib_codec.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ensurepip/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ensurepip/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ed626c94412f2853daa6334c0d7ac7462a037c67 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ensurepip/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ensurepip/__pycache__/__main__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ensurepip/__pycache__/__main__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0ddf18ca93f6d42a181f461547805e34dcc86ba1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ensurepip/__pycache__/__main__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ensurepip/__pycache__/_uninstall.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ensurepip/__pycache__/_uninstall.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..68991ec772bfd4f7cde84908efafa8d3df879d5d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ensurepip/__pycache__/_uninstall.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/html/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/html/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d66885e5ed1c506160d86327f0782cb608c10f9e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/html/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/html/__pycache__/entities.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/html/__pycache__/entities.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f3ecfd4e6a367fa6939388c7f2577e8bb77e383f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/html/__pycache__/entities.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/html/__pycache__/parser.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/html/__pycache__/parser.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..53b45ab843aa61ca382b8e941ef445617bb6b69e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/html/__pycache__/parser.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/http/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/http/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9717ce9841296f3856e699b65d4935e339cf8639 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/http/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/http/__pycache__/client.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/http/__pycache__/client.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c2612094274551d39cac992770ede800633ce34a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/http/__pycache__/client.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/http/__pycache__/cookiejar.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/http/__pycache__/cookiejar.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b39c0e415e5d92354b499f94524e9a76f0b053b2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/http/__pycache__/cookiejar.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/http/__pycache__/cookies.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/http/__pycache__/cookies.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4ebb22230c303a160b9d8521e681a126070c7cc1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/http/__pycache__/cookies.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/http/__pycache__/server.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/http/__pycache__/server.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..482acf7c10d5e6bd783a568388e5d826e733fbf0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/http/__pycache__/server.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/Icons/README.txt b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/Icons/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..d91c4d5d8d8cfa20b4994de21605b48f47ba430f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/Icons/README.txt @@ -0,0 +1,13 @@ +The IDLE icons are from https://bugs.python.org/issue1490384 + +Created by Andrew Clover. + +The original sources are available from Andrew's website: +https://www.doxdesk.com/software/py/pyicons.html + +Various different formats and sizes are available at this GitHub Pull Request: +https://github.com/python/cpython/pull/17473 + +The idle.ico file was created with ImageMagick: + + $ convert idle_16.png idle_32.png idle_48.png idle_256.png idle.ico diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/Icons/idle.ico b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/Icons/idle.ico new file mode 100644 index 0000000000000000000000000000000000000000..2aa9a8300d9e29670ecbe585f5ab21579dece9c2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/Icons/idle.ico differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..49dd5e7e789c59a99076c5348fb7d398900aa40b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/__main__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/__main__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6fd8db34bbd04cedbb8fdd1639d6068a91673cdc Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/__main__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/autocomplete.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/autocomplete.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..41c6677f5133faab129c2a3d7a0822b39e10458d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/autocomplete.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/autocomplete_w.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/autocomplete_w.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fc9d3e0ec62573d2002bcdeb293e2aa307884d39 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/autocomplete_w.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/autoexpand.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/autoexpand.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6f425c47212217fa47fbafcca82682d882c05d29 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/autoexpand.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/browser.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/browser.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8a48d6419bd0884700b76f8e46121e104f5a2092 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/browser.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/calltip.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/calltip.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fe434c425b32c2d3904a5b573fbc8d4197dbafb5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/calltip.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/calltip_w.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/calltip_w.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..16a655bb1495335fa21f8c1988690c3ed82a5e6f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/calltip_w.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/codecontext.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/codecontext.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2e9fba34198eb0338331bde9c8770d14f052e01a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/codecontext.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/colorizer.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/colorizer.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..52da6ecf752b281944b11919575551a4b215caae Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/colorizer.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/config.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/config.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2886cca3a5e501bb993233acd7f5c40f55b04d01 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/config.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/config_key.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/config_key.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3355c1166aa01e5bd2efe3dc6ed9f4b85cdc87c4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/config_key.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/debugger.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/debugger.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9fc41ac1d187d3afa605771116b22fe8603192eb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/debugger.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/debugger_r.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/debugger_r.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..933877d827935d46896318993be28e297c7ddb7d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/debugger_r.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/debugobj.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/debugobj.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d686d3790dfee7b0e1a305309fc7ddf5caba5b3f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/debugobj.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/debugobj_r.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/debugobj_r.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dd40819aade28ee1df41eb46d5dc42d491a05ab6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/debugobj_r.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/delegator.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/delegator.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2e35e80f5fe2de17bc519f21f6ca1568ca3c5c99 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/delegator.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/dynoption.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/dynoption.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3c5e121fa50d63a67a620f3f03b1e3c91ae2dd0c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/dynoption.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/editor.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/editor.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9cbb28b163c45b370acb061b26850974cc5f07b7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/editor.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/filelist.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/filelist.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fb66c9be3712abf8cab7aa6c8ae4980d51ea6214 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/filelist.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/format.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/format.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..68b79ca987896bf958e98fed5d172cf525b08bb1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/format.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/grep.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/grep.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0bf0efbcfebf922e1c28921dafcb10d918ea09a0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/grep.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/help.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/help.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3338647efaa24cf2766570a3015177a25a495ae2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/help.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/help_about.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/help_about.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..710fd80d49c4c559d02d8a4d86d5002656acc2d5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/help_about.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/history.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/history.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..45e6652e512c6105fc44381e49b6b5be28d16fff Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/history.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/hyperparser.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/hyperparser.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..447cf654b0797aa5df80e84c036ac71500f743c6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/hyperparser.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/idle.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/idle.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f5b5a02c71c9ccff450d511c0302e66bcefe169 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/idle.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/iomenu.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/iomenu.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b805f69df133a1bf1710618ee7a7932996f13b6d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/iomenu.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/macosx.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/macosx.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..edab49fd0768b313c709fd47a348fa69fdf4ff0e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/macosx.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/mainmenu.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/mainmenu.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e3293f3a1ec441f70a7fbeabe3b45d1c4deb22a6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/mainmenu.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/multicall.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/multicall.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..baaeeb792e4552465285ededd4d5ca8f127289cd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/multicall.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/outwin.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/outwin.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..53dc96b8cbf6953144f7456c5a033b962f22779a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/outwin.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/parenmatch.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/parenmatch.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bc81de510188c42275bb00e78b2563b8b45dec14 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/parenmatch.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/pathbrowser.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/pathbrowser.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..507a7532ef669b96ec3d85a2ffc79af4414647de Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/pathbrowser.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/percolator.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/percolator.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e10b61deca997a665257295869002faf3cb90bd3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/percolator.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/pyparse.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/pyparse.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b4299913c9caae350752fe6a9b218290eb2e8864 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/pyparse.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/pyshell.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/pyshell.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f1b372ab2e74ff2492d6eb109747a005798384b6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/pyshell.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/query.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/query.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2439016a42afb5316c10d81e557f3e2127f3e8fc Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/query.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/redirector.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/redirector.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8bc5b432ca801a0579a36bc139a8b6a05889d965 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/redirector.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/replace.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/replace.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ef902b41652c5ce07647511b43015ad73fc9ef51 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/replace.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/rpc.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/rpc.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..07a07bc2bd9fbca6fd316eb26de0008884bab9fe Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/rpc.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/run.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/run.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4122bcca24c2563acc5f9d63c59c559ed102410f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/run.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/runscript.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/runscript.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8536f1446a8ecb0513f08659fcfb03a9170c3613 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/runscript.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/scrolledlist.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/scrolledlist.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3a2fd807b512c1f1fd1d6dd37944ae3b3f732386 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/scrolledlist.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/search.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/search.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f38d3bb831b8b013e4f2e9e63f3d28a3913c8b4d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/search.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/searchbase.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/searchbase.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bf8a5222f28fba692da007a5e16df3d93f04c245 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/searchbase.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/searchengine.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/searchengine.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c92451504b31ab9b78dc200eee06e1471fd2eb72 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/searchengine.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/sidebar.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/sidebar.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..22d6884a13f42fdfb070ce05b3e39a4d3ececc85 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/sidebar.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/squeezer.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/squeezer.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eef43fa860f32085b666a406e1b974f4078813ef Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/squeezer.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/stackviewer.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/stackviewer.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..52096b8c4540050ec82063996102d4f12322619a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/stackviewer.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/statusbar.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/statusbar.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..91addab96158eb49aa2418917b235b131158f723 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/statusbar.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/textview.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/textview.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..de55ae07fabc5c723bc9d0b48317deaefd9a8f77 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/textview.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/tooltip.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/tooltip.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..20b12c6b70caf06cace46387823022915df508c3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/tooltip.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/tree.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/tree.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..379b26c4e9b2b431a2607edf93819c6a9574dcf4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/tree.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/undo.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/undo.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f3b299fc25dfd9787dca6b004ebb98929b53e102 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/undo.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/util.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/util.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a87a92a401d2c1511b84fb4d672b832fe50f712 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/util.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/window.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/window.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dde9c212b9ca2af4cb1f4f08720ebde11c1b3aef Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/window.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/zoomheight.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/zoomheight.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0a8142f312eeb9d2e9e01e12859f60c3701fda6d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/zoomheight.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/zzdummy.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/zzdummy.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2751ce372693b99bf511d9fd7daea2d950f4f53e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/zzdummy.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/README.txt b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..cacd06db873d039baa144a95fa45914565ca6197 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/README.txt @@ -0,0 +1,241 @@ +README FOR IDLE TESTS IN IDLELIB.IDLE_TEST + +0. Quick Start + +Automated unit tests were added in 3.3 for Python 3.x. +To run the tests from a command line: + +python -m test.test_idle + +Human-mediated tests were added later in 3.4. + +python -m idlelib.idle_test.htest + + +1. Test Files + +The idle directory, idlelib, has over 60 xyz.py files. The idle_test +subdirectory contains test_xyz.py for each implementation file xyz.py. +To add a test for abc.py, open idle_test/template.py and immediately +Save As test_abc.py. Insert 'abc' on the first line, and replace +'zzdummy' with 'abc. + +Remove the imports of requires and tkinter if not needed. Otherwise, +add to the tkinter imports as needed. + +Add a prefix to 'Test' for the initial test class. The template class +contains code needed or possibly needed for gui tests. See the next +section if doing gui tests. If not, and not needed for further classes, +this code can be removed. + +Add the following at the end of abc.py. If an htest was added first, +insert the import and main lines before the htest lines. + +if __name__ == "__main__": + from unittest import main + main('idlelib.idle_test.test_abc', verbosity=2, exit=False) + +The ', exit=False' is only needed if an htest follows. + + + +2. GUI Tests + +When run as part of the Python test suite, Idle GUI tests need to run +test.support.requires('gui'). A test is a GUI test if it creates a +tkinter.Tk root or master object either directly or indirectly by +instantiating a tkinter or idle class. GUI tests cannot run in test +processes that either have no graphical environment available or are not +allowed to use it. + +To guard a module consisting entirely of GUI tests, start with + +from test.support import requires +requires('gui') + +To guard a test class, put "requires('gui')" in its setUpClass function. +The template.py file does this. + +To avoid interfering with other GUI tests, all GUI objects must be +destroyed and deleted by the end of the test. The Tk root created in a +setUpX function should be destroyed in the corresponding tearDownX and +the module or class attribute deleted. Others widgets should descend +from the single root and the attributes deleted BEFORE root is +destroyed. See https://bugs.python.org/issue20567. + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = tk.Tk() + cls.text = tk.Text(root) + + @classmethod + def tearDownClass(cls): + del cls.text + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + +The update_idletasks call is sometimes needed to prevent the following +warning either when running a test alone or as part of the test suite +(#27196). It should not hurt if not needed. + + can't invoke "event" command: application has been destroyed + ... + "ttk::ThemeChanged" + +If a test creates instance 'e' of EditorWindow, call 'e._close()' before +or as the first part of teardown. The effect of omitting this depends +on the later shutdown. Then enable the after_cancel loop in the +template. This prevents messages like the following. + +bgerror failed to handle background error. + Original error: invalid command name "106096696timer_event" + Error in bgerror: can't invoke "tk" command: application has been destroyed + +Requires('gui') causes the test(s) it guards to be skipped if any of +these conditions are met: + + - The tests are being run by regrtest.py, and it was started without + enabling the "gui" resource with the "-u" command line option. + + - The tests are being run on Windows by a service that is not allowed + to interact with the graphical environment. + + - The tests are being run on Linux and X Windows is not available. + + - The tests are being run on Mac OSX in a process that cannot make a + window manager connection. + + - tkinter.Tk cannot be successfully instantiated for some reason. + + - test.support.use_resources has been set by something other than + regrtest.py and does not contain "gui". + +Tests of non-GUI operations should avoid creating tk widgets. Incidental +uses of tk variables and messageboxes can be replaced by the mock +classes in idle_test/mock_tk.py. The mock text handles some uses of the +tk Text widget. + + +3. Running Unit Tests + +Assume that xyz.py and test_xyz.py both end with a unittest.main() call. +Running either from an Idle editor runs all tests in the test_xyz file +with the version of Python running Idle. Test output appears in the +Shell window. The 'verbosity=2' option lists all test methods in the +file, which is appropriate when developing tests. The 'exit=False' +option is needed in xyx.py files when an htest follows. + +The following command lines also run all test methods, including +GUI tests, in test_xyz.py. (Both '-m idlelib' and '-m idlelib.idle' +start Idle and so cannot run tests.) + +python -m idlelib.xyz +python -m idlelib.idle_test.test_xyz + +The following runs all idle_test/test_*.py tests interactively. + +>>> import unittest +>>> unittest.main('idlelib.idle_test', verbosity=2) + +The following run all Idle tests at a command line. Option '-v' is the +same as 'verbosity=2'. + +python -m unittest -v idlelib.idle_test +python -m test -v -ugui test_idle +python -m test.test_idle + +IDLE tests are 'discovered' by idlelib.idle_test.__init__.load_tests +when this is imported into test.test_idle. Normally, neither file +should be changed when working on individual test modules. The third +command runs unittest indirectly through regrtest. The same happens when +the entire test suite is run with 'python -m test'. So that command must +work for buildbots to stay green. IDLE tests must not disturb the +environment in a way that makes other tests fail (GH-62281). + +To test subsets of modules, see idlelib.idle_test.__init__. This +can be used to find refleaks or possible sources of "Theme changed" +tcl messages (GH-71383). + +To run an individual Testcase or test method, extend the dotted name +given to unittest on the command line or use the test -m option. The +latter allows use of other regrtest options. When using the latter, +all components of the pattern must be present, but any can be replaced +by '*'. + +python -m unittest -v idlelib.idle_test.test_xyz.Test_case.test_meth +python -m test -m idlelib.idle_test.text_xyz.Test_case.test_meth test_idle + +The test suite can be run in an IDLE user process from Shell. +>>> import test.autotest # Issue 25588, 2017/10/13, 3.6.4, 3.7.0a2. +There are currently failures not usually present, and this does not +work when run from the editor. + + +4. Human-mediated Tests + +Human-mediated tests are widget tests that cannot be automated but need +human verification. They are contained in idlelib/idle_test/htest.py, +which has instructions. (Some modules need an auxiliary function, +identified with "# htest # on the header line.) The set is about +complete, though some tests need improvement. To run all htests, run the +htest file from an editor or from the command line with: + +python -m idlelib.idle_test.htest + + +5. Test Coverage + +Install the coverage package into your Python 3.6 site-packages +directory. (Its exact location depends on the OS). +> python3 -m pip install coverage +(On Windows, replace 'python3 with 'py -3.6' or perhaps just 'python'.) + +The problem with running coverage with repository python is that +coverage uses absolute imports for its submodules, hence it needs to be +in a directory in sys.path. One solution: copy the package to the +directory containing the cpython repository. Call it 'dev'. Then run +coverage either directly or from a script in that directory so that +'dev' is prepended to sys.path. + +Either edit or add dev/.coveragerc so it looks something like this. +--- +# .coveragerc sets coverage options. +[run] +branch = True + +[report] +# Regexes for lines to exclude from consideration +exclude_lines = + # Don't complain if non-runnable code isn't run: + if 0: + if __name__ == .__main__.: + + .*# htest # + if not _utest: + if _htest: +--- +The additions for IDLE are 'branch = True', to test coverage both ways, +and the last three exclude lines, to exclude things peculiar to IDLE +that are not executed during tests. + +A script like the following cover.bat (for Windows) is very handy. +--- +@echo off +rem Usage: cover filename [test_ suffix] # proper case required by coverage +rem filename without .py, 2nd parameter if test is not test_filename +setlocal +set py=f:\dev\3x\pcbuild\win32\python_d.exe +set src=idlelib.%1 +if "%2" EQU "" set tst=f:/dev/3x/Lib/idlelib/idle_test/test_%1.py +if "%2" NEQ "" set tst=f:/dev/ex/Lib/idlelib/idle_test/test_%2.py + +%py% -m coverage run --pylib --source=%src% %tst% +%py% -m coverage report --show-missing +%py% -m coverage html +start htmlcov\3x_Lib_idlelib_%1_py.html +rem Above opens new report; htmlcov\index.html displays report index +--- +The second parameter was added for tests of module x not named test_x. +(There were several before modules were renamed, now only one is left.) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..79b5d102dd7da5e0d07795c56fe28b5b70139442 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__init__.py @@ -0,0 +1,27 @@ +"""idlelib.idle_test implements test.test_idle, which tests the IDLE +application as part of the stdlib test suite. +Run IDLE tests alone with "python -m test.test_idle (-v)". + +This package and its contained modules are subject to change and +any direct use is at your own risk. +""" +from os.path import dirname + +# test_idle imports load_tests for test discovery (default all). +# To run subsets of idlelib module tests, insert '[]' after '_'. +# Example: insert '[ac]' for modules beginning with 'a' or 'c'. +# Additional .discover/.addTest pairs with separate inserts work. +# Example: pairs with 'c' and 'g' test c* files and grep. + +def load_tests(loader, standard_tests, pattern): + this_dir = dirname(__file__) + top_dir = dirname(dirname(this_dir)) + module_tests = loader.discover(start_dir=this_dir, + pattern='test_*.py', # Insert here. + top_level_dir=top_dir) + standard_tests.addTests(module_tests) +## module_tests = loader.discover(start_dir=this_dir, +## pattern='test_*.py', # Insert here. +## top_level_dir=top_dir) +## standard_tests.addTests(module_tests) + return standard_tests diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1e65ca8ddc644ab1c21911420dbdf7e0f1fdbf8e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/htest.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/htest.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f3c8d5bef5a21dea1c574891695f6e4a60df2ae5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/htest.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/mock_idle.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/mock_idle.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bd4a6198b9db9c00052cfb8fbdfcd1d394ae9d77 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/mock_idle.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/mock_tk.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/mock_tk.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..927d0d7685d35430f19c1f25c22a0a05314463aa Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/mock_tk.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/template.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/template.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..019db43fbbcf04ca0c040c4bedb88763f4a974b8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/template.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_autocomplete.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_autocomplete.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..927d6d445d9354b0ebda2556d33ecabb5ade78e4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_autocomplete.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_autocomplete_w.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_autocomplete_w.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d8bd94f5629e780d749d5a6a31b119ed4c7bca05 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_autocomplete_w.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_autoexpand.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_autoexpand.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4a7973b42330576452a137256ea970611d89ea80 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_autoexpand.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_browser.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_browser.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cd134d1160f4d545059bbefe5c3412bcbdd96c2f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_browser.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_calltip.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_calltip.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ae6233d4fc83ff722296778a6d92399024491139 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_calltip.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_calltip_w.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_calltip_w.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dadad3ba9be500d2628543cc2e5c1620bc773e63 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_calltip_w.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_codecontext.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_codecontext.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bbf49d467e1c02404b63a71335b1678b62191da1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_codecontext.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_colorizer.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_colorizer.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6dfb247c484082962793e8afb4edcb40ce09f3f5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_colorizer.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_config.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_config.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b0c4e4dce8866855157d280f927e35bfe1de61be Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_config.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_config_key.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_config_key.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..27d9fdb5b4b6cfd98ed01b16296c8fac53188e8b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_config_key.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_configdialog.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_configdialog.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3705688b00ad08a29539fa4b30db0fdf0df54426 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_configdialog.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_debugger.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_debugger.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..96bc58db527f62b2898f57a0df58f25424412b3f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_debugger.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_debugger_r.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_debugger_r.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dd5d47c949656e63f0e866370e5f10eb9f3834e1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_debugger_r.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_debugobj.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_debugobj.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4d2d91a2ba1c83f452134b4e4914ec0520a978ef Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_debugobj.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_debugobj_r.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_debugobj_r.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ab0a2f816e11b9f314a808573d575fa615814eea Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_debugobj_r.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_delegator.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_delegator.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1c605390616a10d2c2f6e3e21d28f4eb5a02244c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_delegator.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_editmenu.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_editmenu.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eda58c7d5affd9b7958af9dbfd5bd908a3bb0607 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_editmenu.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_editor.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_editor.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a13b1629eda440bdefac1695d86e0227a7860fcd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_editor.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_filelist.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_filelist.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..08b2dc3c27dc3016b588d3e498710d8e51c2023d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_filelist.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_format.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_format.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2ca7c974db39a677c7a71d0aa793746038dea016 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_format.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_grep.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_grep.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa36a8eda40fe0dfaddf2ac11dd9b171b0f90c4e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_grep.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_help.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_help.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d8c3c89a486efa66ff8cef6d3db16a37513fd899 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_help.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_help_about.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_help_about.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..938e36bd82772f4919ab21ffc3794e4b0dde446a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_help_about.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_history.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_history.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a8c5be65620c9789b1189fe7f6ef32eb1e2247de Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_history.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_hyperparser.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_hyperparser.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..97fa929085b1e937b05bf9fa124cb32404a4d12f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_hyperparser.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_iomenu.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_iomenu.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cdc2e5e53ca539e5dad9f44e9410346c41e46c3d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_iomenu.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_macosx.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_macosx.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..53c8fd81f50d3989a75ae125390a195d8333f954 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_macosx.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_mainmenu.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_mainmenu.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c71dce62dea61b74c2d5945368afaf8d04c58dad Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_mainmenu.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_multicall.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_multicall.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..44c2427f715e80883ddec2218ddd13ffb0b7b044 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_multicall.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_outwin.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_outwin.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7315e8a022b7cc4099d25eb2d2ec70a212d7caf8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_outwin.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_parenmatch.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_parenmatch.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ea231cf1a766f4eada70367624cd88290bb777b9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_parenmatch.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_pathbrowser.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_pathbrowser.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e7d7a3faf8e714ec529ead8670aa45601b44275d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_pathbrowser.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_percolator.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_percolator.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b4d2c29941432a089f06d4a28659140a7f7499bd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_percolator.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_pyparse.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_pyparse.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..54e33a9f5893406e8d6aba5f5ef37e52105a87b0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_pyparse.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_pyshell.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_pyshell.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7a3cee3c4e09365fd481fb058fe9c1660f7107e7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_pyshell.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_query.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_query.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e9114974c3906340400f01055a557ddd5a19318f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_query.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_redirector.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_redirector.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b8d542845f0cbeab9515382e850bc3836ca9545 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_redirector.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_replace.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_replace.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7785196abfb57bbdd171fb543d6d93e86e072027 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_replace.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_rpc.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_rpc.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c20215cf35de0b483d5c68f716b5ab6a86809ec3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_rpc.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_run.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_run.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c7b960d025dbb87858cb7fc449efed71e3ec71f0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_run.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_runscript.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_runscript.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c0cb902b0ac6030fb3c57e5b2ed59c8edd085914 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_runscript.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_scrolledlist.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_scrolledlist.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..afcd087db05f8423f79f1eefa74ff986b5620322 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_scrolledlist.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_search.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_search.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..44abec2a56bdbd22527ad9ec881e9d6a4d3c372b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_search.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_searchbase.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_searchbase.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..da3fb1fd8d5b4537e1e842ea726bd473e0575d6b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_searchbase.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_searchengine.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_searchengine.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..91552157b0bda2503b796468297ee0948d9121b6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_searchengine.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_sidebar.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_sidebar.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b19996e74967d95f0e14c02c7026266ca6d273db Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_sidebar.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_squeezer.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_squeezer.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6d436601721f938cc87c10516775f9415ab197ca Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_squeezer.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_stackviewer.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_stackviewer.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3169f9fa7ebf2fe128f22cbd7c7fe887d1fba975 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_stackviewer.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_statusbar.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_statusbar.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..411595f49d95bfe87415c43592548a1d24fd80bc Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_statusbar.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_text.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_text.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..57bd7dacdc7064d23790677437f478c2c1a7abcd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_text.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_textview.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_textview.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..01edf79fa9fbf32afb8eb0e48e43fcd153f1e765 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_textview.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_tooltip.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_tooltip.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..31c290c44401fc93225b03a7c385fdb184f78f29 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_tooltip.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_tree.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_tree.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8c65328eff0cc819c2ea6c877f8c21e396393ab6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_tree.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_undo.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_undo.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f283565aaa8e6a3b042680f63c0ffbc575927bab Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_undo.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_util.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_util.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a8ab38111cbface03ebe3334cd2224ee704391fe Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_util.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_warning.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_warning.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f7d74232492fa1b297b82cf5f7b509d408836a8d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_warning.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_window.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_window.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0029dab8c218482cb6af1ce7b4f25c8c934987cf Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_window.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_zoomheight.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_zoomheight.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d7e96d1d640af4c484b9e4ac60715f206d6078ed Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_zoomheight.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_zzdummy.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_zzdummy.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7df9acfa3ee1bdbd7e049cb463daa75a6437464a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/test_zzdummy.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/tkinter_testing_utils.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/tkinter_testing_utils.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ba9d67c4899683b15cff72c17039fc3f77abfcfb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/__pycache__/tkinter_testing_utils.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/example_noext b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/example_noext new file mode 100644 index 0000000000000000000000000000000000000000..7d2510e30bc0ae41fde1a2e2fa30cdbb55318893 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/example_noext @@ -0,0 +1,4 @@ +#!usr/bin/env python + +def example_function(some_argument): + pass diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/example_stub.pyi b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/example_stub.pyi new file mode 100644 index 0000000000000000000000000000000000000000..17b58010a9d8de8f6737998d6277dc51c823841e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/example_stub.pyi @@ -0,0 +1,4 @@ +" Example to test recognition of .pyi file as Python source code. + +class Example: + def method(self, argument1: str, argument2: list[int]) -> None: ... diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/htest.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/htest.py new file mode 100644 index 0000000000000000000000000000000000000000..a7293774eecaeb957314578baaad65f024b40387 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/htest.py @@ -0,0 +1,442 @@ +"""Run human tests of Idle's window, dialog, and popup widgets. + +run(*tests) Create a master Tk() htest window. Within that, run each +callable in tests after finding the matching test spec in this file. If +tests is empty, run an htest for each spec dict in this file after +finding the matching callable in the module named in the spec. Close +the master window to end testing. + +In a tested module, let X be a global name bound to a callable (class or +function) whose .__name__ attribute is also X (the usual situation). The +first parameter of X must be 'parent' or 'master'. When called, the +first argument will be the root window. X must create a child +Toplevel(parent/master) (or subclass thereof). The Toplevel may be a +test widget or dialog, in which case the callable is the corresponding +class. Or the Toplevel may contain the widget to be tested or set up a +context in which a test widget is invoked. In this latter case, the +callable is a wrapper function that sets up the Toplevel and other +objects. Wrapper function names, such as _editor_window', should start +with '_' and be lowercase. + + +End the module with + +if __name__ == '__main__': + + from idlelib.idle_test.htest import run + run(callable) # There could be multiple comma-separated callables. + +To have wrapper functions ignored by coverage reports, tag the def +header like so: "def _wrapper(parent): # htest #". Use the same tag +for htest lines in widget code. Make sure that the 'if __name__' line +matches the above. Then have make sure that .coveragerc includes the +following: + +[report] +exclude_lines = + .*# htest # + if __name__ == .__main__.: + +(The "." instead of "'" is intentional and necessary.) + + +To run any X, this file must contain a matching instance of the +following template, with X.__name__ prepended to '_spec'. +When all tests are run, the prefix is use to get X. + +callable_spec = { + 'file': '', + 'kwds': {'title': ''}, + 'msg': "" + } + +file (no .py): run() imports file.py. +kwds: augmented with {'parent':root} and passed to X as **kwds. +title: an example kwd; some widgets need this, delete line if not. +msg: master window hints about testing the widget. + + +TODO test these modules and classes: + autocomplete_w.AutoCompleteWindow + debugger.Debugger + outwin.OutputWindow (indirectly being tested with grep test) + pyshell.PyShellEditorWindow +""" + +import idlelib.pyshell # Set Windows DPI awareness before Tk(). +from importlib import import_module +import textwrap +import tkinter as tk +from tkinter.ttk import Scrollbar +tk.NoDefaultRoot() + +AboutDialog_spec = { + 'file': 'help_about', + 'kwds': {'title': 'help_about test', + '_htest': True, + }, + 'msg': "Click on URL to open in default browser.\n" + "Verify x.y.z versions and test each button, including Close.\n " + } + +# TODO implement ^\; adding '' to function does not work. +_calltip_window_spec = { + 'file': 'calltip_w', + 'kwds': {}, + 'msg': "Typing '(' should display a calltip.\n" + "Typing ') should hide the calltip.\n" + "So should moving cursor out of argument area.\n" + "Force-open-calltip does not work here.\n" + } + +_color_delegator_spec = { + 'file': 'colorizer', + 'kwds': {}, + 'msg': "The text is sample Python code.\n" + "Ensure components like comments, keywords, builtins,\n" + "string, definitions, and break are correctly colored.\n" + "The default color scheme is in idlelib/config-highlight.def" + } + +ConfigDialog_spec = { + 'file': 'configdialog', + 'kwds': {'title': 'ConfigDialogTest', + '_htest': True,}, + 'msg': "IDLE preferences dialog.\n" + "In the 'Fonts/Tabs' tab, changing font face, should update the " + "font face of the text in the area below it.\nIn the " + "'Highlighting' tab, try different color schemes. Clicking " + "items in the sample program should update the choices above it." + "\nIn the 'Keys', 'General' and 'Extensions' tabs, test settings " + "of interest." + "\n[Ok] to close the dialog.[Apply] to apply the settings and " + "and [Cancel] to revert all changes.\nRe-run the test to ensure " + "changes made have persisted." + } + +CustomRun_spec = { + 'file': 'query', + 'kwds': {'title': 'Customize query.py Run', + '_htest': True}, + 'msg': "Enter with or [OK]. Print valid entry to Shell\n" + "Arguments are parsed into a list\n" + "Mode is currently restart True or False\n" + "Close dialog with valid entry, , [Cancel], [X]" + } + +_debug_object_browser_spec = { + 'file': 'debugobj', + 'kwds': {}, + 'msg': "Double click on items up to the lowest level.\n" + "Attributes of the objects and related information " + "will be displayed side-by-side at each level." + } + +# TODO Improve message +_dyn_option_menu_spec = { + 'file': 'dynoption', + 'kwds': {}, + 'msg': "Select one of the many options in the 'old option set'.\n" + "Click the button to change the option set.\n" + "Select one of the many options in the 'new option set'." + } + +# TODO edit wrapper +_editor_window_spec = { + 'file': 'editor', + 'kwds': {}, + 'msg': "Test editor functions of interest.\n" + "Best to close editor first." + } + +GetKeysWindow_spec = { + 'file': 'config_key', + 'kwds': {'title': 'Test keybindings', + 'action': 'find-again', + 'current_key_sequences': [['', '', '']], + '_htest': True, + }, + 'msg': "Test for different key modifier sequences.\n" + " is invalid.\n" + "No modifier key is invalid.\n" + "Shift key with [a-z],[0-9], function key, move key, tab, space " + "is invalid.\nNo validity checking if advanced key binding " + "entry is used." + } + +_grep_dialog_spec = { + 'file': 'grep', + 'kwds': {}, + 'msg': "Click the 'Show GrepDialog' button.\n" + "Test the various 'Find-in-files' functions.\n" + "The results should be displayed in a new '*Output*' window.\n" + "'Right-click'->'Go to file/line' in the search results\n " + "should open that file in a new EditorWindow." + } + +HelpSource_spec = { + 'file': 'query', + 'kwds': {'title': 'Help name and source', + 'menuitem': 'test', + 'filepath': __file__, + 'used_names': {'abc'}, + '_htest': True}, + 'msg': "Enter menu item name and help file path\n" + "'', > than 30 chars, and 'abc' are invalid menu item names.\n" + "'' and file does not exist are invalid path items.\n" + "Any url ('www...', 'http...') is accepted.\n" + "Test Browse with and without path, as cannot unittest.\n" + "[Ok] or prints valid entry to shell\n" + ", [Cancel], or [X] prints None to shell" + } + +_io_binding_spec = { + 'file': 'iomenu', + 'kwds': {}, + 'msg': "Test the following bindings.\n" + " to open file from dialog.\n" + "Edit the file.\n" + " to print the file.\n" + " to save the file.\n" + " to save-as another file.\n" + " to save-copy-as another file.\n" + "Check that changes were saved by opening the file elsewhere." + } + +_multi_call_spec = { + 'file': 'multicall', + 'kwds': {}, + 'msg': "The following should trigger a print to console or IDLE Shell.\n" + "Entering and leaving the text area, key entry, ,\n" + ", , , \n" + ", and focusing elsewhere." + } + +_module_browser_spec = { + 'file': 'browser', + 'kwds': {}, + 'msg': textwrap.dedent(""" + "Inspect names of module, class(with superclass if applicable), + "methods and functions. Toggle nested items. Double clicking + "on items prints a traceback for an exception that is ignored.""") + } + +_multistatus_bar_spec = { + 'file': 'statusbar', + 'kwds': {}, + 'msg': "Ensure presence of multi-status bar below text area.\n" + "Click 'Update Status' to change the status text" + } + +PathBrowser_spec = { + 'file': 'pathbrowser', + 'kwds': {'_htest': True}, + 'msg': "Test for correct display of all paths in sys.path.\n" + "Toggle nested items out to the lowest level.\n" + "Double clicking on an item prints a traceback\n" + "for an exception that is ignored." + } + +_percolator_spec = { + 'file': 'percolator', + 'kwds': {}, + 'msg': "There are two tracers which can be toggled using a checkbox.\n" + "Toggling a tracer 'on' by checking it should print tracer " + "output to the console or to the IDLE shell.\n" + "If both the tracers are 'on', the output from the tracer which " + "was switched 'on' later, should be printed first\n" + "Test for actions like text entry, and removal." + } + +Query_spec = { + 'file': 'query', + 'kwds': {'title': 'Query', + 'message': 'Enter something', + 'text0': 'Go', + '_htest': True}, + 'msg': "Enter with or [Ok]. Print valid entry to Shell\n" + "Blank line, after stripping, is ignored\n" + "Close dialog with valid entry, , [Cancel], [X]" + } + + +_replace_dialog_spec = { + 'file': 'replace', + 'kwds': {}, + 'msg': "Click the 'Replace' button.\n" + "Test various replace options in the 'Replace dialog'.\n" + "Click [Close] or [X] to close the 'Replace Dialog'." + } + +_scrolled_list_spec = { + 'file': 'scrolledlist', + 'kwds': {}, + 'msg': "You should see a scrollable list of items\n" + "Selecting (clicking) or double clicking an item " + "prints the name to the console or Idle shell.\n" + "Right clicking an item will display a popup." + } + +_search_dialog_spec = { + 'file': 'search', + 'kwds': {}, + 'msg': "Click the 'Search' button.\n" + "Test various search options in the 'Search dialog'.\n" + "Click [Close] or [X] to close the 'Search Dialog'." + } + +_searchbase_spec = { + 'file': 'searchbase', + 'kwds': {}, + 'msg': "Check the appearance of the base search dialog\n" + "Its only action is to close." + } + +show_idlehelp_spec = { + 'file': 'help', + 'kwds': {}, + 'msg': "If the help text displays, this works.\n" + "Text is selectable. Window is scrollable." + } + +_sidebar_number_scrolling_spec = { + 'file': 'sidebar', + 'kwds': {}, + 'msg': textwrap.dedent("""\ + 1. Click on the line numbers and drag down below the edge of the + window, moving the mouse a bit and then leaving it there for a + while. The text and line numbers should gradually scroll down, + with the selection updated continuously. + + 2. With the lines still selected, click on a line number above + or below the selected lines. Only the line whose number was + clicked should be selected. + + 3. Repeat step #1, dragging to above the window. The text and + line numbers should gradually scroll up, with the selection + updated continuously. + + 4. Repeat step #2, clicking a line number below the selection."""), + } + +_stackbrowser_spec = { + 'file': 'stackviewer', + 'kwds': {}, + 'msg': "A stacktrace for a NameError exception.\n" + "Should have NameError and 1 traceback line." + } + +_tooltip_spec = { + 'file': 'tooltip', + 'kwds': {}, + 'msg': "Place mouse cursor over both the buttons\n" + "A tooltip should appear with some text." + } + +_tree_widget_spec = { + 'file': 'tree', + 'kwds': {}, + 'msg': "The canvas is scrollable.\n" + "Click on folders up to to the lowest level." + } + +_undo_delegator_spec = { + 'file': 'undo', + 'kwds': {}, + 'msg': "Click [Undo] to undo any action.\n" + "Click [Redo] to redo any action.\n" + "Click [Dump] to dump the current state " + "by printing to the console or the IDLE shell.\n" + } + +ViewWindow_spec = { + 'file': 'textview', + 'kwds': {'title': 'Test textview', + 'contents': 'The quick brown fox jumps over the lazy dog.\n'*35, + '_htest': True}, + 'msg': "Test for read-only property of text.\n" + "Select text, scroll window, close" + } + +_widget_redirector_spec = { + 'file': 'redirector', + 'kwds': {}, + 'msg': "Every text insert should be printed to the console " + "or the IDLE shell." + } + +def run(*tests): + "Run callables in tests." + root = tk.Tk() + root.title('IDLE htest') + root.resizable(0, 0) + + # A scrollable Label-like constant width text widget. + frameLabel = tk.Frame(root, padx=10) + frameLabel.pack() + text = tk.Text(frameLabel, wrap='word') + text.configure(bg=root.cget('bg'), relief='flat', height=4, width=70) + scrollbar = Scrollbar(frameLabel, command=text.yview) + text.config(yscrollcommand=scrollbar.set) + scrollbar.pack(side='right', fill='y', expand=False) + text.pack(side='left', fill='both', expand=True) + + test_list = [] # Make list of (spec, callable) tuples. + if tests: + for test in tests: + test_spec = globals()[test.__name__ + '_spec'] + test_spec['name'] = test.__name__ + test_list.append((test_spec, test)) + else: + for key, dic in globals().items(): + if key.endswith('_spec'): + test_name = key[:-5] + test_spec = dic + test_spec['name'] = test_name + mod = import_module('idlelib.' + test_spec['file']) + test = getattr(mod, test_name) + test_list.append((test_spec, test)) + test_list.reverse() # So can pop in proper order in next_test. + + test_name = tk.StringVar(root) + callable_object = None + test_kwds = None + + def next_test(): + nonlocal test_name, callable_object, test_kwds + if len(test_list) == 1: + next_button.pack_forget() + test_spec, callable_object = test_list.pop() + test_kwds = test_spec['kwds'] + test_name.set('Test ' + test_spec['name']) + + text['state'] = 'normal' # Enable text replacement. + text.delete('1.0', 'end') + text.insert("1.0", test_spec['msg']) + text['state'] = 'disabled' # Restore read-only property. + + def run_test(_=None): + widget = callable_object(root, **test_kwds) + try: + print(widget.result) # Only true for query classes(?). + except AttributeError: + pass + + def close(_=None): + root.destroy() + + button = tk.Button(root, textvariable=test_name, + default='active', command=run_test) + next_button = tk.Button(root, text="Next", command=next_test) + button.pack() + next_button.pack() + next_button.focus_set() + root.bind('', run_test) + root.bind('', close) + + next_test() + root.mainloop() + + +if __name__ == '__main__': + run() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/mock_idle.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/mock_idle.py new file mode 100644 index 0000000000000000000000000000000000000000..71fa480ce4d05c1d4bcb32fb1cf2d10f8695a2e5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/mock_idle.py @@ -0,0 +1,61 @@ +'''Mock classes that imitate idlelib modules or classes. + +Attributes and methods will be added as needed for tests. +''' + +from idlelib.idle_test.mock_tk import Text + +class Func: + '''Record call, capture args, return/raise result set by test. + + When mock function is called, set or use attributes: + self.called - increment call number even if no args, kwds passed. + self.args - capture positional arguments. + self.kwds - capture keyword arguments. + self.result - return or raise value set in __init__. + self.return_self - return self instead, to mock query class return. + + Most common use will probably be to mock instance methods. + Given class instance, can set and delete as instance attribute. + Mock_tk.Var and Mbox_func are special variants of this. + ''' + def __init__(self, result=None, return_self=False): + self.called = 0 + self.result = result + self.return_self = return_self + self.args = None + self.kwds = None + def __call__(self, *args, **kwds): + self.called += 1 + self.args = args + self.kwds = kwds + if isinstance(self.result, BaseException): + raise self.result + elif self.return_self: + return self + else: + return self.result + + +class Editor: + '''Minimally imitate editor.EditorWindow class. + ''' + def __init__(self, flist=None, filename=None, key=None, root=None, + text=None): # Allow real Text with mock Editor. + self.text = text or Text() + self.undo = UndoDelegator() + + def get_selection_indices(self): + first = self.text.index('1.0') + last = self.text.index('end') + return first, last + + +class UndoDelegator: + '''Minimally imitate undo.UndoDelegator class. + ''' + # A real undo block is only needed for user interaction. + def undo_block_start(*args): + pass + def undo_block_stop(*args): + pass diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/mock_tk.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/mock_tk.py new file mode 100644 index 0000000000000000000000000000000000000000..8304734b847a835e5ad17227a66a0ff3b21eeaf7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/mock_tk.py @@ -0,0 +1,307 @@ +"""Classes that replace tkinter gui objects used by an object being tested. + +A gui object is anything with a master or parent parameter, which is +typically required in spite of what the doc strings say. +""" +import re +from _tkinter import TclError + + +class Event: + '''Minimal mock with attributes for testing event handlers. + + This is not a gui object, but is used as an argument for callbacks + that access attributes of the event passed. If a callback ignores + the event, other than the fact that is happened, pass 'event'. + + Keyboard, mouse, window, and other sources generate Event instances. + Event instances have the following attributes: serial (number of + event), time (of event), type (of event as number), widget (in which + event occurred), and x,y (position of mouse). There are other + attributes for specific events, such as keycode for key events. + tkinter.Event.__doc__ has more but is still not complete. + ''' + def __init__(self, **kwds): + "Create event with attributes needed for test" + self.__dict__.update(kwds) + + +class Var: + "Use for String/Int/BooleanVar: incomplete" + def __init__(self, master=None, value=None, name=None): + self.master = master + self.value = value + self.name = name + def set(self, value): + self.value = value + def get(self): + return self.value + + +class Mbox_func: + """Generic mock for messagebox functions, which all have the same signature. + + Instead of displaying a message box, the mock's call method saves the + arguments as instance attributes, which test functions can then examine. + The test can set the result returned to ask function + """ + def __init__(self, result=None): + self.result = result # Return None for all show funcs + def __call__(self, title, message, *args, **kwds): + # Save all args for possible examination by tester + self.title = title + self.message = message + self.args = args + self.kwds = kwds + return self.result # Set by tester for ask functions + + +class Mbox: + """Mock for tkinter.messagebox with an Mbox_func for each function. + + Example usage in test_module.py for testing functions in module.py: + --- +from idlelib.idle_test.mock_tk import Mbox +import module + +orig_mbox = module.messagebox +showerror = Mbox.showerror # example, for attribute access in test methods + +class Test(unittest.TestCase): + + @classmethod + def setUpClass(cls): + module.messagebox = Mbox + + @classmethod + def tearDownClass(cls): + module.messagebox = orig_mbox + --- + For 'ask' functions, set func.result return value before calling the method + that uses the message function. When messagebox functions are the + only GUI calls in a method, this replacement makes the method GUI-free, + """ + askokcancel = Mbox_func() # True or False + askquestion = Mbox_func() # 'yes' or 'no' + askretrycancel = Mbox_func() # True or False + askyesno = Mbox_func() # True or False + askyesnocancel = Mbox_func() # True, False, or None + showerror = Mbox_func() # None + showinfo = Mbox_func() # None + showwarning = Mbox_func() # None + + +class Text: + """A semi-functional non-gui replacement for tkinter.Text text editors. + + The mock's data model is that a text is a list of \n-terminated lines. + The mock adds an empty string at the beginning of the list so that the + index of actual lines start at 1, as with Tk. The methods never see this. + Tk initializes files with a terminal \n that cannot be deleted. It is + invisible in the sense that one cannot move the cursor beyond it. + + This class is only tested (and valid) with strings of ascii chars. + For testing, we are not concerned with Tk Text's treatment of, + for instance, 0-width characters or character + accent. + """ + def __init__(self, master=None, cnf={}, **kw): + '''Initialize mock, non-gui, text-only Text widget. + + At present, all args are ignored. Almost all affect visual behavior. + There are just a few Text-only options that affect text behavior. + ''' + self.data = ['', '\n'] + + def index(self, index): + "Return string version of index decoded according to current text." + return "%s.%s" % self._decode(index, endflag=1) + + def _decode(self, index, endflag=0): + """Return a (line, char) tuple of int indexes into self.data. + + This implements .index without converting the result back to a string. + The result is constrained by the number of lines and linelengths of + self.data. For many indexes, the result is initially (1, 0). + + The input index may have any of several possible forms: + * line.char float: converted to 'line.char' string; + * 'line.char' string, where line and char are decimal integers; + * 'line.char lineend', where lineend='lineend' (and char is ignored); + * 'line.end', where end='end' (same as above); + * 'insert', the positions before terminal \n; + * 'end', whose meaning depends on the endflag passed to ._endex. + * 'sel.first' or 'sel.last', where sel is a tag -- not implemented. + """ + if isinstance(index, (float, bytes)): + index = str(index) + try: + index=index.lower() + except AttributeError: + raise TclError('bad text index "%s"' % index) from None + + lastline = len(self.data) - 1 # same as number of text lines + if index == 'insert': + return lastline, len(self.data[lastline]) - 1 + elif index == 'end': + return self._endex(endflag) + + line, char = index.split('.') + line = int(line) + + # Out of bounds line becomes first or last ('end') index + if line < 1: + return 1, 0 + elif line > lastline: + return self._endex(endflag) + + linelength = len(self.data[line]) -1 # position before/at \n + if char.endswith(' lineend') or char == 'end': + return line, linelength + # Tk requires that ignored chars before ' lineend' be valid int + if m := re.fullmatch(r'end-(\d*)c', char, re.A): # Used by hyperparser. + return line, linelength - int(m.group(1)) + + # Out of bounds char becomes first or last index of line + char = int(char) + if char < 0: + char = 0 + elif char > linelength: + char = linelength + return line, char + + def _endex(self, endflag): + '''Return position for 'end' or line overflow corresponding to endflag. + + -1: position before terminal \n; for .insert(), .delete + 0: position after terminal \n; for .get, .delete index 1 + 1: same viewed as beginning of non-existent next line (for .index) + ''' + n = len(self.data) + if endflag == 1: + return n, 0 + else: + n -= 1 + return n, len(self.data[n]) + endflag + + def insert(self, index, chars): + "Insert chars before the character at index." + + if not chars: # ''.splitlines() is [], not [''] + return + chars = chars.splitlines(True) + if chars[-1][-1] == '\n': + chars.append('') + line, char = self._decode(index, -1) + before = self.data[line][:char] + after = self.data[line][char:] + self.data[line] = before + chars[0] + self.data[line+1:line+1] = chars[1:] + self.data[line+len(chars)-1] += after + + def get(self, index1, index2=None): + "Return slice from index1 to index2 (default is 'index1+1')." + + startline, startchar = self._decode(index1) + if index2 is None: + endline, endchar = startline, startchar+1 + else: + endline, endchar = self._decode(index2) + + if startline == endline: + return self.data[startline][startchar:endchar] + else: + lines = [self.data[startline][startchar:]] + for i in range(startline+1, endline): + lines.append(self.data[i]) + lines.append(self.data[endline][:endchar]) + return ''.join(lines) + + def delete(self, index1, index2=None): + '''Delete slice from index1 to index2 (default is 'index1+1'). + + Adjust default index2 ('index+1) for line ends. + Do not delete the terminal \n at the very end of self.data ([-1][-1]). + ''' + startline, startchar = self._decode(index1, -1) + if index2 is None: + if startchar < len(self.data[startline])-1: + # not deleting \n + endline, endchar = startline, startchar+1 + elif startline < len(self.data) - 1: + # deleting non-terminal \n, convert 'index1+1 to start of next line + endline, endchar = startline+1, 0 + else: + # do not delete terminal \n if index1 == 'insert' + return + else: + endline, endchar = self._decode(index2, -1) + # restricting end position to insert position excludes terminal \n + + if startline == endline and startchar < endchar: + self.data[startline] = self.data[startline][:startchar] + \ + self.data[startline][endchar:] + elif startline < endline: + self.data[startline] = self.data[startline][:startchar] + \ + self.data[endline][endchar:] + startline += 1 + for i in range(startline, endline+1): + del self.data[startline] + + def compare(self, index1, op, index2): + line1, char1 = self._decode(index1) + line2, char2 = self._decode(index2) + if op == '<': + return line1 < line2 or line1 == line2 and char1 < char2 + elif op == '<=': + return line1 < line2 or line1 == line2 and char1 <= char2 + elif op == '>': + return line1 > line2 or line1 == line2 and char1 > char2 + elif op == '>=': + return line1 > line2 or line1 == line2 and char1 >= char2 + elif op == '==': + return line1 == line2 and char1 == char2 + elif op == '!=': + return line1 != line2 or char1 != char2 + else: + raise TclError('''bad comparison operator "%s": ''' + '''must be <, <=, ==, >=, >, or !=''' % op) + + # The following Text methods normally do something and return None. + # Whether doing nothing is sufficient for a test will depend on the test. + + def mark_set(self, name, index): + "Set mark *name* before the character at index." + pass + + def mark_unset(self, *markNames): + "Delete all marks in markNames." + + def tag_remove(self, tagName, index1, index2=None): + "Remove tag tagName from all characters between index1 and index2." + pass + + # The following Text methods affect the graphics screen and return None. + # Doing nothing should always be sufficient for tests. + + def scan_dragto(self, x, y): + "Adjust the view of the text according to scan_mark" + + def scan_mark(self, x, y): + "Remember the current X, Y coordinates." + + def see(self, index): + "Scroll screen to make the character at INDEX is visible." + pass + + # The following is a Misc method inherited by Text. + # It should properly go in a Misc mock, but is included here for now. + + def bind(sequence=None, func=None, add=None): + "Bind to this widget at event sequence a call to function func." + pass + + +class Entry: + "Mock for tkinter.Entry." + def focus_set(self): + pass diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/template.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/template.py new file mode 100644 index 0000000000000000000000000000000000000000..725a55b9c47230c32c63b3e6cd036f0319173046 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/template.py @@ -0,0 +1,30 @@ +"Test , coverage %." + +from idlelib import zzdummy +import unittest +from test.support import requires +from tkinter import Tk + + +class Test(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + + @classmethod + def tearDownClass(cls): + cls.root.update_idletasks() +## for id in cls.root.tk.call('after', 'info'): +## cls.root.after_cancel(id) # Need for EditorWindow. + cls.root.destroy() + del cls.root + + def test_init(self): + self.assertTrue(True) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_autocomplete.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_autocomplete.py new file mode 100644 index 0000000000000000000000000000000000000000..a811363c18d04e5770ec7071e08f0273dd04f0bf --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_autocomplete.py @@ -0,0 +1,305 @@ +"Test autocomplete, coverage 93%." + +import unittest +from unittest.mock import Mock, patch +from test.support import requires +from tkinter import Tk, Text +import os +import __main__ + +import idlelib.autocomplete as ac +import idlelib.autocomplete_w as acw +from idlelib.idle_test.mock_idle import Func +from idlelib.idle_test.mock_tk import Event + + +class DummyEditwin: + def __init__(self, root, text): + self.root = root + self.text = text + self.indentwidth = 8 + self.tabwidth = 8 + self.prompt_last_line = '>>>' # Currently not used by autocomplete. + + +class AutoCompleteTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.text = Text(cls.root) + cls.editor = DummyEditwin(cls.root, cls.text) + + @classmethod + def tearDownClass(cls): + del cls.editor, cls.text + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def setUp(self): + self.text.delete('1.0', 'end') + self.autocomplete = ac.AutoComplete(self.editor) + + def test_init(self): + self.assertEqual(self.autocomplete.editwin, self.editor) + self.assertEqual(self.autocomplete.text, self.text) + + def test_make_autocomplete_window(self): + testwin = self.autocomplete._make_autocomplete_window() + self.assertIsInstance(testwin, acw.AutoCompleteWindow) + + def test_remove_autocomplete_window(self): + acp = self.autocomplete + acp.autocompletewindow = m = Mock() + acp._remove_autocomplete_window() + m.hide_window.assert_called_once() + self.assertIsNone(acp.autocompletewindow) + + def test_force_open_completions_event(self): + # Call _open_completions and break. + acp = self.autocomplete + open_c = Func() + acp.open_completions = open_c + self.assertEqual(acp.force_open_completions_event('event'), 'break') + self.assertEqual(open_c.args[0], ac.FORCE) + + def test_autocomplete_event(self): + Equal = self.assertEqual + acp = self.autocomplete + + # Result of autocomplete event: If modified tab, None. + ev = Event(mc_state=True) + self.assertIsNone(acp.autocomplete_event(ev)) + del ev.mc_state + + # If tab after whitespace, None. + self.text.insert('1.0', ' """Docstring.\n ') + self.assertIsNone(acp.autocomplete_event(ev)) + self.text.delete('1.0', 'end') + + # If active autocomplete window, complete() and 'break'. + self.text.insert('1.0', 're.') + acp.autocompletewindow = mock = Mock() + mock.is_active = Mock(return_value=True) + Equal(acp.autocomplete_event(ev), 'break') + mock.complete.assert_called_once() + acp.autocompletewindow = None + + # If no active autocomplete window, open_completions(), None/break. + open_c = Func(result=False) + acp.open_completions = open_c + Equal(acp.autocomplete_event(ev), None) + Equal(open_c.args[0], ac.TAB) + open_c.result = True + Equal(acp.autocomplete_event(ev), 'break') + Equal(open_c.args[0], ac.TAB) + + def test_try_open_completions_event(self): + Equal = self.assertEqual + text = self.text + acp = self.autocomplete + trycompletions = acp.try_open_completions_event + after = Func(result='after1') + acp.text.after = after + + # If no text or trigger, after not called. + trycompletions() + Equal(after.called, 0) + text.insert('1.0', 're') + trycompletions() + Equal(after.called, 0) + + # Attribute needed, no existing callback. + text.insert('insert', ' re.') + acp._delayed_completion_id = None + trycompletions() + Equal(acp._delayed_completion_index, text.index('insert')) + Equal(after.args, + (acp.popupwait, acp._delayed_open_completions, ac.TRY_A)) + cb1 = acp._delayed_completion_id + Equal(cb1, 'after1') + + # File needed, existing callback cancelled. + text.insert('insert', ' "./Lib/') + after.result = 'after2' + cancel = Func() + acp.text.after_cancel = cancel + trycompletions() + Equal(acp._delayed_completion_index, text.index('insert')) + Equal(cancel.args, (cb1,)) + Equal(after.args, + (acp.popupwait, acp._delayed_open_completions, ac.TRY_F)) + Equal(acp._delayed_completion_id, 'after2') + + def test_delayed_open_completions(self): + Equal = self.assertEqual + acp = self.autocomplete + open_c = Func() + acp.open_completions = open_c + self.text.insert('1.0', '"dict.') + + # Set autocomplete._delayed_completion_id to None. + # Text index changed, don't call open_completions. + acp._delayed_completion_id = 'after' + acp._delayed_completion_index = self.text.index('insert+1c') + acp._delayed_open_completions('dummy') + self.assertIsNone(acp._delayed_completion_id) + Equal(open_c.called, 0) + + # Text index unchanged, call open_completions. + acp._delayed_completion_index = self.text.index('insert') + acp._delayed_open_completions((1, 2, 3, ac.FILES)) + self.assertEqual(open_c.args[0], (1, 2, 3, ac.FILES)) + + def test_oc_cancel_comment(self): + none = self.assertIsNone + acp = self.autocomplete + + # Comment is in neither code or string. + acp._delayed_completion_id = 'after' + after = Func(result='after') + acp.text.after_cancel = after + self.text.insert(1.0, '# comment') + none(acp.open_completions(ac.TAB)) # From 'else' after 'elif'. + none(acp._delayed_completion_id) + + def test_oc_no_list(self): + acp = self.autocomplete + fetch = Func(result=([],[])) + acp.fetch_completions = fetch + self.text.insert('1.0', 'object') + self.assertIsNone(acp.open_completions(ac.TAB)) + self.text.insert('insert', '.') + self.assertIsNone(acp.open_completions(ac.TAB)) + self.assertEqual(fetch.called, 2) + + + def test_open_completions_none(self): + # Test other two None returns. + none = self.assertIsNone + acp = self.autocomplete + + # No object for attributes or need call not allowed. + self.text.insert(1.0, '.') + none(acp.open_completions(ac.TAB)) + self.text.insert('insert', ' int().') + none(acp.open_completions(ac.TAB)) + + # Blank or quote trigger 'if complete ...'. + self.text.delete(1.0, 'end') + self.assertFalse(acp.open_completions(ac.TAB)) + self.text.insert('1.0', '"') + self.assertFalse(acp.open_completions(ac.TAB)) + self.text.delete('1.0', 'end') + + class dummy_acw: + __init__ = Func() + show_window = Func(result=False) + hide_window = Func() + + def test_open_completions(self): + # Test completions of files and attributes. + acp = self.autocomplete + fetch = Func(result=(['tem'],['tem', '_tem'])) + acp.fetch_completions = fetch + def make_acw(): return self.dummy_acw() + acp._make_autocomplete_window = make_acw + + self.text.insert('1.0', 'int.') + acp.open_completions(ac.TAB) + self.assertIsInstance(acp.autocompletewindow, self.dummy_acw) + self.text.delete('1.0', 'end') + + # Test files. + self.text.insert('1.0', '"t') + self.assertTrue(acp.open_completions(ac.TAB)) + self.text.delete('1.0', 'end') + + def test_completion_kwds(self): + self.assertIn('and', ac.completion_kwds) + self.assertIn('case', ac.completion_kwds) + self.assertNotIn('None', ac.completion_kwds) + + def test_fetch_completions(self): + # Test that fetch_completions returns 2 lists: + # For attribute completion, a large list containing all variables, and + # a small list containing non-private variables. + # For file completion, a large list containing all files in the path, + # and a small list containing files that do not start with '.'. + acp = self.autocomplete + small, large = acp.fetch_completions( + '', ac.ATTRS) + if hasattr(__main__, '__file__') and __main__.__file__ != ac.__file__: + self.assertNotIn('AutoComplete', small) # See issue 36405. + + # Test attributes + s, b = acp.fetch_completions('', ac.ATTRS) + self.assertLess(len(small), len(large)) + self.assertTrue(all(filter(lambda x: x.startswith('_'), s))) + self.assertTrue(any(filter(lambda x: x.startswith('_'), b))) + + # Test smalll should respect to __all__. + with patch.dict('__main__.__dict__', {'__all__': ['a', 'b']}): + s, b = acp.fetch_completions('', ac.ATTRS) + self.assertEqual(s, ['a', 'b']) + self.assertIn('__name__', b) # From __main__.__dict__. + self.assertIn('sum', b) # From __main__.__builtins__.__dict__. + self.assertIn('nonlocal', b) # From keyword.kwlist. + pos = b.index('False') # Test False not included twice. + self.assertNotEqual(b[pos+1], 'False') + + # Test attributes with name entity. + mock = Mock() + mock._private = Mock() + with patch.dict('__main__.__dict__', {'foo': mock}): + s, b = acp.fetch_completions('foo', ac.ATTRS) + self.assertNotIn('_private', s) + self.assertIn('_private', b) + self.assertEqual(s, [i for i in sorted(dir(mock)) if i[:1] != '_']) + self.assertEqual(b, sorted(dir(mock))) + + # Test files + def _listdir(path): + # This will be patch and used in fetch_completions. + if path == '.': + return ['foo', 'bar', '.hidden'] + return ['monty', 'python', '.hidden'] + + with patch.object(os, 'listdir', _listdir): + s, b = acp.fetch_completions('', ac.FILES) + self.assertEqual(s, ['bar', 'foo']) + self.assertEqual(b, ['.hidden', 'bar', 'foo']) + + s, b = acp.fetch_completions('~', ac.FILES) + self.assertEqual(s, ['monty', 'python']) + self.assertEqual(b, ['.hidden', 'monty', 'python']) + + def test_get_entity(self): + # Test that a name is in the namespace of sys.modules and + # __main__.__dict__. + acp = self.autocomplete + Equal = self.assertEqual + + Equal(acp.get_entity('int'), int) + + # Test name from sys.modules. + mock = Mock() + with patch.dict('sys.modules', {'tempfile': mock}): + Equal(acp.get_entity('tempfile'), mock) + + # Test name from __main__.__dict__. + di = {'foo': 10, 'bar': 20} + with patch.dict('__main__.__dict__', {'d': di}): + Equal(acp.get_entity('d'), di) + + # Test name not in namespace. + with patch.dict('__main__.__dict__', {}): + with self.assertRaises(NameError): + acp.get_entity('not_exist') + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_autocomplete_w.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_autocomplete_w.py new file mode 100644 index 0000000000000000000000000000000000000000..a59a375c90fd807e1d3219cde60b3f2612d24fac --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_autocomplete_w.py @@ -0,0 +1,32 @@ +"Test autocomplete_w, coverage 11%." + +import unittest +from test.support import requires +from tkinter import Tk, Text + +import idlelib.autocomplete_w as acw + + +class AutoCompleteWindowTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.text = Text(cls.root) + cls.acw = acw.AutoCompleteWindow(cls.text, tags=None) + + @classmethod + def tearDownClass(cls): + del cls.text, cls.acw + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def test_init(self): + self.assertEqual(self.acw.widget, self.text) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_autoexpand.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_autoexpand.py new file mode 100644 index 0000000000000000000000000000000000000000..e734a8be714a2adc3ea1a6fca6957cac2815309e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_autoexpand.py @@ -0,0 +1,155 @@ +"Test autoexpand, coverage 100%." + +from idlelib.autoexpand import AutoExpand +import unittest +from test.support import requires +from tkinter import Text, Tk + + +class DummyEditwin: + # AutoExpand.__init__ only needs .text + def __init__(self, text): + self.text = text + +class AutoExpandTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.tk = Tk() + cls.text = Text(cls.tk) + cls.auto_expand = AutoExpand(DummyEditwin(cls.text)) + cls.auto_expand.bell = lambda: None + +# If mock_tk.Text._decode understood indexes 'insert' with suffixed 'linestart', +# 'wordstart', and 'lineend', used by autoexpand, we could use the following +# to run these test on non-gui machines (but check bell). +## try: +## requires('gui') +## #raise ResourceDenied() # Uncomment to test mock. +## except ResourceDenied: +## from idlelib.idle_test.mock_tk import Text +## cls.text = Text() +## cls.text.bell = lambda: None +## else: +## from tkinter import Tk, Text +## cls.tk = Tk() +## cls.text = Text(cls.tk) + + @classmethod + def tearDownClass(cls): + del cls.text, cls.auto_expand + if hasattr(cls, 'tk'): + cls.tk.destroy() + del cls.tk + + def tearDown(self): + self.text.delete('1.0', 'end') + + def test_get_prevword(self): + text = self.text + previous = self.auto_expand.getprevword + equal = self.assertEqual + + equal(previous(), '') + + text.insert('insert', 't') + equal(previous(), 't') + + text.insert('insert', 'his') + equal(previous(), 'this') + + text.insert('insert', ' ') + equal(previous(), '') + + text.insert('insert', 'is') + equal(previous(), 'is') + + text.insert('insert', '\nsample\nstring') + equal(previous(), 'string') + + text.delete('3.0', 'insert') + equal(previous(), '') + + text.delete('1.0', 'end') + equal(previous(), '') + + def test_before_only(self): + previous = self.auto_expand.getprevword + expand = self.auto_expand.expand_word_event + equal = self.assertEqual + + self.text.insert('insert', 'ab ac bx ad ab a') + equal(self.auto_expand.getwords(), ['ab', 'ad', 'ac', 'a']) + expand('event') + equal(previous(), 'ab') + expand('event') + equal(previous(), 'ad') + expand('event') + equal(previous(), 'ac') + expand('event') + equal(previous(), 'a') + + def test_after_only(self): + # Also add punctuation 'noise' that should be ignored. + text = self.text + previous = self.auto_expand.getprevword + expand = self.auto_expand.expand_word_event + equal = self.assertEqual + + text.insert('insert', 'a, [ab] ac: () bx"" cd ac= ad ya') + text.mark_set('insert', '1.1') + equal(self.auto_expand.getwords(), ['ab', 'ac', 'ad', 'a']) + expand('event') + equal(previous(), 'ab') + expand('event') + equal(previous(), 'ac') + expand('event') + equal(previous(), 'ad') + expand('event') + equal(previous(), 'a') + + def test_both_before_after(self): + text = self.text + previous = self.auto_expand.getprevword + expand = self.auto_expand.expand_word_event + equal = self.assertEqual + + text.insert('insert', 'ab xy yz\n') + text.insert('insert', 'a ac by ac') + + text.mark_set('insert', '2.1') + equal(self.auto_expand.getwords(), ['ab', 'ac', 'a']) + expand('event') + equal(previous(), 'ab') + expand('event') + equal(previous(), 'ac') + expand('event') + equal(previous(), 'a') + + def test_other_expand_cases(self): + text = self.text + expand = self.auto_expand.expand_word_event + equal = self.assertEqual + + # no expansion candidate found + equal(self.auto_expand.getwords(), []) + equal(expand('event'), 'break') + + text.insert('insert', 'bx cy dz a') + equal(self.auto_expand.getwords(), []) + + # reset state by successfully expanding once + # move cursor to another position and expand again + text.insert('insert', 'ac xy a ac ad a') + text.mark_set('insert', '1.7') + expand('event') + initial_state = self.auto_expand.state + text.mark_set('insert', '1.end') + expand('event') + new_state = self.auto_expand.state + self.assertNotEqual(initial_state, new_state) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_browser.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_browser.py new file mode 100644 index 0000000000000000000000000000000000000000..6cfea3888cd6a9064be1b9b5f5c13febdc701b96 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_browser.py @@ -0,0 +1,257 @@ +"Test browser, coverage 90%." + +from idlelib import browser +from test.support import requires +import unittest +from unittest import mock +from idlelib.idle_test.mock_idle import Func +from idlelib.util import py_extensions + +from collections import deque +import os.path +import pyclbr +from tkinter import Tk + +from idlelib.tree import TreeNode + + +class ModuleBrowserTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.mb = browser.ModuleBrowser(cls.root, __file__, _utest=True) + + @classmethod + def tearDownClass(cls): + cls.mb.close() + cls.root.update_idletasks() + cls.root.destroy() + del cls.root, cls.mb + + def test_init(self): + mb = self.mb + eq = self.assertEqual + eq(mb.path, __file__) + eq(pyclbr._modules, {}) + self.assertIsInstance(mb.node, TreeNode) + self.assertIsNotNone(browser.file_open) + + def test_settitle(self): + mb = self.mb + self.assertIn(os.path.basename(__file__), mb.top.title()) + self.assertEqual(mb.top.iconname(), 'Module Browser') + + def test_rootnode(self): + mb = self.mb + rn = mb.rootnode() + self.assertIsInstance(rn, browser.ModuleBrowserTreeItem) + + def test_close(self): + mb = self.mb + mb.top.destroy = Func() + mb.node.destroy = Func() + mb.close() + self.assertTrue(mb.top.destroy.called) + self.assertTrue(mb.node.destroy.called) + del mb.top.destroy, mb.node.destroy + + def test_is_browseable_extension(self): + path = "/path/to/file" + for ext in py_extensions: + with self.subTest(ext=ext): + filename = f'{path}{ext}' + actual = browser.is_browseable_extension(filename) + expected = ext not in browser.browseable_extension_blocklist + self.assertEqual(actual, expected) + + +# Nested tree same as in test_pyclbr.py except for supers on C0. C1. +mb = pyclbr +module, fname = 'test', 'test.py' +C0 = mb.Class(module, 'C0', ['base'], fname, 1, end_lineno=9) +F1 = mb._nest_function(C0, 'F1', 3, 5) +C1 = mb._nest_class(C0, 'C1', 6, 9, ['']) +C2 = mb._nest_class(C1, 'C2', 7, 9) +F3 = mb._nest_function(C2, 'F3', 9, 9) +f0 = mb.Function(module, 'f0', fname, 11, end_lineno=15) +f1 = mb._nest_function(f0, 'f1', 12, 14) +f2 = mb._nest_function(f1, 'f2', 13, 13) +c1 = mb._nest_class(f0, 'c1', 15, 15) +mock_pyclbr_tree = {'C0': C0, 'f0': f0} + +# Adjust C0.name, C1.name so tests do not depend on order. +browser.transform_children(mock_pyclbr_tree, 'test') # C0(base) +browser.transform_children(C0.children) # C1() + +# The class below checks that the calls above are correct +# and that duplicate calls have no effect. + + +class TransformChildrenTest(unittest.TestCase): + + def test_transform_module_children(self): + eq = self.assertEqual + transform = browser.transform_children + # Parameter matches tree module. + tcl = list(transform(mock_pyclbr_tree, 'test')) + eq(tcl, [C0, f0]) + eq(tcl[0].name, 'C0(base)') + eq(tcl[1].name, 'f0') + # Check that second call does not change suffix. + tcl = list(transform(mock_pyclbr_tree, 'test')) + eq(tcl[0].name, 'C0(base)') + # Nothing to traverse if parameter name isn't same as tree module. + tcl = list(transform(mock_pyclbr_tree, 'different name')) + eq(tcl, []) + + def test_transform_node_children(self): + eq = self.assertEqual + transform = browser.transform_children + # Class with two children, one name altered. + tcl = list(transform(C0.children)) + eq(tcl, [F1, C1]) + eq(tcl[0].name, 'F1') + eq(tcl[1].name, 'C1()') + tcl = list(transform(C0.children)) + eq(tcl[1].name, 'C1()') + # Function with two children. + eq(list(transform(f0.children)), [f1, c1]) + + +class ModuleBrowserTreeItemTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + cls.mbt = browser.ModuleBrowserTreeItem(fname) + + def test_init(self): + self.assertEqual(self.mbt.file, fname) + + def test_gettext(self): + self.assertEqual(self.mbt.GetText(), fname) + + def test_geticonname(self): + self.assertEqual(self.mbt.GetIconName(), 'python') + + def test_isexpandable(self): + self.assertTrue(self.mbt.IsExpandable()) + + def test_listchildren(self): + save_rex = browser.pyclbr.readmodule_ex + save_tc = browser.transform_children + browser.pyclbr.readmodule_ex = Func(result=mock_pyclbr_tree) + browser.transform_children = Func(result=[f0, C0]) + try: + self.assertEqual(self.mbt.listchildren(), [f0, C0]) + finally: + browser.pyclbr.readmodule_ex = save_rex + browser.transform_children = save_tc + + def test_getsublist(self): + mbt = self.mbt + mbt.listchildren = Func(result=[f0, C0]) + sub0, sub1 = mbt.GetSubList() + del mbt.listchildren + self.assertIsInstance(sub0, browser.ChildBrowserTreeItem) + self.assertIsInstance(sub1, browser.ChildBrowserTreeItem) + self.assertEqual(sub0.name, 'f0') + self.assertEqual(sub1.name, 'C0(base)') + + @mock.patch('idlelib.browser.file_open') + def test_ondoubleclick(self, fopen): + mbt = self.mbt + + with mock.patch('os.path.exists', return_value=False): + mbt.OnDoubleClick() + fopen.assert_not_called() + + with mock.patch('os.path.exists', return_value=True): + mbt.OnDoubleClick() + fopen.assert_called_once_with(fname) + + +class ChildBrowserTreeItemTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + CBT = browser.ChildBrowserTreeItem + cls.cbt_f1 = CBT(f1) + cls.cbt_C1 = CBT(C1) + cls.cbt_F1 = CBT(F1) + + @classmethod + def tearDownClass(cls): + del cls.cbt_C1, cls.cbt_f1, cls.cbt_F1 + + def test_init(self): + eq = self.assertEqual + eq(self.cbt_C1.name, 'C1()') + self.assertFalse(self.cbt_C1.isfunction) + eq(self.cbt_f1.name, 'f1') + self.assertTrue(self.cbt_f1.isfunction) + + def test_gettext(self): + self.assertEqual(self.cbt_C1.GetText(), 'class C1()') + self.assertEqual(self.cbt_f1.GetText(), 'def f1(...)') + + def test_geticonname(self): + self.assertEqual(self.cbt_C1.GetIconName(), 'folder') + self.assertEqual(self.cbt_f1.GetIconName(), 'python') + + def test_isexpandable(self): + self.assertTrue(self.cbt_C1.IsExpandable()) + self.assertTrue(self.cbt_f1.IsExpandable()) + self.assertFalse(self.cbt_F1.IsExpandable()) + + def test_getsublist(self): + eq = self.assertEqual + CBT = browser.ChildBrowserTreeItem + + f1sublist = self.cbt_f1.GetSubList() + self.assertIsInstance(f1sublist[0], CBT) + eq(len(f1sublist), 1) + eq(f1sublist[0].name, 'f2') + + eq(self.cbt_F1.GetSubList(), []) + + @mock.patch('idlelib.browser.file_open') + def test_ondoubleclick(self, fopen): + goto = fopen.return_value.gotoline = mock.Mock() + self.cbt_F1.OnDoubleClick() + fopen.assert_called() + goto.assert_called() + goto.assert_called_with(self.cbt_F1.obj.lineno) + # Failure test would have to raise OSError or AttributeError. + + +class NestedChildrenTest(unittest.TestCase): + "Test that all the nodes in a nested tree are added to the BrowserTree." + + def test_nested(self): + queue = deque() + actual_names = [] + # The tree items are processed in breadth first order. + # Verify that processing each sublist hits every node and + # in the right order. + expected_names = ['f0', 'C0(base)', + 'f1', 'c1', 'F1', 'C1()', + 'f2', 'C2', + 'F3'] + CBT = browser.ChildBrowserTreeItem + queue.extend((CBT(f0), CBT(C0))) + while queue: + cb = queue.popleft() + sublist = cb.GetSubList() + queue.extend(sublist) + self.assertIn(cb.name, cb.GetText()) + self.assertIn(cb.GetIconName(), ('python', 'folder')) + self.assertIs(cb.IsExpandable(), sublist != []) + actual_names.append(cb.name) + self.assertEqual(actual_names, expected_names) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_calltip.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_calltip.py new file mode 100644 index 0000000000000000000000000000000000000000..28c196a42672fcd2b025753341a7aac656926a6a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_calltip.py @@ -0,0 +1,372 @@ +"Test calltip, coverage 76%" + +from idlelib import calltip +import unittest +from unittest.mock import Mock +import textwrap +import types +import re +from idlelib.idle_test.mock_tk import Text +from test.support import MISSING_C_DOCSTRINGS + + +# Test Class TC is used in multiple get_argspec test methods +class TC: + 'doc' + tip = "(ai=None, *b)" + def __init__(self, ai=None, *b): 'doc' + __init__.tip = "(self, ai=None, *b)" + def t1(self): 'doc' + t1.tip = "(self)" + def t2(self, ai, b=None): 'doc' + t2.tip = "(self, ai, b=None)" + def t3(self, ai, *args): 'doc' + t3.tip = "(self, ai, *args)" + def t4(self, *args): 'doc' + t4.tip = "(self, *args)" + def t5(self, ai, b=None, *args, **kw): 'doc' + t5.tip = "(self, ai, b=None, *args, **kw)" + def t6(no, self): 'doc' + t6.tip = "(no, self)" + def __call__(self, ci): 'doc' + __call__.tip = "(self, ci)" + def nd(self): pass # No doc. + # attaching .tip to wrapped methods does not work + @classmethod + def cm(cls, a): 'doc' + @staticmethod + def sm(b): 'doc' + + +tc = TC() +default_tip = calltip._default_callable_argspec +get_spec = calltip.get_argspec + + +class Get_argspecTest(unittest.TestCase): + # The get_spec function must return a string, even if blank. + # Test a variety of objects to be sure that none cause it to raise + # (quite aside from getting as correct an answer as possible). + # The tests of builtins may break if inspect or the docstrings change, + # but a red buildbot is better than a user crash (as has happened). + # For a simple mismatch, change the expected output to the actual. + + @unittest.skipIf(MISSING_C_DOCSTRINGS, + "Signature information for builtins requires docstrings") + def test_builtins(self): + + def tiptest(obj, out): + self.assertEqual(get_spec(obj), out) + + # Python class that inherits builtin methods + class List(list): "List() doc" + + # Simulate builtin with no docstring for default tip test + class SB: __call__ = None + + if List.__doc__ is not None: + tiptest(List, + f'(iterable=(), /)' + f'\n{List.__doc__}') + tiptest(list.__new__, + '(*args, **kwargs)\n' + 'Create and return a new object. ' + 'See help(type) for accurate signature.') + tiptest(list.__init__, + '(self, /, *args, **kwargs)\n' + 'Initialize self. See help(type(self)) for accurate signature.') + append_doc = "\nAppend object to the end of the list." + tiptest(list.append, '(self, object, /)' + append_doc) + tiptest(List.append, '(self, object, /)' + append_doc) + tiptest([].append, '(object, /)' + append_doc) + # The use of 'object' above matches the signature text. + + tiptest(types.MethodType, + '(function, instance, /)\n' + 'Create a bound instance method object.') + tiptest(SB(), default_tip) + + p = re.compile('') + tiptest(re.sub, '''\ +(pattern, repl, string, count=0, flags=0) +Return the string obtained by replacing the leftmost +non-overlapping occurrences of the pattern in string by the +replacement repl. repl can be either a string or a callable; +if a string, backslash escapes in it are processed. If it is +a callable, it's passed the Match object and must return''') + tiptest(p.sub, '''\ +(repl, string, count=0) +Return the string obtained by replacing the leftmost \ +non-overlapping occurrences o...''') + + def test_signature_wrap(self): + if textwrap.TextWrapper.__doc__ is not None: + self.assertEqual(get_spec(textwrap.TextWrapper), '''\ +(width=70, initial_indent='', subsequent_indent='', expand_tabs=True, + replace_whitespace=True, fix_sentence_endings=False, break_long_words=True, + drop_whitespace=True, break_on_hyphens=True, tabsize=8, *, max_lines=None, + placeholder=' [...]') +Object for wrapping/filling text. The public interface consists of +the wrap() and fill() methods; the other methods are just there for +subclasses to override in order to tweak the default behaviour. +If you want to completely replace the main wrapping algorithm, +you\'ll probably have to override _wrap_chunks().''') + + def test_properly_formatted(self): + + def foo(s='a'*100): + pass + + def bar(s='a'*100): + """Hello Guido""" + pass + + def baz(s='a'*100, z='b'*100): + pass + + indent = calltip._INDENT + + sfoo = "(s='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"\ + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n" + indent + "aaaaaaaaa"\ + "aaaaaaaaaa')" + sbar = "(s='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"\ + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n" + indent + "aaaaaaaaa"\ + "aaaaaaaaaa')\nHello Guido" + sbaz = "(s='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"\ + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n" + indent + "aaaaaaaaa"\ + "aaaaaaaaaa', z='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"\ + "bbbbbbbbbbbbbbbbb\n" + indent + "bbbbbbbbbbbbbbbbbbbbbb"\ + "bbbbbbbbbbbbbbbbbbbbbb')" + + for func,doc in [(foo, sfoo), (bar, sbar), (baz, sbaz)]: + with self.subTest(func=func, doc=doc): + self.assertEqual(get_spec(func), doc) + + def test_docline_truncation(self): + def f(): pass + f.__doc__ = 'a'*300 + self.assertEqual(get_spec(f), f"()\n{'a'*(calltip._MAX_COLS-3) + '...'}") + + @unittest.skipIf(MISSING_C_DOCSTRINGS, + "Signature information for builtins requires docstrings") + def test_multiline_docstring(self): + # Test fewer lines than max. + self.assertEqual(get_spec(range), + "range(stop) -> range object\n" + "range(start, stop[, step]) -> range object") + + # Test max lines + self.assertEqual(get_spec(bytes), '''\ +bytes(iterable_of_ints) -> bytes +bytes(string, encoding[, errors]) -> bytes +bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer +bytes(int) -> bytes object of size given by the parameter initialized with null bytes +bytes() -> empty bytes object''') + + def test_multiline_docstring_2(self): + # Test more than max lines + def f(): pass + f.__doc__ = 'a\n' * 15 + self.assertEqual(get_spec(f), '()' + '\na' * calltip._MAX_LINES) + + def test_functions(self): + def t1(): 'doc' + t1.tip = "()" + def t2(a, b=None): 'doc' + t2.tip = "(a, b=None)" + def t3(a, *args): 'doc' + t3.tip = "(a, *args)" + def t4(*args): 'doc' + t4.tip = "(*args)" + def t5(a, b=None, *args, **kw): 'doc' + t5.tip = "(a, b=None, *args, **kw)" + + doc = '\ndoc' if t1.__doc__ is not None else '' + for func in (t1, t2, t3, t4, t5, TC): + with self.subTest(func=func): + self.assertEqual(get_spec(func), func.tip + doc) + + def test_methods(self): + doc = '\ndoc' if TC.__doc__ is not None else '' + for meth in (TC.t1, TC.t2, TC.t3, TC.t4, TC.t5, TC.t6, TC.__call__): + with self.subTest(meth=meth): + self.assertEqual(get_spec(meth), meth.tip + doc) + self.assertEqual(get_spec(TC.cm), "(a)" + doc) + self.assertEqual(get_spec(TC.sm), "(b)" + doc) + + def test_bound_methods(self): + # test that first parameter is correctly removed from argspec + doc = '\ndoc' if TC.__doc__ is not None else '' + for meth, mtip in ((tc.t1, "()"), (tc.t4, "(*args)"), + (tc.t6, "(self)"), (tc.__call__, '(ci)'), + (tc, '(ci)'), (TC.cm, "(a)"),): + with self.subTest(meth=meth, mtip=mtip): + self.assertEqual(get_spec(meth), mtip + doc) + + def test_starred_parameter(self): + # test that starred first parameter is *not* removed from argspec + class C: + def m1(*args): pass + c = C() + for meth, mtip in ((C.m1, '(*args)'), (c.m1, "(*args)"),): + with self.subTest(meth=meth, mtip=mtip): + self.assertEqual(get_spec(meth), mtip) + + def test_invalid_method_get_spec(self): + class C: + def m2(**kwargs): pass + class Test: + def __call__(*, a): pass + + mtip = calltip._invalid_method + self.assertEqual(get_spec(C().m2), mtip) + self.assertEqual(get_spec(Test()), mtip) + + def test_non_ascii_name(self): + # test that re works to delete a first parameter name that + # includes non-ascii chars, such as various forms of A. + uni = "(A\u0391\u0410\u05d0\u0627\u0905\u1e00\u3042, a)" + assert calltip._first_param.sub('', uni) == '(a)' + + def test_no_docstring(self): + for meth, mtip in ((TC.nd, "(self)"), (tc.nd, "()")): + with self.subTest(meth=meth, mtip=mtip): + self.assertEqual(get_spec(meth), mtip) + + def test_buggy_getattr_class(self): + class NoCall: + def __getattr__(self, name): # Not invoked for class attribute. + raise IndexError # Bug. + class CallA(NoCall): + def __call__(self, ci): # Bug does not matter. + pass + class CallB(NoCall): + def __call__(oui, a, b, c): # Non-standard 'self'. + pass + + for meth, mtip in ((NoCall, default_tip), (CallA, default_tip), + (NoCall(), ''), (CallA(), '(ci)'), + (CallB(), '(a, b, c)')): + with self.subTest(meth=meth, mtip=mtip): + self.assertEqual(get_spec(meth), mtip) + + def test_metaclass_class(self): # Failure case for issue 38689. + class Type(type): # Type() requires 3 type args, returns class. + __class__ = property({}.__getitem__, {}.__setitem__) + class Object(metaclass=Type): + __slots__ = '__class__' + for meth, mtip in ((Type, get_spec(type)), (Object, default_tip), + (Object(), '')): + with self.subTest(meth=meth, mtip=mtip): + self.assertEqual(get_spec(meth), mtip) + + def test_non_callables(self): + for obj in (0, 0.0, '0', b'0', [], {}): + with self.subTest(obj=obj): + self.assertEqual(get_spec(obj), '') + + +class Get_entityTest(unittest.TestCase): + def test_bad_entity(self): + self.assertIsNone(calltip.get_entity('1/0')) + def test_good_entity(self): + self.assertIs(calltip.get_entity('int'), int) + + +# Test the 9 Calltip methods. +# open_calltip is about half the code; the others are fairly trivial. +# The default mocks are what are needed for open_calltip. + +class mock_Shell: + "Return mock sufficient to pass to hyperparser." + def __init__(self, text): + text.tag_prevrange = Mock(return_value=None) + self.text = text + self.prompt_last_line = ">>> " + self.indentwidth = 4 + self.tabwidth = 8 + + +class mock_TipWindow: + def __init__(self): + pass + + def showtip(self, text, parenleft, parenright): + self.args = parenleft, parenright + self.parenline, self.parencol = map(int, parenleft.split('.')) + + +class WrappedCalltip(calltip.Calltip): + def _make_tk_calltip_window(self): + return mock_TipWindow() + + def remove_calltip_window(self, event=None): + if self.active_calltip: # Setup to None. + self.active_calltip = None + self.tips_removed += 1 # Setup to 0. + + def fetch_tip(self, expression): + return 'tip' + + +class CalltipTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + cls.text = Text() + cls.ct = WrappedCalltip(mock_Shell(cls.text)) + + def setUp(self): + self.text.delete('1.0', 'end') # Insert and call + self.ct.active_calltip = None + # Test .active_calltip, +args + self.ct.tips_removed = 0 + + def open_close(self, testfunc): + # Open-close template with testfunc called in between. + opentip = self.ct.open_calltip + self.text.insert(1.0, 'f(') + opentip(False) + self.tip = self.ct.active_calltip + testfunc(self) ### + self.text.insert('insert', ')') + opentip(False) + self.assertIsNone(self.ct.active_calltip, None) + + def test_open_close(self): + def args(self): + self.assertEqual(self.tip.args, ('1.1', '1.end')) + self.open_close(args) + + def test_repeated_force(self): + def force(self): + for char in 'abc': + self.text.insert('insert', 'a') + self.ct.open_calltip(True) + self.ct.open_calltip(True) + self.assertIs(self.ct.active_calltip, self.tip) + self.open_close(force) + + def test_repeated_parens(self): + def parens(self): + for context in "a", "'": + with self.subTest(context=context): + self.text.insert('insert', context) + for char in '(()())': + self.text.insert('insert', char) + self.assertIs(self.ct.active_calltip, self.tip) + self.text.insert('insert', "'") + self.open_close(parens) + + def test_comment_parens(self): + def comment(self): + self.text.insert('insert', "# ") + for char in '(()())': + self.text.insert('insert', char) + self.assertIs(self.ct.active_calltip, self.tip) + self.text.insert('insert', "\n") + self.open_close(comment) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_calltip_w.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_calltip_w.py new file mode 100644 index 0000000000000000000000000000000000000000..a5ec76e15ffdf3ed8c4259dd3c9435ca9e0ec3a4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_calltip_w.py @@ -0,0 +1,29 @@ +"Test calltip_w, coverage 18%." + +from idlelib import calltip_w +import unittest +from test.support import requires +from tkinter import Tk, Text + + +class CallTipWindowTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.text = Text(cls.root) + cls.calltip = calltip_w.CalltipWindow(cls.text) + + @classmethod + def tearDownClass(cls): + cls.root.update_idletasks() + cls.root.destroy() + del cls.text, cls.root + + def test_init(self): + self.assertEqual(self.calltip.anchor_widget, self.text) + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_codecontext.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_codecontext.py new file mode 100644 index 0000000000000000000000000000000000000000..6969ad73b01a81a7ec896a2c1991905e26e7a564 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_codecontext.py @@ -0,0 +1,455 @@ +"Test codecontext, coverage 100%" + +from idlelib import codecontext +import unittest +import unittest.mock +from test.support import requires +from tkinter import NSEW, Tk, Frame, Text, TclError + +from unittest import mock +import re +from idlelib import config + + +usercfg = codecontext.idleConf.userCfg +testcfg = { + 'main': config.IdleUserConfParser(''), + 'highlight': config.IdleUserConfParser(''), + 'keys': config.IdleUserConfParser(''), + 'extensions': config.IdleUserConfParser(''), +} +code_sample = """\ + +class C1: + # Class comment. + def __init__(self, a, b): + self.a = a + self.b = b + def compare(self): + if a > b: + return a + elif a < b: + return b + else: + return None +""" + + +class DummyEditwin: + def __init__(self, root, frame, text): + self.root = root + self.top = root + self.text_frame = frame + self.text = text + self.label = '' + + def getlineno(self, index): + return int(float(self.text.index(index))) + + def update_menu_label(self, **kwargs): + self.label = kwargs['label'] + + +class CodeContextTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + root = cls.root = Tk() + root.withdraw() + frame = cls.frame = Frame(root) + text = cls.text = Text(frame) + text.insert('1.0', code_sample) + # Need to pack for creation of code context text widget. + frame.pack(side='left', fill='both', expand=1) + text.grid(row=1, column=1, sticky=NSEW) + cls.editor = DummyEditwin(root, frame, text) + codecontext.idleConf.userCfg = testcfg + + @classmethod + def tearDownClass(cls): + codecontext.idleConf.userCfg = usercfg + cls.editor.text.delete('1.0', 'end') + del cls.editor, cls.frame, cls.text + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def setUp(self): + self.text.yview(0) + self.text['font'] = 'TkFixedFont' + self.cc = codecontext.CodeContext(self.editor) + + self.highlight_cfg = {"background": '#abcdef', + "foreground": '#123456'} + orig_idleConf_GetHighlight = codecontext.idleConf.GetHighlight + def mock_idleconf_GetHighlight(theme, element): + if element == 'context': + return self.highlight_cfg + return orig_idleConf_GetHighlight(theme, element) + GetHighlight_patcher = unittest.mock.patch.object( + codecontext.idleConf, 'GetHighlight', mock_idleconf_GetHighlight) + GetHighlight_patcher.start() + self.addCleanup(GetHighlight_patcher.stop) + + self.font_override = 'TkFixedFont' + def mock_idleconf_GetFont(root, configType, section): + return self.font_override + GetFont_patcher = unittest.mock.patch.object( + codecontext.idleConf, 'GetFont', mock_idleconf_GetFont) + GetFont_patcher.start() + self.addCleanup(GetFont_patcher.stop) + + def tearDown(self): + if self.cc.context: + self.cc.context.destroy() + # Explicitly call __del__ to remove scheduled scripts. + self.cc.__del__() + del self.cc.context, self.cc + + def test_init(self): + eq = self.assertEqual + ed = self.editor + cc = self.cc + + eq(cc.editwin, ed) + eq(cc.text, ed.text) + eq(cc.text['font'], ed.text['font']) + self.assertIsNone(cc.context) + eq(cc.info, [(0, -1, '', False)]) + eq(cc.topvisible, 1) + self.assertIsNone(self.cc.t1) + + def test_del(self): + self.cc.__del__() + + def test_del_with_timer(self): + timer = self.cc.t1 = self.text.after(10000, lambda: None) + self.cc.__del__() + with self.assertRaises(TclError) as cm: + self.root.tk.call('after', 'info', timer) + self.assertIn("doesn't exist", str(cm.exception)) + + def test_reload(self): + codecontext.CodeContext.reload() + self.assertEqual(self.cc.context_depth, 15) + + def test_toggle_code_context_event(self): + eq = self.assertEqual + cc = self.cc + toggle = cc.toggle_code_context_event + + # Make sure code context is off. + if cc.context: + toggle() + + # Toggle on. + toggle() + self.assertIsNotNone(cc.context) + eq(cc.context['font'], self.text['font']) + eq(cc.context['fg'], self.highlight_cfg['foreground']) + eq(cc.context['bg'], self.highlight_cfg['background']) + eq(cc.context.get('1.0', 'end-1c'), '') + eq(cc.editwin.label, 'Hide Code Context') + eq(self.root.tk.call('after', 'info', self.cc.t1)[1], 'timer') + + # Toggle off. + toggle() + self.assertIsNone(cc.context) + eq(cc.editwin.label, 'Show Code Context') + self.assertIsNone(self.cc.t1) + + # Scroll down and toggle back on. + line11_context = '\n'.join(x[2] for x in cc.get_context(11)[0]) + cc.text.yview(11) + toggle() + eq(cc.context.get('1.0', 'end-1c'), line11_context) + + # Toggle off and on again. + toggle() + toggle() + eq(cc.context.get('1.0', 'end-1c'), line11_context) + + def test_get_context(self): + eq = self.assertEqual + gc = self.cc.get_context + + # stopline must be greater than 0. + with self.assertRaises(AssertionError): + gc(1, stopline=0) + + eq(gc(3), ([(2, 0, 'class C1:', 'class')], 0)) + + # Don't return comment. + eq(gc(4), ([(2, 0, 'class C1:', 'class')], 0)) + + # Two indentation levels and no comment. + eq(gc(5), ([(2, 0, 'class C1:', 'class'), + (4, 4, ' def __init__(self, a, b):', 'def')], 0)) + + # Only one 'def' is returned, not both at the same indent level. + eq(gc(10), ([(2, 0, 'class C1:', 'class'), + (7, 4, ' def compare(self):', 'def'), + (8, 8, ' if a > b:', 'if')], 0)) + + # With 'elif', also show the 'if' even though it's at the same level. + eq(gc(11), ([(2, 0, 'class C1:', 'class'), + (7, 4, ' def compare(self):', 'def'), + (8, 8, ' if a > b:', 'if'), + (10, 8, ' elif a < b:', 'elif')], 0)) + + # Set stop_line to not go back to first line in source code. + # Return includes stop_line. + eq(gc(11, stopline=2), ([(2, 0, 'class C1:', 'class'), + (7, 4, ' def compare(self):', 'def'), + (8, 8, ' if a > b:', 'if'), + (10, 8, ' elif a < b:', 'elif')], 0)) + eq(gc(11, stopline=3), ([(7, 4, ' def compare(self):', 'def'), + (8, 8, ' if a > b:', 'if'), + (10, 8, ' elif a < b:', 'elif')], 4)) + eq(gc(11, stopline=8), ([(8, 8, ' if a > b:', 'if'), + (10, 8, ' elif a < b:', 'elif')], 8)) + + # Set stop_indent to test indent level to stop at. + eq(gc(11, stopindent=4), ([(7, 4, ' def compare(self):', 'def'), + (8, 8, ' if a > b:', 'if'), + (10, 8, ' elif a < b:', 'elif')], 4)) + # Check that the 'if' is included. + eq(gc(11, stopindent=8), ([(8, 8, ' if a > b:', 'if'), + (10, 8, ' elif a < b:', 'elif')], 8)) + + def test_update_code_context(self): + eq = self.assertEqual + cc = self.cc + # Ensure code context is active. + if not cc.context: + cc.toggle_code_context_event() + + # Invoke update_code_context without scrolling - nothing happens. + self.assertIsNone(cc.update_code_context()) + eq(cc.info, [(0, -1, '', False)]) + eq(cc.topvisible, 1) + + # Scroll down to line 1. + cc.text.yview(1) + cc.update_code_context() + eq(cc.info, [(0, -1, '', False)]) + eq(cc.topvisible, 2) + eq(cc.context.get('1.0', 'end-1c'), '') + + # Scroll down to line 2. + cc.text.yview(2) + cc.update_code_context() + eq(cc.info, [(0, -1, '', False), (2, 0, 'class C1:', 'class')]) + eq(cc.topvisible, 3) + eq(cc.context.get('1.0', 'end-1c'), 'class C1:') + + # Scroll down to line 3. Since it's a comment, nothing changes. + cc.text.yview(3) + cc.update_code_context() + eq(cc.info, [(0, -1, '', False), (2, 0, 'class C1:', 'class')]) + eq(cc.topvisible, 4) + eq(cc.context.get('1.0', 'end-1c'), 'class C1:') + + # Scroll down to line 4. + cc.text.yview(4) + cc.update_code_context() + eq(cc.info, [(0, -1, '', False), + (2, 0, 'class C1:', 'class'), + (4, 4, ' def __init__(self, a, b):', 'def')]) + eq(cc.topvisible, 5) + eq(cc.context.get('1.0', 'end-1c'), 'class C1:\n' + ' def __init__(self, a, b):') + + # Scroll down to line 11. Last 'def' is removed. + cc.text.yview(11) + cc.update_code_context() + eq(cc.info, [(0, -1, '', False), + (2, 0, 'class C1:', 'class'), + (7, 4, ' def compare(self):', 'def'), + (8, 8, ' if a > b:', 'if'), + (10, 8, ' elif a < b:', 'elif')]) + eq(cc.topvisible, 12) + eq(cc.context.get('1.0', 'end-1c'), 'class C1:\n' + ' def compare(self):\n' + ' if a > b:\n' + ' elif a < b:') + + # No scroll. No update, even though context_depth changed. + cc.update_code_context() + cc.context_depth = 1 + eq(cc.info, [(0, -1, '', False), + (2, 0, 'class C1:', 'class'), + (7, 4, ' def compare(self):', 'def'), + (8, 8, ' if a > b:', 'if'), + (10, 8, ' elif a < b:', 'elif')]) + eq(cc.topvisible, 12) + eq(cc.context.get('1.0', 'end-1c'), 'class C1:\n' + ' def compare(self):\n' + ' if a > b:\n' + ' elif a < b:') + + # Scroll up. + cc.text.yview(5) + cc.update_code_context() + eq(cc.info, [(0, -1, '', False), + (2, 0, 'class C1:', 'class'), + (4, 4, ' def __init__(self, a, b):', 'def')]) + eq(cc.topvisible, 6) + # context_depth is 1. + eq(cc.context.get('1.0', 'end-1c'), ' def __init__(self, a, b):') + + def test_jumptoline(self): + eq = self.assertEqual + cc = self.cc + jump = cc.jumptoline + + if not cc.context: + cc.toggle_code_context_event() + + # Empty context. + cc.text.yview('2.0') + cc.update_code_context() + eq(cc.topvisible, 2) + cc.context.mark_set('insert', '1.5') + jump() + eq(cc.topvisible, 1) + + # 4 lines of context showing. + cc.text.yview('12.0') + cc.update_code_context() + eq(cc.topvisible, 12) + cc.context.mark_set('insert', '3.0') + jump() + eq(cc.topvisible, 8) + + # More context lines than limit. + cc.context_depth = 2 + cc.text.yview('12.0') + cc.update_code_context() + eq(cc.topvisible, 12) + cc.context.mark_set('insert', '1.0') + jump() + eq(cc.topvisible, 8) + + # Context selection stops jump. + cc.text.yview('5.0') + cc.update_code_context() + cc.context.tag_add('sel', '1.0', '2.0') + cc.context.mark_set('insert', '1.0') + jump() # Without selection, to line 2. + eq(cc.topvisible, 5) + + @mock.patch.object(codecontext.CodeContext, 'update_code_context') + def test_timer_event(self, mock_update): + # Ensure code context is not active. + if self.cc.context: + self.cc.toggle_code_context_event() + self.cc.timer_event() + mock_update.assert_not_called() + + # Activate code context. + self.cc.toggle_code_context_event() + self.cc.timer_event() + mock_update.assert_called() + + def test_font(self): + eq = self.assertEqual + cc = self.cc + + orig_font = cc.text['font'] + test_font = 'TkTextFont' + self.assertNotEqual(orig_font, test_font) + + # Ensure code context is not active. + if cc.context is not None: + cc.toggle_code_context_event() + + self.font_override = test_font + # Nothing breaks or changes with inactive code context. + cc.update_font() + + # Activate code context, previous font change is immediately effective. + cc.toggle_code_context_event() + eq(cc.context['font'], test_font) + + # Call the font update, change is picked up. + self.font_override = orig_font + cc.update_font() + eq(cc.context['font'], orig_font) + + def test_highlight_colors(self): + eq = self.assertEqual + cc = self.cc + + orig_colors = dict(self.highlight_cfg) + test_colors = {'background': '#222222', 'foreground': '#ffff00'} + + def assert_colors_are_equal(colors): + eq(cc.context['background'], colors['background']) + eq(cc.context['foreground'], colors['foreground']) + + # Ensure code context is not active. + if cc.context: + cc.toggle_code_context_event() + + self.highlight_cfg = test_colors + # Nothing breaks with inactive code context. + cc.update_highlight_colors() + + # Activate code context, previous colors change is immediately effective. + cc.toggle_code_context_event() + assert_colors_are_equal(test_colors) + + # Call colors update with no change to the configured colors. + cc.update_highlight_colors() + assert_colors_are_equal(test_colors) + + # Call the colors update with code context active, change is picked up. + self.highlight_cfg = orig_colors + cc.update_highlight_colors() + assert_colors_are_equal(orig_colors) + + +class HelperFunctionText(unittest.TestCase): + + def test_get_spaces_firstword(self): + get = codecontext.get_spaces_firstword + test_lines = ( + (' first word', (' ', 'first')), + ('\tfirst word', ('\t', 'first')), + (' \u19D4\u19D2: ', (' ', '\u19D4\u19D2')), + ('no spaces', ('', 'no')), + ('', ('', '')), + ('# TEST COMMENT', ('', '')), + (' (continuation)', (' ', '')) + ) + for line, expected_output in test_lines: + self.assertEqual(get(line), expected_output) + + # Send the pattern in the call. + self.assertEqual(get(' (continuation)', + c=re.compile(r'^(\s*)([^\s]*)')), + (' ', '(continuation)')) + + def test_get_line_info(self): + eq = self.assertEqual + gli = codecontext.get_line_info + lines = code_sample.splitlines() + + # Line 1 is not a BLOCKOPENER. + eq(gli(lines[0]), (codecontext.INFINITY, '', False)) + # Line 2 is a BLOCKOPENER without an indent. + eq(gli(lines[1]), (0, 'class C1:', 'class')) + # Line 3 is not a BLOCKOPENER and does not return the indent level. + eq(gli(lines[2]), (codecontext.INFINITY, ' # Class comment.', False)) + # Line 4 is a BLOCKOPENER and is indented. + eq(gli(lines[3]), (4, ' def __init__(self, a, b):', 'def')) + # Line 8 is a different BLOCKOPENER and is indented. + eq(gli(lines[7]), (8, ' if a > b:', 'if')) + # Test tab. + eq(gli('\tif a == b:'), (1, '\tif a == b:', 'if')) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_colorizer.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_colorizer.py new file mode 100644 index 0000000000000000000000000000000000000000..308bc389384d33dc8d4bb473b06dc5b5b127c0b6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_colorizer.py @@ -0,0 +1,622 @@ +"Test colorizer, coverage 99%." +from idlelib import colorizer +from test.support import requires +import unittest +from unittest import mock +from idlelib.idle_test.tkinter_testing_utils import run_in_tk_mainloop + +from functools import partial +import textwrap +from tkinter import Tk, Text +from idlelib import config +from idlelib.percolator import Percolator + + +usercfg = colorizer.idleConf.userCfg +testcfg = { + 'main': config.IdleUserConfParser(''), + 'highlight': config.IdleUserConfParser(''), + 'keys': config.IdleUserConfParser(''), + 'extensions': config.IdleUserConfParser(''), +} + +source = textwrap.dedent("""\ + if True: int ('1') # keyword, builtin, string, comment + elif False: print(0) # 'string' in comment + else: float(None) # if in comment + if iF + If + IF: 'keyword matching must respect case' + if'': x or'' # valid keyword-string no-space combinations + async def f(): await g() + # Strings should be entirely colored, including quotes. + 'x', '''x''', "x", \"""x\""" + 'abc\\ + def' + '''abc\\ + def''' + # All valid prefixes for unicode and byte strings should be colored. + r'x', u'x', R'x', U'x', f'x', F'x' + fr'x', Fr'x', fR'x', FR'x', rf'x', rF'x', Rf'x', RF'x' + b'x',B'x', br'x',Br'x',bR'x',BR'x', rb'x', rB'x',Rb'x',RB'x' + # Invalid combinations of legal characters should be half colored. + ur'x', ru'x', uf'x', fu'x', UR'x', ufr'x', rfu'x', xf'x', fx'x' + match point: + case (x, 0) as _: + print(f"X={x}") + case [_, [_], "_", + _]: + pass + case _ if ("a" if _ else set()): pass + case _: + raise ValueError("Not a point _") + ''' + case _:''' + "match x:" + """) + + +def setUpModule(): + colorizer.idleConf.userCfg = testcfg + + +def tearDownModule(): + colorizer.idleConf.userCfg = usercfg + + +class FunctionTest(unittest.TestCase): + + def test_any(self): + self.assertEqual(colorizer.any('test', ('a', 'b', 'cd')), + '(?Pa|b|cd)') + + def test_make_pat(self): + # Tested in more detail by testing prog. + self.assertTrue(colorizer.make_pat()) + + def test_prog(self): + prog = colorizer.prog + eq = self.assertEqual + line = 'def f():\n print("hello")\n' + m = prog.search(line) + eq(m.groupdict()['KEYWORD'], 'def') + m = prog.search(line, m.end()) + eq(m.groupdict()['SYNC'], '\n') + m = prog.search(line, m.end()) + eq(m.groupdict()['BUILTIN'], 'print') + m = prog.search(line, m.end()) + eq(m.groupdict()['STRING'], '"hello"') + m = prog.search(line, m.end()) + eq(m.groupdict()['SYNC'], '\n') + + def test_idprog(self): + idprog = colorizer.idprog + m = idprog.match('nospace') + self.assertIsNone(m) + m = idprog.match(' space') + self.assertEqual(m.group(0), ' space') + + +class ColorConfigTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + root = cls.root = Tk() + root.withdraw() + cls.text = Text(root) + + @classmethod + def tearDownClass(cls): + del cls.text + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def test_color_config(self): + text = self.text + eq = self.assertEqual + colorizer.color_config(text) + # Uses IDLE Classic theme as default. + eq(text['background'], '#ffffff') + eq(text['foreground'], '#000000') + eq(text['selectbackground'], 'gray') + eq(text['selectforeground'], '#000000') + eq(text['insertbackground'], 'black') + eq(text['inactiveselectbackground'], 'gray') + + +class ColorDelegatorInstantiationTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + root = cls.root = Tk() + root.withdraw() + cls.text = Text(root) + + @classmethod + def tearDownClass(cls): + del cls.text + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def setUp(self): + self.color = colorizer.ColorDelegator() + + def tearDown(self): + self.color.close() + self.text.delete('1.0', 'end') + self.color.resetcache() + del self.color + + def test_init(self): + color = self.color + self.assertIsInstance(color, colorizer.ColorDelegator) + + def test_init_state(self): + # init_state() is called during the instantiation of + # ColorDelegator in setUp(). + color = self.color + self.assertIsNone(color.after_id) + self.assertTrue(color.allow_colorizing) + self.assertFalse(color.colorizing) + self.assertFalse(color.stop_colorizing) + + +class ColorDelegatorTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + root = cls.root = Tk() + root.withdraw() + text = cls.text = Text(root) + cls.percolator = Percolator(text) + # Delegator stack = [Delegator(text)] + + @classmethod + def tearDownClass(cls): + cls.percolator.close() + del cls.percolator, cls.text + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def setUp(self): + self.color = colorizer.ColorDelegator() + self.percolator.insertfilter(self.color) + # Calls color.setdelegate(Delegator(text)). + + def tearDown(self): + self.color.close() + self.percolator.removefilter(self.color) + self.text.delete('1.0', 'end') + self.color.resetcache() + del self.color + + def test_setdelegate(self): + # Called in setUp when filter is attached to percolator. + color = self.color + self.assertIsInstance(color.delegate, colorizer.Delegator) + # It is too late to mock notify_range, so test side effect. + self.assertEqual(self.root.tk.call( + 'after', 'info', color.after_id)[1], 'timer') + + def test_LoadTagDefs(self): + highlight = partial(config.idleConf.GetHighlight, theme='IDLE Classic') + for tag, colors in self.color.tagdefs.items(): + with self.subTest(tag=tag): + self.assertIn('background', colors) + self.assertIn('foreground', colors) + if tag not in ('SYNC', 'TODO'): + self.assertEqual(colors, highlight(element=tag.lower())) + + def test_config_colors(self): + text = self.text + highlight = partial(config.idleConf.GetHighlight, theme='IDLE Classic') + for tag in self.color.tagdefs: + for plane in ('background', 'foreground'): + with self.subTest(tag=tag, plane=plane): + if tag in ('SYNC', 'TODO'): + self.assertEqual(text.tag_cget(tag, plane), '') + else: + self.assertEqual(text.tag_cget(tag, plane), + highlight(element=tag.lower())[plane]) + # 'sel' is marked as the highest priority. + self.assertEqual(text.tag_names()[-1], 'sel') + + @mock.patch.object(colorizer.ColorDelegator, 'notify_range') + def test_insert(self, mock_notify): + text = self.text + # Initial text. + text.insert('insert', 'foo') + self.assertEqual(text.get('1.0', 'end'), 'foo\n') + mock_notify.assert_called_with('1.0', '1.0+3c') + # Additional text. + text.insert('insert', 'barbaz') + self.assertEqual(text.get('1.0', 'end'), 'foobarbaz\n') + mock_notify.assert_called_with('1.3', '1.3+6c') + + @mock.patch.object(colorizer.ColorDelegator, 'notify_range') + def test_delete(self, mock_notify): + text = self.text + # Initialize text. + text.insert('insert', 'abcdefghi') + self.assertEqual(text.get('1.0', 'end'), 'abcdefghi\n') + # Delete single character. + text.delete('1.7') + self.assertEqual(text.get('1.0', 'end'), 'abcdefgi\n') + mock_notify.assert_called_with('1.7') + # Delete multiple characters. + text.delete('1.3', '1.6') + self.assertEqual(text.get('1.0', 'end'), 'abcgi\n') + mock_notify.assert_called_with('1.3') + + def test_notify_range(self): + text = self.text + color = self.color + eq = self.assertEqual + + # Colorizing already scheduled. + save_id = color.after_id + eq(self.root.tk.call('after', 'info', save_id)[1], 'timer') + self.assertFalse(color.colorizing) + self.assertFalse(color.stop_colorizing) + self.assertTrue(color.allow_colorizing) + + # Coloring scheduled and colorizing in progress. + color.colorizing = True + color.notify_range('1.0', 'end') + self.assertFalse(color.stop_colorizing) + eq(color.after_id, save_id) + + # No colorizing scheduled and colorizing in progress. + text.after_cancel(save_id) + color.after_id = None + color.notify_range('1.0', '1.0+3c') + self.assertTrue(color.stop_colorizing) + self.assertIsNotNone(color.after_id) + eq(self.root.tk.call('after', 'info', color.after_id)[1], 'timer') + # New event scheduled. + self.assertNotEqual(color.after_id, save_id) + + # No colorizing scheduled and colorizing off. + text.after_cancel(color.after_id) + color.after_id = None + color.allow_colorizing = False + color.notify_range('1.4', '1.4+10c') + # Nothing scheduled when colorizing is off. + self.assertIsNone(color.after_id) + + def test_toggle_colorize_event(self): + color = self.color + eq = self.assertEqual + + # Starts with colorizing allowed and scheduled. + self.assertFalse(color.colorizing) + self.assertFalse(color.stop_colorizing) + self.assertTrue(color.allow_colorizing) + eq(self.root.tk.call('after', 'info', color.after_id)[1], 'timer') + + # Toggle colorizing off. + color.toggle_colorize_event() + self.assertIsNone(color.after_id) + self.assertFalse(color.colorizing) + self.assertFalse(color.stop_colorizing) + self.assertFalse(color.allow_colorizing) + + # Toggle on while colorizing in progress (doesn't add timer). + color.colorizing = True + color.toggle_colorize_event() + self.assertIsNone(color.after_id) + self.assertTrue(color.colorizing) + self.assertFalse(color.stop_colorizing) + self.assertTrue(color.allow_colorizing) + + # Toggle off while colorizing in progress. + color.toggle_colorize_event() + self.assertIsNone(color.after_id) + self.assertTrue(color.colorizing) + self.assertTrue(color.stop_colorizing) + self.assertFalse(color.allow_colorizing) + + # Toggle on while colorizing not in progress. + color.colorizing = False + color.toggle_colorize_event() + eq(self.root.tk.call('after', 'info', color.after_id)[1], 'timer') + self.assertFalse(color.colorizing) + self.assertTrue(color.stop_colorizing) + self.assertTrue(color.allow_colorizing) + + @mock.patch.object(colorizer.ColorDelegator, 'recolorize_main') + def test_recolorize(self, mock_recmain): + text = self.text + color = self.color + eq = self.assertEqual + # Call recolorize manually and not scheduled. + text.after_cancel(color.after_id) + + # No delegate. + save_delegate = color.delegate + color.delegate = None + color.recolorize() + mock_recmain.assert_not_called() + color.delegate = save_delegate + + # Toggle off colorizing. + color.allow_colorizing = False + color.recolorize() + mock_recmain.assert_not_called() + color.allow_colorizing = True + + # Colorizing in progress. + color.colorizing = True + color.recolorize() + mock_recmain.assert_not_called() + color.colorizing = False + + # Colorizing is done, but not completed, so rescheduled. + color.recolorize() + self.assertFalse(color.stop_colorizing) + self.assertFalse(color.colorizing) + mock_recmain.assert_called() + eq(mock_recmain.call_count, 1) + # Rescheduled when TODO tag still exists. + eq(self.root.tk.call('after', 'info', color.after_id)[1], 'timer') + + # No changes to text, so no scheduling added. + text.tag_remove('TODO', '1.0', 'end') + color.recolorize() + self.assertFalse(color.stop_colorizing) + self.assertFalse(color.colorizing) + mock_recmain.assert_called() + eq(mock_recmain.call_count, 2) + self.assertIsNone(color.after_id) + + @mock.patch.object(colorizer.ColorDelegator, 'notify_range') + def test_recolorize_main(self, mock_notify): + text = self.text + color = self.color + eq = self.assertEqual + + text.insert('insert', source) + expected = (('1.0', ('KEYWORD',)), ('1.2', ()), ('1.3', ('KEYWORD',)), + ('1.7', ()), ('1.9', ('BUILTIN',)), ('1.14', ('STRING',)), + ('1.19', ('COMMENT',)), + ('2.1', ('KEYWORD',)), ('2.18', ()), ('2.25', ('COMMENT',)), + ('3.6', ('BUILTIN',)), ('3.12', ('KEYWORD',)), ('3.21', ('COMMENT',)), + ('4.0', ('KEYWORD',)), ('4.3', ()), ('4.6', ()), + ('5.2', ('STRING',)), ('5.8', ('KEYWORD',)), ('5.10', ('STRING',)), + ('6.0', ('KEYWORD',)), ('6.10', ('DEFINITION',)), ('6.11', ()), + ('8.0', ('STRING',)), ('8.4', ()), ('8.5', ('STRING',)), + ('8.12', ()), ('8.14', ('STRING',)), + ('19.0', ('KEYWORD',)), + ('20.4', ('KEYWORD',)), ('20.16', ('KEYWORD',)),# ('20.19', ('KEYWORD',)), + #('22.4', ('KEYWORD',)), ('22.10', ('KEYWORD',)), ('22.14', ('KEYWORD',)), ('22.19', ('STRING',)), + #('23.12', ('KEYWORD',)), + ('24.8', ('KEYWORD',)), + ('25.4', ('KEYWORD',)), ('25.9', ('KEYWORD',)), + ('25.11', ('KEYWORD',)), ('25.15', ('STRING',)), + ('25.19', ('KEYWORD',)), ('25.22', ()), + ('25.24', ('KEYWORD',)), ('25.29', ('BUILTIN',)), ('25.37', ('KEYWORD',)), + ('26.4', ('KEYWORD',)), ('26.9', ('KEYWORD',)),# ('26.11', ('KEYWORD',)), ('26.14', (),), + ('27.25', ('STRING',)), ('27.38', ('STRING',)), + ('29.0', ('STRING',)), + ('30.1', ('STRING',)), + # SYNC at the end of every line. + ('1.55', ('SYNC',)), ('2.50', ('SYNC',)), ('3.34', ('SYNC',)), + ) + + # Nothing marked to do therefore no tags in text. + text.tag_remove('TODO', '1.0', 'end') + color.recolorize_main() + for tag in text.tag_names(): + with self.subTest(tag=tag): + eq(text.tag_ranges(tag), ()) + + # Source marked for processing. + text.tag_add('TODO', '1.0', 'end') + # Check some indexes. + color.recolorize_main() + for index, expected_tags in expected: + with self.subTest(index=index): + eq(text.tag_names(index), expected_tags) + + # Check for some tags for ranges. + eq(text.tag_nextrange('TODO', '1.0'), ()) + eq(text.tag_nextrange('KEYWORD', '1.0'), ('1.0', '1.2')) + eq(text.tag_nextrange('COMMENT', '2.0'), ('2.22', '2.43')) + eq(text.tag_nextrange('SYNC', '2.0'), ('2.43', '3.0')) + eq(text.tag_nextrange('STRING', '2.0'), ('4.17', '4.53')) + eq(text.tag_nextrange('STRING', '8.0'), ('8.0', '8.3')) + eq(text.tag_nextrange('STRING', '8.3'), ('8.5', '8.12')) + eq(text.tag_nextrange('STRING', '8.12'), ('8.14', '8.17')) + eq(text.tag_nextrange('STRING', '8.17'), ('8.19', '8.26')) + eq(text.tag_nextrange('SYNC', '8.0'), ('8.26', '9.0')) + eq(text.tag_nextrange('SYNC', '30.0'), ('30.10', '32.0')) + + def _assert_highlighting(self, source, tag_ranges): + """Check highlighting of a given piece of code. + + This inserts just this code into the Text widget. It will then + check that the resulting highlighting tag ranges exactly match + those described in the given `tag_ranges` dict. + + Note that the irrelevant tags 'sel', 'TODO' and 'SYNC' are + ignored. + """ + text = self.text + + with mock.patch.object(colorizer.ColorDelegator, 'notify_range'): + text.delete('1.0', 'end-1c') + text.insert('insert', source) + text.tag_add('TODO', '1.0', 'end-1c') + self.color.recolorize_main() + + # Make a dict with highlighting tag ranges in the Text widget. + text_tag_ranges = {} + for tag in set(text.tag_names()) - {'sel', 'TODO', 'SYNC'}: + indexes = [rng.string for rng in text.tag_ranges(tag)] + for index_pair in zip(indexes[::2], indexes[1::2]): + text_tag_ranges.setdefault(tag, []).append(index_pair) + + self.assertEqual(text_tag_ranges, tag_ranges) + + with mock.patch.object(colorizer.ColorDelegator, 'notify_range'): + text.delete('1.0', 'end-1c') + + def test_def_statement(self): + # empty def + self._assert_highlighting('def', {'KEYWORD': [('1.0', '1.3')]}) + + # def followed by identifier + self._assert_highlighting('def foo:', {'KEYWORD': [('1.0', '1.3')], + 'DEFINITION': [('1.4', '1.7')]}) + + # def followed by partial identifier + self._assert_highlighting('def fo', {'KEYWORD': [('1.0', '1.3')], + 'DEFINITION': [('1.4', '1.6')]}) + + # def followed by non-keyword + self._assert_highlighting('def ++', {'KEYWORD': [('1.0', '1.3')]}) + + def test_match_soft_keyword(self): + # empty match + self._assert_highlighting('match', {'KEYWORD': [('1.0', '1.5')]}) + + # match followed by partial identifier + self._assert_highlighting('match fo', {'KEYWORD': [('1.0', '1.5')]}) + + # match followed by identifier and colon + self._assert_highlighting('match foo:', {'KEYWORD': [('1.0', '1.5')]}) + + # match followed by keyword + self._assert_highlighting('match and', {'KEYWORD': [('1.6', '1.9')]}) + + # match followed by builtin with keyword prefix + self._assert_highlighting('match int:', {'KEYWORD': [('1.0', '1.5')], + 'BUILTIN': [('1.6', '1.9')]}) + + # match followed by non-text operator + self._assert_highlighting('match^', {}) + self._assert_highlighting('match @', {}) + + # match followed by colon + self._assert_highlighting('match :', {}) + + # match followed by comma + self._assert_highlighting('match\t,', {}) + + # match followed by a lone underscore + self._assert_highlighting('match _:', {'KEYWORD': [('1.0', '1.5')]}) + + def test_case_soft_keyword(self): + # empty case + self._assert_highlighting('case', {'KEYWORD': [('1.0', '1.4')]}) + + # case followed by partial identifier + self._assert_highlighting('case fo', {'KEYWORD': [('1.0', '1.4')]}) + + # case followed by identifier and colon + self._assert_highlighting('case foo:', {'KEYWORD': [('1.0', '1.4')]}) + + # case followed by keyword + self._assert_highlighting('case and', {'KEYWORD': [('1.5', '1.8')]}) + + # case followed by builtin with keyword prefix + self._assert_highlighting('case int:', {'KEYWORD': [('1.0', '1.4')], + 'BUILTIN': [('1.5', '1.8')]}) + + # case followed by non-text operator + self._assert_highlighting('case^', {}) + self._assert_highlighting('case @', {}) + + # case followed by colon + self._assert_highlighting('case :', {}) + + # case followed by comma + self._assert_highlighting('case\t,', {}) + + # case followed by a lone underscore + self._assert_highlighting('case _:', {'KEYWORD': [('1.0', '1.4'), + ('1.5', '1.6')]}) + + def test_long_multiline_string(self): + source = textwrap.dedent('''\ + """a + b + c + d + e""" + ''') + self._assert_highlighting(source, {'STRING': [('1.0', '5.4')]}) + + @run_in_tk_mainloop(delay=50) + def test_incremental_editing(self): + text = self.text + eq = self.assertEqual + + # Simulate typing 'inte'. During this, the highlighting should + # change from normal to keyword to builtin to normal. + text.insert('insert', 'i') + yield + eq(text.tag_nextrange('BUILTIN', '1.0'), ()) + eq(text.tag_nextrange('KEYWORD', '1.0'), ()) + + text.insert('insert', 'n') + yield + eq(text.tag_nextrange('BUILTIN', '1.0'), ()) + eq(text.tag_nextrange('KEYWORD', '1.0'), ('1.0', '1.2')) + + text.insert('insert', 't') + yield + eq(text.tag_nextrange('BUILTIN', '1.0'), ('1.0', '1.3')) + eq(text.tag_nextrange('KEYWORD', '1.0'), ()) + + text.insert('insert', 'e') + yield + eq(text.tag_nextrange('BUILTIN', '1.0'), ()) + eq(text.tag_nextrange('KEYWORD', '1.0'), ()) + + # Simulate deleting three characters from the end of 'inte'. + # During this, the highlighting should change from normal to + # builtin to keyword to normal. + text.delete('insert-1c', 'insert') + yield + eq(text.tag_nextrange('BUILTIN', '1.0'), ('1.0', '1.3')) + eq(text.tag_nextrange('KEYWORD', '1.0'), ()) + + text.delete('insert-1c', 'insert') + yield + eq(text.tag_nextrange('BUILTIN', '1.0'), ()) + eq(text.tag_nextrange('KEYWORD', '1.0'), ('1.0', '1.2')) + + text.delete('insert-1c', 'insert') + yield + eq(text.tag_nextrange('BUILTIN', '1.0'), ()) + eq(text.tag_nextrange('KEYWORD', '1.0'), ()) + + @mock.patch.object(colorizer.ColorDelegator, 'recolorize') + @mock.patch.object(colorizer.ColorDelegator, 'notify_range') + def test_removecolors(self, mock_notify, mock_recolorize): + text = self.text + color = self.color + text.insert('insert', source) + + color.recolorize_main() + # recolorize_main doesn't add these tags. + text.tag_add("ERROR", "1.0") + text.tag_add("TODO", "1.0") + text.tag_add("hit", "1.0") + for tag in color.tagdefs: + with self.subTest(tag=tag): + self.assertNotEqual(text.tag_ranges(tag), ()) + + color.removecolors() + for tag in color.tagdefs: + with self.subTest(tag=tag): + self.assertEqual(text.tag_ranges(tag), ()) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_config.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_config.py new file mode 100644 index 0000000000000000000000000000000000000000..6d75cf7aa67dcce3b9bc49cc54cb4d5fd24cc103 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_config.py @@ -0,0 +1,805 @@ +"""Test config, coverage 93%. +(100% for IdleConfParser, IdleUserConfParser*, ConfigChanges). +* Exception is OSError clause in Save method. +Much of IdleConf is also exercised by ConfigDialog and test_configdialog. +""" +from idlelib import config +import sys +import os +import tempfile +from test.support import captured_stderr, findfile +import unittest +from unittest import mock +import idlelib +from idlelib.idle_test.mock_idle import Func + +# Tests should not depend on fortuitous user configurations. +# They must not affect actual user .cfg files. +# Replace user parsers with empty parsers that cannot be saved +# due to getting '' as the filename when created. + +idleConf = config.idleConf +usercfg = idleConf.userCfg +testcfg = {} +usermain = testcfg['main'] = config.IdleUserConfParser('') +userhigh = testcfg['highlight'] = config.IdleUserConfParser('') +userkeys = testcfg['keys'] = config.IdleUserConfParser('') +userextn = testcfg['extensions'] = config.IdleUserConfParser('') + +def setUpModule(): + idleConf.userCfg = testcfg + idlelib.testing = True + +def tearDownModule(): + idleConf.userCfg = usercfg + idlelib.testing = False + + +class IdleConfParserTest(unittest.TestCase): + """Test that IdleConfParser works""" + + config = """ + [one] + one = false + two = true + three = 10 + + [two] + one = a string + two = true + three = false + """ + + def test_get(self): + parser = config.IdleConfParser('') + parser.read_string(self.config) + eq = self.assertEqual + + # Test with type argument. + self.assertIs(parser.Get('one', 'one', type='bool'), False) + self.assertIs(parser.Get('one', 'two', type='bool'), True) + eq(parser.Get('one', 'three', type='int'), 10) + eq(parser.Get('two', 'one'), 'a string') + self.assertIs(parser.Get('two', 'two', type='bool'), True) + self.assertIs(parser.Get('two', 'three', type='bool'), False) + + # Test without type should fallback to string. + eq(parser.Get('two', 'two'), 'true') + eq(parser.Get('two', 'three'), 'false') + + # If option not exist, should return None, or default. + self.assertIsNone(parser.Get('not', 'exist')) + eq(parser.Get('not', 'exist', default='DEFAULT'), 'DEFAULT') + + def test_get_option_list(self): + parser = config.IdleConfParser('') + parser.read_string(self.config) + get_list = parser.GetOptionList + self.assertCountEqual(get_list('one'), ['one', 'two', 'three']) + self.assertCountEqual(get_list('two'), ['one', 'two', 'three']) + self.assertEqual(get_list('not exist'), []) + + def test_load_nothing(self): + parser = config.IdleConfParser('') + parser.Load() + self.assertEqual(parser.sections(), []) + + def test_load_file(self): + # Borrow test/configdata/cfgparser.1 from test_configparser. + config_path = findfile('cfgparser.1', subdir='configdata') + parser = config.IdleConfParser(config_path) + parser.Load() + + self.assertEqual(parser.Get('Foo Bar', 'foo'), 'newbar') + self.assertEqual(parser.GetOptionList('Foo Bar'), ['foo']) + + +class IdleUserConfParserTest(unittest.TestCase): + """Test that IdleUserConfParser works""" + + def new_parser(self, path=''): + return config.IdleUserConfParser(path) + + def test_set_option(self): + parser = self.new_parser() + parser.add_section('Foo') + # Setting new option in existing section should return True. + self.assertTrue(parser.SetOption('Foo', 'bar', 'true')) + # Setting existing option with same value should return False. + self.assertFalse(parser.SetOption('Foo', 'bar', 'true')) + # Setting exiting option with new value should return True. + self.assertTrue(parser.SetOption('Foo', 'bar', 'false')) + self.assertEqual(parser.Get('Foo', 'bar'), 'false') + + # Setting option in new section should create section and return True. + self.assertTrue(parser.SetOption('Bar', 'bar', 'true')) + self.assertCountEqual(parser.sections(), ['Bar', 'Foo']) + self.assertEqual(parser.Get('Bar', 'bar'), 'true') + + def test_remove_option(self): + parser = self.new_parser() + parser.AddSection('Foo') + parser.SetOption('Foo', 'bar', 'true') + + self.assertTrue(parser.RemoveOption('Foo', 'bar')) + self.assertFalse(parser.RemoveOption('Foo', 'bar')) + self.assertFalse(parser.RemoveOption('Not', 'Exist')) + + def test_add_section(self): + parser = self.new_parser() + self.assertEqual(parser.sections(), []) + + # Should not add duplicate section. + # Configparser raises DuplicateError, IdleParser not. + parser.AddSection('Foo') + parser.AddSection('Foo') + parser.AddSection('Bar') + self.assertCountEqual(parser.sections(), ['Bar', 'Foo']) + + def test_remove_empty_sections(self): + parser = self.new_parser() + + parser.AddSection('Foo') + parser.AddSection('Bar') + parser.SetOption('Idle', 'name', 'val') + self.assertCountEqual(parser.sections(), ['Bar', 'Foo', 'Idle']) + parser.RemoveEmptySections() + self.assertEqual(parser.sections(), ['Idle']) + + def test_is_empty(self): + parser = self.new_parser() + + parser.AddSection('Foo') + parser.AddSection('Bar') + self.assertTrue(parser.IsEmpty()) + self.assertEqual(parser.sections(), []) + + parser.SetOption('Foo', 'bar', 'false') + parser.AddSection('Bar') + self.assertFalse(parser.IsEmpty()) + self.assertCountEqual(parser.sections(), ['Foo']) + + def test_save(self): + with tempfile.TemporaryDirectory() as tdir: + path = os.path.join(tdir, 'test.cfg') + parser = self.new_parser(path) + parser.AddSection('Foo') + parser.SetOption('Foo', 'bar', 'true') + + # Should save to path when config is not empty. + self.assertFalse(os.path.exists(path)) + parser.Save() + self.assertTrue(os.path.exists(path)) + + # Should remove the file from disk when config is empty. + parser.remove_section('Foo') + parser.Save() + self.assertFalse(os.path.exists(path)) + + +class IdleConfTest(unittest.TestCase): + """Test for idleConf""" + + @classmethod + def setUpClass(cls): + cls.config_string = {} + + conf = config.IdleConf(_utest=True) + if __name__ != '__main__': + idle_dir = os.path.dirname(__file__) + else: + idle_dir = os.path.abspath(sys.path[0]) + for ctype in conf.config_types: + config_path = os.path.join(idle_dir, '../config-%s.def' % ctype) + with open(config_path) as f: + cls.config_string[ctype] = f.read() + + cls.orig_warn = config._warn + config._warn = Func() + + @classmethod + def tearDownClass(cls): + config._warn = cls.orig_warn + + def new_config(self, _utest=False): + return config.IdleConf(_utest=_utest) + + def mock_config(self): + """Return a mocked idleConf + + Both default and user config used the same config-*.def + """ + conf = config.IdleConf(_utest=True) + for ctype in conf.config_types: + conf.defaultCfg[ctype] = config.IdleConfParser('') + conf.defaultCfg[ctype].read_string(self.config_string[ctype]) + conf.userCfg[ctype] = config.IdleUserConfParser('') + conf.userCfg[ctype].read_string(self.config_string[ctype]) + + return conf + + @unittest.skipIf(sys.platform.startswith('win'), 'this is test for unix system') + def test_get_user_cfg_dir_unix(self): + # Test to get user config directory under unix. + conf = self.new_config(_utest=True) + + # Check normal way should success + with mock.patch('os.path.expanduser', return_value='/home/foo'): + with mock.patch('os.path.exists', return_value=True): + self.assertEqual(conf.GetUserCfgDir(), '/home/foo/.idlerc') + + # Check os.getcwd should success + with mock.patch('os.path.expanduser', return_value='~'): + with mock.patch('os.getcwd', return_value='/home/foo/cpython'): + with mock.patch('os.mkdir'): + self.assertEqual(conf.GetUserCfgDir(), + '/home/foo/cpython/.idlerc') + + # Check user dir not exists and created failed should raise SystemExit + with mock.patch('os.path.join', return_value='/path/not/exists'): + with self.assertRaises(SystemExit): + with self.assertRaises(FileNotFoundError): + conf.GetUserCfgDir() + + @unittest.skipIf(not sys.platform.startswith('win'), 'this is test for Windows system') + def test_get_user_cfg_dir_windows(self): + # Test to get user config directory under Windows. + conf = self.new_config(_utest=True) + + # Check normal way should success + with mock.patch('os.path.expanduser', return_value='C:\\foo'): + with mock.patch('os.path.exists', return_value=True): + self.assertEqual(conf.GetUserCfgDir(), 'C:\\foo\\.idlerc') + + # Check os.getcwd should success + with mock.patch('os.path.expanduser', return_value='~'): + with mock.patch('os.getcwd', return_value='C:\\foo\\cpython'): + with mock.patch('os.mkdir'): + self.assertEqual(conf.GetUserCfgDir(), + 'C:\\foo\\cpython\\.idlerc') + + # Check user dir not exists and created failed should raise SystemExit + with mock.patch('os.path.join', return_value='/path/not/exists'): + with self.assertRaises(SystemExit): + with self.assertRaises(FileNotFoundError): + conf.GetUserCfgDir() + + def test_create_config_handlers(self): + conf = self.new_config(_utest=True) + + # Mock out idle_dir + idle_dir = '/home/foo' + with mock.patch.dict({'__name__': '__foo__'}): + with mock.patch('os.path.dirname', return_value=idle_dir): + conf.CreateConfigHandlers() + + # Check keys are equal + self.assertCountEqual(conf.defaultCfg, conf.config_types) + self.assertCountEqual(conf.userCfg, conf.config_types) + + # Check conf parser are correct type + for default_parser in conf.defaultCfg.values(): + self.assertIsInstance(default_parser, config.IdleConfParser) + for user_parser in conf.userCfg.values(): + self.assertIsInstance(user_parser, config.IdleUserConfParser) + + # Check config path are correct + for cfg_type, parser in conf.defaultCfg.items(): + self.assertEqual(parser.file, + os.path.join(idle_dir, f'config-{cfg_type}.def')) + for cfg_type, parser in conf.userCfg.items(): + self.assertEqual(parser.file, + os.path.join(conf.userdir or '#', f'config-{cfg_type}.cfg')) + + def test_load_cfg_files(self): + conf = self.new_config(_utest=True) + + # Borrow test/configdata/cfgparser.1 from test_configparser. + config_path = findfile('cfgparser.1', subdir='configdata') + conf.defaultCfg['foo'] = config.IdleConfParser(config_path) + conf.userCfg['foo'] = config.IdleUserConfParser(config_path) + + # Load all config from path + conf.LoadCfgFiles() + + eq = self.assertEqual + + # Check defaultCfg is loaded + eq(conf.defaultCfg['foo'].Get('Foo Bar', 'foo'), 'newbar') + eq(conf.defaultCfg['foo'].GetOptionList('Foo Bar'), ['foo']) + + # Check userCfg is loaded + eq(conf.userCfg['foo'].Get('Foo Bar', 'foo'), 'newbar') + eq(conf.userCfg['foo'].GetOptionList('Foo Bar'), ['foo']) + + def test_save_user_cfg_files(self): + conf = self.mock_config() + + with mock.patch('idlelib.config.IdleUserConfParser.Save') as m: + conf.SaveUserCfgFiles() + self.assertEqual(m.call_count, len(conf.userCfg)) + + def test_get_option(self): + conf = self.mock_config() + + eq = self.assertEqual + eq(conf.GetOption('main', 'EditorWindow', 'width'), '80') + eq(conf.GetOption('main', 'EditorWindow', 'width', type='int'), 80) + with mock.patch('idlelib.config._warn') as _warn: + eq(conf.GetOption('main', 'EditorWindow', 'font', type='int'), None) + eq(conf.GetOption('main', 'EditorWindow', 'NotExists'), None) + eq(conf.GetOption('main', 'EditorWindow', 'NotExists', default='NE'), 'NE') + eq(_warn.call_count, 4) + + def test_set_option(self): + conf = self.mock_config() + + conf.SetOption('main', 'Foo', 'bar', 'newbar') + self.assertEqual(conf.GetOption('main', 'Foo', 'bar'), 'newbar') + + def test_get_section_list(self): + conf = self.mock_config() + + self.assertCountEqual( + conf.GetSectionList('default', 'main'), + ['General', 'EditorWindow', 'PyShell', 'Indent', 'Theme', + 'Keys', 'History', 'HelpFiles']) + self.assertCountEqual( + conf.GetSectionList('user', 'main'), + ['General', 'EditorWindow', 'PyShell', 'Indent', 'Theme', + 'Keys', 'History', 'HelpFiles']) + + with self.assertRaises(config.InvalidConfigSet): + conf.GetSectionList('foobar', 'main') + with self.assertRaises(config.InvalidConfigType): + conf.GetSectionList('default', 'notexists') + + def test_get_highlight(self): + conf = self.mock_config() + + eq = self.assertEqual + eq(conf.GetHighlight('IDLE Classic', 'normal'), {'foreground': '#000000', + 'background': '#ffffff'}) + + # Test cursor (this background should be normal-background) + eq(conf.GetHighlight('IDLE Classic', 'cursor'), {'foreground': 'black', + 'background': '#ffffff'}) + + # Test get user themes + conf.SetOption('highlight', 'Foobar', 'normal-foreground', '#747474') + conf.SetOption('highlight', 'Foobar', 'normal-background', '#171717') + with mock.patch('idlelib.config._warn'): + eq(conf.GetHighlight('Foobar', 'normal'), {'foreground': '#747474', + 'background': '#171717'}) + + def test_get_theme_dict(self): + # TODO: finish. + conf = self.mock_config() + + # These two should be the same + self.assertEqual( + conf.GetThemeDict('default', 'IDLE Classic'), + conf.GetThemeDict('user', 'IDLE Classic')) + + with self.assertRaises(config.InvalidTheme): + conf.GetThemeDict('bad', 'IDLE Classic') + + def test_get_current_theme_and_keys(self): + conf = self.mock_config() + + self.assertEqual(conf.CurrentTheme(), conf.current_colors_and_keys('Theme')) + self.assertEqual(conf.CurrentKeys(), conf.current_colors_and_keys('Keys')) + + def test_current_colors_and_keys(self): + conf = self.mock_config() + + self.assertEqual(conf.current_colors_and_keys('Theme'), 'IDLE Classic') + + def test_default_keys(self): + current_platform = sys.platform + conf = self.new_config(_utest=True) + + sys.platform = 'win32' + self.assertEqual(conf.default_keys(), 'IDLE Classic Windows') + + sys.platform = 'darwin' + self.assertEqual(conf.default_keys(), 'IDLE Classic OSX') + + sys.platform = 'some-linux' + self.assertEqual(conf.default_keys(), 'IDLE Modern Unix') + + # Restore platform + sys.platform = current_platform + + def test_get_extensions(self): + userextn.read_string(''' + [ZzDummy] + enable = True + [DISABLE] + enable = False + ''') + eq = self.assertEqual + iGE = idleConf.GetExtensions + eq(iGE(shell_only=True), []) + eq(iGE(), ['ZzDummy']) + eq(iGE(editor_only=True), ['ZzDummy']) + eq(iGE(active_only=False), ['ZzDummy', 'DISABLE']) + eq(iGE(active_only=False, editor_only=True), ['ZzDummy', 'DISABLE']) + userextn.remove_section('ZzDummy') + userextn.remove_section('DISABLE') + + + def test_remove_key_bind_names(self): + conf = self.mock_config() + + self.assertCountEqual( + conf.RemoveKeyBindNames(conf.GetSectionList('default', 'extensions')), + ['AutoComplete', 'CodeContext', 'FormatParagraph', 'ParenMatch', 'ZzDummy']) + + def test_get_extn_name_for_event(self): + userextn.read_string(''' + [ZzDummy] + enable = True + ''') + eq = self.assertEqual + eq(idleConf.GetExtnNameForEvent('z-in'), 'ZzDummy') + eq(idleConf.GetExtnNameForEvent('z-out'), None) + userextn.remove_section('ZzDummy') + + def test_get_extension_keys(self): + userextn.read_string(''' + [ZzDummy] + enable = True + ''') + self.assertEqual(idleConf.GetExtensionKeys('ZzDummy'), + {'<>': ['']}) + userextn.remove_section('ZzDummy') +# need option key test +## key = [''] if sys.platform == 'darwin' else [''] +## eq(conf.GetExtensionKeys('ZoomHeight'), {'<>': key}) + + def test_get_extension_bindings(self): + userextn.read_string(''' + [ZzDummy] + enable = True + ''') + eq = self.assertEqual + iGEB = idleConf.GetExtensionBindings + eq(iGEB('NotExists'), {}) + expect = {'<>': [''], + '<>': ['']} + eq(iGEB('ZzDummy'), expect) + userextn.remove_section('ZzDummy') + + def test_get_keybinding(self): + conf = self.mock_config() + + eq = self.assertEqual + eq(conf.GetKeyBinding('IDLE Modern Unix', '<>'), + ['', '']) + eq(conf.GetKeyBinding('IDLE Classic Unix', '<>'), + ['', '']) + eq(conf.GetKeyBinding('IDLE Classic Windows', '<>'), + ['', '']) + eq(conf.GetKeyBinding('IDLE Classic Mac', '<>'), ['']) + eq(conf.GetKeyBinding('IDLE Classic OSX', '<>'), ['']) + + # Test keybinding not exists + eq(conf.GetKeyBinding('NOT EXISTS', '<>'), []) + eq(conf.GetKeyBinding('IDLE Modern Unix', 'NOT EXISTS'), []) + + def test_get_current_keyset(self): + current_platform = sys.platform + conf = self.mock_config() + + # Ensure that platform isn't darwin + sys.platform = 'some-linux' + self.assertEqual(conf.GetCurrentKeySet(), conf.GetKeySet(conf.CurrentKeys())) + + # This should not be the same, since replace ') + self.assertEqual(conf.GetKeySet('IDLE Modern Unix')['<>'], '') + + def test_is_core_binding(self): + # XXX: Should move out the core keys to config file or other place + conf = self.mock_config() + + self.assertTrue(conf.IsCoreBinding('copy')) + self.assertTrue(conf.IsCoreBinding('cut')) + self.assertTrue(conf.IsCoreBinding('del-word-right')) + self.assertFalse(conf.IsCoreBinding('not-exists')) + + def test_extra_help_source_list(self): + # Test GetExtraHelpSourceList and GetAllExtraHelpSourcesList in same + # place to prevent prepare input data twice. + conf = self.mock_config() + + # Test default with no extra help source + self.assertEqual(conf.GetExtraHelpSourceList('default'), []) + self.assertEqual(conf.GetExtraHelpSourceList('user'), []) + with self.assertRaises(config.InvalidConfigSet): + self.assertEqual(conf.GetExtraHelpSourceList('bad'), []) + self.assertCountEqual( + conf.GetAllExtraHelpSourcesList(), + conf.GetExtraHelpSourceList('default') + conf.GetExtraHelpSourceList('user')) + + # Add help source to user config + conf.userCfg['main'].SetOption('HelpFiles', '4', 'Python;https://python.org') # This is bad input + conf.userCfg['main'].SetOption('HelpFiles', '3', 'Python:https://python.org') # This is bad input + conf.userCfg['main'].SetOption('HelpFiles', '2', 'Pillow;https://pillow.readthedocs.io/en/latest/') + conf.userCfg['main'].SetOption('HelpFiles', '1', 'IDLE;C:/Programs/Python36/Lib/idlelib/help.html') + self.assertEqual(conf.GetExtraHelpSourceList('user'), + [('IDLE', 'C:/Programs/Python36/Lib/idlelib/help.html', '1'), + ('Pillow', 'https://pillow.readthedocs.io/en/latest/', '2'), + ('Python', 'https://python.org', '4')]) + self.assertCountEqual( + conf.GetAllExtraHelpSourcesList(), + conf.GetExtraHelpSourceList('default') + conf.GetExtraHelpSourceList('user')) + + def test_get_font(self): + from test.support import requires + from tkinter import Tk + from tkinter.font import Font + conf = self.mock_config() + + requires('gui') + root = Tk() + root.withdraw() + + f = Font.actual(Font(name='TkFixedFont', exists=True, root=root)) + self.assertEqual( + conf.GetFont(root, 'main', 'EditorWindow'), + (f['family'], 10 if f['size'] <= 0 else f['size'], f['weight'])) + + # Cleanup root + root.destroy() + del root + + def test_get_core_keys(self): + conf = self.mock_config() + + eq = self.assertEqual + eq(conf.GetCoreKeys()['<>'], ['']) + eq(conf.GetCoreKeys()['<>'], ['', '']) + eq(conf.GetCoreKeys()['<>'], ['']) + eq(conf.GetCoreKeys('IDLE Classic Windows')['<>'], + ['', '']) + eq(conf.GetCoreKeys('IDLE Classic OSX')['<>'], ['']) + eq(conf.GetCoreKeys('IDLE Classic Unix')['<>'], + ['', '']) + eq(conf.GetCoreKeys('IDLE Modern Unix')['<>'], + ['', '']) + + +class CurrentColorKeysTest(unittest.TestCase): + """ Test colorkeys function with user config [Theme] and [Keys] patterns. + + colorkeys = config.IdleConf.current_colors_and_keys + Test all patterns written by IDLE and some errors + Item 'default' should really be 'builtin' (versus 'custom). + """ + colorkeys = idleConf.current_colors_and_keys + default_theme = 'IDLE Classic' + default_keys = idleConf.default_keys() + + def test_old_builtin_theme(self): + # On initial installation, user main is blank. + self.assertEqual(self.colorkeys('Theme'), self.default_theme) + # For old default, name2 must be blank. + usermain.read_string(''' + [Theme] + default = True + ''') + # IDLE omits 'name' for default old builtin theme. + self.assertEqual(self.colorkeys('Theme'), self.default_theme) + # IDLE adds 'name' for non-default old builtin theme. + usermain['Theme']['name'] = 'IDLE New' + self.assertEqual(self.colorkeys('Theme'), 'IDLE New') + # Erroneous non-default old builtin reverts to default. + usermain['Theme']['name'] = 'non-existent' + self.assertEqual(self.colorkeys('Theme'), self.default_theme) + usermain.remove_section('Theme') + + def test_new_builtin_theme(self): + # IDLE writes name2 for new builtins. + usermain.read_string(''' + [Theme] + default = True + name2 = IDLE Dark + ''') + self.assertEqual(self.colorkeys('Theme'), 'IDLE Dark') + # Leftover 'name', not removed, is ignored. + usermain['Theme']['name'] = 'IDLE New' + self.assertEqual(self.colorkeys('Theme'), 'IDLE Dark') + # Erroneous non-default new builtin reverts to default. + usermain['Theme']['name2'] = 'non-existent' + self.assertEqual(self.colorkeys('Theme'), self.default_theme) + usermain.remove_section('Theme') + + def test_user_override_theme(self): + # Erroneous custom name (no definition) reverts to default. + usermain.read_string(''' + [Theme] + default = False + name = Custom Dark + ''') + self.assertEqual(self.colorkeys('Theme'), self.default_theme) + # Custom name is valid with matching Section name. + userhigh.read_string('[Custom Dark]\na=b') + self.assertEqual(self.colorkeys('Theme'), 'Custom Dark') + # Name2 is ignored. + usermain['Theme']['name2'] = 'non-existent' + self.assertEqual(self.colorkeys('Theme'), 'Custom Dark') + usermain.remove_section('Theme') + userhigh.remove_section('Custom Dark') + + def test_old_builtin_keys(self): + # On initial installation, user main is blank. + self.assertEqual(self.colorkeys('Keys'), self.default_keys) + # For old default, name2 must be blank, name is always used. + usermain.read_string(''' + [Keys] + default = True + name = IDLE Classic Unix + ''') + self.assertEqual(self.colorkeys('Keys'), 'IDLE Classic Unix') + # Erroneous non-default old builtin reverts to default. + usermain['Keys']['name'] = 'non-existent' + self.assertEqual(self.colorkeys('Keys'), self.default_keys) + usermain.remove_section('Keys') + + def test_new_builtin_keys(self): + # IDLE writes name2 for new builtins. + usermain.read_string(''' + [Keys] + default = True + name2 = IDLE Modern Unix + ''') + self.assertEqual(self.colorkeys('Keys'), 'IDLE Modern Unix') + # Leftover 'name', not removed, is ignored. + usermain['Keys']['name'] = 'IDLE Classic Unix' + self.assertEqual(self.colorkeys('Keys'), 'IDLE Modern Unix') + # Erroneous non-default new builtin reverts to default. + usermain['Keys']['name2'] = 'non-existent' + self.assertEqual(self.colorkeys('Keys'), self.default_keys) + usermain.remove_section('Keys') + + def test_user_override_keys(self): + # Erroneous custom name (no definition) reverts to default. + usermain.read_string(''' + [Keys] + default = False + name = Custom Keys + ''') + self.assertEqual(self.colorkeys('Keys'), self.default_keys) + # Custom name is valid with matching Section name. + userkeys.read_string('[Custom Keys]\na=b') + self.assertEqual(self.colorkeys('Keys'), 'Custom Keys') + # Name2 is ignored. + usermain['Keys']['name2'] = 'non-existent' + self.assertEqual(self.colorkeys('Keys'), 'Custom Keys') + usermain.remove_section('Keys') + userkeys.remove_section('Custom Keys') + + +class ChangesTest(unittest.TestCase): + + empty = {'main':{}, 'highlight':{}, 'keys':{}, 'extensions':{}} + + def load(self): # Test_add_option verifies that this works. + changes = self.changes + changes.add_option('main', 'Msec', 'mitem', 'mval') + changes.add_option('highlight', 'Hsec', 'hitem', 'hval') + changes.add_option('keys', 'Ksec', 'kitem', 'kval') + return changes + + loaded = {'main': {'Msec': {'mitem': 'mval'}}, + 'highlight': {'Hsec': {'hitem': 'hval'}}, + 'keys': {'Ksec': {'kitem':'kval'}}, + 'extensions': {}} + + def setUp(self): + self.changes = config.ConfigChanges() + + def test_init(self): + self.assertEqual(self.changes, self.empty) + + def test_add_option(self): + changes = self.load() + self.assertEqual(changes, self.loaded) + changes.add_option('main', 'Msec', 'mitem', 'mval') + self.assertEqual(changes, self.loaded) + + def test_save_option(self): # Static function does not touch changes. + save_option = self.changes.save_option + self.assertTrue(save_option('main', 'Indent', 'what', '0')) + self.assertFalse(save_option('main', 'Indent', 'what', '0')) + self.assertEqual(usermain['Indent']['what'], '0') + + self.assertTrue(save_option('main', 'Indent', 'use-spaces', '0')) + self.assertEqual(usermain['Indent']['use-spaces'], '0') + self.assertTrue(save_option('main', 'Indent', 'use-spaces', '1')) + self.assertFalse(usermain.has_option('Indent', 'use-spaces')) + usermain.remove_section('Indent') + + def test_save_added(self): + changes = self.load() + self.assertTrue(changes.save_all()) + self.assertEqual(usermain['Msec']['mitem'], 'mval') + self.assertEqual(userhigh['Hsec']['hitem'], 'hval') + self.assertEqual(userkeys['Ksec']['kitem'], 'kval') + changes.add_option('main', 'Msec', 'mitem', 'mval') + self.assertFalse(changes.save_all()) + usermain.remove_section('Msec') + userhigh.remove_section('Hsec') + userkeys.remove_section('Ksec') + + def test_save_help(self): + # Any change to HelpFiles overwrites entire section. + changes = self.changes + changes.save_option('main', 'HelpFiles', 'IDLE', 'idledoc') + changes.add_option('main', 'HelpFiles', 'ELDI', 'codeldi') + changes.save_all() + self.assertFalse(usermain.has_option('HelpFiles', 'IDLE')) + self.assertTrue(usermain.has_option('HelpFiles', 'ELDI')) + + def test_save_default(self): # Cover 2nd and 3rd false branches. + changes = self.changes + changes.add_option('main', 'Indent', 'use-spaces', '1') + # save_option returns False; cfg_type_changed remains False. + + # TODO: test that save_all calls usercfg Saves. + + def test_delete_section(self): + changes = self.load() + changes.delete_section('main', 'fake') # Test no exception. + self.assertEqual(changes, self.loaded) # Test nothing deleted. + for cfgtype, section in (('main', 'Msec'), ('keys', 'Ksec')): + testcfg[cfgtype].SetOption(section, 'name', 'value') + changes.delete_section(cfgtype, section) + with self.assertRaises(KeyError): + changes[cfgtype][section] # Test section gone from changes + testcfg[cfgtype][section] # and from mock userCfg. + # TODO test for save call. + + def test_clear(self): + changes = self.load() + changes.clear() + self.assertEqual(changes, self.empty) + + +class WarningTest(unittest.TestCase): + + def test_warn(self): + Equal = self.assertEqual + config._warned = set() + with captured_stderr() as stderr: + config._warn('warning', 'key') + Equal(config._warned, {('warning','key')}) + Equal(stderr.getvalue(), 'warning'+'\n') + with captured_stderr() as stderr: + config._warn('warning', 'key') + Equal(stderr.getvalue(), '') + with captured_stderr() as stderr: + config._warn('warn2', 'yek') + Equal(config._warned, {('warning','key'), ('warn2','yek')}) + Equal(stderr.getvalue(), 'warn2'+'\n') + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_config_key.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_config_key.py new file mode 100644 index 0000000000000000000000000000000000000000..32f878b842b276dc892c0606503d4fb8abde2180 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_config_key.py @@ -0,0 +1,356 @@ +"""Test config_key, coverage 98%. + +Coverage is effectively 100%. Tkinter dialog is mocked, Mac-only line +may be skipped, and dummy function in bind test should not be called. +Not tested: exit with 'self.advanced or self.keys_ok(keys) ...' False. +""" + +from idlelib import config_key +from test.support import requires +import unittest +from unittest import mock +from tkinter import Tk, TclError +from idlelib.idle_test.mock_idle import Func +from idlelib.idle_test.mock_tk import Mbox_func + + +class ValidationTest(unittest.TestCase): + "Test validation methods: ok, keys_ok, bind_ok." + + class Validator(config_key.GetKeysFrame): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + class list_keys_final: + get = Func() + self.list_keys_final = list_keys_final + get_modifiers = Func() + showerror = Mbox_func() + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + keylist = [[''], ['', '']] + cls.dialog = cls.Validator(cls.root, '<>', keylist) + + @classmethod + def tearDownClass(cls): + del cls.dialog + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def setUp(self): + self.dialog.showerror.message = '' + # A test that needs a particular final key value should set it. + # A test that sets a non-blank modifier list should reset it to []. + + def test_ok_empty(self): + self.dialog.key_string.set(' ') + self.dialog.ok() + self.assertEqual(self.dialog.result, '') + self.assertEqual(self.dialog.showerror.message, 'No key specified.') + + def test_ok_good(self): + self.dialog.key_string.set('') + self.dialog.list_keys_final.get.result = 'F11' + self.dialog.ok() + self.assertEqual(self.dialog.result, '') + self.assertEqual(self.dialog.showerror.message, '') + + def test_keys_no_ending(self): + self.assertFalse(self.dialog.keys_ok('')) + self.assertIn('No modifier', self.dialog.showerror.message) + + def test_keys_no_modifier_ok(self): + self.dialog.list_keys_final.get.result = 'F11' + self.assertTrue(self.dialog.keys_ok('')) + self.assertEqual(self.dialog.showerror.message, '') + + def test_keys_shift_bad(self): + self.dialog.list_keys_final.get.result = 'a' + self.dialog.get_modifiers.result = ['Shift'] + self.assertFalse(self.dialog.keys_ok('')) + self.assertIn('shift modifier', self.dialog.showerror.message) + self.dialog.get_modifiers.result = [] + + def test_keys_dup(self): + for mods, final, seq in (([], 'F12', ''), + (['Control'], 'x', ''), + (['Control'], 'X', '')): + with self.subTest(m=mods, f=final, s=seq): + self.dialog.list_keys_final.get.result = final + self.dialog.get_modifiers.result = mods + self.assertFalse(self.dialog.keys_ok(seq)) + self.assertIn('already in use', self.dialog.showerror.message) + self.dialog.get_modifiers.result = [] + + def test_bind_ok(self): + self.assertTrue(self.dialog.bind_ok('')) + self.assertEqual(self.dialog.showerror.message, '') + + def test_bind_not_ok(self): + self.assertFalse(self.dialog.bind_ok('')) + self.assertIn('not accepted', self.dialog.showerror.message) + + +class ToggleLevelTest(unittest.TestCase): + "Test toggle between Basic and Advanced frames." + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.dialog = config_key.GetKeysFrame(cls.root, '<>', []) + + @classmethod + def tearDownClass(cls): + del cls.dialog + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def test_toggle_level(self): + dialog = self.dialog + + def stackorder(): + """Get the stack order of the children of the frame. + + winfo_children() stores the children in stack order, so + this can be used to check whether a frame is above or + below another one. + """ + for index, child in enumerate(dialog.winfo_children()): + if child._name == 'keyseq_basic': + basic = index + if child._name == 'keyseq_advanced': + advanced = index + return basic, advanced + + # New window starts at basic level. + self.assertFalse(dialog.advanced) + self.assertIn('Advanced', dialog.button_level['text']) + basic, advanced = stackorder() + self.assertGreater(basic, advanced) + + # Toggle to advanced. + dialog.toggle_level() + self.assertTrue(dialog.advanced) + self.assertIn('Basic', dialog.button_level['text']) + basic, advanced = stackorder() + self.assertGreater(advanced, basic) + + # Toggle to basic. + dialog.button_level.invoke() + self.assertFalse(dialog.advanced) + self.assertIn('Advanced', dialog.button_level['text']) + basic, advanced = stackorder() + self.assertGreater(basic, advanced) + + +class KeySelectionTest(unittest.TestCase): + "Test selecting key on Basic frames." + + class Basic(config_key.GetKeysFrame): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + class list_keys_final: + get = Func() + select_clear = Func() + yview = Func() + self.list_keys_final = list_keys_final + def set_modifiers_for_platform(self): + self.modifiers = ['foo', 'bar', 'BAZ'] + self.modifier_label = {'BAZ': 'ZZZ'} + showerror = Mbox_func() + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.dialog = cls.Basic(cls.root, '<>', []) + + @classmethod + def tearDownClass(cls): + del cls.dialog + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def setUp(self): + self.dialog.clear_key_seq() + + def test_get_modifiers(self): + dialog = self.dialog + gm = dialog.get_modifiers + eq = self.assertEqual + + # Modifiers are set on/off by invoking the checkbutton. + dialog.modifier_checkbuttons['foo'].invoke() + eq(gm(), ['foo']) + + dialog.modifier_checkbuttons['BAZ'].invoke() + eq(gm(), ['foo', 'BAZ']) + + dialog.modifier_checkbuttons['foo'].invoke() + eq(gm(), ['BAZ']) + + @mock.patch.object(config_key.GetKeysFrame, 'get_modifiers') + def test_build_key_string(self, mock_modifiers): + dialog = self.dialog + key = dialog.list_keys_final + string = dialog.key_string.get + eq = self.assertEqual + + key.get.result = 'a' + mock_modifiers.return_value = [] + dialog.build_key_string() + eq(string(), '') + + mock_modifiers.return_value = ['mymod'] + dialog.build_key_string() + eq(string(), '') + + key.get.result = '' + mock_modifiers.return_value = ['mymod', 'test'] + dialog.build_key_string() + eq(string(), '') + + @mock.patch.object(config_key.GetKeysFrame, 'get_modifiers') + def test_final_key_selected(self, mock_modifiers): + dialog = self.dialog + key = dialog.list_keys_final + string = dialog.key_string.get + eq = self.assertEqual + + mock_modifiers.return_value = ['Shift'] + key.get.result = '{' + dialog.final_key_selected() + eq(string(), '') + + +class CancelWindowTest(unittest.TestCase): + "Simulate user clicking [Cancel] button." + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.dialog = config_key.GetKeysWindow( + cls.root, 'Title', '<>', [], _utest=True) + + @classmethod + def tearDownClass(cls): + cls.dialog.cancel() + del cls.dialog + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + @mock.patch.object(config_key.GetKeysFrame, 'ok') + def test_cancel(self, mock_frame_ok): + self.assertEqual(self.dialog.winfo_class(), 'Toplevel') + self.dialog.button_cancel.invoke() + with self.assertRaises(TclError): + self.dialog.winfo_class() + self.assertEqual(self.dialog.result, '') + mock_frame_ok.assert_not_called() + + +class OKWindowTest(unittest.TestCase): + "Simulate user clicking [OK] button." + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.dialog = config_key.GetKeysWindow( + cls.root, 'Title', '<>', [], _utest=True) + + @classmethod + def tearDownClass(cls): + cls.dialog.cancel() + del cls.dialog + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + @mock.patch.object(config_key.GetKeysFrame, 'ok') + def test_ok(self, mock_frame_ok): + self.assertEqual(self.dialog.winfo_class(), 'Toplevel') + self.dialog.button_ok.invoke() + with self.assertRaises(TclError): + self.dialog.winfo_class() + mock_frame_ok.assert_called() + + +class WindowResultTest(unittest.TestCase): + "Test window result get and set." + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.dialog = config_key.GetKeysWindow( + cls.root, 'Title', '<>', [], _utest=True) + + @classmethod + def tearDownClass(cls): + cls.dialog.cancel() + del cls.dialog + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def test_result(self): + dialog = self.dialog + eq = self.assertEqual + + dialog.result = '' + eq(dialog.result, '') + eq(dialog.frame.result,'') + + dialog.result = 'bar' + eq(dialog.result,'bar') + eq(dialog.frame.result,'bar') + + dialog.frame.result = 'foo' + eq(dialog.result, 'foo') + eq(dialog.frame.result,'foo') + + +class HelperTest(unittest.TestCase): + "Test module level helper functions." + + def test_translate_key(self): + tr = config_key.translate_key + eq = self.assertEqual + + # Letters return unchanged with no 'Shift'. + eq(tr('q', []), 'Key-q') + eq(tr('q', ['Control', 'Alt']), 'Key-q') + + # 'Shift' uppercases single lowercase letters. + eq(tr('q', ['Shift']), 'Key-Q') + eq(tr('q', ['Control', 'Shift']), 'Key-Q') + eq(tr('q', ['Control', 'Alt', 'Shift']), 'Key-Q') + + # Convert key name to keysym. + eq(tr('Page Up', []), 'Key-Prior') + # 'Shift' doesn't change case when it's not a single char. + eq(tr('*', ['Shift']), 'Key-asterisk') + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_configdialog.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_configdialog.py new file mode 100644 index 0000000000000000000000000000000000000000..5099d0933824453c32ca0ec9582721db840db566 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_configdialog.py @@ -0,0 +1,1580 @@ +"""Test configdialog, coverage 94%. + +Half the class creates dialog, half works with user customizations. +""" +from idlelib import configdialog +from test.support import requires +requires('gui') +import unittest +from unittest import mock +from idlelib.idle_test.mock_idle import Func +from tkinter import (Tk, StringVar, IntVar, BooleanVar, DISABLED, NORMAL) +from idlelib import config +from idlelib.configdialog import idleConf, changes, tracers + +# Tests should not depend on fortuitous user configurations. +# They must not affect actual user .cfg files. +# Use solution from test_config: empty parsers with no filename. +usercfg = idleConf.userCfg +testcfg = { + 'main': config.IdleUserConfParser(''), + 'highlight': config.IdleUserConfParser(''), + 'keys': config.IdleUserConfParser(''), + 'extensions': config.IdleUserConfParser(''), +} + +root = None +dialog = None +mainpage = changes['main'] +highpage = changes['highlight'] +keyspage = changes['keys'] +extpage = changes['extensions'] + + +def setUpModule(): + global root, dialog + idleConf.userCfg = testcfg + root = Tk() + # root.withdraw() # Comment out, see issue 30870 + dialog = configdialog.ConfigDialog(root, 'Test', _utest=True) + + +def tearDownModule(): + global root, dialog + idleConf.userCfg = usercfg + tracers.detach() + tracers.clear() + changes.clear() + root.update_idletasks() + root.destroy() + root = dialog = None + + +class ConfigDialogTest(unittest.TestCase): + + def test_deactivate_current_config(self): + pass + + def activate_config_changes(self): + pass + + +class ButtonTest(unittest.TestCase): + + def test_click_ok(self): + d = dialog + apply = d.apply = mock.Mock() + destroy = d.destroy = mock.Mock() + d.buttons['Ok'].invoke() + apply.assert_called_once() + destroy.assert_called_once() + del d.destroy, d.apply + + def test_click_apply(self): + d = dialog + deactivate = d.deactivate_current_config = mock.Mock() + save_ext = d.extpage.save_all_changed_extensions = mock.Mock() + activate = d.activate_config_changes = mock.Mock() + d.buttons['Apply'].invoke() + deactivate.assert_called_once() + save_ext.assert_called_once() + activate.assert_called_once() + del d.extpage.save_all_changed_extensions + del d.activate_config_changes, d.deactivate_current_config + + def test_click_cancel(self): + d = dialog + d.destroy = Func() + changes['main']['something'] = 1 + d.buttons['Cancel'].invoke() + self.assertEqual(changes['main'], {}) + self.assertEqual(d.destroy.called, 1) + del d.destroy + + def test_click_help(self): + dialog.note.select(dialog.keyspage) + with mock.patch.object(configdialog, 'view_text', + new_callable=Func) as view: + dialog.buttons['Help'].invoke() + title, contents = view.kwds['title'], view.kwds['contents'] + self.assertEqual(title, 'Help for IDLE preferences') + self.assertTrue(contents.startswith('When you click') and + contents.endswith('a different name.\n')) + + +class FontPageTest(unittest.TestCase): + """Test that font widgets enable users to make font changes. + + Test that widget actions set vars, that var changes add three + options to changes and call set_samples, and that set_samples + changes the font of both sample boxes. + """ + @classmethod + def setUpClass(cls): + page = cls.page = dialog.fontpage + dialog.note.select(page) + page.set_samples = Func() # Mask instance method. + page.update() + + @classmethod + def tearDownClass(cls): + del cls.page.set_samples # Unmask instance method. + + def setUp(self): + changes.clear() + + def test_load_font_cfg(self): + # Leave widget load test to human visual check. + # TODO Improve checks when add IdleConf.get_font_values. + tracers.detach() + d = self.page + d.font_name.set('Fake') + d.font_size.set('1') + d.font_bold.set(True) + d.set_samples.called = 0 + d.load_font_cfg() + self.assertNotEqual(d.font_name.get(), 'Fake') + self.assertNotEqual(d.font_size.get(), '1') + self.assertFalse(d.font_bold.get()) + self.assertEqual(d.set_samples.called, 1) + tracers.attach() + + def test_fontlist_key(self): + # Up and Down keys should select a new font. + d = self.page + if d.fontlist.size() < 2: + self.skipTest('need at least 2 fonts') + fontlist = d.fontlist + fontlist.activate(0) + font = d.fontlist.get('active') + + # Test Down key. + fontlist.focus_force() + fontlist.update() + fontlist.event_generate('') + fontlist.event_generate('') + + down_font = fontlist.get('active') + self.assertNotEqual(down_font, font) + self.assertIn(d.font_name.get(), down_font.lower()) + + # Test Up key. + fontlist.focus_force() + fontlist.update() + fontlist.event_generate('') + fontlist.event_generate('') + + up_font = fontlist.get('active') + self.assertEqual(up_font, font) + self.assertIn(d.font_name.get(), up_font.lower()) + + def test_fontlist_mouse(self): + # Click on item should select that item. + d = self.page + if d.fontlist.size() < 2: + self.skipTest('need at least 2 fonts') + fontlist = d.fontlist + fontlist.activate(0) + + # Select next item in listbox + fontlist.focus_force() + fontlist.see(1) + fontlist.update() + x, y, dx, dy = fontlist.bbox(1) + x += dx // 2 + y += dy // 2 + fontlist.event_generate('', x=x, y=y) + fontlist.event_generate('', x=x, y=y) + + font1 = fontlist.get(1) + select_font = fontlist.get('anchor') + self.assertEqual(select_font, font1) + self.assertIn(d.font_name.get(), font1.lower()) + + def test_sizelist(self): + # Click on number should select that number + d = self.page + d.sizelist.variable.set(40) + self.assertEqual(d.font_size.get(), '40') + + def test_bold_toggle(self): + # Click on checkbutton should invert it. + d = self.page + d.font_bold.set(False) + d.bold_toggle.invoke() + self.assertTrue(d.font_bold.get()) + d.bold_toggle.invoke() + self.assertFalse(d.font_bold.get()) + + def test_font_set(self): + # Test that setting a font Variable results in 3 provisional + # change entries and a call to set_samples. Use values sure to + # not be defaults. + + default_font = idleConf.GetFont(root, 'main', 'EditorWindow') + default_size = str(default_font[1]) + default_bold = default_font[2] == 'bold' + d = self.page + d.font_size.set(default_size) + d.font_bold.set(default_bold) + d.set_samples.called = 0 + + d.font_name.set('Test Font') + expected = {'EditorWindow': {'font': 'Test Font', + 'font-size': default_size, + 'font-bold': str(default_bold)}} + self.assertEqual(mainpage, expected) + self.assertEqual(d.set_samples.called, 1) + changes.clear() + + d.font_size.set('20') + expected = {'EditorWindow': {'font': 'Test Font', + 'font-size': '20', + 'font-bold': str(default_bold)}} + self.assertEqual(mainpage, expected) + self.assertEqual(d.set_samples.called, 2) + changes.clear() + + d.font_bold.set(not default_bold) + expected = {'EditorWindow': {'font': 'Test Font', + 'font-size': '20', + 'font-bold': str(not default_bold)}} + self.assertEqual(mainpage, expected) + self.assertEqual(d.set_samples.called, 3) + + def test_set_samples(self): + d = self.page + del d.set_samples # Unmask method for test + orig_samples = d.font_sample, d.highlight_sample + d.font_sample, d.highlight_sample = {}, {} + d.font_name.set('test') + d.font_size.set('5') + d.font_bold.set(1) + expected = {'font': ('test', '5', 'bold')} + + # Test set_samples. + d.set_samples() + self.assertTrue(d.font_sample == d.highlight_sample == expected) + + d.font_sample, d.highlight_sample = orig_samples + d.set_samples = Func() # Re-mask for other tests. + + +class HighPageTest(unittest.TestCase): + """Test that highlight tab widgets enable users to make changes. + + Test that widget actions set vars, that var changes add + options to changes and that themes work correctly. + """ + + @classmethod + def setUpClass(cls): + page = cls.page = dialog.highpage + dialog.note.select(page) + page.set_theme_type = Func() + page.paint_theme_sample = Func() + page.set_highlight_target = Func() + page.set_color_sample = Func() + page.update() + + @classmethod + def tearDownClass(cls): + d = cls.page + del d.set_theme_type, d.paint_theme_sample + del d.set_highlight_target, d.set_color_sample + + def setUp(self): + d = self.page + # The following is needed for test_load_key_cfg, _delete_custom_keys. + # This may indicate a defect in some test or function. + for section in idleConf.GetSectionList('user', 'highlight'): + idleConf.userCfg['highlight'].remove_section(section) + changes.clear() + d.set_theme_type.called = 0 + d.paint_theme_sample.called = 0 + d.set_highlight_target.called = 0 + d.set_color_sample.called = 0 + + def test_load_theme_cfg(self): + tracers.detach() + d = self.page + eq = self.assertEqual + + # Use builtin theme with no user themes created. + idleConf.CurrentTheme = mock.Mock(return_value='IDLE Classic') + d.load_theme_cfg() + self.assertTrue(d.theme_source.get()) + # builtinlist sets variable builtin_name to the CurrentTheme default. + eq(d.builtin_name.get(), 'IDLE Classic') + eq(d.custom_name.get(), '- no custom themes -') + eq(d.custom_theme_on.state(), ('disabled',)) + eq(d.set_theme_type.called, 1) + eq(d.paint_theme_sample.called, 1) + eq(d.set_highlight_target.called, 1) + + # Builtin theme with non-empty user theme list. + idleConf.SetOption('highlight', 'test1', 'option', 'value') + idleConf.SetOption('highlight', 'test2', 'option2', 'value2') + d.load_theme_cfg() + eq(d.builtin_name.get(), 'IDLE Classic') + eq(d.custom_name.get(), 'test1') + eq(d.set_theme_type.called, 2) + eq(d.paint_theme_sample.called, 2) + eq(d.set_highlight_target.called, 2) + + # Use custom theme. + idleConf.CurrentTheme = mock.Mock(return_value='test2') + idleConf.SetOption('main', 'Theme', 'default', '0') + d.load_theme_cfg() + self.assertFalse(d.theme_source.get()) + eq(d.builtin_name.get(), 'IDLE Classic') + eq(d.custom_name.get(), 'test2') + eq(d.set_theme_type.called, 3) + eq(d.paint_theme_sample.called, 3) + eq(d.set_highlight_target.called, 3) + + del idleConf.CurrentTheme + tracers.attach() + + def test_theme_source(self): + eq = self.assertEqual + d = self.page + # Test these separately. + d.var_changed_builtin_name = Func() + d.var_changed_custom_name = Func() + # Builtin selected. + d.builtin_theme_on.invoke() + eq(mainpage, {'Theme': {'default': 'True'}}) + eq(d.var_changed_builtin_name.called, 1) + eq(d.var_changed_custom_name.called, 0) + changes.clear() + + # Custom selected. + d.custom_theme_on.state(('!disabled',)) + d.custom_theme_on.invoke() + self.assertEqual(mainpage, {'Theme': {'default': 'False'}}) + eq(d.var_changed_builtin_name.called, 1) + eq(d.var_changed_custom_name.called, 1) + del d.var_changed_builtin_name, d.var_changed_custom_name + + def test_builtin_name(self): + eq = self.assertEqual + d = self.page + item_list = ['IDLE Classic', 'IDLE Dark', 'IDLE New'] + + # Not in old_themes, defaults name to first item. + idleConf.SetOption('main', 'Theme', 'name', 'spam') + d.builtinlist.SetMenu(item_list, 'IDLE Dark') + eq(mainpage, {'Theme': {'name': 'IDLE Classic', + 'name2': 'IDLE Dark'}}) + eq(d.theme_message['text'], 'New theme, see Help') + eq(d.paint_theme_sample.called, 1) + + # Not in old themes - uses name2. + changes.clear() + idleConf.SetOption('main', 'Theme', 'name', 'IDLE New') + d.builtinlist.SetMenu(item_list, 'IDLE Dark') + eq(mainpage, {'Theme': {'name2': 'IDLE Dark'}}) + eq(d.theme_message['text'], 'New theme, see Help') + eq(d.paint_theme_sample.called, 2) + + # Builtin name in old_themes. + changes.clear() + d.builtinlist.SetMenu(item_list, 'IDLE Classic') + eq(mainpage, {'Theme': {'name': 'IDLE Classic', 'name2': ''}}) + eq(d.theme_message['text'], '') + eq(d.paint_theme_sample.called, 3) + + def test_custom_name(self): + d = self.page + + # If no selections, doesn't get added. + d.customlist.SetMenu([], '- no custom themes -') + self.assertNotIn('Theme', mainpage) + self.assertEqual(d.paint_theme_sample.called, 0) + + # Custom name selected. + changes.clear() + d.customlist.SetMenu(['a', 'b', 'c'], 'c') + self.assertEqual(mainpage, {'Theme': {'name': 'c'}}) + self.assertEqual(d.paint_theme_sample.called, 1) + + def test_color(self): + d = self.page + d.on_new_color_set = Func() + # self.color is only set in get_color through colorchooser. + d.color.set('green') + self.assertEqual(d.on_new_color_set.called, 1) + del d.on_new_color_set + + def test_highlight_target_list_mouse(self): + # Set highlight_target through targetlist. + eq = self.assertEqual + d = self.page + + d.targetlist.SetMenu(['a', 'b', 'c'], 'c') + eq(d.highlight_target.get(), 'c') + eq(d.set_highlight_target.called, 1) + + def test_highlight_target_text_mouse(self): + # Set highlight_target through clicking highlight_sample. + eq = self.assertEqual + d = self.page + hs = d.highlight_sample + hs.focus_force() + + def click_char(index): + "Simulate click on character at *index*." + hs.see(index) + hs.update_idletasks() + x, y, dx, dy = hs.bbox(index) + x += dx // 2 + y += dy // 2 + hs.event_generate('', x=0, y=0) + hs.event_generate('', x=x, y=y) + hs.event_generate('', x=x, y=y) + hs.event_generate('', x=x, y=y) + + # Reverse theme_elements to make the tag the key. + elem = {tag: element for element, tag in d.theme_elements.items()} + + # If highlight_sample has a tag that isn't in theme_elements, there + # will be a KeyError in the test run. + count = 0 + for tag in hs.tag_names(): + try: + click_char(hs.tag_nextrange(tag, "1.0")[0]) + eq(d.highlight_target.get(), elem[tag]) + count += 1 + eq(d.set_highlight_target.called, count) + except IndexError: + pass # Skip unused theme_elements tag, like 'sel'. + + def test_highlight_sample_double_click(self): + # Test double click on highlight_sample. + eq = self.assertEqual + d = self.page + + hs = d.highlight_sample + hs.focus_force() + hs.see(1.0) + hs.update_idletasks() + + # Test binding from configdialog. + hs.event_generate('', x=0, y=0) + hs.event_generate('', x=0, y=0) + # Double click is a sequence of two clicks in a row. + for _ in range(2): + hs.event_generate('', x=0, y=0) + hs.event_generate('', x=0, y=0) + + eq(hs.tag_ranges('sel'), ()) + + def test_highlight_sample_b1_motion(self): + # Test button motion on highlight_sample. + eq = self.assertEqual + d = self.page + + hs = d.highlight_sample + hs.focus_force() + hs.see(1.0) + hs.update_idletasks() + + x, y, dx, dy, offset = hs.dlineinfo('1.0') + + # Test binding from configdialog. + hs.event_generate('') + hs.event_generate('') + hs.event_generate('', x=x, y=y) + hs.event_generate('', x=x, y=y) + hs.event_generate('', x=dx, y=dy) + hs.event_generate('', x=dx, y=dy) + + eq(hs.tag_ranges('sel'), ()) + + def test_set_theme_type(self): + eq = self.assertEqual + d = self.page + del d.set_theme_type + + # Builtin theme selected. + d.theme_source.set(True) + d.set_theme_type() + eq(d.builtinlist['state'], NORMAL) + eq(d.customlist['state'], DISABLED) + eq(d.button_delete_custom.state(), ('disabled',)) + + # Custom theme selected. + d.theme_source.set(False) + d.set_theme_type() + eq(d.builtinlist['state'], DISABLED) + eq(d.custom_theme_on.state(), ('selected',)) + eq(d.customlist['state'], NORMAL) + eq(d.button_delete_custom.state(), ()) + d.set_theme_type = Func() + + def test_get_color(self): + eq = self.assertEqual + d = self.page + orig_chooser = configdialog.colorchooser.askcolor + chooser = configdialog.colorchooser.askcolor = Func() + gntn = d.get_new_theme_name = Func() + + d.highlight_target.set('Editor Breakpoint') + d.color.set('#ffffff') + + # Nothing selected. + chooser.result = (None, None) + d.button_set_color.invoke() + eq(d.color.get(), '#ffffff') + + # Selection same as previous color. + chooser.result = ('', d.style.lookup(d.frame_color_set['style'], 'background')) + d.button_set_color.invoke() + eq(d.color.get(), '#ffffff') + + # Select different color. + chooser.result = ((222.8671875, 0.0, 0.0), '#de0000') + + # Default theme. + d.color.set('#ffffff') + d.theme_source.set(True) + + # No theme name selected therefore color not saved. + gntn.result = '' + d.button_set_color.invoke() + eq(gntn.called, 1) + eq(d.color.get(), '#ffffff') + # Theme name selected. + gntn.result = 'My New Theme' + d.button_set_color.invoke() + eq(d.custom_name.get(), gntn.result) + eq(d.color.get(), '#de0000') + + # Custom theme. + d.color.set('#ffffff') + d.theme_source.set(False) + d.button_set_color.invoke() + eq(d.color.get(), '#de0000') + + del d.get_new_theme_name + configdialog.colorchooser.askcolor = orig_chooser + + def test_on_new_color_set(self): + d = self.page + color = '#3f7cae' + d.custom_name.set('Python') + d.highlight_target.set('Selected Text') + d.fg_bg_toggle.set(True) + + d.color.set(color) + self.assertEqual(d.style.lookup(d.frame_color_set['style'], 'background'), color) + self.assertEqual(d.highlight_sample.tag_cget('hilite', 'foreground'), color) + self.assertEqual(highpage, + {'Python': {'hilite-foreground': color}}) + + def test_get_new_theme_name(self): + orig_sectionname = configdialog.SectionName + sn = configdialog.SectionName = Func(return_self=True) + d = self.page + + sn.result = 'New Theme' + self.assertEqual(d.get_new_theme_name(''), 'New Theme') + + configdialog.SectionName = orig_sectionname + + def test_save_as_new_theme(self): + d = self.page + gntn = d.get_new_theme_name = Func() + d.theme_source.set(True) + + # No name entered. + gntn.result = '' + d.button_save_custom.invoke() + self.assertNotIn(gntn.result, idleConf.userCfg['highlight']) + + # Name entered. + gntn.result = 'my new theme' + gntn.called = 0 + self.assertNotIn(gntn.result, idleConf.userCfg['highlight']) + d.button_save_custom.invoke() + self.assertIn(gntn.result, idleConf.userCfg['highlight']) + + del d.get_new_theme_name + + def test_create_new_and_save_new(self): + eq = self.assertEqual + d = self.page + + # Use default as previously active theme. + d.theme_source.set(True) + d.builtin_name.set('IDLE Classic') + first_new = 'my new custom theme' + second_new = 'my second custom theme' + + # No changes, so themes are an exact copy. + self.assertNotIn(first_new, idleConf.userCfg) + d.create_new(first_new) + eq(idleConf.GetSectionList('user', 'highlight'), [first_new]) + eq(idleConf.GetThemeDict('default', 'IDLE Classic'), + idleConf.GetThemeDict('user', first_new)) + eq(d.custom_name.get(), first_new) + self.assertFalse(d.theme_source.get()) # Use custom set. + eq(d.set_theme_type.called, 1) + + # Test that changed targets are in new theme. + changes.add_option('highlight', first_new, 'hit-background', 'yellow') + self.assertNotIn(second_new, idleConf.userCfg) + d.create_new(second_new) + eq(idleConf.GetSectionList('user', 'highlight'), [first_new, second_new]) + self.assertNotEqual(idleConf.GetThemeDict('user', first_new), + idleConf.GetThemeDict('user', second_new)) + # Check that difference in themes was in `hit-background` from `changes`. + idleConf.SetOption('highlight', first_new, 'hit-background', 'yellow') + eq(idleConf.GetThemeDict('user', first_new), + idleConf.GetThemeDict('user', second_new)) + + def test_set_highlight_target(self): + eq = self.assertEqual + d = self.page + del d.set_highlight_target + + # Target is cursor. + d.highlight_target.set('Cursor') + eq(d.fg_on.state(), ('disabled', 'selected')) + eq(d.bg_on.state(), ('disabled',)) + self.assertTrue(d.fg_bg_toggle) + eq(d.set_color_sample.called, 1) + + # Target is not cursor. + d.highlight_target.set('Comment') + eq(d.fg_on.state(), ('selected',)) + eq(d.bg_on.state(), ()) + self.assertTrue(d.fg_bg_toggle) + eq(d.set_color_sample.called, 2) + + d.set_highlight_target = Func() + + def test_set_color_sample_binding(self): + d = self.page + scs = d.set_color_sample + + d.fg_on.invoke() + self.assertEqual(scs.called, 1) + + d.bg_on.invoke() + self.assertEqual(scs.called, 2) + + def test_set_color_sample(self): + d = self.page + del d.set_color_sample + d.highlight_target.set('Selected Text') + d.fg_bg_toggle.set(True) + d.set_color_sample() + self.assertEqual( + d.style.lookup(d.frame_color_set['style'], 'background'), + d.highlight_sample.tag_cget('hilite', 'foreground')) + d.set_color_sample = Func() + + def test_paint_theme_sample(self): + eq = self.assertEqual + page = self.page + del page.paint_theme_sample # Delete masking mock. + hs_tag = page.highlight_sample.tag_cget + gh = idleConf.GetHighlight + + # Create custom theme based on IDLE Dark. + page.theme_source.set(True) + page.builtin_name.set('IDLE Dark') + theme = 'IDLE Test' + page.create_new(theme) + page.set_color_sample.called = 0 + + # Base theme with nothing in `changes`. + page.paint_theme_sample() + new_console = {'foreground': 'blue', + 'background': 'yellow',} + for key, value in new_console.items(): + self.assertNotEqual(hs_tag('console', key), value) + eq(page.set_color_sample.called, 1) + + # Apply changes. + for key, value in new_console.items(): + changes.add_option('highlight', theme, 'console-'+key, value) + page.paint_theme_sample() + for key, value in new_console.items(): + eq(hs_tag('console', key), value) + eq(page.set_color_sample.called, 2) + + page.paint_theme_sample = Func() + + def test_delete_custom(self): + eq = self.assertEqual + d = self.page + d.button_delete_custom.state(('!disabled',)) + yesno = d.askyesno = Func() + dialog.deactivate_current_config = Func() + dialog.activate_config_changes = Func() + + theme_name = 'spam theme' + idleConf.userCfg['highlight'].SetOption(theme_name, 'name', 'value') + highpage[theme_name] = {'option': 'True'} + + theme_name2 = 'other theme' + idleConf.userCfg['highlight'].SetOption(theme_name2, 'name', 'value') + highpage[theme_name2] = {'option': 'False'} + + # Force custom theme. + d.custom_theme_on.state(('!disabled',)) + d.custom_theme_on.invoke() + d.custom_name.set(theme_name) + + # Cancel deletion. + yesno.result = False + d.button_delete_custom.invoke() + eq(yesno.called, 1) + eq(highpage[theme_name], {'option': 'True'}) + eq(idleConf.GetSectionList('user', 'highlight'), [theme_name, theme_name2]) + eq(dialog.deactivate_current_config.called, 0) + eq(dialog.activate_config_changes.called, 0) + eq(d.set_theme_type.called, 0) + + # Confirm deletion. + yesno.result = True + d.button_delete_custom.invoke() + eq(yesno.called, 2) + self.assertNotIn(theme_name, highpage) + eq(idleConf.GetSectionList('user', 'highlight'), [theme_name2]) + eq(d.custom_theme_on.state(), ()) + eq(d.custom_name.get(), theme_name2) + eq(dialog.deactivate_current_config.called, 1) + eq(dialog.activate_config_changes.called, 1) + eq(d.set_theme_type.called, 1) + + # Confirm deletion of second theme - empties list. + d.custom_name.set(theme_name2) + yesno.result = True + d.button_delete_custom.invoke() + eq(yesno.called, 3) + self.assertNotIn(theme_name, highpage) + eq(idleConf.GetSectionList('user', 'highlight'), []) + eq(d.custom_theme_on.state(), ('disabled',)) + eq(d.custom_name.get(), '- no custom themes -') + eq(dialog.deactivate_current_config.called, 2) + eq(dialog.activate_config_changes.called, 2) + eq(d.set_theme_type.called, 2) + + del dialog.activate_config_changes, dialog.deactivate_current_config + del d.askyesno + + +class KeysPageTest(unittest.TestCase): + """Test that keys tab widgets enable users to make changes. + + Test that widget actions set vars, that var changes add + options to changes and that key sets works correctly. + """ + + @classmethod + def setUpClass(cls): + page = cls.page = dialog.keyspage + dialog.note.select(page) + page.set_keys_type = Func() + page.load_keys_list = Func() + + @classmethod + def tearDownClass(cls): + page = cls.page + del page.set_keys_type, page.load_keys_list + + def setUp(self): + d = self.page + # The following is needed for test_load_key_cfg, _delete_custom_keys. + # This may indicate a defect in some test or function. + for section in idleConf.GetSectionList('user', 'keys'): + idleConf.userCfg['keys'].remove_section(section) + changes.clear() + d.set_keys_type.called = 0 + d.load_keys_list.called = 0 + + def test_load_key_cfg(self): + tracers.detach() + d = self.page + eq = self.assertEqual + + # Use builtin keyset with no user keysets created. + idleConf.CurrentKeys = mock.Mock(return_value='IDLE Classic OSX') + d.load_key_cfg() + self.assertTrue(d.keyset_source.get()) + # builtinlist sets variable builtin_name to the CurrentKeys default. + eq(d.builtin_name.get(), 'IDLE Classic OSX') + eq(d.custom_name.get(), '- no custom keys -') + eq(d.custom_keyset_on.state(), ('disabled',)) + eq(d.set_keys_type.called, 1) + eq(d.load_keys_list.called, 1) + eq(d.load_keys_list.args, ('IDLE Classic OSX', )) + + # Builtin keyset with non-empty user keyset list. + idleConf.SetOption('keys', 'test1', 'option', 'value') + idleConf.SetOption('keys', 'test2', 'option2', 'value2') + d.load_key_cfg() + eq(d.builtin_name.get(), 'IDLE Classic OSX') + eq(d.custom_name.get(), 'test1') + eq(d.set_keys_type.called, 2) + eq(d.load_keys_list.called, 2) + eq(d.load_keys_list.args, ('IDLE Classic OSX', )) + + # Use custom keyset. + idleConf.CurrentKeys = mock.Mock(return_value='test2') + idleConf.default_keys = mock.Mock(return_value='IDLE Modern Unix') + idleConf.SetOption('main', 'Keys', 'default', '0') + d.load_key_cfg() + self.assertFalse(d.keyset_source.get()) + eq(d.builtin_name.get(), 'IDLE Modern Unix') + eq(d.custom_name.get(), 'test2') + eq(d.set_keys_type.called, 3) + eq(d.load_keys_list.called, 3) + eq(d.load_keys_list.args, ('test2', )) + + del idleConf.CurrentKeys, idleConf.default_keys + tracers.attach() + + def test_keyset_source(self): + eq = self.assertEqual + d = self.page + # Test these separately. + d.var_changed_builtin_name = Func() + d.var_changed_custom_name = Func() + # Builtin selected. + d.builtin_keyset_on.invoke() + eq(mainpage, {'Keys': {'default': 'True'}}) + eq(d.var_changed_builtin_name.called, 1) + eq(d.var_changed_custom_name.called, 0) + changes.clear() + + # Custom selected. + d.custom_keyset_on.state(('!disabled',)) + d.custom_keyset_on.invoke() + self.assertEqual(mainpage, {'Keys': {'default': 'False'}}) + eq(d.var_changed_builtin_name.called, 1) + eq(d.var_changed_custom_name.called, 1) + del d.var_changed_builtin_name, d.var_changed_custom_name + + def test_builtin_name(self): + eq = self.assertEqual + d = self.page + idleConf.userCfg['main'].remove_section('Keys') + item_list = ['IDLE Classic Windows', 'IDLE Classic OSX', + 'IDLE Modern UNIX'] + + # Not in old_keys, defaults name to first item. + d.builtinlist.SetMenu(item_list, 'IDLE Modern UNIX') + eq(mainpage, {'Keys': {'name': 'IDLE Classic Windows', + 'name2': 'IDLE Modern UNIX'}}) + eq(d.keys_message['text'], 'New key set, see Help') + eq(d.load_keys_list.called, 1) + eq(d.load_keys_list.args, ('IDLE Modern UNIX', )) + + # Not in old keys - uses name2. + changes.clear() + idleConf.SetOption('main', 'Keys', 'name', 'IDLE Classic Unix') + d.builtinlist.SetMenu(item_list, 'IDLE Modern UNIX') + eq(mainpage, {'Keys': {'name2': 'IDLE Modern UNIX'}}) + eq(d.keys_message['text'], 'New key set, see Help') + eq(d.load_keys_list.called, 2) + eq(d.load_keys_list.args, ('IDLE Modern UNIX', )) + + # Builtin name in old_keys. + changes.clear() + d.builtinlist.SetMenu(item_list, 'IDLE Classic OSX') + eq(mainpage, {'Keys': {'name': 'IDLE Classic OSX', 'name2': ''}}) + eq(d.keys_message['text'], '') + eq(d.load_keys_list.called, 3) + eq(d.load_keys_list.args, ('IDLE Classic OSX', )) + + def test_custom_name(self): + d = self.page + + # If no selections, doesn't get added. + d.customlist.SetMenu([], '- no custom keys -') + self.assertNotIn('Keys', mainpage) + self.assertEqual(d.load_keys_list.called, 0) + + # Custom name selected. + changes.clear() + d.customlist.SetMenu(['a', 'b', 'c'], 'c') + self.assertEqual(mainpage, {'Keys': {'name': 'c'}}) + self.assertEqual(d.load_keys_list.called, 1) + + def test_keybinding(self): + idleConf.SetOption('extensions', 'ZzDummy', 'enable', 'True') + d = self.page + d.custom_name.set('my custom keys') + d.bindingslist.delete(0, 'end') + d.bindingslist.insert(0, 'copy') + d.bindingslist.insert(1, 'z-in') + d.bindingslist.selection_set(0) + d.bindingslist.selection_anchor(0) + # Core binding - adds to keys. + d.keybinding.set('') + self.assertEqual(keyspage, + {'my custom keys': {'copy': ''}}) + + # Not a core binding - adds to extensions. + d.bindingslist.selection_set(1) + d.bindingslist.selection_anchor(1) + d.keybinding.set('') + self.assertEqual(extpage, + {'ZzDummy_cfgBindings': {'z-in': ''}}) + + def test_set_keys_type(self): + eq = self.assertEqual + d = self.page + del d.set_keys_type + + # Builtin keyset selected. + d.keyset_source.set(True) + d.set_keys_type() + eq(d.builtinlist['state'], NORMAL) + eq(d.customlist['state'], DISABLED) + eq(d.button_delete_custom_keys.state(), ('disabled',)) + + # Custom keyset selected. + d.keyset_source.set(False) + d.set_keys_type() + eq(d.builtinlist['state'], DISABLED) + eq(d.custom_keyset_on.state(), ('selected',)) + eq(d.customlist['state'], NORMAL) + eq(d.button_delete_custom_keys.state(), ()) + d.set_keys_type = Func() + + def test_get_new_keys(self): + eq = self.assertEqual + d = self.page + orig_getkeysdialog = configdialog.GetKeysWindow + gkd = configdialog.GetKeysWindow = Func(return_self=True) + gnkn = d.get_new_keys_name = Func() + + d.button_new_keys.state(('!disabled',)) + d.bindingslist.delete(0, 'end') + d.bindingslist.insert(0, 'copy - ') + d.bindingslist.selection_set(0) + d.bindingslist.selection_anchor(0) + d.keybinding.set('Key-a') + d.keyset_source.set(True) # Default keyset. + + # Default keyset; no change to binding. + gkd.result = '' + d.button_new_keys.invoke() + eq(d.bindingslist.get('anchor'), 'copy - ') + # Keybinding isn't changed when there isn't a change entered. + eq(d.keybinding.get(), 'Key-a') + + # Default keyset; binding changed. + gkd.result = '' + # No keyset name selected therefore binding not saved. + gnkn.result = '' + d.button_new_keys.invoke() + eq(gnkn.called, 1) + eq(d.bindingslist.get('anchor'), 'copy - ') + # Keyset name selected. + gnkn.result = 'My New Key Set' + d.button_new_keys.invoke() + eq(d.custom_name.get(), gnkn.result) + eq(d.bindingslist.get('anchor'), 'copy - ') + eq(d.keybinding.get(), '') + + # User keyset; binding changed. + d.keyset_source.set(False) # Custom keyset. + gnkn.called = 0 + gkd.result = '' + d.button_new_keys.invoke() + eq(gnkn.called, 0) + eq(d.bindingslist.get('anchor'), 'copy - ') + eq(d.keybinding.get(), '') + + del d.get_new_keys_name + configdialog.GetKeysWindow = orig_getkeysdialog + + def test_get_new_keys_name(self): + orig_sectionname = configdialog.SectionName + sn = configdialog.SectionName = Func(return_self=True) + d = self.page + + sn.result = 'New Keys' + self.assertEqual(d.get_new_keys_name(''), 'New Keys') + + configdialog.SectionName = orig_sectionname + + def test_save_as_new_key_set(self): + d = self.page + gnkn = d.get_new_keys_name = Func() + d.keyset_source.set(True) + + # No name entered. + gnkn.result = '' + d.button_save_custom_keys.invoke() + + # Name entered. + gnkn.result = 'my new key set' + gnkn.called = 0 + self.assertNotIn(gnkn.result, idleConf.userCfg['keys']) + d.button_save_custom_keys.invoke() + self.assertIn(gnkn.result, idleConf.userCfg['keys']) + + del d.get_new_keys_name + + def test_on_bindingslist_select(self): + d = self.page + b = d.bindingslist + b.delete(0, 'end') + b.insert(0, 'copy') + b.insert(1, 'find') + b.activate(0) + + b.focus_force() + b.see(1) + b.update() + x, y, dx, dy = b.bbox(1) + x += dx // 2 + y += dy // 2 + b.event_generate('', x=0, y=0) + b.event_generate('', x=x, y=y) + b.event_generate('', x=x, y=y) + b.event_generate('', x=x, y=y) + self.assertEqual(b.get('anchor'), 'find') + self.assertEqual(d.button_new_keys.state(), ()) + + def test_create_new_key_set_and_save_new_key_set(self): + eq = self.assertEqual + d = self.page + + # Use default as previously active keyset. + d.keyset_source.set(True) + d.builtin_name.set('IDLE Classic Windows') + first_new = 'my new custom key set' + second_new = 'my second custom keyset' + + # No changes, so keysets are an exact copy. + self.assertNotIn(first_new, idleConf.userCfg) + d.create_new_key_set(first_new) + eq(idleConf.GetSectionList('user', 'keys'), [first_new]) + eq(idleConf.GetKeySet('IDLE Classic Windows'), + idleConf.GetKeySet(first_new)) + eq(d.custom_name.get(), first_new) + self.assertFalse(d.keyset_source.get()) # Use custom set. + eq(d.set_keys_type.called, 1) + + # Test that changed keybindings are in new keyset. + changes.add_option('keys', first_new, 'copy', '') + self.assertNotIn(second_new, idleConf.userCfg) + d.create_new_key_set(second_new) + eq(idleConf.GetSectionList('user', 'keys'), [first_new, second_new]) + self.assertNotEqual(idleConf.GetKeySet(first_new), + idleConf.GetKeySet(second_new)) + # Check that difference in keysets was in option `copy` from `changes`. + idleConf.SetOption('keys', first_new, 'copy', '') + eq(idleConf.GetKeySet(first_new), idleConf.GetKeySet(second_new)) + + def test_load_keys_list(self): + eq = self.assertEqual + d = self.page + gks = idleConf.GetKeySet = Func() + del d.load_keys_list + b = d.bindingslist + + b.delete(0, 'end') + b.insert(0, '<>') + b.insert(1, '<>') + gks.result = {'<>': ['', ''], + '<>': [''], + '<>': ['']} + changes.add_option('keys', 'my keys', 'spam', '') + expected = ('copy - ', + 'force-open-completions - ', + 'spam - ') + + # No current selection. + d.load_keys_list('my keys') + eq(b.get(0, 'end'), expected) + eq(b.get('anchor'), '') + eq(b.curselection(), ()) + + # Check selection. + b.selection_set(1) + b.selection_anchor(1) + d.load_keys_list('my keys') + eq(b.get(0, 'end'), expected) + eq(b.get('anchor'), 'force-open-completions - ') + eq(b.curselection(), (1, )) + + # Change selection. + b.selection_set(2) + b.selection_anchor(2) + d.load_keys_list('my keys') + eq(b.get(0, 'end'), expected) + eq(b.get('anchor'), 'spam - ') + eq(b.curselection(), (2, )) + d.load_keys_list = Func() + + del idleConf.GetKeySet + + def test_delete_custom_keys(self): + eq = self.assertEqual + d = self.page + d.button_delete_custom_keys.state(('!disabled',)) + yesno = d.askyesno = Func() + dialog.deactivate_current_config = Func() + dialog.activate_config_changes = Func() + + keyset_name = 'spam key set' + idleConf.userCfg['keys'].SetOption(keyset_name, 'name', 'value') + keyspage[keyset_name] = {'option': 'True'} + + keyset_name2 = 'other key set' + idleConf.userCfg['keys'].SetOption(keyset_name2, 'name', 'value') + keyspage[keyset_name2] = {'option': 'False'} + + # Force custom keyset. + d.custom_keyset_on.state(('!disabled',)) + d.custom_keyset_on.invoke() + d.custom_name.set(keyset_name) + + # Cancel deletion. + yesno.result = False + d.button_delete_custom_keys.invoke() + eq(yesno.called, 1) + eq(keyspage[keyset_name], {'option': 'True'}) + eq(idleConf.GetSectionList('user', 'keys'), [keyset_name, keyset_name2]) + eq(dialog.deactivate_current_config.called, 0) + eq(dialog.activate_config_changes.called, 0) + eq(d.set_keys_type.called, 0) + + # Confirm deletion. + yesno.result = True + d.button_delete_custom_keys.invoke() + eq(yesno.called, 2) + self.assertNotIn(keyset_name, keyspage) + eq(idleConf.GetSectionList('user', 'keys'), [keyset_name2]) + eq(d.custom_keyset_on.state(), ()) + eq(d.custom_name.get(), keyset_name2) + eq(dialog.deactivate_current_config.called, 1) + eq(dialog.activate_config_changes.called, 1) + eq(d.set_keys_type.called, 1) + + # Confirm deletion of second keyset - empties list. + d.custom_name.set(keyset_name2) + yesno.result = True + d.button_delete_custom_keys.invoke() + eq(yesno.called, 3) + self.assertNotIn(keyset_name, keyspage) + eq(idleConf.GetSectionList('user', 'keys'), []) + eq(d.custom_keyset_on.state(), ('disabled',)) + eq(d.custom_name.get(), '- no custom keys -') + eq(dialog.deactivate_current_config.called, 2) + eq(dialog.activate_config_changes.called, 2) + eq(d.set_keys_type.called, 2) + + del dialog.activate_config_changes, dialog.deactivate_current_config + del d.askyesno + + +class WinPageTest(unittest.TestCase): + """Test that general tab widgets enable users to make changes. + + Test that widget actions set vars, that var changes add + options to changes. + """ + @classmethod + def setUpClass(cls): + page = cls.page = dialog.winpage + dialog.note.select(page) + page.update() + + def setUp(self): + changes.clear() + + def test_load_windows_cfg(self): + # Set to wrong values, load, check right values. + eq = self.assertEqual + d = self.page + d.startup_edit.set(1) + d.win_width.set(1) + d.win_height.set(1) + d.load_windows_cfg() + eq(d.startup_edit.get(), 0) + eq(d.win_width.get(), '80') + eq(d.win_height.get(), '40') + + def test_startup(self): + d = self.page + d.startup_editor_on.invoke() + self.assertEqual(mainpage, + {'General': {'editor-on-startup': '1'}}) + changes.clear() + d.startup_shell_on.invoke() + self.assertEqual(mainpage, + {'General': {'editor-on-startup': '0'}}) + + def test_editor_size(self): + d = self.page + d.win_height_int.delete(0, 'end') + d.win_height_int.insert(0, '11') + self.assertEqual(mainpage, {'EditorWindow': {'height': '11'}}) + changes.clear() + d.win_width_int.delete(0, 'end') + d.win_width_int.insert(0, '11') + self.assertEqual(mainpage, {'EditorWindow': {'width': '11'}}) + + def test_indent_spaces(self): + d = self.page + d.indent_chooser.set(6) + self.assertEqual(d.indent_spaces.get(), '6') + self.assertEqual(mainpage, {'Indent': {'num-spaces': '6'}}) + + def test_cursor_blink(self): + self.page.cursor_blink_bool.invoke() + self.assertEqual(mainpage, {'EditorWindow': {'cursor-blink': 'False'}}) + + def test_autocomplete_wait(self): + self.page.auto_wait_int.delete(0, 'end') + self.page.auto_wait_int.insert(0, '11') + self.assertEqual(extpage, {'AutoComplete': {'popupwait': '11'}}) + + def test_parenmatch(self): + d = self.page + eq = self.assertEqual + d.paren_style_type['menu'].invoke(0) + eq(extpage, {'ParenMatch': {'style': 'opener'}}) + changes.clear() + d.paren_flash_time.delete(0, 'end') + d.paren_flash_time.insert(0, '11') + eq(extpage, {'ParenMatch': {'flash-delay': '11'}}) + changes.clear() + d.bell_on.invoke() + eq(extpage, {'ParenMatch': {'bell': 'False'}}) + + def test_paragraph(self): + self.page.format_width_int.delete(0, 'end') + self.page.format_width_int.insert(0, '11') + self.assertEqual(extpage, {'FormatParagraph': {'max-width': '11'}}) + + +class ShedPageTest(unittest.TestCase): + """Test that shed tab widgets enable users to make changes. + + Test that widget actions set vars, that var changes add + options to changes. + """ + @classmethod + def setUpClass(cls): + page = cls.page = dialog.shedpage + dialog.note.select(page) + page.update() + + def setUp(self): + changes.clear() + + def test_load_shelled_cfg(self): + # Set to wrong values, load, check right values. + eq = self.assertEqual + d = self.page + d.autosave.set(1) + d.load_shelled_cfg() + eq(d.autosave.get(), 0) + + def test_autosave(self): + d = self.page + d.save_auto_on.invoke() + self.assertEqual(mainpage, {'General': {'autosave': '1'}}) + d.save_ask_on.invoke() + self.assertEqual(mainpage, {'General': {'autosave': '0'}}) + + def test_context(self): + self.page.context_int.delete(0, 'end') + self.page.context_int.insert(0, '1') + self.assertEqual(extpage, {'CodeContext': {'maxlines': '1'}}) + + +#unittest.skip("Nothing here yet TODO") +class ExtPageTest(unittest.TestCase): + """Test that the help source list works correctly.""" + @classmethod + def setUpClass(cls): + page = dialog.extpage + dialog.note.select(page) + + +class HelpSourceTest(unittest.TestCase): + """Test that the help source list works correctly.""" + @classmethod + def setUpClass(cls): + page = dialog.extpage + dialog.note.select(page) + frame = cls.frame = page.frame_help + frame.set = frame.set_add_delete_state = Func() + frame.upc = frame.update_help_changes = Func() + frame.update() + + @classmethod + def tearDownClass(cls): + frame = cls.frame + del frame.set, frame.set_add_delete_state + del frame.upc, frame.update_help_changes + frame.helplist.delete(0, 'end') + frame.user_helplist.clear() + + def setUp(self): + changes.clear() + + def test_load_helplist(self): + eq = self.assertEqual + fr = self.frame + fr.helplist.insert('end', 'bad') + fr.user_helplist = ['bad', 'worse'] + idleConf.SetOption('main', 'HelpFiles', '1', 'name;file') + fr.load_helplist() + eq(fr.helplist.get(0, 'end'), ('name',)) + eq(fr.user_helplist, [('name', 'file', '1')]) + + def test_source_selected(self): + fr = self.frame + fr.set = fr.set_add_delete_state + fr.upc = fr.update_help_changes + helplist = fr.helplist + dex = 'end' + helplist.insert(dex, 'source') + helplist.activate(dex) + + helplist.focus_force() + helplist.see(dex) + helplist.update() + x, y, dx, dy = helplist.bbox(dex) + x += dx // 2 + y += dy // 2 + fr.set.called = fr.upc.called = 0 + helplist.event_generate('', x=0, y=0) + helplist.event_generate('', x=x, y=y) + helplist.event_generate('', x=x, y=y) + helplist.event_generate('', x=x, y=y) + self.assertEqual(helplist.get('anchor'), 'source') + self.assertTrue(fr.set.called) + self.assertFalse(fr.upc.called) + + def test_set_add_delete_state(self): + # Call with 0 items, 1 unselected item, 1 selected item. + eq = self.assertEqual + fr = self.frame + del fr.set_add_delete_state # Unmask method. + sad = fr.set_add_delete_state + h = fr.helplist + + h.delete(0, 'end') + sad() + eq(fr.button_helplist_edit.state(), ('disabled',)) + eq(fr.button_helplist_remove.state(), ('disabled',)) + + h.insert(0, 'source') + sad() + eq(fr.button_helplist_edit.state(), ('disabled',)) + eq(fr.button_helplist_remove.state(), ('disabled',)) + + h.selection_set(0) + sad() + eq(fr.button_helplist_edit.state(), ()) + eq(fr.button_helplist_remove.state(), ()) + fr.set_add_delete_state = Func() # Mask method. + + def test_helplist_item_add(self): + # Call without and twice with HelpSource result. + # Double call enables check on order. + eq = self.assertEqual + orig_helpsource = configdialog.HelpSource + hs = configdialog.HelpSource = Func(return_self=True) + fr = self.frame + fr.helplist.delete(0, 'end') + fr.user_helplist.clear() + fr.set.called = fr.upc.called = 0 + + hs.result = '' + fr.helplist_item_add() + self.assertTrue(list(fr.helplist.get(0, 'end')) == + fr.user_helplist == []) + self.assertFalse(fr.upc.called) + + hs.result = ('name1', 'file1') + fr.helplist_item_add() + hs.result = ('name2', 'file2') + fr.helplist_item_add() + eq(fr.helplist.get(0, 'end'), ('name1', 'name2')) + eq(fr.user_helplist, [('name1', 'file1'), ('name2', 'file2')]) + eq(fr.upc.called, 2) + self.assertFalse(fr.set.called) + + configdialog.HelpSource = orig_helpsource + + def test_helplist_item_edit(self): + # Call without and with HelpSource change. + eq = self.assertEqual + orig_helpsource = configdialog.HelpSource + hs = configdialog.HelpSource = Func(return_self=True) + fr = self.frame + fr.helplist.delete(0, 'end') + fr.helplist.insert(0, 'name1') + fr.helplist.selection_set(0) + fr.helplist.selection_anchor(0) + fr.user_helplist.clear() + fr.user_helplist.append(('name1', 'file1')) + fr.set.called = fr.upc.called = 0 + + hs.result = '' + fr.helplist_item_edit() + hs.result = ('name1', 'file1') + fr.helplist_item_edit() + eq(fr.helplist.get(0, 'end'), ('name1',)) + eq(fr.user_helplist, [('name1', 'file1')]) + self.assertFalse(fr.upc.called) + + hs.result = ('name2', 'file2') + fr.helplist_item_edit() + eq(fr.helplist.get(0, 'end'), ('name2',)) + eq(fr.user_helplist, [('name2', 'file2')]) + self.assertTrue(fr.upc.called == fr.set.called == 1) + + configdialog.HelpSource = orig_helpsource + + def test_helplist_item_remove(self): + eq = self.assertEqual + fr = self.frame + fr.helplist.delete(0, 'end') + fr.helplist.insert(0, 'name1') + fr.helplist.selection_set(0) + fr.helplist.selection_anchor(0) + fr.user_helplist.clear() + fr.user_helplist.append(('name1', 'file1')) + fr.set.called = fr.upc.called = 0 + + fr.helplist_item_remove() + eq(fr.helplist.get(0, 'end'), ()) + eq(fr.user_helplist, []) + self.assertTrue(fr.upc.called == fr.set.called == 1) + + def test_update_help_changes(self): + fr = self.frame + del fr.update_help_changes + fr.user_helplist.clear() + fr.user_helplist.append(('name1', 'file1')) + fr.user_helplist.append(('name2', 'file2')) + + fr.update_help_changes() + self.assertEqual(mainpage['HelpFiles'], + {'1': 'name1;file1', '2': 'name2;file2'}) + fr.update_help_changes = Func() + + +class VarTraceTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + cls.tracers = configdialog.VarTrace() + cls.iv = IntVar(root) + cls.bv = BooleanVar(root) + + @classmethod + def tearDownClass(cls): + del cls.tracers, cls.iv, cls.bv + + def setUp(self): + self.tracers.clear() + self.called = 0 + + def var_changed_increment(self, *params): + self.called += 13 + + def var_changed_boolean(self, *params): + pass + + def test_init(self): + tr = self.tracers + tr.__init__() + self.assertEqual(tr.untraced, []) + self.assertEqual(tr.traced, []) + + def test_clear(self): + tr = self.tracers + tr.untraced.append(0) + tr.traced.append(1) + tr.clear() + self.assertEqual(tr.untraced, []) + self.assertEqual(tr.traced, []) + + def test_add(self): + tr = self.tracers + func = Func() + cb = tr.make_callback = mock.Mock(return_value=func) + + iv = tr.add(self.iv, self.var_changed_increment) + self.assertIs(iv, self.iv) + bv = tr.add(self.bv, self.var_changed_boolean) + self.assertIs(bv, self.bv) + + sv = StringVar(root) + sv2 = tr.add(sv, ('main', 'section', 'option')) + self.assertIs(sv2, sv) + cb.assert_called_once() + cb.assert_called_with(sv, ('main', 'section', 'option')) + + expected = [(iv, self.var_changed_increment), + (bv, self.var_changed_boolean), + (sv, func)] + self.assertEqual(tr.traced, []) + self.assertEqual(tr.untraced, expected) + + del tr.make_callback + + def test_make_callback(self): + cb = self.tracers.make_callback(self.iv, ('main', 'section', 'option')) + self.assertTrue(callable(cb)) + self.iv.set(42) + # Not attached, so set didn't invoke the callback. + self.assertNotIn('section', changes['main']) + # Invoke callback manually. + cb() + self.assertIn('section', changes['main']) + self.assertEqual(changes['main']['section']['option'], '42') + changes.clear() + + def test_attach_detach(self): + tr = self.tracers + iv = tr.add(self.iv, self.var_changed_increment) + bv = tr.add(self.bv, self.var_changed_boolean) + expected = [(iv, self.var_changed_increment), + (bv, self.var_changed_boolean)] + + # Attach callbacks and test call increment. + tr.attach() + self.assertEqual(tr.untraced, []) + self.assertCountEqual(tr.traced, expected) + iv.set(1) + self.assertEqual(iv.get(), 1) + self.assertEqual(self.called, 13) + + # Check that only one callback is attached to a variable. + # If more than one callback were attached, then var_changed_increment + # would be called twice and the counter would be 2. + self.called = 0 + tr.attach() + iv.set(1) + self.assertEqual(self.called, 13) + + # Detach callbacks. + self.called = 0 + tr.detach() + self.assertEqual(tr.traced, []) + self.assertCountEqual(tr.untraced, expected) + iv.set(1) + self.assertEqual(self.called, 0) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_debugger.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_debugger.py new file mode 100644 index 0000000000000000000000000000000000000000..d1c9638dd5d711e39b13522d1e2a74cac136a85a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_debugger.py @@ -0,0 +1,297 @@ +"""Test debugger, coverage 66% + +Try to make tests pass with draft bdbx, which may replace bdb in 3.13+. +""" + +from idlelib import debugger +from collections import namedtuple +from textwrap import dedent +from tkinter import Tk + +from test.support import requires +import unittest +from unittest import mock +from unittest.mock import Mock, patch + +"""A test python script for the debug tests.""" +TEST_CODE = dedent(""" + i = 1 + i += 2 + if i == 3: + print(i) + """) + + +class MockFrame: + "Minimal mock frame." + + def __init__(self, code, lineno): + self.f_code = code + self.f_lineno = lineno + + +class IdbTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + cls.gui = Mock() + cls.idb = debugger.Idb(cls.gui) + + # Create test and code objects to simulate a debug session. + code_obj = compile(TEST_CODE, 'idlelib/file.py', mode='exec') + frame1 = MockFrame(code_obj, 1) + frame1.f_back = None + frame2 = MockFrame(code_obj, 2) + frame2.f_back = frame1 + cls.frame = frame2 + cls.msg = 'file.py:2: ()' + + def test_init(self): + self.assertIs(self.idb.gui, self.gui) + # Won't test super call since two Bdbs are very different. + + def test_user_line(self): + # Test that .user_line() creates a string message for a frame. + self.gui.interaction = Mock() + self.idb.user_line(self.frame) + self.gui.interaction.assert_called_once_with(self.msg, self.frame) + + def test_user_exception(self): + # Test that .user_exception() creates a string message for a frame. + exc_info = (type(ValueError), ValueError(), None) + self.gui.interaction = Mock() + self.idb.user_exception(self.frame, exc_info) + self.gui.interaction.assert_called_once_with( + self.msg, self.frame, exc_info) + + +class FunctionTest(unittest.TestCase): + # Test module functions together. + + def test_functions(self): + rpc_obj = compile(TEST_CODE,'rpc.py', mode='exec') + rpc_frame = MockFrame(rpc_obj, 2) + rpc_frame.f_back = rpc_frame + self.assertTrue(debugger._in_rpc_code(rpc_frame)) + self.assertEqual(debugger._frame2message(rpc_frame), + 'rpc.py:2: ()') + + code_obj = compile(TEST_CODE, 'idlelib/debugger.py', mode='exec') + code_frame = MockFrame(code_obj, 1) + code_frame.f_back = None + self.assertFalse(debugger._in_rpc_code(code_frame)) + self.assertEqual(debugger._frame2message(code_frame), + 'debugger.py:1: ()') + + code_frame.f_back = code_frame + self.assertFalse(debugger._in_rpc_code(code_frame)) + code_frame.f_back = rpc_frame + self.assertTrue(debugger._in_rpc_code(code_frame)) + + +class DebuggerTest(unittest.TestCase): + "Tests for Debugger that do not need a real root." + + @classmethod + def setUpClass(cls): + cls.pyshell = Mock() + cls.pyshell.root = Mock() + cls.idb = Mock() + with patch.object(debugger.Debugger, 'make_gui'): + cls.debugger = debugger.Debugger(cls.pyshell, cls.idb) + cls.debugger.root = Mock() + + def test_cont(self): + self.debugger.cont() + self.idb.set_continue.assert_called_once() + + def test_step(self): + self.debugger.step() + self.idb.set_step.assert_called_once() + + def test_quit(self): + self.debugger.quit() + self.idb.set_quit.assert_called_once() + + def test_next(self): + with patch.object(self.debugger, 'frame') as frame: + self.debugger.next() + self.idb.set_next.assert_called_once_with(frame) + + def test_ret(self): + with patch.object(self.debugger, 'frame') as frame: + self.debugger.ret() + self.idb.set_return.assert_called_once_with(frame) + + def test_clear_breakpoint(self): + self.debugger.clear_breakpoint('test.py', 4) + self.idb.clear_break.assert_called_once_with('test.py', 4) + + def test_clear_file_breaks(self): + self.debugger.clear_file_breaks('test.py') + self.idb.clear_all_file_breaks.assert_called_once_with('test.py') + + def test_set_load_breakpoints(self): + # Test the .load_breakpoints() method calls idb. + FileIO = namedtuple('FileIO', 'filename') + + class MockEditWindow(object): + def __init__(self, fn, breakpoints): + self.io = FileIO(fn) + self.breakpoints = breakpoints + + self.pyshell.flist = Mock() + self.pyshell.flist.inversedict = ( + MockEditWindow('test1.py', [4, 4]), + MockEditWindow('test2.py', [13, 44, 45]), + ) + self.debugger.set_breakpoint('test0.py', 1) + self.idb.set_break.assert_called_once_with('test0.py', 1) + self.debugger.load_breakpoints() # Call set_breakpoint 5 times. + self.idb.set_break.assert_has_calls( + [mock.call('test0.py', 1), + mock.call('test1.py', 4), + mock.call('test1.py', 4), + mock.call('test2.py', 13), + mock.call('test2.py', 44), + mock.call('test2.py', 45)]) + + def test_sync_source_line(self): + # Test that .sync_source_line() will set the flist.gotofileline with fixed frame. + test_code = compile(TEST_CODE, 'test_sync.py', 'exec') + test_frame = MockFrame(test_code, 1) + self.debugger.frame = test_frame + + self.debugger.flist = Mock() + with patch('idlelib.debugger.os.path.exists', return_value=True): + self.debugger.sync_source_line() + self.debugger.flist.gotofileline.assert_called_once_with('test_sync.py', 1) + + +class DebuggerGuiTest(unittest.TestCase): + """Tests for debugger.Debugger that need tk root. + + close needs debugger.top set in make_gui. + """ + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = root = Tk() + root.withdraw() + cls.pyshell = Mock() + cls.pyshell.root = root + cls.idb = Mock() +# stack tests fail with debugger here. +## cls.debugger = debugger.Debugger(cls.pyshell, cls.idb) +## cls.debugger.root = root +## # real root needed for real make_gui +## # run, interacting, abort_loop + + @classmethod + def tearDownClass(cls): + cls.root.destroy() + del cls.root + + def setUp(self): + self.debugger = debugger.Debugger(self.pyshell, self.idb) + self.debugger.root = self.root + # real root needed for real make_gui + # run, interacting, abort_loop + + def test_run_debugger(self): + self.debugger.run(1, 'two') + self.idb.run.assert_called_once_with(1, 'two') + self.assertEqual(self.debugger.interacting, 0) + + def test_close(self): + # Test closing the window in an idle state. + self.debugger.close() + self.pyshell.close_debugger.assert_called_once() + + def test_show_stack(self): + self.debugger.show_stack() + self.assertEqual(self.debugger.stackviewer.gui, self.debugger) + + def test_show_stack_with_frame(self): + test_frame = MockFrame(None, None) + self.debugger.frame = test_frame + + # Reset the stackviewer to force it to be recreated. + self.debugger.stackviewer = None + self.idb.get_stack.return_value = ([], 0) + self.debugger.show_stack() + + # Check that the newly created stackviewer has the test gui as a field. + self.assertEqual(self.debugger.stackviewer.gui, self.debugger) + self.idb.get_stack.assert_called_once_with(test_frame, None) + + +class StackViewerTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + + @classmethod + def tearDownClass(cls): + cls.root.destroy() + del cls.root + + def setUp(self): + self.code = compile(TEST_CODE, 'test_stackviewer.py', 'exec') + self.stack = [ + (MockFrame(self.code, 1), 1), + (MockFrame(self.code, 2), 2) + ] + # Create a stackviewer and load the test stack. + self.sv = debugger.StackViewer(self.root, None, None) + self.sv.load_stack(self.stack) + + def test_init(self): + # Test creation of StackViewer. + gui = None + flist = None + master_window = self.root + sv = debugger.StackViewer(master_window, flist, gui) + self.assertTrue(hasattr(sv, 'stack')) + + def test_load_stack(self): + # Test the .load_stack() method against a fixed test stack. + # Check the test stack is assigned and the list contains the repr of them. + self.assertEqual(self.sv.stack, self.stack) + self.assertTrue('?.(), line 1:' in self.sv.get(0)) + self.assertEqual(self.sv.get(1), '?.(), line 2: ') + + def test_show_source(self): + # Test the .show_source() method against a fixed test stack. + # Patch out the file list to monitor it + self.sv.flist = Mock() + # Patch out isfile to pretend file exists. + with patch('idlelib.debugger.os.path.isfile', return_value=True) as isfile: + self.sv.show_source(1) + isfile.assert_called_once_with('test_stackviewer.py') + self.sv.flist.open.assert_called_once_with('test_stackviewer.py') + + +class NameSpaceTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + + @classmethod + def tearDownClass(cls): + cls.root.destroy() + del cls.root + + def test_init(self): + debugger.NamespaceViewer(self.root, 'Test') + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_debugger_r.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_debugger_r.py new file mode 100644 index 0000000000000000000000000000000000000000..cf8af05fe27e77b7a4ec17c2bd9dfcd163a4750e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_debugger_r.py @@ -0,0 +1,36 @@ +"Test debugger_r, coverage 30%." + +from idlelib import debugger_r +import unittest + +# Boilerplate likely to be needed for future test classes. +##from test.support import requires +##from tkinter import Tk +##class Test(unittest.TestCase): +## @classmethod +## def setUpClass(cls): +## requires('gui') +## cls.root = Tk() +## @classmethod +## def tearDownClass(cls): +## cls.root.destroy() + +# GUIProxy, IdbAdapter, FrameProxy, CodeProxy, DictProxy, +# GUIAdapter, IdbProxy, and 7 functions still need tests. + +class IdbAdapterTest(unittest.TestCase): + + def test_dict_item_noattr(self): # Issue 33065. + + class BinData: + def __repr__(self): + return self.length + + debugger_r.dicttable[0] = {'BinData': BinData()} + idb = debugger_r.IdbAdapter(None) + self.assertTrue(idb.dict_item(0, 'BinData')) + debugger_r.dicttable.clear() + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_debugobj.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_debugobj.py new file mode 100644 index 0000000000000000000000000000000000000000..90ace4e1bc4f9ef8ca24028c4c01b985412fdc6d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_debugobj.py @@ -0,0 +1,57 @@ +"Test debugobj, coverage 40%." + +from idlelib import debugobj +import unittest + + +class ObjectTreeItemTest(unittest.TestCase): + + def test_init(self): + ti = debugobj.ObjectTreeItem('label', 22) + self.assertEqual(ti.labeltext, 'label') + self.assertEqual(ti.object, 22) + self.assertEqual(ti.setfunction, None) + + +class ClassTreeItemTest(unittest.TestCase): + + def test_isexpandable(self): + ti = debugobj.ClassTreeItem('label', 0) + self.assertTrue(ti.IsExpandable()) + + +class AtomicObjectTreeItemTest(unittest.TestCase): + + def test_isexpandable(self): + ti = debugobj.AtomicObjectTreeItem('label', 0) + self.assertFalse(ti.IsExpandable()) + + +class SequenceTreeItemTest(unittest.TestCase): + + def test_isexpandable(self): + ti = debugobj.SequenceTreeItem('label', ()) + self.assertFalse(ti.IsExpandable()) + ti = debugobj.SequenceTreeItem('label', (1,)) + self.assertTrue(ti.IsExpandable()) + + def test_keys(self): + ti = debugobj.SequenceTreeItem('label', 'abc') + self.assertEqual(list(ti.keys()), [0, 1, 2]) # keys() is a range. + + +class DictTreeItemTest(unittest.TestCase): + + def test_isexpandable(self): + ti = debugobj.DictTreeItem('label', {}) + self.assertFalse(ti.IsExpandable()) + ti = debugobj.DictTreeItem('label', {1:1}) + self.assertTrue(ti.IsExpandable()) + + def test_keys(self): + ti = debugobj.DictTreeItem('label', {1:1, 0:0, 2:2}) + self.assertEqual(ti.keys(), [0, 1, 2]) # keys() is a sorted list. + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_debugobj_r.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_debugobj_r.py new file mode 100644 index 0000000000000000000000000000000000000000..86e51b6cb2cb22d31aa9c4a1d8cc5b713b8eec34 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_debugobj_r.py @@ -0,0 +1,22 @@ +"Test debugobj_r, coverage 56%." + +from idlelib import debugobj_r +import unittest + + +class WrappedObjectTreeItemTest(unittest.TestCase): + + def test_getattr(self): + ti = debugobj_r.WrappedObjectTreeItem(list) + self.assertEqual(ti.append, list.append) + +class StubObjectTreeItemTest(unittest.TestCase): + + def test_init(self): + ti = debugobj_r.StubObjectTreeItem('socket', 1111) + self.assertEqual(ti.sockio, 'socket') + self.assertEqual(ti.oid, 1111) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_delegator.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_delegator.py new file mode 100644 index 0000000000000000000000000000000000000000..922416297a42e028bc0db33fb1f5195190b29f6e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_delegator.py @@ -0,0 +1,44 @@ +"Test delegator, coverage 100%." + +from idlelib.delegator import Delegator +import unittest + + +class DelegatorTest(unittest.TestCase): + + def test_mydel(self): + # Test a simple use scenario. + + # Initialize an int delegator. + mydel = Delegator(int) + self.assertIs(mydel.delegate, int) + self.assertEqual(mydel._Delegator__cache, set()) + # Trying to access a non-attribute of int fails. + self.assertRaises(AttributeError, mydel.__getattr__, 'xyz') + + # Add real int attribute 'bit_length' by accessing it. + bl = mydel.bit_length + self.assertIs(bl, int.bit_length) + self.assertIs(mydel.__dict__['bit_length'], int.bit_length) + self.assertEqual(mydel._Delegator__cache, {'bit_length'}) + + # Add attribute 'numerator'. + mydel.numerator + self.assertEqual(mydel._Delegator__cache, {'bit_length', 'numerator'}) + + # Delete 'numerator'. + del mydel.numerator + self.assertNotIn('numerator', mydel.__dict__) + # The current implementation leaves it in the name cache. + # self.assertIn('numerator', mydel._Delegator__cache) + # However, this is not required and not part of the specification + + # Change delegate to float, first resetting the attributes. + mydel.setdelegate(float) # calls resetcache + self.assertNotIn('bit_length', mydel.__dict__) + self.assertEqual(mydel._Delegator__cache, set()) + self.assertIs(mydel.delegate, float) + + +if __name__ == '__main__': + unittest.main(verbosity=2, exit=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_editmenu.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_editmenu.py new file mode 100644 index 0000000000000000000000000000000000000000..17478473a3d1b2711fd8e1ffa7f6076c540c4386 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_editmenu.py @@ -0,0 +1,74 @@ +'''Test (selected) IDLE Edit menu items. + +Edit modules have their own test files +''' +from test.support import requires +requires('gui') +import tkinter as tk +from tkinter import ttk +import unittest +from idlelib import pyshell + +class PasteTest(unittest.TestCase): + '''Test pasting into widgets that allow pasting. + + On X11, replacing selections requires tk fix. + ''' + @classmethod + def setUpClass(cls): + cls.root = root = tk.Tk() + cls.root.withdraw() + pyshell.fix_x11_paste(root) + cls.text = tk.Text(root) + cls.entry = tk.Entry(root) + cls.tentry = ttk.Entry(root) + cls.spin = tk.Spinbox(root) + root.clipboard_clear() + root.clipboard_append('two') + + @classmethod + def tearDownClass(cls): + del cls.text, cls.entry, cls.tentry + cls.root.clipboard_clear() + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def test_paste_text(self): + "Test pasting into text with and without a selection." + text = self.text + for tag, ans in ('', 'onetwo\n'), ('sel', 'two\n'): + with self.subTest(tag=tag, ans=ans): + text.delete('1.0', 'end') + text.insert('1.0', 'one', tag) + text.event_generate('<>') + self.assertEqual(text.get('1.0', 'end'), ans) + + def test_paste_entry(self): + "Test pasting into an entry with and without a selection." + # Generated <> fails for tk entry without empty select + # range for 'no selection'. Live widget works fine. + for entry in self.entry, self.tentry: + for end, ans in (0, 'onetwo'), ('end', 'two'): + with self.subTest(entry=entry, end=end, ans=ans): + entry.delete(0, 'end') + entry.insert(0, 'one') + entry.select_range(0, end) + entry.event_generate('<>') + self.assertEqual(entry.get(), ans) + + def test_paste_spin(self): + "Test pasting into a spinbox with and without a selection." + # See note above for entry. + spin = self.spin + for end, ans in (0, 'onetwo'), ('end', 'two'): + with self.subTest(end=end, ans=ans): + spin.delete(0, 'end') + spin.insert(0, 'one') + spin.selection('range', 0, end) # see note + spin.event_generate('<>') + self.assertEqual(spin.get(), ans) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_editor.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_editor.py new file mode 100644 index 0000000000000000000000000000000000000000..0dfe2f3c58befadd0e85765cac1c1f29083d26fc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_editor.py @@ -0,0 +1,241 @@ +"Test editor, coverage 53%." + +from idlelib import editor +import unittest +from collections import namedtuple +from test.support import requires +from tkinter import Tk, Text + +Editor = editor.EditorWindow + + +class EditorWindowTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + + @classmethod + def tearDownClass(cls): + cls.root.update_idletasks() + for id in cls.root.tk.call('after', 'info'): + cls.root.after_cancel(id) + cls.root.destroy() + del cls.root + + def test_init(self): + e = Editor(root=self.root) + self.assertEqual(e.root, self.root) + e._close() + + +class GetLineIndentTest(unittest.TestCase): + def test_empty_lines(self): + for tabwidth in [1, 2, 4, 6, 8]: + for line in ['', '\n']: + with self.subTest(line=line, tabwidth=tabwidth): + self.assertEqual( + editor.get_line_indent(line, tabwidth=tabwidth), + (0, 0), + ) + + def test_tabwidth_4(self): + # (line, (raw, effective)) + tests = (('no spaces', (0, 0)), + # Internal space isn't counted. + (' space test', (4, 4)), + ('\ttab test', (1, 4)), + ('\t\tdouble tabs test', (2, 8)), + # Different results when mixing tabs and spaces. + (' \tmixed test', (5, 8)), + (' \t mixed test', (5, 6)), + ('\t mixed test', (5, 8)), + # Spaces not divisible by tabwidth. + (' \tmixed test', (3, 4)), + (' \t mixed test', (3, 5)), + ('\t mixed test', (3, 6)), + # Only checks spaces and tabs. + ('\nnewline test', (0, 0))) + + for line, expected in tests: + with self.subTest(line=line): + self.assertEqual( + editor.get_line_indent(line, tabwidth=4), + expected, + ) + + def test_tabwidth_8(self): + # (line, (raw, effective)) + tests = (('no spaces', (0, 0)), + # Internal space isn't counted. + (' space test', (8, 8)), + ('\ttab test', (1, 8)), + ('\t\tdouble tabs test', (2, 16)), + # Different results when mixing tabs and spaces. + (' \tmixed test', (9, 16)), + (' \t mixed test', (9, 10)), + ('\t mixed test', (9, 16)), + # Spaces not divisible by tabwidth. + (' \tmixed test', (3, 8)), + (' \t mixed test', (3, 9)), + ('\t mixed test', (3, 10)), + # Only checks spaces and tabs. + ('\nnewline test', (0, 0))) + + for line, expected in tests: + with self.subTest(line=line): + self.assertEqual( + editor.get_line_indent(line, tabwidth=8), + expected, + ) + + +def insert(text, string): + text.delete('1.0', 'end') + text.insert('end', string) + text.update_idletasks() # Force update for colorizer to finish. + + +class IndentAndNewlineTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.window = Editor(root=cls.root) + cls.window.indentwidth = 2 + cls.window.tabwidth = 2 + + @classmethod + def tearDownClass(cls): + cls.window._close() + del cls.window + cls.root.update_idletasks() + for id in cls.root.tk.call('after', 'info'): + cls.root.after_cancel(id) + cls.root.destroy() + del cls.root + + def test_indent_and_newline_event(self): + eq = self.assertEqual + w = self.window + text = w.text + get = text.get + nl = w.newline_and_indent_event + + TestInfo = namedtuple('Tests', ['label', 'text', 'expected', 'mark']) + + tests = (TestInfo('Empty line inserts with no indent.', + ' \n def __init__(self):', + '\n \n def __init__(self):\n', + '1.end'), + TestInfo('Inside bracket before space, deletes space.', + ' def f1(self, a, b):', + ' def f1(self,\n a, b):\n', + '1.14'), + TestInfo('Inside bracket after space, deletes space.', + ' def f1(self, a, b):', + ' def f1(self,\n a, b):\n', + '1.15'), + TestInfo('Inside string with one line - no indent.', + ' """Docstring."""', + ' """Docstring.\n"""\n', + '1.15'), + TestInfo('Inside string with more than one line.', + ' """Docstring.\n Docstring Line 2"""', + ' """Docstring.\n Docstring Line 2\n """\n', + '2.18'), + TestInfo('Backslash with one line.', + 'a =\\', + 'a =\\\n \n', + '1.end'), + TestInfo('Backslash with more than one line.', + 'a =\\\n multiline\\', + 'a =\\\n multiline\\\n \n', + '2.end'), + TestInfo('Block opener - indents +1 level.', + ' def f1(self):\n pass', + ' def f1(self):\n \n pass\n', + '1.end'), + TestInfo('Block closer - dedents -1 level.', + ' def f1(self):\n pass', + ' def f1(self):\n pass\n \n', + '2.end'), + ) + + for test in tests: + with self.subTest(label=test.label): + insert(text, test.text) + text.mark_set('insert', test.mark) + nl(event=None) + eq(get('1.0', 'end'), test.expected) + + # Selected text. + insert(text, ' def f1(self, a, b):\n return a + b') + text.tag_add('sel', '1.17', '1.end') + nl(None) + # Deletes selected text before adding new line. + eq(get('1.0', 'end'), ' def f1(self, a,\n \n return a + b\n') + + +class IndentSearcherTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.text = Text(cls.root) + + @classmethod + def tearDownClass(cls): + cls.root.destroy() + del cls.root + + def test_searcher(self): + text = self.text + searcher = (self.text) + test_info = (# text, (block, indent)) + ("", (None, None)), + ("[1,", (None, None)), # TokenError + ("if 1:\n", ('if 1:\n', None)), + ("if 1:\n 2\n 3\n", ('if 1:\n', ' 2\n')), + ) + for code, expected_pair in test_info: + with self.subTest(code=code): + insert(text, code) + actual_pair = editor.IndentSearcher(text).run() + self.assertEqual(actual_pair, expected_pair) + + +class RMenuTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.window = Editor(root=cls.root) + + @classmethod + def tearDownClass(cls): + cls.window._close() + del cls.window + cls.root.update_idletasks() + for id in cls.root.tk.call('after', 'info'): + cls.root.after_cancel(id) + cls.root.destroy() + del cls.root + + class DummyRMenu: + def tk_popup(x, y): pass + + def test_rclick(self): + pass + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_filelist.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_filelist.py new file mode 100644 index 0000000000000000000000000000000000000000..731f1975e50e23907f60764c0c149f101c6fe898 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_filelist.py @@ -0,0 +1,33 @@ +"Test filelist, coverage 19%." + +from idlelib import filelist +import unittest +from test.support import requires +from tkinter import Tk + +class FileListTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + + @classmethod + def tearDownClass(cls): + cls.root.update_idletasks() + for id in cls.root.tk.call('after', 'info'): + cls.root.after_cancel(id) + cls.root.destroy() + del cls.root + + def test_new_empty(self): + flist = filelist.FileList(self.root) + self.assertEqual(flist.root, self.root) + e = flist.new() + self.assertEqual(type(e), flist.EditorWindow) + e._close() + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_format.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_format.py new file mode 100644 index 0000000000000000000000000000000000000000..e5e903688597aa770452f15102f9ee7850ace49e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_format.py @@ -0,0 +1,668 @@ +"Test format, coverage 99%." + +from idlelib import format as ft +import unittest +from unittest import mock +from test.support import requires +from tkinter import Tk, Text +from idlelib.editor import EditorWindow +from idlelib.idle_test.mock_idle import Editor as MockEditor + + +class Is_Get_Test(unittest.TestCase): + """Test the is_ and get_ functions""" + test_comment = '# This is a comment' + test_nocomment = 'This is not a comment' + trailingws_comment = '# This is a comment ' + leadingws_comment = ' # This is a comment' + leadingws_nocomment = ' This is not a comment' + + def test_is_all_white(self): + self.assertTrue(ft.is_all_white('')) + self.assertTrue(ft.is_all_white('\t\n\r\f\v')) + self.assertFalse(ft.is_all_white(self.test_comment)) + + def test_get_indent(self): + Equal = self.assertEqual + Equal(ft.get_indent(self.test_comment), '') + Equal(ft.get_indent(self.trailingws_comment), '') + Equal(ft.get_indent(self.leadingws_comment), ' ') + Equal(ft.get_indent(self.leadingws_nocomment), ' ') + + def test_get_comment_header(self): + Equal = self.assertEqual + # Test comment strings + Equal(ft.get_comment_header(self.test_comment), '#') + Equal(ft.get_comment_header(self.trailingws_comment), '#') + Equal(ft.get_comment_header(self.leadingws_comment), ' #') + # Test non-comment strings + Equal(ft.get_comment_header(self.leadingws_nocomment), ' ') + Equal(ft.get_comment_header(self.test_nocomment), '') + + +class FindTest(unittest.TestCase): + """Test the find_paragraph function in paragraph module. + + Using the runcase() function, find_paragraph() is called with 'mark' set at + multiple indexes before and inside the test paragraph. + + It appears that code with the same indentation as a quoted string is grouped + as part of the same paragraph, which is probably incorrect behavior. + """ + + @classmethod + def setUpClass(cls): + from idlelib.idle_test.mock_tk import Text + cls.text = Text() + + def runcase(self, inserttext, stopline, expected): + # Check that find_paragraph returns the expected paragraph when + # the mark index is set to beginning, middle, end of each line + # up to but not including the stop line + text = self.text + text.insert('1.0', inserttext) + for line in range(1, stopline): + linelength = int(text.index("%d.end" % line).split('.')[1]) + for col in (0, linelength//2, linelength): + tempindex = "%d.%d" % (line, col) + self.assertEqual(ft.find_paragraph(text, tempindex), expected) + text.delete('1.0', 'end') + + def test_find_comment(self): + comment = ( + "# Comment block with no blank lines before\n" + "# Comment line\n" + "\n") + self.runcase(comment, 3, ('1.0', '3.0', '#', comment[0:58])) + + comment = ( + "\n" + "# Comment block with whitespace line before and after\n" + "# Comment line\n" + "\n") + self.runcase(comment, 4, ('2.0', '4.0', '#', comment[1:70])) + + comment = ( + "\n" + " # Indented comment block with whitespace before and after\n" + " # Comment line\n" + "\n") + self.runcase(comment, 4, ('2.0', '4.0', ' #', comment[1:82])) + + comment = ( + "\n" + "# Single line comment\n" + "\n") + self.runcase(comment, 3, ('2.0', '3.0', '#', comment[1:23])) + + comment = ( + "\n" + " # Single line comment with leading whitespace\n" + "\n") + self.runcase(comment, 3, ('2.0', '3.0', ' #', comment[1:51])) + + comment = ( + "\n" + "# Comment immediately followed by code\n" + "x = 42\n" + "\n") + self.runcase(comment, 3, ('2.0', '3.0', '#', comment[1:40])) + + comment = ( + "\n" + " # Indented comment immediately followed by code\n" + "x = 42\n" + "\n") + self.runcase(comment, 3, ('2.0', '3.0', ' #', comment[1:53])) + + comment = ( + "\n" + "# Comment immediately followed by indented code\n" + " x = 42\n" + "\n") + self.runcase(comment, 3, ('2.0', '3.0', '#', comment[1:49])) + + def test_find_paragraph(self): + teststring = ( + '"""String with no blank lines before\n' + 'String line\n' + '"""\n' + '\n') + self.runcase(teststring, 4, ('1.0', '4.0', '', teststring[0:53])) + + teststring = ( + "\n" + '"""String with whitespace line before and after\n' + 'String line.\n' + '"""\n' + '\n') + self.runcase(teststring, 5, ('2.0', '5.0', '', teststring[1:66])) + + teststring = ( + '\n' + ' """Indented string with whitespace before and after\n' + ' Comment string.\n' + ' """\n' + '\n') + self.runcase(teststring, 5, ('2.0', '5.0', ' ', teststring[1:85])) + + teststring = ( + '\n' + '"""Single line string."""\n' + '\n') + self.runcase(teststring, 3, ('2.0', '3.0', '', teststring[1:27])) + + teststring = ( + '\n' + ' """Single line string with leading whitespace."""\n' + '\n') + self.runcase(teststring, 3, ('2.0', '3.0', ' ', teststring[1:55])) + + +class ReformatFunctionTest(unittest.TestCase): + """Test the reformat_paragraph function without the editor window.""" + + def test_reformat_paragraph(self): + Equal = self.assertEqual + reform = ft.reformat_paragraph + hw = "O hello world" + Equal(reform(' ', 1), ' ') + Equal(reform("Hello world", 20), "Hello world") + + # Test without leading newline + Equal(reform(hw, 1), "O\nhello\nworld") + Equal(reform(hw, 6), "O\nhello\nworld") + Equal(reform(hw, 7), "O hello\nworld") + Equal(reform(hw, 12), "O hello\nworld") + Equal(reform(hw, 13), "O hello world") + + # Test with leading newline + hw = "\nO hello world" + Equal(reform(hw, 1), "\nO\nhello\nworld") + Equal(reform(hw, 6), "\nO\nhello\nworld") + Equal(reform(hw, 7), "\nO hello\nworld") + Equal(reform(hw, 12), "\nO hello\nworld") + Equal(reform(hw, 13), "\nO hello world") + + +class ReformatCommentTest(unittest.TestCase): + """Test the reformat_comment function without the editor window.""" + + def test_reformat_comment(self): + Equal = self.assertEqual + + # reformat_comment formats to a minimum of 20 characters + test_string = ( + " \"\"\"this is a test of a reformat for a triple quoted string" + " will it reformat to less than 70 characters for me?\"\"\"") + result = ft.reformat_comment(test_string, 70, " ") + expected = ( + " \"\"\"this is a test of a reformat for a triple quoted string will it\n" + " reformat to less than 70 characters for me?\"\"\"") + Equal(result, expected) + + test_comment = ( + "# this is a test of a reformat for a triple quoted string will " + "it reformat to less than 70 characters for me?") + result = ft.reformat_comment(test_comment, 70, "#") + expected = ( + "# this is a test of a reformat for a triple quoted string will it\n" + "# reformat to less than 70 characters for me?") + Equal(result, expected) + + +class FormatClassTest(unittest.TestCase): + def test_init_close(self): + instance = ft.FormatParagraph('editor') + self.assertEqual(instance.editwin, 'editor') + instance.close() + self.assertEqual(instance.editwin, None) + + +# For testing format_paragraph_event, Initialize FormatParagraph with +# a mock Editor with .text and .get_selection_indices. The text must +# be a Text wrapper that adds two methods + +# A real EditorWindow creates unneeded, time-consuming baggage and +# sometimes emits shutdown warnings like this: +# "warning: callback failed in WindowList +# : invalid command name ".55131368.windows". +# Calling EditorWindow._close in tearDownClass prevents this but causes +# other problems (windows left open). + +class TextWrapper: + def __init__(self, master): + self.text = Text(master=master) + def __getattr__(self, name): + return getattr(self.text, name) + def undo_block_start(self): pass + def undo_block_stop(self): pass + +class Editor: + def __init__(self, root): + self.text = TextWrapper(root) + get_selection_indices = EditorWindow. get_selection_indices + +class FormatEventTest(unittest.TestCase): + """Test the formatting of text inside a Text widget. + + This is done with FormatParagraph.format.paragraph_event, + which calls functions in the module as appropriate. + """ + test_string = ( + " '''this is a test of a reformat for a triple " + "quoted string will it reformat to less than 70 " + "characters for me?'''\n") + multiline_test_string = ( + " '''The first line is under the max width.\n" + " The second line's length is way over the max width. It goes " + "on and on until it is over 100 characters long.\n" + " Same thing with the third line. It is also way over the max " + "width, but FormatParagraph will fix it.\n" + " '''\n") + multiline_test_comment = ( + "# The first line is under the max width.\n" + "# The second line's length is way over the max width. It goes on " + "and on until it is over 100 characters long.\n" + "# Same thing with the third line. It is also way over the max " + "width, but FormatParagraph will fix it.\n" + "# The fourth line is short like the first line.") + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + editor = Editor(root=cls.root) + cls.text = editor.text.text # Test code does not need the wrapper. + cls.formatter = ft.FormatParagraph(editor).format_paragraph_event + # Sets the insert mark just after the re-wrapped and inserted text. + + @classmethod + def tearDownClass(cls): + del cls.text, cls.formatter + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def test_short_line(self): + self.text.insert('1.0', "Short line\n") + self.formatter("Dummy") + self.assertEqual(self.text.get('1.0', 'insert'), "Short line\n" ) + self.text.delete('1.0', 'end') + + def test_long_line(self): + text = self.text + + # Set cursor ('insert' mark) to '1.0', within text. + text.insert('1.0', self.test_string) + text.mark_set('insert', '1.0') + self.formatter('ParameterDoesNothing', limit=70) + result = text.get('1.0', 'insert') + # find function includes \n + expected = ( +" '''this is a test of a reformat for a triple quoted string will it\n" +" reformat to less than 70 characters for me?'''\n") # yes + self.assertEqual(result, expected) + text.delete('1.0', 'end') + + # Select from 1.11 to line end. + text.insert('1.0', self.test_string) + text.tag_add('sel', '1.11', '1.end') + self.formatter('ParameterDoesNothing', limit=70) + result = text.get('1.0', 'insert') + # selection excludes \n + expected = ( +" '''this is a test of a reformat for a triple quoted string will it reformat\n" +" to less than 70 characters for me?'''") # no + self.assertEqual(result, expected) + text.delete('1.0', 'end') + + def test_multiple_lines(self): + text = self.text + # Select 2 long lines. + text.insert('1.0', self.multiline_test_string) + text.tag_add('sel', '2.0', '4.0') + self.formatter('ParameterDoesNothing', limit=70) + result = text.get('2.0', 'insert') + expected = ( +" The second line's length is way over the max width. It goes on and\n" +" on until it is over 100 characters long. Same thing with the third\n" +" line. It is also way over the max width, but FormatParagraph will\n" +" fix it.\n") + self.assertEqual(result, expected) + text.delete('1.0', 'end') + + def test_comment_block(self): + text = self.text + + # Set cursor ('insert') to '1.0', within block. + text.insert('1.0', self.multiline_test_comment) + self.formatter('ParameterDoesNothing', limit=70) + result = text.get('1.0', 'insert') + expected = ( +"# The first line is under the max width. The second line's length is\n" +"# way over the max width. It goes on and on until it is over 100\n" +"# characters long. Same thing with the third line. It is also way over\n" +"# the max width, but FormatParagraph will fix it. The fourth line is\n" +"# short like the first line.\n") + self.assertEqual(result, expected) + text.delete('1.0', 'end') + + # Select line 2, verify line 1 unaffected. + text.insert('1.0', self.multiline_test_comment) + text.tag_add('sel', '2.0', '3.0') + self.formatter('ParameterDoesNothing', limit=70) + result = text.get('1.0', 'insert') + expected = ( +"# The first line is under the max width.\n" +"# The second line's length is way over the max width. It goes on and\n" +"# on until it is over 100 characters long.\n") + self.assertEqual(result, expected) + text.delete('1.0', 'end') + +# The following block worked with EditorWindow but fails with the mock. +# Lines 2 and 3 get pasted together even though the previous block left +# the previous line alone. More investigation is needed. +## # Select lines 3 and 4 +## text.insert('1.0', self.multiline_test_comment) +## text.tag_add('sel', '3.0', '5.0') +## self.formatter('ParameterDoesNothing') +## result = text.get('3.0', 'insert') +## expected = ( +##"# Same thing with the third line. It is also way over the max width,\n" +##"# but FormatParagraph will fix it. The fourth line is short like the\n" +##"# first line.\n") +## self.assertEqual(result, expected) +## text.delete('1.0', 'end') + + +class DummyEditwin: + def __init__(self, root, text): + self.root = root + self.text = text + self.indentwidth = 4 + self.tabwidth = 4 + self.usetabs = False + self.context_use_ps1 = True + + _make_blanks = EditorWindow._make_blanks + get_selection_indices = EditorWindow.get_selection_indices + + +class FormatRegionTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.text = Text(cls.root) + cls.text.undo_block_start = mock.Mock() + cls.text.undo_block_stop = mock.Mock() + cls.editor = DummyEditwin(cls.root, cls.text) + cls.formatter = ft.FormatRegion(cls.editor) + + @classmethod + def tearDownClass(cls): + del cls.text, cls.formatter, cls.editor + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def setUp(self): + self.text.insert('1.0', self.code_sample) + + def tearDown(self): + self.text.delete('1.0', 'end') + + code_sample = """\ +# WS line needed for test. +class C1: + # Class comment. + def __init__(self, a, b): + self.a = a + self.b = b + + def compare(self): + if a > b: + return a + elif a < b: + return b + else: + return None +""" + + def test_get_region(self): + get = self.formatter.get_region + text = self.text + eq = self.assertEqual + + # Add selection. + text.tag_add('sel', '7.0', '10.0') + expected_lines = ['', + ' def compare(self):', + ' if a > b:', + ''] + eq(get(), ('7.0', '10.0', '\n'.join(expected_lines), expected_lines)) + + # Remove selection. + text.tag_remove('sel', '1.0', 'end') + eq(get(), ('15.0', '16.0', '\n', ['', ''])) + + def test_set_region(self): + set_ = self.formatter.set_region + text = self.text + eq = self.assertEqual + + save_bell = text.bell + text.bell = mock.Mock() + line6 = self.code_sample.splitlines()[5] + line10 = self.code_sample.splitlines()[9] + + text.tag_add('sel', '6.0', '11.0') + head, tail, chars, lines = self.formatter.get_region() + + # No changes. + set_(head, tail, chars, lines) + text.bell.assert_called_once() + eq(text.get('6.0', '11.0'), chars) + eq(text.get('sel.first', 'sel.last'), chars) + text.tag_remove('sel', '1.0', 'end') + + # Alter selected lines by changing lines and adding a newline. + newstring = 'added line 1\n\n\n\n' + newlines = newstring.split('\n') + set_('7.0', '10.0', chars, newlines) + # Selection changed. + eq(text.get('sel.first', 'sel.last'), newstring) + # Additional line added, so last index is changed. + eq(text.get('7.0', '11.0'), newstring) + # Before and after lines unchanged. + eq(text.get('6.0', '7.0-1c'), line6) + eq(text.get('11.0', '12.0-1c'), line10) + text.tag_remove('sel', '1.0', 'end') + + text.bell = save_bell + + def test_indent_region_event(self): + indent = self.formatter.indent_region_event + text = self.text + eq = self.assertEqual + + text.tag_add('sel', '7.0', '10.0') + indent() + # Blank lines aren't affected by indent. + eq(text.get('7.0', '10.0'), ('\n def compare(self):\n if a > b:\n')) + + def test_dedent_region_event(self): + dedent = self.formatter.dedent_region_event + text = self.text + eq = self.assertEqual + + text.tag_add('sel', '7.0', '10.0') + dedent() + # Blank lines aren't affected by dedent. + eq(text.get('7.0', '10.0'), ('\ndef compare(self):\n if a > b:\n')) + + def test_comment_region_event(self): + comment = self.formatter.comment_region_event + text = self.text + eq = self.assertEqual + + text.tag_add('sel', '7.0', '10.0') + comment() + eq(text.get('7.0', '10.0'), ('##\n## def compare(self):\n## if a > b:\n')) + + def test_uncomment_region_event(self): + comment = self.formatter.comment_region_event + uncomment = self.formatter.uncomment_region_event + text = self.text + eq = self.assertEqual + + text.tag_add('sel', '7.0', '10.0') + comment() + uncomment() + eq(text.get('7.0', '10.0'), ('\n def compare(self):\n if a > b:\n')) + + # Only remove comments at the beginning of a line. + text.tag_remove('sel', '1.0', 'end') + text.tag_add('sel', '3.0', '4.0') + uncomment() + eq(text.get('3.0', '3.end'), (' # Class comment.')) + + self.formatter.set_region('3.0', '4.0', '', ['# Class comment.', '']) + uncomment() + eq(text.get('3.0', '3.end'), (' Class comment.')) + + @mock.patch.object(ft.FormatRegion, "_asktabwidth") + def test_tabify_region_event(self, _asktabwidth): + tabify = self.formatter.tabify_region_event + text = self.text + eq = self.assertEqual + + text.tag_add('sel', '7.0', '10.0') + # No tabwidth selected. + _asktabwidth.return_value = None + self.assertIsNone(tabify()) + + _asktabwidth.return_value = 3 + self.assertIsNotNone(tabify()) + eq(text.get('7.0', '10.0'), ('\n\t def compare(self):\n\t\t if a > b:\n')) + + @mock.patch.object(ft.FormatRegion, "_asktabwidth") + def test_untabify_region_event(self, _asktabwidth): + untabify = self.formatter.untabify_region_event + text = self.text + eq = self.assertEqual + + text.tag_add('sel', '7.0', '10.0') + # No tabwidth selected. + _asktabwidth.return_value = None + self.assertIsNone(untabify()) + + _asktabwidth.return_value = 2 + self.formatter.tabify_region_event() + _asktabwidth.return_value = 3 + self.assertIsNotNone(untabify()) + eq(text.get('7.0', '10.0'), ('\n def compare(self):\n if a > b:\n')) + + @mock.patch.object(ft, "askinteger") + def test_ask_tabwidth(self, askinteger): + ask = self.formatter._asktabwidth + askinteger.return_value = 10 + self.assertEqual(ask(), 10) + + +class IndentsTest(unittest.TestCase): + + @mock.patch.object(ft, "askyesno") + def test_toggle_tabs(self, askyesno): + editor = DummyEditwin(None, None) # usetabs == False. + indents = ft.Indents(editor) + askyesno.return_value = True + + indents.toggle_tabs_event(None) + self.assertEqual(editor.usetabs, True) + self.assertEqual(editor.indentwidth, 8) + + indents.toggle_tabs_event(None) + self.assertEqual(editor.usetabs, False) + self.assertEqual(editor.indentwidth, 8) + + @mock.patch.object(ft, "askinteger") + def test_change_indentwidth(self, askinteger): + editor = DummyEditwin(None, None) # indentwidth == 4. + indents = ft.Indents(editor) + + askinteger.return_value = None + indents.change_indentwidth_event(None) + self.assertEqual(editor.indentwidth, 4) + + askinteger.return_value = 3 + indents.change_indentwidth_event(None) + self.assertEqual(editor.indentwidth, 3) + + askinteger.return_value = 5 + editor.usetabs = True + indents.change_indentwidth_event(None) + self.assertEqual(editor.indentwidth, 3) + + +class RstripTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.text = Text(cls.root) + cls.editor = MockEditor(text=cls.text) + cls.do_rstrip = ft.Rstrip(cls.editor).do_rstrip + + @classmethod + def tearDownClass(cls): + del cls.text, cls.do_rstrip, cls.editor + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def tearDown(self): + self.text.delete('1.0', 'end-1c') + + def test_rstrip_lines(self): + original = ( + "Line with an ending tab \n" + "Line ending in 5 spaces \n" + "Linewithnospaces\n" + " indented line\n" + " indented line with trailing space \n" + " \n") + stripped = ( + "Line with an ending tab\n" + "Line ending in 5 spaces\n" + "Linewithnospaces\n" + " indented line\n" + " indented line with trailing space\n") + + self.text.insert('1.0', original) + self.do_rstrip() + self.assertEqual(self.text.get('1.0', 'insert'), stripped) + + def test_rstrip_end(self): + text = self.text + for code in ('', '\n', '\n\n\n'): + with self.subTest(code=code): + text.insert('1.0', code) + self.do_rstrip() + self.assertEqual(text.get('1.0','end-1c'), '') + for code in ('a\n', 'a\n\n', 'a\n\n\n'): + with self.subTest(code=code): + text.delete('1.0', 'end-1c') + text.insert('1.0', code) + self.do_rstrip() + self.assertEqual(text.get('1.0','end-1c'), 'a\n') + + +if __name__ == '__main__': + unittest.main(verbosity=2, exit=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_grep.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_grep.py new file mode 100644 index 0000000000000000000000000000000000000000..a0b5b69171879c0042d7ac3fe3f049e86ba7b0c0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_grep.py @@ -0,0 +1,156 @@ +""" !Changing this line will break Test_findfile.test_found! +Non-gui unit tests for grep.GrepDialog methods. +dummy_command calls grep_it calls findfiles. +An exception raised in one method will fail callers. +Otherwise, tests are mostly independent. +Currently only test grep_it, coverage 51%. +""" +from idlelib import grep +import unittest +from test.support import captured_stdout +from idlelib.idle_test.mock_tk import Var +import os +import re + + +class Dummy_searchengine: + '''GrepDialog.__init__ calls parent SearchDiabolBase which attaches the + passed in SearchEngine instance as attribute 'engine'. Only a few of the + many possible self.engine.x attributes are needed here. + ''' + def getpat(self): + return self._pat + +searchengine = Dummy_searchengine() + + +class Dummy_grep: + # Methods tested + #default_command = GrepDialog.default_command + grep_it = grep.GrepDialog.grep_it + # Other stuff needed + recvar = Var(False) + engine = searchengine + def close(self): # gui method + pass + +_grep = Dummy_grep() + + +class FindfilesTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + cls.realpath = os.path.realpath(__file__) + cls.path = os.path.dirname(cls.realpath) + + @classmethod + def tearDownClass(cls): + del cls.realpath, cls.path + + def test_invaliddir(self): + with captured_stdout() as s: + filelist = list(grep.findfiles('invaliddir', '*.*', False)) + self.assertEqual(filelist, []) + self.assertIn('invalid', s.getvalue()) + + def test_curdir(self): + # Test os.curdir. + ff = grep.findfiles + save_cwd = os.getcwd() + os.chdir(self.path) + filename = 'test_grep.py' + filelist = list(ff(os.curdir, filename, False)) + self.assertIn(os.path.join(os.curdir, filename), filelist) + os.chdir(save_cwd) + + def test_base(self): + ff = grep.findfiles + readme = os.path.join(self.path, 'README.txt') + + # Check for Python files in path where this file lives. + filelist = list(ff(self.path, '*.py', False)) + # This directory has many Python files. + self.assertGreater(len(filelist), 10) + self.assertIn(self.realpath, filelist) + self.assertNotIn(readme, filelist) + + # Look for .txt files in path where this file lives. + filelist = list(ff(self.path, '*.txt', False)) + self.assertNotEqual(len(filelist), 0) + self.assertNotIn(self.realpath, filelist) + self.assertIn(readme, filelist) + + # Look for non-matching pattern. + filelist = list(ff(self.path, 'grep.*', False)) + self.assertEqual(len(filelist), 0) + self.assertNotIn(self.realpath, filelist) + + def test_recurse(self): + ff = grep.findfiles + parent = os.path.dirname(self.path) + grepfile = os.path.join(parent, 'grep.py') + pat = '*.py' + + # Get Python files only in parent directory. + filelist = list(ff(parent, pat, False)) + parent_size = len(filelist) + # Lots of Python files in idlelib. + self.assertGreater(parent_size, 20) + self.assertIn(grepfile, filelist) + # Without subdirectories, this file isn't returned. + self.assertNotIn(self.realpath, filelist) + + # Include subdirectories. + filelist = list(ff(parent, pat, True)) + # More files found now. + self.assertGreater(len(filelist), parent_size) + self.assertIn(grepfile, filelist) + # This file exists in list now. + self.assertIn(self.realpath, filelist) + + # Check another level up the tree. + parent = os.path.dirname(parent) + filelist = list(ff(parent, '*.py', True)) + self.assertIn(self.realpath, filelist) + + +class Grep_itTest(unittest.TestCase): + # Test captured reports with 0 and some hits. + # Should test file names, but Windows reports have mixed / and \ separators + # from incomplete replacement, so 'later'. + + def report(self, pat): + _grep.engine._pat = pat + with captured_stdout() as s: + _grep.grep_it(re.compile(pat), __file__) + lines = s.getvalue().split('\n') + lines.pop() # remove bogus '' after last \n + return lines + + def test_unfound(self): + pat = 'xyz*'*7 + lines = self.report(pat) + self.assertEqual(len(lines), 2) + self.assertIn(pat, lines[0]) + self.assertEqual(lines[1], 'No hits.') + + def test_found(self): + + pat = '""" !Changing this line will break Test_findfile.test_found!' + lines = self.report(pat) + self.assertEqual(len(lines), 5) + self.assertIn(pat, lines[0]) + self.assertIn('py: 1:', lines[1]) # line number 1 + self.assertIn('2', lines[3]) # hits found 2 + self.assertTrue(lines[4].startswith('(Hint:')) + + +class Default_commandTest(unittest.TestCase): + # To write this, move outwin import to top of GrepDialog + # so it can be replaced by captured_stdout in class setup/teardown. + pass + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_help.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_help.py new file mode 100644 index 0000000000000000000000000000000000000000..c528d4e77f8ca7c32aca8e66d5c0183966661546 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_help.py @@ -0,0 +1,36 @@ +"Test help, coverage 94%." + +from idlelib import help +import unittest +from test.support import requires +requires('gui') +from os.path import abspath, dirname, join +from tkinter import Tk + + +class IdleDocTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + "By itself, this tests that file parsed without exception." + cls.root = root = Tk() + root.withdraw() + cls.window = help.show_idlehelp(root) + + @classmethod + def tearDownClass(cls): + del cls.window + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def test_1window(self): + self.assertIn('IDLE Doc', self.window.wm_title()) + + def test_4text(self): + text = self.window.frame.text + self.assertEqual(text.get('1.0', '1.end'), ' IDLE ') + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_help_about.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_help_about.py new file mode 100644 index 0000000000000000000000000000000000000000..7e16abdb7c9f96f1a939ec0d27f0cb426922f6d9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_help_about.py @@ -0,0 +1,182 @@ +"""Test help_about, coverage 100%. +help_about.build_bits branches on sys.platform='darwin'. +'100% combines coverage on Mac and others. +""" + +from idlelib import help_about +import unittest +from test.support import requires, findfile +from tkinter import Tk, TclError +from idlelib.idle_test.mock_idle import Func +from idlelib.idle_test.mock_tk import Mbox_func +from idlelib import textview +import os.path +from platform import python_version + +About = help_about.AboutDialog + + +class LiveDialogTest(unittest.TestCase): + """Simulate user clicking buttons other than [Close]. + + Test that invoked textview has text from source. + """ + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.dialog = About(cls.root, 'About IDLE', _utest=True) + + @classmethod + def tearDownClass(cls): + del cls.dialog + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def test_build_bits(self): + self.assertIn(help_about.bits, ('32', '64')) + + def test_dialog_title(self): + """Test about dialog title""" + self.assertEqual(self.dialog.title(), 'About IDLE') + + def test_dialog_logo(self): + """Test about dialog logo.""" + path, file = os.path.split(self.dialog.icon_image['file']) + fn, ext = os.path.splitext(file) + self.assertEqual(fn, 'idle_48') + + def test_printer_buttons(self): + """Test buttons whose commands use printer function.""" + dialog = self.dialog + button_sources = [(dialog.py_license, license, 'license'), + (dialog.py_copyright, copyright, 'copyright'), + (dialog.py_credits, credits, 'credits')] + + for button, printer, name in button_sources: + with self.subTest(name=name): + printer._Printer__setup() + button.invoke() + get = dialog._current_textview.viewframe.textframe.text.get + lines = printer._Printer__lines + if len(lines) < 2: + self.fail(name + ' full text was not found') + self.assertEqual(lines[0], get('1.0', '1.end')) + self.assertEqual(lines[1], get('2.0', '2.end')) + dialog._current_textview.destroy() + + def test_file_buttons(self): + """Test buttons that display files.""" + dialog = self.dialog + button_sources = [(self.dialog.readme, 'README.txt', 'readme'), + (self.dialog.idle_news, 'News3.txt', 'news'), + (self.dialog.idle_credits, 'CREDITS.txt', 'credits')] + + for button, filename, name in button_sources: + with self.subTest(name=name): + button.invoke() + fn = findfile(filename, subdir='idlelib') + get = dialog._current_textview.viewframe.textframe.text.get + with open(fn, encoding='utf-8') as f: + self.assertEqual(f.readline().strip(), get('1.0', '1.end')) + f.readline() + self.assertEqual(f.readline().strip(), get('3.0', '3.end')) + dialog._current_textview.destroy() + + +class DefaultTitleTest(unittest.TestCase): + "Test default title." + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.dialog = About(cls.root, _utest=True) + + @classmethod + def tearDownClass(cls): + del cls.dialog + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def test_dialog_title(self): + """Test about dialog title""" + self.assertEqual(self.dialog.title(), + f'About IDLE {python_version()}' + f' ({help_about.bits} bit)') + + +class CloseTest(unittest.TestCase): + """Simulate user clicking [Close] button""" + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.dialog = About(cls.root, 'About IDLE', _utest=True) + + @classmethod + def tearDownClass(cls): + del cls.dialog + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def test_close(self): + self.assertEqual(self.dialog.winfo_class(), 'Toplevel') + self.dialog.button_ok.invoke() + with self.assertRaises(TclError): + self.dialog.winfo_class() + + +class Dummy_about_dialog: + # Dummy class for testing file display functions. + idle_credits = About.show_idle_credits + idle_readme = About.show_readme + idle_news = About.show_idle_news + # Called by the above + display_file_text = About.display_file_text + _utest = True + + +class DisplayFileTest(unittest.TestCase): + """Test functions that display files. + + While somewhat redundant with gui-based test_file_dialog, + these unit tests run on all buildbots, not just a few. + """ + dialog = Dummy_about_dialog() + + @classmethod + def setUpClass(cls): + cls.orig_error = textview.showerror + cls.orig_view = textview.view_text + cls.error = Mbox_func() + cls.view = Func() + textview.showerror = cls.error + textview.view_text = cls.view + + @classmethod + def tearDownClass(cls): + textview.showerror = cls.orig_error + textview.view_text = cls.orig_view + + def test_file_display(self): + for handler in (self.dialog.idle_credits, + self.dialog.idle_readme, + self.dialog.idle_news): + self.error.message = '' + self.view.called = False + with self.subTest(handler=handler): + handler() + self.assertEqual(self.error.message, '') + self.assertEqual(self.view.called, True) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_history.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_history.py new file mode 100644 index 0000000000000000000000000000000000000000..675396514447514ff9c6811d095fe054fef589b0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_history.py @@ -0,0 +1,172 @@ +" Test history, coverage 100%." + +from idlelib.history import History +import unittest +from test.support import requires + +import tkinter as tk +from tkinter import Text as tkText +from idlelib.idle_test.mock_tk import Text as mkText +from idlelib.config import idleConf + +line1 = 'a = 7' +line2 = 'b = a' + + +class StoreTest(unittest.TestCase): + '''Tests History.__init__ and History.store with mock Text''' + + @classmethod + def setUpClass(cls): + cls.text = mkText() + cls.history = History(cls.text) + + def tearDown(self): + self.text.delete('1.0', 'end') + self.history.history = [] + + def test_init(self): + self.assertIs(self.history.text, self.text) + self.assertEqual(self.history.history, []) + self.assertIsNone(self.history.prefix) + self.assertIsNone(self.history.pointer) + self.assertEqual(self.history.cyclic, + idleConf.GetOption("main", "History", "cyclic", 1, "bool")) + + def test_store_short(self): + self.history.store('a') + self.assertEqual(self.history.history, []) + self.history.store(' a ') + self.assertEqual(self.history.history, []) + + def test_store_dup(self): + self.history.store(line1) + self.assertEqual(self.history.history, [line1]) + self.history.store(line2) + self.assertEqual(self.history.history, [line1, line2]) + self.history.store(line1) + self.assertEqual(self.history.history, [line2, line1]) + + def test_store_reset(self): + self.history.prefix = line1 + self.history.pointer = 0 + self.history.store(line2) + self.assertIsNone(self.history.prefix) + self.assertIsNone(self.history.pointer) + + +class TextWrapper: + def __init__(self, master): + self.text = tkText(master=master) + self._bell = False + def __getattr__(self, name): + return getattr(self.text, name) + def bell(self): + self._bell = True + + +class FetchTest(unittest.TestCase): + '''Test History.fetch with wrapped tk.Text. + ''' + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = tk.Tk() + cls.root.withdraw() + + def setUp(self): + self.text = text = TextWrapper(self.root) + text.insert('1.0', ">>> ") + text.mark_set('iomark', '1.4') + text.mark_gravity('iomark', 'left') + self.history = History(text) + self.history.history = [line1, line2] + + @classmethod + def tearDownClass(cls): + cls.root.destroy() + del cls.root + + def fetch_test(self, reverse, line, prefix, index, *, bell=False): + # Perform one fetch as invoked by Alt-N or Alt-P + # Test the result. The line test is the most important. + # The last two are diagnostic of fetch internals. + History = self.history + History.fetch(reverse) + + Equal = self.assertEqual + Equal(self.text.get('iomark', 'end-1c'), line) + Equal(self.text._bell, bell) + if bell: + self.text._bell = False + Equal(History.prefix, prefix) + Equal(History.pointer, index) + Equal(self.text.compare("insert", '==', "end-1c"), 1) + + def test_fetch_prev_cyclic(self): + prefix = '' + test = self.fetch_test + test(True, line2, prefix, 1) + test(True, line1, prefix, 0) + test(True, prefix, None, None, bell=True) + + def test_fetch_next_cyclic(self): + prefix = '' + test = self.fetch_test + test(False, line1, prefix, 0) + test(False, line2, prefix, 1) + test(False, prefix, None, None, bell=True) + + # Prefix 'a' tests skip line2, which starts with 'b' + def test_fetch_prev_prefix(self): + prefix = 'a' + self.text.insert('iomark', prefix) + self.fetch_test(True, line1, prefix, 0) + self.fetch_test(True, prefix, None, None, bell=True) + + def test_fetch_next_prefix(self): + prefix = 'a' + self.text.insert('iomark', prefix) + self.fetch_test(False, line1, prefix, 0) + self.fetch_test(False, prefix, None, None, bell=True) + + def test_fetch_prev_noncyclic(self): + prefix = '' + self.history.cyclic = False + test = self.fetch_test + test(True, line2, prefix, 1) + test(True, line1, prefix, 0) + test(True, line1, prefix, 0, bell=True) + + def test_fetch_next_noncyclic(self): + prefix = '' + self.history.cyclic = False + test = self.fetch_test + test(False, prefix, None, None, bell=True) + test(True, line2, prefix, 1) + test(False, prefix, None, None, bell=True) + test(False, prefix, None, None, bell=True) + + def test_fetch_cursor_move(self): + # Move cursor after fetch + self.history.fetch(reverse=True) # initialization + self.text.mark_set('insert', 'iomark') + self.fetch_test(True, line2, None, None, bell=True) + + def test_fetch_edit(self): + # Edit after fetch + self.history.fetch(reverse=True) # initialization + self.text.delete('iomark', 'insert', ) + self.text.insert('iomark', 'a =') + self.fetch_test(True, line1, 'a =', 0) # prefix is reset + + def test_history_prev_next(self): + # Minimally test functions bound to events + self.history.history_prev('dummy event') + self.assertEqual(self.history.pointer, 1) + self.history.history_next('dummy event') + self.assertEqual(self.history.pointer, None) + + +if __name__ == '__main__': + unittest.main(verbosity=2, exit=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_hyperparser.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_hyperparser.py new file mode 100644 index 0000000000000000000000000000000000000000..343843c4166e97dcab123c4b9835341e15f65739 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_hyperparser.py @@ -0,0 +1,276 @@ +"Test hyperparser, coverage 98%." + +from idlelib.hyperparser import HyperParser +import unittest +from test.support import requires +from tkinter import Tk, Text +from idlelib.editor import EditorWindow + +class DummyEditwin: + def __init__(self, text): + self.text = text + self.indentwidth = 8 + self.tabwidth = 8 + self.prompt_last_line = '>>>' + self.num_context_lines = 50, 500, 1000 + + _build_char_in_string_func = EditorWindow._build_char_in_string_func + is_char_in_string = EditorWindow.is_char_in_string + + +class HyperParserTest(unittest.TestCase): + code = ( + '"""This is a module docstring"""\n' + '# this line is a comment\n' + 'x = "this is a string"\n' + "y = 'this is also a string'\n" + 'l = [i for i in range(10)]\n' + 'm = [py*py for # comment\n' + ' py in l]\n' + 'x.__len__\n' + "z = ((r'asdf')+('a')))\n" + '[x for x in\n' + 'for = False\n' + 'cliché = "this is a string with unicode, what a cliché"' + ) + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.text = Text(cls.root) + cls.editwin = DummyEditwin(cls.text) + + @classmethod + def tearDownClass(cls): + del cls.text, cls.editwin + cls.root.destroy() + del cls.root + + def setUp(self): + self.text.insert('insert', self.code) + + def tearDown(self): + self.text.delete('1.0', 'end') + self.editwin.prompt_last_line = '>>>' + + def get_parser(self, index): + """ + Return a parser object with index at 'index' + """ + return HyperParser(self.editwin, index) + + def test_init(self): + """ + test corner cases in the init method + """ + with self.assertRaises(ValueError) as ve: + self.text.tag_add('console', '1.0', '1.end') + p = self.get_parser('1.5') + self.assertIn('precedes', str(ve.exception)) + + # test without ps1 + self.editwin.prompt_last_line = '' + + # number of lines lesser than 50 + p = self.get_parser('end') + self.assertEqual(p.rawtext, self.text.get('1.0', 'end')) + + # number of lines greater than 50 + self.text.insert('end', self.text.get('1.0', 'end')*4) + p = self.get_parser('54.5') + + def test_is_in_string(self): + get = self.get_parser + + p = get('1.0') + self.assertFalse(p.is_in_string()) + p = get('1.4') + self.assertTrue(p.is_in_string()) + p = get('2.3') + self.assertFalse(p.is_in_string()) + p = get('3.3') + self.assertFalse(p.is_in_string()) + p = get('3.7') + self.assertTrue(p.is_in_string()) + p = get('4.6') + self.assertTrue(p.is_in_string()) + p = get('12.54') + self.assertTrue(p.is_in_string()) + + def test_is_in_code(self): + get = self.get_parser + + p = get('1.0') + self.assertTrue(p.is_in_code()) + p = get('1.1') + self.assertFalse(p.is_in_code()) + p = get('2.5') + self.assertFalse(p.is_in_code()) + p = get('3.4') + self.assertTrue(p.is_in_code()) + p = get('3.6') + self.assertFalse(p.is_in_code()) + p = get('4.14') + self.assertFalse(p.is_in_code()) + + def test_get_surrounding_bracket(self): + get = self.get_parser + + def without_mustclose(parser): + # a utility function to get surrounding bracket + # with mustclose=False + return parser.get_surrounding_brackets(mustclose=False) + + def with_mustclose(parser): + # a utility function to get surrounding bracket + # with mustclose=True + return parser.get_surrounding_brackets(mustclose=True) + + p = get('3.2') + self.assertIsNone(with_mustclose(p)) + self.assertIsNone(without_mustclose(p)) + + p = get('5.6') + self.assertTupleEqual(without_mustclose(p), ('5.4', '5.25')) + self.assertTupleEqual(without_mustclose(p), with_mustclose(p)) + + p = get('5.23') + self.assertTupleEqual(without_mustclose(p), ('5.21', '5.24')) + self.assertTupleEqual(without_mustclose(p), with_mustclose(p)) + + p = get('6.15') + self.assertTupleEqual(without_mustclose(p), ('6.4', '6.end')) + self.assertIsNone(with_mustclose(p)) + + p = get('9.end') + self.assertIsNone(with_mustclose(p)) + self.assertIsNone(without_mustclose(p)) + + def test_get_expression(self): + get = self.get_parser + + p = get('4.2') + self.assertEqual(p.get_expression(), 'y ') + + p = get('4.7') + with self.assertRaises(ValueError) as ve: + p.get_expression() + self.assertIn('is inside a code', str(ve.exception)) + + p = get('5.25') + self.assertEqual(p.get_expression(), 'range(10)') + + p = get('6.7') + self.assertEqual(p.get_expression(), 'py') + + p = get('6.8') + self.assertEqual(p.get_expression(), '') + + p = get('7.9') + self.assertEqual(p.get_expression(), 'py') + + p = get('8.end') + self.assertEqual(p.get_expression(), 'x.__len__') + + p = get('9.13') + self.assertEqual(p.get_expression(), "r'asdf'") + + p = get('9.17') + with self.assertRaises(ValueError) as ve: + p.get_expression() + self.assertIn('is inside a code', str(ve.exception)) + + p = get('10.0') + self.assertEqual(p.get_expression(), '') + + p = get('10.6') + self.assertEqual(p.get_expression(), '') + + p = get('10.11') + self.assertEqual(p.get_expression(), '') + + p = get('11.3') + self.assertEqual(p.get_expression(), '') + + p = get('11.11') + self.assertEqual(p.get_expression(), 'False') + + p = get('12.6') + self.assertEqual(p.get_expression(), 'cliché') + + def test_eat_identifier(self): + def is_valid_id(candidate): + result = HyperParser._eat_identifier(candidate, 0, len(candidate)) + if result == len(candidate): + return True + elif result == 0: + return False + else: + err_msg = "Unexpected result: {} (expected 0 or {}".format( + result, len(candidate) + ) + raise Exception(err_msg) + + # invalid first character which is valid elsewhere in an identifier + self.assertFalse(is_valid_id('2notid')) + + # ASCII-only valid identifiers + self.assertTrue(is_valid_id('valid_id')) + self.assertTrue(is_valid_id('_valid_id')) + self.assertTrue(is_valid_id('valid_id_')) + self.assertTrue(is_valid_id('_2valid_id')) + + # keywords which should be "eaten" + self.assertTrue(is_valid_id('True')) + self.assertTrue(is_valid_id('False')) + self.assertTrue(is_valid_id('None')) + + # keywords which should not be "eaten" + self.assertFalse(is_valid_id('for')) + self.assertFalse(is_valid_id('import')) + self.assertFalse(is_valid_id('return')) + + # valid unicode identifiers + self.assertTrue(is_valid_id('cliche')) + self.assertTrue(is_valid_id('cliché')) + self.assertTrue(is_valid_id('a٢')) + + # invalid unicode identifiers + self.assertFalse(is_valid_id('2a')) + self.assertFalse(is_valid_id('٢a')) + self.assertFalse(is_valid_id('a²')) + + # valid identifier after "punctuation" + self.assertEqual(HyperParser._eat_identifier('+ var', 0, 5), len('var')) + self.assertEqual(HyperParser._eat_identifier('+var', 0, 4), len('var')) + self.assertEqual(HyperParser._eat_identifier('.var', 0, 4), len('var')) + + # invalid identifiers + self.assertFalse(is_valid_id('+')) + self.assertFalse(is_valid_id(' ')) + self.assertFalse(is_valid_id(':')) + self.assertFalse(is_valid_id('?')) + self.assertFalse(is_valid_id('^')) + self.assertFalse(is_valid_id('\\')) + self.assertFalse(is_valid_id('"')) + self.assertFalse(is_valid_id('"a string"')) + + def test_eat_identifier_various_lengths(self): + eat_id = HyperParser._eat_identifier + + for length in range(1, 21): + self.assertEqual(eat_id('a' * length, 0, length), length) + self.assertEqual(eat_id('é' * length, 0, length), length) + self.assertEqual(eat_id('a' + '2' * (length - 1), 0, length), length) + self.assertEqual(eat_id('é' + '2' * (length - 1), 0, length), length) + self.assertEqual(eat_id('é' + 'a' * (length - 1), 0, length), length) + self.assertEqual(eat_id('é' * (length - 1) + 'a', 0, length), length) + self.assertEqual(eat_id('+' * length, 0, length), 0) + self.assertEqual(eat_id('2' + 'a' * (length - 1), 0, length), 0) + self.assertEqual(eat_id('2' + 'é' * (length - 1), 0, length), 0) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_iomenu.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_iomenu.py new file mode 100644 index 0000000000000000000000000000000000000000..e0642cf0cabef0470424d9e04cfc4aa68c4adb26 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_iomenu.py @@ -0,0 +1,84 @@ +"Test , coverage 17%." + +from idlelib import iomenu +import unittest +from test.support import requires +from tkinter import Tk +from idlelib.editor import EditorWindow +from idlelib import util +from idlelib.idle_test.mock_idle import Func + +# Fail if either tokenize.open and t.detect_encoding does not exist. +# These are used in loadfile and encode. +# Also used in pyshell.MI.execfile and runscript.tabnanny. +from tokenize import open, detect_encoding +# Remove when we have proper tests that use both. + + +class IOBindingTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.editwin = EditorWindow(root=cls.root) + cls.io = iomenu.IOBinding(cls.editwin) + + @classmethod + def tearDownClass(cls): + cls.io.close() + cls.editwin._close() + del cls.editwin + cls.root.update_idletasks() + for id in cls.root.tk.call('after', 'info'): + cls.root.after_cancel(id) # Need for EditorWindow. + cls.root.destroy() + del cls.root + + def test_init(self): + self.assertIs(self.io.editwin, self.editwin) + + def test_fixnewlines_end(self): + eq = self.assertEqual + io = self.io + fix = io.fixnewlines + text = io.editwin.text + + # Make the editor temporarily look like Shell. + self.editwin.interp = None + shelltext = '>>> if 1' + self.editwin.get_prompt_text = Func(result=shelltext) + eq(fix(), shelltext) # Get... call and '\n' not added. + del self.editwin.interp, self.editwin.get_prompt_text + + text.insert(1.0, 'a') + eq(fix(), 'a'+io.eol_convention) + eq(text.get('1.0', 'end-1c'), 'a\n') + eq(fix(), 'a'+io.eol_convention) + + +def _extension_in_filetypes(extension): + return any( + f'*{extension}' in filetype_tuple[1] + for filetype_tuple in iomenu.IOBinding.filetypes + ) + + +class FiletypesTest(unittest.TestCase): + def test_python_source_files(self): + for extension in util.py_extensions: + with self.subTest(extension=extension): + self.assertTrue( + _extension_in_filetypes(extension) + ) + + def test_text_files(self): + self.assertTrue(_extension_in_filetypes('.txt')) + + def test_all_files(self): + self.assertTrue(_extension_in_filetypes('')) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_macosx.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_macosx.py new file mode 100644 index 0000000000000000000000000000000000000000..86da8849e5ca00f55affd806b4b89e74f55fdcb5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_macosx.py @@ -0,0 +1,113 @@ +"Test macosx, coverage 45% on Windows." + +from idlelib import macosx +import unittest +from test.support import requires +import tkinter as tk +import unittest.mock as mock +from idlelib.filelist import FileList + +mactypes = {'carbon', 'cocoa', 'xquartz'} +nontypes = {'other'} +alltypes = mactypes | nontypes + + +def setUpModule(): + global orig_tktype + orig_tktype = macosx._tk_type + + +def tearDownModule(): + macosx._tk_type = orig_tktype + + +class InitTktypeTest(unittest.TestCase): + "Test _init_tk_type." + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = tk.Tk() + cls.root.withdraw() + cls.orig_platform = macosx.platform + + @classmethod + def tearDownClass(cls): + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + macosx.platform = cls.orig_platform + + def test_init_sets_tktype(self): + "Test that _init_tk_type sets _tk_type according to platform." + for platform, types in ('darwin', alltypes), ('other', nontypes): + with self.subTest(platform=platform): + macosx.platform = platform + macosx._tk_type = None + macosx._init_tk_type() + self.assertIn(macosx._tk_type, types) + + +class IsTypeTkTest(unittest.TestCase): + "Test each of the four isTypeTk predecates." + isfuncs = ((macosx.isAquaTk, ('carbon', 'cocoa')), + (macosx.isCarbonTk, ('carbon')), + (macosx.isCocoaTk, ('cocoa')), + (macosx.isXQuartz, ('xquartz')), + ) + + @mock.patch('idlelib.macosx._init_tk_type') + def test_is_calls_init(self, mockinit): + "Test that each isTypeTk calls _init_tk_type when _tk_type is None." + macosx._tk_type = None + for func, whentrue in self.isfuncs: + with self.subTest(func=func): + func() + self.assertTrue(mockinit.called) + mockinit.reset_mock() + + def test_isfuncs(self): + "Test that each isTypeTk return correct bool." + for func, whentrue in self.isfuncs: + for tktype in alltypes: + with self.subTest(func=func, whentrue=whentrue, tktype=tktype): + macosx._tk_type = tktype + (self.assertTrue if tktype in whentrue else self.assertFalse)\ + (func()) + + +class SetupTest(unittest.TestCase): + "Test setupApp." + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = tk.Tk() + cls.root.withdraw() + def cmd(tkpath, func): + assert isinstance(tkpath, str) + assert isinstance(func, type(cmd)) + cls.root.createcommand = cmd + + @classmethod + def tearDownClass(cls): + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + @mock.patch('idlelib.macosx.overrideRootMenu') #27312 + def test_setupapp(self, overrideRootMenu): + "Call setupApp with each possible graphics type." + root = self.root + flist = FileList(root) + for tktype in alltypes: + with self.subTest(tktype=tktype): + macosx._tk_type = tktype + macosx.setupApp(root, flist) + if tktype in ('carbon', 'cocoa'): + self.assertTrue(overrideRootMenu.called) + overrideRootMenu.reset_mock() + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_mainmenu.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_mainmenu.py new file mode 100644 index 0000000000000000000000000000000000000000..51d2accfe48a1c738b73509563d21bc59e5d3a12 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_mainmenu.py @@ -0,0 +1,42 @@ +"Test mainmenu, coverage 100%." +# Reported as 88%; mocking turtledemo absence would have no point. + +from idlelib import mainmenu +import re +import unittest + + +class MainMenuTest(unittest.TestCase): + + def test_menudefs(self): + actual = [item[0] for item in mainmenu.menudefs] + expect = ['file', 'edit', 'format', 'run', 'shell', + 'debug', 'options', 'window', 'help'] + self.assertEqual(actual, expect) + + def test_default_keydefs(self): + self.assertGreaterEqual(len(mainmenu.default_keydefs), 50) + + def test_tcl_indexes(self): + # Test tcl patterns used to find menuitem to alter. + # On failure, change pattern here and in function(s). + # Patterns here have '.*' for re instead of '*' for tcl. + for menu, pattern in ( + ('debug', '.*tack.*iewer'), # PyShell.debug_menu_postcommand + ('options', '.*ode.*ontext'), # EW.__init__, CodeContext.toggle... + ('options', '.*ine.*umbers'), # EW.__init__, EW.toggle...event. + ): + with self.subTest(menu=menu, pattern=pattern): + for menutup in mainmenu.menudefs: + if menutup[0] == menu: + break + else: + self.assertTrue(0, f"{menu} not in menudefs") + self.assertTrue(any(re.search(pattern, menuitem[0]) + for menuitem in menutup[1] + if menuitem is not None), # Separator. + f"{pattern} not in {menu}") + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_multicall.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_multicall.py new file mode 100644 index 0000000000000000000000000000000000000000..b3a3bfb88f9c31fa025d112803991212261e2508 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_multicall.py @@ -0,0 +1,48 @@ +"Test multicall, coverage 33%." + +from idlelib import multicall +import unittest +from test.support import requires +from tkinter import Tk, Text + + +class MultiCallTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.mc = multicall.MultiCallCreator(Text) + + @classmethod + def tearDownClass(cls): + del cls.mc + cls.root.update_idletasks() +## for id in cls.root.tk.call('after', 'info'): +## cls.root.after_cancel(id) # Need for EditorWindow. + cls.root.destroy() + del cls.root + + def test_creator(self): + mc = self.mc + self.assertIs(multicall._multicall_dict[Text], mc) + self.assertTrue(issubclass(mc, Text)) + mc2 = multicall.MultiCallCreator(Text) + self.assertIs(mc, mc2) + + def test_init(self): + mctext = self.mc(self.root) + self.assertIsInstance(mctext._MultiCall__binders, list) + + def test_yview(self): + # Added for tree.wheel_event + # (it depends on yview to not be overridden) + mc = self.mc + self.assertIs(mc.yview, Text.yview) + mctext = self.mc(self.root) + self.assertIs(mctext.yview.__func__, Text.yview) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_outwin.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_outwin.py new file mode 100644 index 0000000000000000000000000000000000000000..d6e85ad674417c13bed1e95adf32ac83521382ee --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_outwin.py @@ -0,0 +1,166 @@ +"Test outwin, coverage 76%." + +from idlelib import outwin +import unittest +from test.support import requires +from tkinter import Tk, Text +from idlelib.idle_test.mock_tk import Mbox_func +from idlelib.idle_test.mock_idle import Func +from unittest import mock + + +class OutputWindowTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + root = cls.root = Tk() + root.withdraw() + w = cls.window = outwin.OutputWindow(None, None, None, root) + cls.text = w.text = Text(root) + + @classmethod + def tearDownClass(cls): + cls.window.close() + del cls.text, cls.window + cls.root.destroy() + del cls.root + + def setUp(self): + self.text.delete('1.0', 'end') + + def test_ispythonsource(self): + # OutputWindow overrides ispythonsource to always return False. + w = self.window + self.assertFalse(w.ispythonsource('test.txt')) + self.assertFalse(w.ispythonsource(__file__)) + + def test_window_title(self): + self.assertEqual(self.window.top.title(), 'Output') + + def test_maybesave(self): + w = self.window + eq = self.assertEqual + w.get_saved = Func() + + w.get_saved.result = False + eq(w.maybesave(), 'no') + eq(w.get_saved.called, 1) + + w.get_saved.result = True + eq(w.maybesave(), 'yes') + eq(w.get_saved.called, 2) + del w.get_saved + + def test_write(self): + eq = self.assertEqual + delete = self.text.delete + get = self.text.get + write = self.window.write + + # No new line - insert stays on same line. + delete('1.0', 'end') + test_text = 'test text' + eq(write(test_text), len(test_text)) + eq(get('1.0', '1.end'), 'test text') + eq(get('insert linestart', 'insert lineend'), 'test text') + + # New line - insert moves to next line. + delete('1.0', 'end') + test_text = 'test text\n' + eq(write(test_text), len(test_text)) + eq(get('1.0', '1.end'), 'test text') + eq(get('insert linestart', 'insert lineend'), '') + + # Text after new line is tagged for second line of Text widget. + delete('1.0', 'end') + test_text = 'test text\nLine 2' + eq(write(test_text), len(test_text)) + eq(get('1.0', '1.end'), 'test text') + eq(get('2.0', '2.end'), 'Line 2') + eq(get('insert linestart', 'insert lineend'), 'Line 2') + + # Test tags. + delete('1.0', 'end') + test_text = 'test text\n' + test_text2 = 'Line 2\n' + eq(write(test_text, tags='mytag'), len(test_text)) + eq(write(test_text2, tags='secondtag'), len(test_text2)) + eq(get('mytag.first', 'mytag.last'), test_text) + eq(get('secondtag.first', 'secondtag.last'), test_text2) + eq(get('1.0', '1.end'), test_text.rstrip('\n')) + eq(get('2.0', '2.end'), test_text2.rstrip('\n')) + + def test_writelines(self): + eq = self.assertEqual + get = self.text.get + writelines = self.window.writelines + + writelines(('Line 1\n', 'Line 2\n', 'Line 3\n')) + eq(get('1.0', '1.end'), 'Line 1') + eq(get('2.0', '2.end'), 'Line 2') + eq(get('3.0', '3.end'), 'Line 3') + eq(get('insert linestart', 'insert lineend'), '') + + def test_goto_file_line(self): + eq = self.assertEqual + w = self.window + text = self.text + + w.flist = mock.Mock() + gfl = w.flist.gotofileline = Func() + showerror = w.showerror = Mbox_func() + + # No file/line number. + w.write('Not a file line') + self.assertIsNone(w.goto_file_line()) + eq(gfl.called, 0) + eq(showerror.title, 'No special line') + + # Current file/line number. + w.write(f'{str(__file__)}: 42: spam\n') + w.write(f'{str(__file__)}: 21: spam') + self.assertIsNone(w.goto_file_line()) + eq(gfl.args, (str(__file__), 21)) + + # Previous line has file/line number. + text.delete('1.0', 'end') + w.write(f'{str(__file__)}: 42: spam\n') + w.write('Not a file line') + self.assertIsNone(w.goto_file_line()) + eq(gfl.args, (str(__file__), 42)) + + del w.flist.gotofileline, w.showerror + + +class ModuleFunctionTest(unittest.TestCase): + + @classmethod + def setUp(cls): + outwin.file_line_progs = None + + def test_compile_progs(self): + outwin.compile_progs() + for pat, regex in zip(outwin.file_line_pats, outwin.file_line_progs): + self.assertEqual(regex.pattern, pat) + + @mock.patch('builtins.open') + def test_file_line_helper(self, mock_open): + flh = outwin.file_line_helper + test_lines = ( + (r'foo file "testfile1", line 42, bar', ('testfile1', 42)), + (r'foo testfile2(21) bar', ('testfile2', 21)), + (r' testfile3 : 42: foo bar\n', (' testfile3 ', 42)), + (r'foo testfile4.py :1: ', ('foo testfile4.py ', 1)), + ('testfile5: \u19D4\u19D2: ', ('testfile5', 42)), + (r'testfile6: 42', None), # only one `:` + (r'testfile7 42 text', None) # no separators + ) + for line, expected_output in test_lines: + self.assertEqual(flh(line), expected_output) + if expected_output: + mock_open.assert_called_with(expected_output[0]) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_parenmatch.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_parenmatch.py new file mode 100644 index 0000000000000000000000000000000000000000..2e10d7cd36760ff66f33c4b22ab62e5ac3f7d46c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_parenmatch.py @@ -0,0 +1,112 @@ +"""Test parenmatch, coverage 91%. + +This must currently be a gui test because ParenMatch methods use +several text methods not defined on idlelib.idle_test.mock_tk.Text. +""" +from idlelib.parenmatch import ParenMatch +from test.support import requires +requires('gui') + +import unittest +from unittest.mock import Mock +from tkinter import Tk, Text + + +class DummyEditwin: + def __init__(self, text): + self.text = text + self.indentwidth = 8 + self.tabwidth = 8 + self.prompt_last_line = '>>>' # Currently not used by parenmatch. + + +class ParenMatchTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + cls.root = Tk() + cls.root.withdraw() + cls.text = Text(cls.root) + cls.editwin = DummyEditwin(cls.text) + cls.editwin.text_frame = Mock() + + @classmethod + def tearDownClass(cls): + del cls.text, cls.editwin + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def tearDown(self): + self.text.delete('1.0', 'end') + + def get_parenmatch(self): + pm = ParenMatch(self.editwin) + pm.bell = lambda: None + return pm + + def test_paren_styles(self): + """ + Test ParenMatch with each style. + """ + text = self.text + pm = self.get_parenmatch() + for style, range1, range2 in ( + ('opener', ('1.10', '1.11'), ('1.10', '1.11')), + ('default',('1.10', '1.11'),('1.10', '1.11')), + ('parens', ('1.14', '1.15'), ('1.15', '1.16')), + ('expression', ('1.10', '1.15'), ('1.10', '1.16'))): + with self.subTest(style=style): + text.delete('1.0', 'end') + pm.STYLE = style + text.insert('insert', 'def foobar(a, b') + + pm.flash_paren_event('event') + self.assertIn('<>', text.event_info()) + if style == 'parens': + self.assertTupleEqual(text.tag_nextrange('paren', '1.0'), + ('1.10', '1.11')) + self.assertTupleEqual( + text.tag_prevrange('paren', 'end'), range1) + + text.insert('insert', ')') + pm.restore_event() + self.assertNotIn('<>', + text.event_info()) + self.assertEqual(text.tag_prevrange('paren', 'end'), ()) + + pm.paren_closed_event('event') + self.assertTupleEqual( + text.tag_prevrange('paren', 'end'), range2) + + def test_paren_corner(self): + """ + Test corner cases in flash_paren_event and paren_closed_event. + + Force execution of conditional expressions and alternate paths. + """ + text = self.text + pm = self.get_parenmatch() + + text.insert('insert', '# Comment.)') + pm.paren_closed_event('event') + + text.insert('insert', '\ndef') + pm.flash_paren_event('event') + pm.paren_closed_event('event') + + text.insert('insert', ' a, *arg)') + pm.paren_closed_event('event') + + def test_handle_restore_timer(self): + pm = self.get_parenmatch() + pm.restore_event = Mock() + pm.handle_restore_timer(0) + self.assertTrue(pm.restore_event.called) + pm.restore_event.reset_mock() + pm.handle_restore_timer(1) + self.assertFalse(pm.restore_event.called) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_pathbrowser.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_pathbrowser.py new file mode 100644 index 0000000000000000000000000000000000000000..13d8b9e1ba9572afeefc20b2bf0f6b7bf3a50716 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_pathbrowser.py @@ -0,0 +1,86 @@ +"Test pathbrowser, coverage 95%." + +from idlelib import pathbrowser +import unittest +from test.support import requires +from tkinter import Tk + +import os.path +import pyclbr # for _modules +import sys # for sys.path + +from idlelib.idle_test.mock_idle import Func +import idlelib # for __file__ +from idlelib import browser +from idlelib.tree import TreeNode + + +class PathBrowserTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.pb = pathbrowser.PathBrowser(cls.root, _utest=True) + + @classmethod + def tearDownClass(cls): + cls.pb.close() + cls.root.update_idletasks() + cls.root.destroy() + del cls.root, cls.pb + + def test_init(self): + pb = self.pb + eq = self.assertEqual + eq(pb.master, self.root) + eq(pyclbr._modules, {}) + self.assertIsInstance(pb.node, TreeNode) + self.assertIsNotNone(browser.file_open) + + def test_settitle(self): + pb = self.pb + self.assertEqual(pb.top.title(), 'Path Browser') + self.assertEqual(pb.top.iconname(), 'Path Browser') + + def test_rootnode(self): + pb = self.pb + rn = pb.rootnode() + self.assertIsInstance(rn, pathbrowser.PathBrowserTreeItem) + + def test_close(self): + pb = self.pb + pb.top.destroy = Func() + pb.node.destroy = Func() + pb.close() + self.assertTrue(pb.top.destroy.called) + self.assertTrue(pb.node.destroy.called) + del pb.top.destroy, pb.node.destroy + + +class DirBrowserTreeItemTest(unittest.TestCase): + + def test_DirBrowserTreeItem(self): + # Issue16226 - make sure that getting a sublist works + d = pathbrowser.DirBrowserTreeItem('') + d.GetSubList() + self.assertEqual('', d.GetText()) + + dir = os.path.split(os.path.abspath(idlelib.__file__))[0] + self.assertEqual(d.ispackagedir(dir), True) + self.assertEqual(d.ispackagedir(dir + '/Icons'), False) + + +class PathBrowserTreeItemTest(unittest.TestCase): + + def test_PathBrowserTreeItem(self): + p = pathbrowser.PathBrowserTreeItem() + self.assertEqual(p.GetText(), 'sys.path') + sub = p.GetSubList() + self.assertEqual(len(sub), len(sys.path)) + self.assertEqual(type(sub[0]), pathbrowser.DirBrowserTreeItem) + + +if __name__ == '__main__': + unittest.main(verbosity=2, exit=False) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_percolator.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_percolator.py new file mode 100644 index 0000000000000000000000000000000000000000..17668ccd1227b7834cdf374287c812f23f048337 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_percolator.py @@ -0,0 +1,118 @@ +"Test percolator, coverage 100%." + +from idlelib.percolator import Percolator, Delegator +import unittest +from test.support import requires +requires('gui') +from tkinter import Text, Tk, END + + +class MyFilter(Delegator): + def __init__(self): + Delegator.__init__(self, None) + + def insert(self, *args): + self.insert_called_with = args + self.delegate.insert(*args) + + def delete(self, *args): + self.delete_called_with = args + self.delegate.delete(*args) + + def uppercase_insert(self, index, chars, tags=None): + chars = chars.upper() + self.delegate.insert(index, chars) + + def lowercase_insert(self, index, chars, tags=None): + chars = chars.lower() + self.delegate.insert(index, chars) + + def dont_insert(self, index, chars, tags=None): + pass + + +class PercolatorTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + cls.root = Tk() + cls.text = Text(cls.root) + + @classmethod + def tearDownClass(cls): + del cls.text + cls.root.destroy() + del cls.root + + def setUp(self): + self.percolator = Percolator(self.text) + self.filter_one = MyFilter() + self.filter_two = MyFilter() + self.percolator.insertfilter(self.filter_one) + self.percolator.insertfilter(self.filter_two) + + def tearDown(self): + self.percolator.close() + self.text.delete('1.0', END) + + def test_insertfilter(self): + self.assertIsNotNone(self.filter_one.delegate) + self.assertEqual(self.percolator.top, self.filter_two) + self.assertEqual(self.filter_two.delegate, self.filter_one) + self.assertEqual(self.filter_one.delegate, self.percolator.bottom) + + def test_removefilter(self): + filter_three = MyFilter() + self.percolator.removefilter(self.filter_two) + self.assertEqual(self.percolator.top, self.filter_one) + self.assertIsNone(self.filter_two.delegate) + + filter_three = MyFilter() + self.percolator.insertfilter(self.filter_two) + self.percolator.insertfilter(filter_three) + self.percolator.removefilter(self.filter_one) + self.assertEqual(self.percolator.top, filter_three) + self.assertEqual(filter_three.delegate, self.filter_two) + self.assertEqual(self.filter_two.delegate, self.percolator.bottom) + self.assertIsNone(self.filter_one.delegate) + + def test_insert(self): + self.text.insert('insert', 'foo') + self.assertEqual(self.text.get('1.0', END), 'foo\n') + self.assertTupleEqual(self.filter_one.insert_called_with, + ('insert', 'foo', None)) + + def test_modify_insert(self): + self.filter_one.insert = self.filter_one.uppercase_insert + self.text.insert('insert', 'bAr') + self.assertEqual(self.text.get('1.0', END), 'BAR\n') + + def test_modify_chain_insert(self): + filter_three = MyFilter() + self.percolator.insertfilter(filter_three) + self.filter_two.insert = self.filter_two.uppercase_insert + self.filter_one.insert = self.filter_one.lowercase_insert + self.text.insert('insert', 'BaR') + self.assertEqual(self.text.get('1.0', END), 'bar\n') + + def test_dont_insert(self): + self.filter_one.insert = self.filter_one.dont_insert + self.text.insert('insert', 'foo bar') + self.assertEqual(self.text.get('1.0', END), '\n') + self.filter_one.insert = self.filter_one.dont_insert + self.text.insert('insert', 'foo bar') + self.assertEqual(self.text.get('1.0', END), '\n') + + def test_without_filter(self): + self.text.insert('insert', 'hello') + self.assertEqual(self.text.get('1.0', 'end'), 'hello\n') + + def test_delete(self): + self.text.insert('insert', 'foo') + self.text.delete('1.0', '1.2') + self.assertEqual(self.text.get('1.0', END), 'o\n') + self.assertTupleEqual(self.filter_one.delete_called_with, + ('1.0', '1.2')) + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_pyparse.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_pyparse.py new file mode 100644 index 0000000000000000000000000000000000000000..384db566ac76cdb44fb3c2998a989e848d56cd6c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_pyparse.py @@ -0,0 +1,483 @@ +"Test pyparse, coverage 96%." + +from idlelib import pyparse +import unittest +from collections import namedtuple + + +class ParseMapTest(unittest.TestCase): + + def test_parsemap(self): + keepwhite = {ord(c): ord(c) for c in ' \t\n\r'} + mapping = pyparse.ParseMap(keepwhite) + self.assertEqual(mapping[ord('\t')], ord('\t')) + self.assertEqual(mapping[ord('a')], ord('x')) + self.assertEqual(mapping[1000], ord('x')) + + def test_trans(self): + # trans is the production instance of ParseMap, used in _study1 + parser = pyparse.Parser(4, 4) + self.assertEqual('\t a([{b}])b"c\'d\n'.translate(pyparse.trans), + 'xxx(((x)))x"x\'x\n') + + +class PyParseTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + cls.parser = pyparse.Parser(indentwidth=4, tabwidth=4) + + @classmethod + def tearDownClass(cls): + del cls.parser + + def test_init(self): + self.assertEqual(self.parser.indentwidth, 4) + self.assertEqual(self.parser.tabwidth, 4) + + def test_set_code(self): + eq = self.assertEqual + p = self.parser + setcode = p.set_code + + # Not empty and doesn't end with newline. + with self.assertRaises(AssertionError): + setcode('a') + + tests = ('', + 'a\n') + + for string in tests: + with self.subTest(string=string): + setcode(string) + eq(p.code, string) + eq(p.study_level, 0) + + def test_find_good_parse_start(self): + eq = self.assertEqual + p = self.parser + setcode = p.set_code + start = p.find_good_parse_start + def char_in_string_false(index): return False + + # First line starts with 'def' and ends with ':', then 0 is the pos. + setcode('def spam():\n') + eq(start(char_in_string_false), 0) + + # First line begins with a keyword in the list and ends + # with an open brace, then 0 is the pos. This is how + # hyperparser calls this function as the newline is not added + # in the editor, but rather on the call to setcode. + setcode('class spam( ' + ' \n') + eq(start(char_in_string_false), 0) + + # Split def across lines. + setcode('"""This is a module docstring"""\n' + 'class C:\n' + ' def __init__(self, a,\n' + ' b=True):\n' + ' pass\n' + ) + pos0, pos = 33, 42 # Start of 'class...', ' def' lines. + + # Passing no value or non-callable should fail (issue 32989). + with self.assertRaises(TypeError): + start() + with self.assertRaises(TypeError): + start(False) + + # Make text look like a string. This returns pos as the start + # position, but it's set to None. + self.assertIsNone(start(is_char_in_string=lambda index: True)) + + # Make all text look like it's not in a string. This means that it + # found a good start position. + eq(start(char_in_string_false), pos) + + # If the beginning of the def line is not in a string, then it + # returns that as the index. + eq(start(is_char_in_string=lambda index: index > pos), pos) + # If the beginning of the def line is in a string, then it + # looks for a previous index. + eq(start(is_char_in_string=lambda index: index >= pos), pos0) + # If everything before the 'def' is in a string, then returns None. + # The non-continuation def line returns 44 (see below). + eq(start(is_char_in_string=lambda index: index < pos), None) + + # Code without extra line break in def line - mostly returns the same + # values. + setcode('"""This is a module docstring"""\n' + 'class C:\n' + ' def __init__(self, a, b=True):\n' + ' pass\n' + ) # Does not affect class, def positions. + eq(start(char_in_string_false), pos) + eq(start(is_char_in_string=lambda index: index > pos), pos) + eq(start(is_char_in_string=lambda index: index >= pos), pos0) + # When the def line isn't split, this returns which doesn't match the + # split line test. + eq(start(is_char_in_string=lambda index: index < pos), pos) + + def test_set_lo(self): + code = ( + '"""This is a module docstring"""\n' + 'class C:\n' + ' def __init__(self, a,\n' + ' b=True):\n' + ' pass\n' + ) + pos = 42 + p = self.parser + p.set_code(code) + + # Previous character is not a newline. + with self.assertRaises(AssertionError): + p.set_lo(5) + + # A value of 0 doesn't change self.code. + p.set_lo(0) + self.assertEqual(p.code, code) + + # An index that is preceded by a newline. + p.set_lo(pos) + self.assertEqual(p.code, code[pos:]) + + def test_study1(self): + eq = self.assertEqual + p = self.parser + setcode = p.set_code + study = p._study1 + + (NONE, BACKSLASH, FIRST, NEXT, BRACKET) = range(5) + TestInfo = namedtuple('TestInfo', ['string', 'goodlines', + 'continuation']) + tests = ( + TestInfo('', [0], NONE), + # Docstrings. + TestInfo('"""This is a complete docstring."""\n', [0, 1], NONE), + TestInfo("'''This is a complete docstring.'''\n", [0, 1], NONE), + TestInfo('"""This is a continued docstring.\n', [0, 1], FIRST), + TestInfo("'''This is a continued docstring.\n", [0, 1], FIRST), + TestInfo('"""Closing quote does not match."\n', [0, 1], FIRST), + TestInfo('"""Bracket in docstring [\n', [0, 1], FIRST), + TestInfo("'''Incomplete two line docstring.\n\n", [0, 2], NEXT), + # Single-quoted strings. + TestInfo('"This is a complete string."\n', [0, 1], NONE), + TestInfo('"This is an incomplete string.\n', [0, 1], NONE), + TestInfo("'This is more incomplete.\n\n", [0, 1, 2], NONE), + # Comment (backslash does not continue comments). + TestInfo('# Comment\\\n', [0, 1], NONE), + # Brackets. + TestInfo('("""Complete string in bracket"""\n', [0, 1], BRACKET), + TestInfo('("""Open string in bracket\n', [0, 1], FIRST), + TestInfo('a = (1 + 2) - 5 *\\\n', [0, 1], BACKSLASH), # No bracket. + TestInfo('\n def function1(self, a,\n b):\n', + [0, 1, 3], NONE), + TestInfo('\n def function1(self, a,\\\n', [0, 1, 2], BRACKET), + TestInfo('\n def function1(self, a,\n', [0, 1, 2], BRACKET), + TestInfo('())\n', [0, 1], NONE), # Extra closer. + TestInfo(')(\n', [0, 1], BRACKET), # Extra closer. + # For the mismatched example, it doesn't look like continuation. + TestInfo('{)(]\n', [0, 1], NONE), # Mismatched. + ) + + for test in tests: + with self.subTest(string=test.string): + setcode(test.string) # resets study_level + study() + eq(p.study_level, 1) + eq(p.goodlines, test.goodlines) + eq(p.continuation, test.continuation) + + # Called again, just returns without reprocessing. + self.assertIsNone(study()) + + def test_get_continuation_type(self): + eq = self.assertEqual + p = self.parser + setcode = p.set_code + gettype = p.get_continuation_type + + (NONE, BACKSLASH, FIRST, NEXT, BRACKET) = range(5) + TestInfo = namedtuple('TestInfo', ['string', 'continuation']) + tests = ( + TestInfo('', NONE), + TestInfo('"""This is a continuation docstring.\n', FIRST), + TestInfo("'''This is a multiline-continued docstring.\n\n", NEXT), + TestInfo('a = (1 + 2) - 5 *\\\n', BACKSLASH), + TestInfo('\n def function1(self, a,\\\n', BRACKET) + ) + + for test in tests: + with self.subTest(string=test.string): + setcode(test.string) + eq(gettype(), test.continuation) + + def test_study2(self): + eq = self.assertEqual + p = self.parser + setcode = p.set_code + study = p._study2 + + TestInfo = namedtuple('TestInfo', ['string', 'start', 'end', 'lastch', + 'openbracket', 'bracketing']) + tests = ( + TestInfo('', 0, 0, '', None, ((0, 0),)), + TestInfo("'''This is a multiline continuation docstring.\n\n", + 0, 48, "'", None, ((0, 0), (0, 1), (48, 0))), + TestInfo(' # Comment\\\n', + 0, 12, '', None, ((0, 0), (1, 1), (12, 0))), + # A comment without a space is a special case + TestInfo(' #Comment\\\n', + 0, 0, '', None, ((0, 0),)), + # Backslash continuation. + TestInfo('a = (1 + 2) - 5 *\\\n', + 0, 19, '*', None, ((0, 0), (4, 1), (11, 0))), + # Bracket continuation with close. + TestInfo('\n def function1(self, a,\n b):\n', + 1, 48, ':', None, ((1, 0), (17, 1), (46, 0))), + # Bracket continuation with unneeded backslash. + TestInfo('\n def function1(self, a,\\\n', + 1, 28, ',', 17, ((1, 0), (17, 1))), + # Bracket continuation. + TestInfo('\n def function1(self, a,\n', + 1, 27, ',', 17, ((1, 0), (17, 1))), + # Bracket continuation with comment at end of line with text. + TestInfo('\n def function1(self, a, # End of line comment.\n', + 1, 51, ',', 17, ((1, 0), (17, 1), (28, 2), (51, 1))), + # Multi-line statement with comment line in between code lines. + TestInfo(' a = ["first item",\n # Comment line\n "next item",\n', + 0, 55, ',', 6, ((0, 0), (6, 1), (7, 2), (19, 1), + (23, 2), (38, 1), (42, 2), (53, 1))), + TestInfo('())\n', + 0, 4, ')', None, ((0, 0), (0, 1), (2, 0), (3, 0))), + TestInfo(')(\n', 0, 3, '(', 1, ((0, 0), (1, 0), (1, 1))), + # Wrong closers still decrement stack level. + TestInfo('{)(]\n', + 0, 5, ']', None, ((0, 0), (0, 1), (2, 0), (2, 1), (4, 0))), + # Character after backslash. + TestInfo(':\\a\n', 0, 4, '\\a', None, ((0, 0),)), + TestInfo('\n', 0, 0, '', None, ((0, 0),)), + ) + + for test in tests: + with self.subTest(string=test.string): + setcode(test.string) + study() + eq(p.study_level, 2) + eq(p.stmt_start, test.start) + eq(p.stmt_end, test.end) + eq(p.lastch, test.lastch) + eq(p.lastopenbracketpos, test.openbracket) + eq(p.stmt_bracketing, test.bracketing) + + # Called again, just returns without reprocessing. + self.assertIsNone(study()) + + def test_get_num_lines_in_stmt(self): + eq = self.assertEqual + p = self.parser + setcode = p.set_code + getlines = p.get_num_lines_in_stmt + + TestInfo = namedtuple('TestInfo', ['string', 'lines']) + tests = ( + TestInfo('[x for x in a]\n', 1), # Closed on one line. + TestInfo('[x\nfor x in a\n', 2), # Not closed. + TestInfo('[x\\\nfor x in a\\\n', 2), # "", unneeded backslashes. + TestInfo('[x\nfor x in a\n]\n', 3), # Closed on multi-line. + TestInfo('\n"""Docstring comment L1"""\nL2\nL3\nL4\n', 1), + TestInfo('\n"""Docstring comment L1\nL2"""\nL3\nL4\n', 1), + TestInfo('\n"""Docstring comment L1\\\nL2\\\nL3\\\nL4\\\n', 4), + TestInfo('\n\n"""Docstring comment L1\\\nL2\\\nL3\\\nL4\\\n"""\n', 5) + ) + + # Blank string doesn't have enough elements in goodlines. + setcode('') + with self.assertRaises(IndexError): + getlines() + + for test in tests: + with self.subTest(string=test.string): + setcode(test.string) + eq(getlines(), test.lines) + + def test_compute_bracket_indent(self): + eq = self.assertEqual + p = self.parser + setcode = p.set_code + indent = p.compute_bracket_indent + + TestInfo = namedtuple('TestInfo', ['string', 'spaces']) + tests = ( + TestInfo('def function1(self, a,\n', 14), + # Characters after bracket. + TestInfo('\n def function1(self, a,\n', 18), + TestInfo('\n\tdef function1(self, a,\n', 18), + # No characters after bracket. + TestInfo('\n def function1(\n', 8), + TestInfo('\n\tdef function1(\n', 8), + TestInfo('\n def function1( \n', 8), # Ignore extra spaces. + TestInfo('[\n"first item",\n # Comment line\n "next item",\n', 0), + TestInfo('[\n "first item",\n # Comment line\n "next item",\n', 2), + TestInfo('["first item",\n # Comment line\n "next item",\n', 1), + TestInfo('(\n', 4), + TestInfo('(a\n', 1), + ) + + # Must be C_BRACKET continuation type. + setcode('def function1(self, a, b):\n') + with self.assertRaises(AssertionError): + indent() + + for test in tests: + setcode(test.string) + eq(indent(), test.spaces) + + def test_compute_backslash_indent(self): + eq = self.assertEqual + p = self.parser + setcode = p.set_code + indent = p.compute_backslash_indent + + # Must be C_BACKSLASH continuation type. + errors = (('def function1(self, a, b\\\n'), # Bracket. + (' """ (\\\n'), # Docstring. + ('a = #\\\n'), # Inline comment. + ) + for string in errors: + with self.subTest(string=string): + setcode(string) + with self.assertRaises(AssertionError): + indent() + + TestInfo = namedtuple('TestInfo', ('string', 'spaces')) + tests = (TestInfo('a = (1 + 2) - 5 *\\\n', 4), + TestInfo('a = 1 + 2 - 5 *\\\n', 4), + TestInfo(' a = 1 + 2 - 5 *\\\n', 8), + TestInfo(' a = "spam"\\\n', 6), + TestInfo(' a = \\\n"a"\\\n', 4), + TestInfo(' a = #\\\n"a"\\\n', 5), + TestInfo('a == \\\n', 2), + TestInfo('a != \\\n', 2), + # Difference between containing = and those not. + TestInfo('\\\n', 2), + TestInfo(' \\\n', 6), + TestInfo('\t\\\n', 6), + TestInfo('a\\\n', 3), + TestInfo('{}\\\n', 4), + TestInfo('(1 + 2) - 5 *\\\n', 3), + ) + for test in tests: + with self.subTest(string=test.string): + setcode(test.string) + eq(indent(), test.spaces) + + def test_get_base_indent_string(self): + eq = self.assertEqual + p = self.parser + setcode = p.set_code + baseindent = p.get_base_indent_string + + TestInfo = namedtuple('TestInfo', ['string', 'indent']) + tests = (TestInfo('', ''), + TestInfo('def a():\n', ''), + TestInfo('\tdef a():\n', '\t'), + TestInfo(' def a():\n', ' '), + TestInfo(' def a(\n', ' '), + TestInfo('\t\n def a(\n', ' '), + TestInfo('\t\n # Comment.\n', ' '), + ) + + for test in tests: + with self.subTest(string=test.string): + setcode(test.string) + eq(baseindent(), test.indent) + + def test_is_block_opener(self): + yes = self.assertTrue + no = self.assertFalse + p = self.parser + setcode = p.set_code + opener = p.is_block_opener + + TestInfo = namedtuple('TestInfo', ['string', 'assert_']) + tests = ( + TestInfo('def a():\n', yes), + TestInfo('\n def function1(self, a,\n b):\n', yes), + TestInfo(':\n', yes), + TestInfo('a:\n', yes), + TestInfo('):\n', yes), + TestInfo('(:\n', yes), + TestInfo('":\n', no), + TestInfo('\n def function1(self, a,\n', no), + TestInfo('def function1(self, a):\n pass\n', no), + TestInfo('# A comment:\n', no), + TestInfo('"""A docstring:\n', no), + TestInfo('"""A docstring:\n', no), + ) + + for test in tests: + with self.subTest(string=test.string): + setcode(test.string) + test.assert_(opener()) + + def test_is_block_closer(self): + yes = self.assertTrue + no = self.assertFalse + p = self.parser + setcode = p.set_code + closer = p.is_block_closer + + TestInfo = namedtuple('TestInfo', ['string', 'assert_']) + tests = ( + TestInfo('return\n', yes), + TestInfo('\tbreak\n', yes), + TestInfo(' continue\n', yes), + TestInfo(' raise\n', yes), + TestInfo('pass \n', yes), + TestInfo('pass\t\n', yes), + TestInfo('return #\n', yes), + TestInfo('raised\n', no), + TestInfo('returning\n', no), + TestInfo('# return\n', no), + TestInfo('"""break\n', no), + TestInfo('"continue\n', no), + TestInfo('def function1(self, a):\n pass\n', yes), + ) + + for test in tests: + with self.subTest(string=test.string): + setcode(test.string) + test.assert_(closer()) + + def test_get_last_stmt_bracketing(self): + eq = self.assertEqual + p = self.parser + setcode = p.set_code + bracketing = p.get_last_stmt_bracketing + + TestInfo = namedtuple('TestInfo', ['string', 'bracket']) + tests = ( + TestInfo('', ((0, 0),)), + TestInfo('a\n', ((0, 0),)), + TestInfo('()()\n', ((0, 0), (0, 1), (2, 0), (2, 1), (4, 0))), + TestInfo('(\n)()\n', ((0, 0), (0, 1), (3, 0), (3, 1), (5, 0))), + TestInfo('()\n()\n', ((3, 0), (3, 1), (5, 0))), + TestInfo('()(\n)\n', ((0, 0), (0, 1), (2, 0), (2, 1), (5, 0))), + TestInfo('(())\n', ((0, 0), (0, 1), (1, 2), (3, 1), (4, 0))), + TestInfo('(\n())\n', ((0, 0), (0, 1), (2, 2), (4, 1), (5, 0))), + # Same as matched test. + TestInfo('{)(]\n', ((0, 0), (0, 1), (2, 0), (2, 1), (4, 0))), + TestInfo('(((())\n', + ((0, 0), (0, 1), (1, 2), (2, 3), (3, 4), (5, 3), (6, 2))), + ) + + for test in tests: + with self.subTest(string=test.string): + setcode(test.string) + eq(bracketing(), test.bracket) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_pyshell.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_pyshell.py new file mode 100644 index 0000000000000000000000000000000000000000..706703965bffd6f74d3b5916b4c21be8c897426b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_pyshell.py @@ -0,0 +1,148 @@ +"Test pyshell, coverage 12%." +# Plus coverage of test_warning. Was 20% with test_openshell. + +from idlelib import pyshell +import unittest +from test.support import requires +from tkinter import Tk + + +class FunctionTest(unittest.TestCase): + # Test stand-alone module level non-gui functions. + + def test_restart_line_wide(self): + eq = self.assertEqual + for file, mul, extra in (('', 22, ''), ('finame', 21, '=')): + width = 60 + bar = mul * '=' + with self.subTest(file=file, bar=bar): + file = file or 'Shell' + line = pyshell.restart_line(width, file) + eq(len(line), width) + eq(line, f"{bar+extra} RESTART: {file} {bar}") + + def test_restart_line_narrow(self): + expect, taglen = "= RESTART: Shell", 16 + for width in (taglen-1, taglen, taglen+1): + with self.subTest(width=width): + self.assertEqual(pyshell.restart_line(width, ''), expect) + self.assertEqual(pyshell.restart_line(taglen+2, ''), expect+' =') + + +class PyShellFileListTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + + @classmethod + def tearDownClass(cls): + #cls.root.update_idletasks() +## for id in cls.root.tk.call('after', 'info'): +## cls.root.after_cancel(id) # Need for EditorWindow. + cls.root.destroy() + del cls.root + + def test_init(self): + psfl = pyshell.PyShellFileList(self.root) + self.assertEqual(psfl.EditorWindow, pyshell.PyShellEditorWindow) + self.assertIsNone(psfl.pyshell) + +# The following sometimes causes 'invalid command name "109734456recolorize"'. +# Uncommenting after_cancel above prevents this, but results in +# TclError: bad window path name ".!listedtoplevel.!frame.text" +# which is normally prevented by after_cancel. +## def test_openshell(self): +## pyshell.use_subprocess = False +## ps = pyshell.PyShellFileList(self.root).open_shell() +## self.assertIsInstance(ps, pyshell.PyShell) + + +class PyShellRemoveLastNewlineAndSurroundingWhitespaceTest(unittest.TestCase): + regexp = pyshell.PyShell._last_newline_re + + def all_removed(self, text): + self.assertEqual('', self.regexp.sub('', text)) + + def none_removed(self, text): + self.assertEqual(text, self.regexp.sub('', text)) + + def check_result(self, text, expected): + self.assertEqual(expected, self.regexp.sub('', text)) + + def test_empty(self): + self.all_removed('') + + def test_newline(self): + self.all_removed('\n') + + def test_whitespace_no_newline(self): + self.all_removed(' ') + self.all_removed(' ') + self.all_removed(' ') + self.all_removed(' ' * 20) + self.all_removed('\t') + self.all_removed('\t\t') + self.all_removed('\t\t\t') + self.all_removed('\t' * 20) + self.all_removed('\t ') + self.all_removed(' \t') + self.all_removed(' \t \t ') + self.all_removed('\t \t \t') + + def test_newline_with_whitespace(self): + self.all_removed(' \n') + self.all_removed('\t\n') + self.all_removed(' \t\n') + self.all_removed('\t \n') + self.all_removed('\n ') + self.all_removed('\n\t') + self.all_removed('\n \t') + self.all_removed('\n\t ') + self.all_removed(' \n ') + self.all_removed('\t\n ') + self.all_removed(' \n\t') + self.all_removed('\t\n\t') + self.all_removed('\t \t \t\n') + self.all_removed(' \t \t \n') + self.all_removed('\n\t \t \t') + self.all_removed('\n \t \t ') + + def test_multiple_newlines(self): + self.check_result('\n\n', '\n') + self.check_result('\n' * 5, '\n' * 4) + self.check_result('\n' * 5 + '\t', '\n' * 4) + self.check_result('\n' * 20, '\n' * 19) + self.check_result('\n' * 20 + ' ', '\n' * 19) + self.check_result(' \n \n ', ' \n') + self.check_result(' \n\n ', ' \n') + self.check_result(' \n\n', ' \n') + self.check_result('\t\n\n', '\t\n') + self.check_result('\n\n ', '\n') + self.check_result('\n\n\t', '\n') + self.check_result(' \n \n ', ' \n') + self.check_result('\t\n\t\n\t', '\t\n') + + def test_non_whitespace(self): + self.none_removed('a') + self.check_result('a\n', 'a') + self.check_result('a\n ', 'a') + self.check_result('a \n ', 'a') + self.check_result('a \n\t', 'a') + self.none_removed('-') + self.check_result('-\n', '-') + self.none_removed('.') + self.check_result('.\n', '.') + + def test_unsupported_whitespace(self): + self.none_removed('\v') + self.none_removed('\n\v') + self.check_result('\v\n', '\v') + self.none_removed(' \n\v') + self.check_result('\v\n ', '\v') + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_query.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_query.py new file mode 100644 index 0000000000000000000000000000000000000000..bb12b2b08652d54717f314849d28a8bfc8f5c3bb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_query.py @@ -0,0 +1,451 @@ +"""Test query, coverage 93%. + +Non-gui tests for Query, SectionName, ModuleName, and HelpSource use +dummy versions that extract the non-gui methods and add other needed +attributes. GUI tests create an instance of each class and simulate +entries and button clicks. Subclass tests only target the new code in +the subclass definition. + +The appearance of the widgets is checked by the Query and +HelpSource htests. These are run by running query.py. +""" +from idlelib import query +import unittest +from test.support import requires +from tkinter import Tk, END + +import sys +from unittest import mock +from idlelib.idle_test.mock_tk import Var + + +# NON-GUI TESTS + +class QueryTest(unittest.TestCase): + "Test Query base class." + + class Dummy_Query: + # Test the following Query methods. + entry_ok = query.Query.entry_ok + ok = query.Query.ok + cancel = query.Query.cancel + # Add attributes and initialization needed for tests. + def __init__(self, dummy_entry): + self.entry = Var(value=dummy_entry) + self.entry_error = {'text': ''} + self.result = None + self.destroyed = False + def showerror(self, message): + self.entry_error['text'] = message + def destroy(self): + self.destroyed = True + + def test_entry_ok_blank(self): + dialog = self.Dummy_Query(' ') + self.assertEqual(dialog.entry_ok(), None) + self.assertEqual((dialog.result, dialog.destroyed), (None, False)) + self.assertIn('blank line', dialog.entry_error['text']) + + def test_entry_ok_good(self): + dialog = self.Dummy_Query(' good ') + Equal = self.assertEqual + Equal(dialog.entry_ok(), 'good') + Equal((dialog.result, dialog.destroyed), (None, False)) + Equal(dialog.entry_error['text'], '') + + def test_ok_blank(self): + dialog = self.Dummy_Query('') + dialog.entry.focus_set = mock.Mock() + self.assertEqual(dialog.ok(), None) + self.assertTrue(dialog.entry.focus_set.called) + del dialog.entry.focus_set + self.assertEqual((dialog.result, dialog.destroyed), (None, False)) + + def test_ok_good(self): + dialog = self.Dummy_Query('good') + self.assertEqual(dialog.ok(), None) + self.assertEqual((dialog.result, dialog.destroyed), ('good', True)) + + def test_cancel(self): + dialog = self.Dummy_Query('does not matter') + self.assertEqual(dialog.cancel(), None) + self.assertEqual((dialog.result, dialog.destroyed), (None, True)) + + +class SectionNameTest(unittest.TestCase): + "Test SectionName subclass of Query." + + class Dummy_SectionName: + entry_ok = query.SectionName.entry_ok # Function being tested. + used_names = ['used'] + def __init__(self, dummy_entry): + self.entry = Var(value=dummy_entry) + self.entry_error = {'text': ''} + def showerror(self, message): + self.entry_error['text'] = message + + def test_blank_section_name(self): + dialog = self.Dummy_SectionName(' ') + self.assertEqual(dialog.entry_ok(), None) + self.assertIn('no name', dialog.entry_error['text']) + + def test_used_section_name(self): + dialog = self.Dummy_SectionName('used') + self.assertEqual(dialog.entry_ok(), None) + self.assertIn('use', dialog.entry_error['text']) + + def test_long_section_name(self): + dialog = self.Dummy_SectionName('good'*8) + self.assertEqual(dialog.entry_ok(), None) + self.assertIn('longer than 30', dialog.entry_error['text']) + + def test_good_section_name(self): + dialog = self.Dummy_SectionName(' good ') + self.assertEqual(dialog.entry_ok(), 'good') + self.assertEqual(dialog.entry_error['text'], '') + + +class ModuleNameTest(unittest.TestCase): + "Test ModuleName subclass of Query." + + class Dummy_ModuleName: + entry_ok = query.ModuleName.entry_ok # Function being tested. + text0 = '' + def __init__(self, dummy_entry): + self.entry = Var(value=dummy_entry) + self.entry_error = {'text': ''} + def showerror(self, message): + self.entry_error['text'] = message + + def test_blank_module_name(self): + dialog = self.Dummy_ModuleName(' ') + self.assertEqual(dialog.entry_ok(), None) + self.assertIn('no name', dialog.entry_error['text']) + + def test_bogus_module_name(self): + dialog = self.Dummy_ModuleName('__name_xyz123_should_not_exist__') + self.assertEqual(dialog.entry_ok(), None) + self.assertIn('not found', dialog.entry_error['text']) + + def test_c_source_name(self): + dialog = self.Dummy_ModuleName('itertools') + self.assertEqual(dialog.entry_ok(), None) + self.assertIn('source-based', dialog.entry_error['text']) + + def test_good_module_name(self): + dialog = self.Dummy_ModuleName('idlelib') + self.assertTrue(dialog.entry_ok().endswith('__init__.py')) + self.assertEqual(dialog.entry_error['text'], '') + dialog = self.Dummy_ModuleName('idlelib.idle') + self.assertTrue(dialog.entry_ok().endswith('idle.py')) + self.assertEqual(dialog.entry_error['text'], '') + + +class GotoTest(unittest.TestCase): + "Test Goto subclass of Query." + + class Dummy_ModuleName: + entry_ok = query.Goto.entry_ok # Function being tested. + def __init__(self, dummy_entry): + self.entry = Var(value=dummy_entry) + self.entry_error = {'text': ''} + def showerror(self, message): + self.entry_error['text'] = message + + def test_bogus_goto(self): + dialog = self.Dummy_ModuleName('a') + self.assertEqual(dialog.entry_ok(), None) + self.assertIn('not a base 10 integer', dialog.entry_error['text']) + + def test_bad_goto(self): + dialog = self.Dummy_ModuleName('0') + self.assertEqual(dialog.entry_ok(), None) + self.assertIn('not a positive integer', dialog.entry_error['text']) + + def test_good_goto(self): + dialog = self.Dummy_ModuleName('1') + self.assertEqual(dialog.entry_ok(), 1) + self.assertEqual(dialog.entry_error['text'], '') + + +# 3 HelpSource test classes each test one method. + +class HelpsourceBrowsefileTest(unittest.TestCase): + "Test browse_file method of ModuleName subclass of Query." + + class Dummy_HelpSource: + browse_file = query.HelpSource.browse_file + pathvar = Var() + + def test_file_replaces_path(self): + dialog = self.Dummy_HelpSource() + # Path is widget entry, either '' or something. + # Func return is file dialog return, either '' or something. + # Func return should override widget entry. + # We need all 4 combinations to test all (most) code paths. + for path, func, result in ( + ('', lambda a,b,c:'', ''), + ('', lambda a,b,c: __file__, __file__), + ('htest', lambda a,b,c:'', 'htest'), + ('htest', lambda a,b,c: __file__, __file__)): + with self.subTest(): + dialog.pathvar.set(path) + dialog.askfilename = func + dialog.browse_file() + self.assertEqual(dialog.pathvar.get(), result) + + +class HelpsourcePathokTest(unittest.TestCase): + "Test path_ok method of HelpSource subclass of Query." + + class Dummy_HelpSource: + path_ok = query.HelpSource.path_ok + def __init__(self, dummy_path): + self.path = Var(value=dummy_path) + self.path_error = {'text': ''} + def showerror(self, message, widget=None): + self.path_error['text'] = message + + orig_platform = query.platform # Set in test_path_ok_file. + @classmethod + def tearDownClass(cls): + query.platform = cls.orig_platform + + def test_path_ok_blank(self): + dialog = self.Dummy_HelpSource(' ') + self.assertEqual(dialog.path_ok(), None) + self.assertIn('no help file', dialog.path_error['text']) + + def test_path_ok_bad(self): + dialog = self.Dummy_HelpSource(__file__ + 'bad-bad-bad') + self.assertEqual(dialog.path_ok(), None) + self.assertIn('not exist', dialog.path_error['text']) + + def test_path_ok_web(self): + dialog = self.Dummy_HelpSource('') + Equal = self.assertEqual + for url in 'www.py.org', 'http://py.org': + with self.subTest(): + dialog.path.set(url) + self.assertEqual(dialog.path_ok(), url) + self.assertEqual(dialog.path_error['text'], '') + + def test_path_ok_file(self): + dialog = self.Dummy_HelpSource('') + for platform, prefix in ('darwin', 'file://'), ('other', ''): + with self.subTest(): + query.platform = platform + dialog.path.set(__file__) + self.assertEqual(dialog.path_ok(), prefix + __file__) + self.assertEqual(dialog.path_error['text'], '') + + +class HelpsourceEntryokTest(unittest.TestCase): + "Test entry_ok method of HelpSource subclass of Query." + + class Dummy_HelpSource: + entry_ok = query.HelpSource.entry_ok + entry_error = {} + path_error = {} + def item_ok(self): + return self.name + def path_ok(self): + return self.path + + def test_entry_ok_helpsource(self): + dialog = self.Dummy_HelpSource() + for name, path, result in ((None, None, None), + (None, 'doc.txt', None), + ('doc', None, None), + ('doc', 'doc.txt', ('doc', 'doc.txt'))): + with self.subTest(): + dialog.name, dialog.path = name, path + self.assertEqual(dialog.entry_ok(), result) + + +# 2 CustomRun test classes each test one method. + +class CustomRunCLIargsokTest(unittest.TestCase): + "Test cli_ok method of the CustomRun subclass of Query." + + class Dummy_CustomRun: + cli_args_ok = query.CustomRun.cli_args_ok + def __init__(self, dummy_entry): + self.entry = Var(value=dummy_entry) + self.entry_error = {'text': ''} + def showerror(self, message): + self.entry_error['text'] = message + + def test_blank_args(self): + dialog = self.Dummy_CustomRun(' ') + self.assertEqual(dialog.cli_args_ok(), []) + + def test_invalid_args(self): + dialog = self.Dummy_CustomRun("'no-closing-quote") + self.assertEqual(dialog.cli_args_ok(), None) + self.assertIn('No closing', dialog.entry_error['text']) + + def test_good_args(self): + args = ['-n', '10', '--verbose', '-p', '/path', '--name'] + dialog = self.Dummy_CustomRun(' '.join(args) + ' "my name"') + self.assertEqual(dialog.cli_args_ok(), args + ["my name"]) + self.assertEqual(dialog.entry_error['text'], '') + + +class CustomRunEntryokTest(unittest.TestCase): + "Test entry_ok method of the CustomRun subclass of Query." + + class Dummy_CustomRun: + entry_ok = query.CustomRun.entry_ok + entry_error = {} + restartvar = Var() + def cli_args_ok(self): + return self.cli_args + + def test_entry_ok_customrun(self): + dialog = self.Dummy_CustomRun() + for restart in {True, False}: + dialog.restartvar.set(restart) + for cli_args, result in ((None, None), + (['my arg'], (['my arg'], restart))): + with self.subTest(restart=restart, cli_args=cli_args): + dialog.cli_args = cli_args + self.assertEqual(dialog.entry_ok(), result) + + +# GUI TESTS + +class QueryGuiTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = root = Tk() + cls.root.withdraw() + cls.dialog = query.Query(root, 'TEST', 'test', _utest=True) + cls.dialog.destroy = mock.Mock() + + @classmethod + def tearDownClass(cls): + del cls.dialog.destroy + del cls.dialog + cls.root.destroy() + del cls.root + + def setUp(self): + self.dialog.entry.delete(0, 'end') + self.dialog.result = None + self.dialog.destroy.reset_mock() + + def test_click_ok(self): + dialog = self.dialog + dialog.entry.insert(0, 'abc') + dialog.button_ok.invoke() + self.assertEqual(dialog.result, 'abc') + self.assertTrue(dialog.destroy.called) + + def test_click_blank(self): + dialog = self.dialog + dialog.button_ok.invoke() + self.assertEqual(dialog.result, None) + self.assertFalse(dialog.destroy.called) + + def test_click_cancel(self): + dialog = self.dialog + dialog.entry.insert(0, 'abc') + dialog.button_cancel.invoke() + self.assertEqual(dialog.result, None) + self.assertTrue(dialog.destroy.called) + + +class SectionnameGuiTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + + def test_click_section_name(self): + root = Tk() + root.withdraw() + dialog = query.SectionName(root, 'T', 't', {'abc'}, _utest=True) + Equal = self.assertEqual + self.assertEqual(dialog.used_names, {'abc'}) + dialog.entry.insert(0, 'okay') + dialog.button_ok.invoke() + self.assertEqual(dialog.result, 'okay') + root.destroy() + + +class ModulenameGuiTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + + def test_click_module_name(self): + root = Tk() + root.withdraw() + dialog = query.ModuleName(root, 'T', 't', 'idlelib', _utest=True) + self.assertEqual(dialog.text0, 'idlelib') + self.assertEqual(dialog.entry.get(), 'idlelib') + dialog.button_ok.invoke() + self.assertTrue(dialog.result.endswith('__init__.py')) + root.destroy() + + +class GotoGuiTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + + def test_click_module_name(self): + root = Tk() + root.withdraw() + dialog = query.Goto(root, 'T', 't', _utest=True) + dialog.entry.insert(0, '22') + dialog.button_ok.invoke() + self.assertEqual(dialog.result, 22) + root.destroy() + + +class HelpsourceGuiTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + + def test_click_help_source(self): + root = Tk() + root.withdraw() + dialog = query.HelpSource(root, 'T', menuitem='__test__', + filepath=__file__, _utest=True) + Equal = self.assertEqual + Equal(dialog.entry.get(), '__test__') + Equal(dialog.path.get(), __file__) + dialog.button_ok.invoke() + prefix = "file://" if sys.platform == 'darwin' else '' + Equal(dialog.result, ('__test__', prefix + __file__)) + root.destroy() + + +class CustomRunGuiTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + + def test_click_args(self): + root = Tk() + root.withdraw() + dialog = query.CustomRun(root, 'Title', + cli_args=['a', 'b=1'], _utest=True) + self.assertEqual(dialog.entry.get(), 'a b=1') + dialog.entry.insert(END, ' c') + dialog.button_ok.invoke() + self.assertEqual(dialog.result, (['a', 'b=1', 'c'], True)) + root.destroy() + + +if __name__ == '__main__': + unittest.main(verbosity=2, exit=False) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_redirector.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_redirector.py new file mode 100644 index 0000000000000000000000000000000000000000..a97b3002afcf12cec74c77a036978e2a22b45598 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_redirector.py @@ -0,0 +1,122 @@ +"Test redirector, coverage 100%." + +from idlelib.redirector import WidgetRedirector +import unittest +from test.support import requires +from tkinter import Tk, Text, TclError +from idlelib.idle_test.mock_idle import Func + + +class InitCloseTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.text = Text(cls.root) + + @classmethod + def tearDownClass(cls): + del cls.text + cls.root.destroy() + del cls.root + + def test_init(self): + redir = WidgetRedirector(self.text) + self.assertEqual(redir.widget, self.text) + self.assertEqual(redir.tk, self.text.tk) + self.assertRaises(TclError, WidgetRedirector, self.text) + redir.close() # restore self.tk, self.text + + def test_close(self): + redir = WidgetRedirector(self.text) + redir.register('insert', Func) + redir.close() + self.assertEqual(redir._operations, {}) + self.assertFalse(hasattr(self.text, 'widget')) + + +class WidgetRedirectorTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.text = Text(cls.root) + + @classmethod + def tearDownClass(cls): + del cls.text + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def setUp(self): + self.redir = WidgetRedirector(self.text) + self.func = Func() + self.orig_insert = self.redir.register('insert', self.func) + self.text.insert('insert', 'asdf') # leaves self.text empty + + def tearDown(self): + self.text.delete('1.0', 'end') + self.redir.close() + + def test_repr(self): # partly for 100% coverage + self.assertIn('Redirector', repr(self.redir)) + self.assertIn('Original', repr(self.orig_insert)) + + def test_register(self): + self.assertEqual(self.text.get('1.0', 'end'), '\n') + self.assertEqual(self.func.args, ('insert', 'asdf')) + self.assertIn('insert', self.redir._operations) + self.assertIn('insert', self.text.__dict__) + self.assertEqual(self.text.insert, self.func) + + def test_original_command(self): + self.assertEqual(self.orig_insert.operation, 'insert') + self.assertEqual(self.orig_insert.tk_call, self.text.tk.call) + self.orig_insert('insert', 'asdf') + self.assertEqual(self.text.get('1.0', 'end'), 'asdf\n') + + def test_unregister(self): + self.assertIsNone(self.redir.unregister('invalid operation name')) + self.assertEqual(self.redir.unregister('insert'), self.func) + self.assertNotIn('insert', self.redir._operations) + self.assertNotIn('insert', self.text.__dict__) + + def test_unregister_no_attribute(self): + del self.text.insert + self.assertEqual(self.redir.unregister('insert'), self.func) + + def test_dispatch_intercept(self): + self.func.__init__(True) + self.assertTrue(self.redir.dispatch('insert', False)) + self.assertFalse(self.func.args[0]) + + def test_dispatch_bypass(self): + self.orig_insert('insert', 'asdf') + # tk.call returns '' where Python would return None + self.assertEqual(self.redir.dispatch('delete', '1.0', 'end'), '') + self.assertEqual(self.text.get('1.0', 'end'), '\n') + + def test_dispatch_error(self): + self.func.__init__(TclError()) + self.assertEqual(self.redir.dispatch('insert', False), '') + self.assertEqual(self.redir.dispatch('invalid'), '') + + def test_command_dispatch(self): + # Test that .__init__ causes redirection of tk calls + # through redir.dispatch + self.root.call(self.text._w, 'insert', 'hello') + self.assertEqual(self.func.args, ('hello',)) + self.assertEqual(self.text.get('1.0', 'end'), '\n') + # Ensure that called through redir .dispatch and not through + # self.text.insert by having mock raise TclError. + self.func.__init__(TclError()) + self.assertEqual(self.root.call(self.text._w, 'insert', 'boo'), '') + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_replace.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_replace.py new file mode 100644 index 0000000000000000000000000000000000000000..6c07389b29ad4558077353dd65eccb32c722dcba --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_replace.py @@ -0,0 +1,294 @@ +"Test replace, coverage 78%." + +from idlelib.replace import ReplaceDialog +import unittest +from test.support import requires +requires('gui') +from tkinter import Tk, Text + +from unittest.mock import Mock +from idlelib.idle_test.mock_tk import Mbox +import idlelib.searchengine as se + +orig_mbox = se.messagebox +showerror = Mbox.showerror + + +class ReplaceDialogTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + cls.root = Tk() + cls.root.withdraw() + se.messagebox = Mbox + cls.engine = se.SearchEngine(cls.root) + cls.dialog = ReplaceDialog(cls.root, cls.engine) + cls.dialog.bell = lambda: None + cls.dialog.ok = Mock() + cls.text = Text(cls.root) + cls.text.undo_block_start = Mock() + cls.text.undo_block_stop = Mock() + cls.dialog.text = cls.text + + @classmethod + def tearDownClass(cls): + se.messagebox = orig_mbox + del cls.text, cls.dialog, cls.engine + cls.root.destroy() + del cls.root + + def setUp(self): + self.text.insert('insert', 'This is a sample sTring') + + def tearDown(self): + self.engine.patvar.set('') + self.dialog.replvar.set('') + self.engine.wordvar.set(False) + self.engine.casevar.set(False) + self.engine.revar.set(False) + self.engine.wrapvar.set(True) + self.engine.backvar.set(False) + showerror.title = '' + showerror.message = '' + self.text.delete('1.0', 'end') + + def test_replace_simple(self): + # Test replace function with all options at default setting. + # Wrap around - True + # Regular Expression - False + # Match case - False + # Match word - False + # Direction - Forwards + text = self.text + equal = self.assertEqual + pv = self.engine.patvar + rv = self.dialog.replvar + replace = self.dialog.replace_it + + # test accessor method + self.engine.setpat('asdf') + equal(self.engine.getpat(), pv.get()) + + # text found and replaced + pv.set('a') + rv.set('asdf') + replace() + equal(text.get('1.8', '1.12'), 'asdf') + + # don't "match word" case + text.mark_set('insert', '1.0') + pv.set('is') + rv.set('hello') + replace() + equal(text.get('1.2', '1.7'), 'hello') + + # don't "match case" case + pv.set('string') + rv.set('world') + replace() + equal(text.get('1.23', '1.28'), 'world') + + # without "regular expression" case + text.mark_set('insert', 'end') + text.insert('insert', '\nline42:') + before_text = text.get('1.0', 'end') + pv.set(r'[a-z][\d]+') + replace() + after_text = text.get('1.0', 'end') + equal(before_text, after_text) + + # test with wrap around selected and complete a cycle + text.mark_set('insert', '1.9') + pv.set('i') + rv.set('j') + replace() + equal(text.get('1.8'), 'i') + equal(text.get('2.1'), 'j') + replace() + equal(text.get('2.1'), 'j') + equal(text.get('1.8'), 'j') + before_text = text.get('1.0', 'end') + replace() + after_text = text.get('1.0', 'end') + equal(before_text, after_text) + + # text not found + before_text = text.get('1.0', 'end') + pv.set('foobar') + replace() + after_text = text.get('1.0', 'end') + equal(before_text, after_text) + + # test access method + self.dialog.find_it(0) + + def test_replace_wrap_around(self): + text = self.text + equal = self.assertEqual + pv = self.engine.patvar + rv = self.dialog.replvar + replace = self.dialog.replace_it + self.engine.wrapvar.set(False) + + # replace candidate found both after and before 'insert' + text.mark_set('insert', '1.4') + pv.set('i') + rv.set('j') + replace() + equal(text.get('1.2'), 'i') + equal(text.get('1.5'), 'j') + replace() + equal(text.get('1.2'), 'i') + equal(text.get('1.20'), 'j') + replace() + equal(text.get('1.2'), 'i') + + # replace candidate found only before 'insert' + text.mark_set('insert', '1.8') + pv.set('is') + before_text = text.get('1.0', 'end') + replace() + after_text = text.get('1.0', 'end') + equal(before_text, after_text) + + def test_replace_whole_word(self): + text = self.text + equal = self.assertEqual + pv = self.engine.patvar + rv = self.dialog.replvar + replace = self.dialog.replace_it + self.engine.wordvar.set(True) + + pv.set('is') + rv.set('hello') + replace() + equal(text.get('1.0', '1.4'), 'This') + equal(text.get('1.5', '1.10'), 'hello') + + def test_replace_match_case(self): + equal = self.assertEqual + text = self.text + pv = self.engine.patvar + rv = self.dialog.replvar + replace = self.dialog.replace_it + self.engine.casevar.set(True) + + before_text = self.text.get('1.0', 'end') + pv.set('this') + rv.set('that') + replace() + after_text = self.text.get('1.0', 'end') + equal(before_text, after_text) + + pv.set('This') + replace() + equal(text.get('1.0', '1.4'), 'that') + + def test_replace_regex(self): + equal = self.assertEqual + text = self.text + pv = self.engine.patvar + rv = self.dialog.replvar + replace = self.dialog.replace_it + self.engine.revar.set(True) + + before_text = text.get('1.0', 'end') + pv.set(r'[a-z][\d]+') + rv.set('hello') + replace() + after_text = text.get('1.0', 'end') + equal(before_text, after_text) + + text.insert('insert', '\nline42') + replace() + equal(text.get('2.0', '2.8'), 'linhello') + + pv.set('') + replace() + self.assertIn('error', showerror.title) + self.assertIn('Empty', showerror.message) + + pv.set(r'[\d') + replace() + self.assertIn('error', showerror.title) + self.assertIn('Pattern', showerror.message) + + showerror.title = '' + showerror.message = '' + pv.set('[a]') + rv.set('test\\') + replace() + self.assertIn('error', showerror.title) + self.assertIn('Invalid Replace Expression', showerror.message) + + # test access method + self.engine.setcookedpat("?") + equal(pv.get(), "\\?") + + def test_replace_backwards(self): + equal = self.assertEqual + text = self.text + pv = self.engine.patvar + rv = self.dialog.replvar + replace = self.dialog.replace_it + self.engine.backvar.set(True) + + text.insert('insert', '\nis as ') + + pv.set('is') + rv.set('was') + replace() + equal(text.get('1.2', '1.4'), 'is') + equal(text.get('2.0', '2.3'), 'was') + replace() + equal(text.get('1.5', '1.8'), 'was') + replace() + equal(text.get('1.2', '1.5'), 'was') + + def test_replace_all(self): + text = self.text + pv = self.engine.patvar + rv = self.dialog.replvar + replace_all = self.dialog.replace_all + + text.insert('insert', '\n') + text.insert('insert', text.get('1.0', 'end')*100) + pv.set('is') + rv.set('was') + replace_all() + self.assertNotIn('is', text.get('1.0', 'end')) + + self.engine.revar.set(True) + pv.set('') + replace_all() + self.assertIn('error', showerror.title) + self.assertIn('Empty', showerror.message) + + pv.set('[s][T]') + rv.set('\\') + replace_all() + + self.engine.revar.set(False) + pv.set('text which is not present') + rv.set('foobar') + replace_all() + + def test_default_command(self): + text = self.text + pv = self.engine.patvar + rv = self.dialog.replvar + replace_find = self.dialog.default_command + equal = self.assertEqual + + pv.set('This') + rv.set('was') + replace_find() + equal(text.get('sel.first', 'sel.last'), 'was') + + self.engine.revar.set(True) + pv.set('') + replace_find() + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_rpc.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_rpc.py new file mode 100644 index 0000000000000000000000000000000000000000..81eff398c72f45b9cc25546513be2cb861e490b8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_rpc.py @@ -0,0 +1,29 @@ +"Test rpc, coverage 20%." + +from idlelib import rpc +import unittest + + + +class CodePicklerTest(unittest.TestCase): + + def test_pickle_unpickle(self): + def f(): return a + b + c + func, (cbytes,) = rpc.pickle_code(f.__code__) + self.assertIs(func, rpc.unpickle_code) + self.assertIn(b'test_rpc.py', cbytes) + code = rpc.unpickle_code(cbytes) + self.assertEqual(code.co_names, ('a', 'b', 'c')) + + def test_code_pickler(self): + self.assertIn(type((lambda:None).__code__), + rpc.CodePickler.dispatch_table) + + def test_dumps(self): + def f(): pass + # The main test here is that pickling code does not raise. + self.assertIn(b'test_rpc.py', rpc.dumps(f.__code__)) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_run.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_run.py new file mode 100644 index 0000000000000000000000000000000000000000..ec4637c5ca617a9eb380d46825ee32c429520edc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_run.py @@ -0,0 +1,429 @@ +"Test run, coverage 54%." + +from idlelib import run +import io +import sys +from test.support import captured_output, captured_stderr +import unittest +from unittest import mock +import idlelib +from idlelib.idle_test.mock_idle import Func + +idlelib.testing = True # Use {} for executing test user code. + + +class ExceptionTest(unittest.TestCase): + + def test_print_exception_unhashable(self): + class UnhashableException(Exception): + def __eq__(self, other): + return True + + ex1 = UnhashableException('ex1') + ex2 = UnhashableException('ex2') + try: + raise ex2 from ex1 + except UnhashableException: + try: + raise ex1 + except UnhashableException: + with captured_stderr() as output: + with mock.patch.object(run, 'cleanup_traceback') as ct: + ct.side_effect = lambda t, e: t + run.print_exception() + + tb = output.getvalue().strip().splitlines() + self.assertEqual(11, len(tb)) + self.assertIn('UnhashableException: ex2', tb[3]) + self.assertIn('UnhashableException: ex1', tb[10]) + + data = (('1/0', ZeroDivisionError, "division by zero\n"), + ('abc', NameError, "name 'abc' is not defined. " + "Did you mean: 'abs'?\n"), + ('int.reel', AttributeError, + "type object 'int' has no attribute 'reel'. " + "Did you mean: 'real'?\n"), + ) + + def test_get_message(self): + for code, exc, msg in self.data: + with self.subTest(code=code): + try: + eval(compile(code, '', 'eval')) + except exc: + typ, val, tb = sys.exc_info() + actual = run.get_message_lines(typ, val, tb)[0] + expect = f'{exc.__name__}: {msg}' + self.assertEqual(actual, expect) + + @mock.patch.object(run, 'cleanup_traceback', + new_callable=lambda: (lambda t, e: None)) + def test_get_multiple_message(self, mock): + d = self.data + data2 = ((d[0], d[1]), (d[1], d[2]), (d[2], d[0])) + subtests = 0 + for (code1, exc1, msg1), (code2, exc2, msg2) in data2: + with self.subTest(codes=(code1,code2)): + try: + eval(compile(code1, '', 'eval')) + except exc1: + try: + eval(compile(code2, '', 'eval')) + except exc2: + with captured_stderr() as output: + run.print_exception() + actual = output.getvalue() + self.assertIn(msg1, actual) + self.assertIn(msg2, actual) + subtests += 1 + self.assertEqual(subtests, len(data2)) # All subtests ran? + +# StdioFile tests. + +class S(str): + def __str__(self): + return '%s:str' % type(self).__name__ + def __unicode__(self): + return '%s:unicode' % type(self).__name__ + def __len__(self): + return 3 + def __iter__(self): + return iter('abc') + def __getitem__(self, *args): + return '%s:item' % type(self).__name__ + def __getslice__(self, *args): + return '%s:slice' % type(self).__name__ + + +class MockShell: + def __init__(self): + self.reset() + def write(self, *args): + self.written.append(args) + def readline(self): + return self.lines.pop() + def close(self): + pass + def reset(self): + self.written = [] + def push(self, lines): + self.lines = list(lines)[::-1] + + +class StdInputFilesTest(unittest.TestCase): + + def test_misc(self): + shell = MockShell() + f = run.StdInputFile(shell, 'stdin') + self.assertIsInstance(f, io.TextIOBase) + self.assertEqual(f.encoding, 'utf-8') + self.assertEqual(f.errors, 'strict') + self.assertIsNone(f.newlines) + self.assertEqual(f.name, '') + self.assertFalse(f.closed) + self.assertTrue(f.isatty()) + self.assertTrue(f.readable()) + self.assertFalse(f.writable()) + self.assertFalse(f.seekable()) + + def test_unsupported(self): + shell = MockShell() + f = run.StdInputFile(shell, 'stdin') + self.assertRaises(OSError, f.fileno) + self.assertRaises(OSError, f.tell) + self.assertRaises(OSError, f.seek, 0) + self.assertRaises(OSError, f.write, 'x') + self.assertRaises(OSError, f.writelines, ['x']) + + def test_read(self): + shell = MockShell() + f = run.StdInputFile(shell, 'stdin') + shell.push(['one\n', 'two\n', '']) + self.assertEqual(f.read(), 'one\ntwo\n') + shell.push(['one\n', 'two\n', '']) + self.assertEqual(f.read(-1), 'one\ntwo\n') + shell.push(['one\n', 'two\n', '']) + self.assertEqual(f.read(None), 'one\ntwo\n') + shell.push(['one\n', 'two\n', 'three\n', '']) + self.assertEqual(f.read(2), 'on') + self.assertEqual(f.read(3), 'e\nt') + self.assertEqual(f.read(10), 'wo\nthree\n') + + shell.push(['one\n', 'two\n']) + self.assertEqual(f.read(0), '') + self.assertRaises(TypeError, f.read, 1.5) + self.assertRaises(TypeError, f.read, '1') + self.assertRaises(TypeError, f.read, 1, 1) + + def test_readline(self): + shell = MockShell() + f = run.StdInputFile(shell, 'stdin') + shell.push(['one\n', 'two\n', 'three\n', 'four\n']) + self.assertEqual(f.readline(), 'one\n') + self.assertEqual(f.readline(-1), 'two\n') + self.assertEqual(f.readline(None), 'three\n') + shell.push(['one\ntwo\n']) + self.assertEqual(f.readline(), 'one\n') + self.assertEqual(f.readline(), 'two\n') + shell.push(['one', 'two', 'three']) + self.assertEqual(f.readline(), 'one') + self.assertEqual(f.readline(), 'two') + shell.push(['one\n', 'two\n', 'three\n']) + self.assertEqual(f.readline(2), 'on') + self.assertEqual(f.readline(1), 'e') + self.assertEqual(f.readline(1), '\n') + self.assertEqual(f.readline(10), 'two\n') + + shell.push(['one\n', 'two\n']) + self.assertEqual(f.readline(0), '') + self.assertRaises(TypeError, f.readlines, 1.5) + self.assertRaises(TypeError, f.readlines, '1') + self.assertRaises(TypeError, f.readlines, 1, 1) + + def test_readlines(self): + shell = MockShell() + f = run.StdInputFile(shell, 'stdin') + shell.push(['one\n', 'two\n', '']) + self.assertEqual(f.readlines(), ['one\n', 'two\n']) + shell.push(['one\n', 'two\n', '']) + self.assertEqual(f.readlines(-1), ['one\n', 'two\n']) + shell.push(['one\n', 'two\n', '']) + self.assertEqual(f.readlines(None), ['one\n', 'two\n']) + shell.push(['one\n', 'two\n', '']) + self.assertEqual(f.readlines(0), ['one\n', 'two\n']) + shell.push(['one\n', 'two\n', '']) + self.assertEqual(f.readlines(3), ['one\n']) + shell.push(['one\n', 'two\n', '']) + self.assertEqual(f.readlines(4), ['one\n', 'two\n']) + + shell.push(['one\n', 'two\n', '']) + self.assertRaises(TypeError, f.readlines, 1.5) + self.assertRaises(TypeError, f.readlines, '1') + self.assertRaises(TypeError, f.readlines, 1, 1) + + def test_close(self): + shell = MockShell() + f = run.StdInputFile(shell, 'stdin') + shell.push(['one\n', 'two\n', '']) + self.assertFalse(f.closed) + self.assertEqual(f.readline(), 'one\n') + f.close() + self.assertFalse(f.closed) + self.assertEqual(f.readline(), 'two\n') + self.assertRaises(TypeError, f.close, 1) + + +class StdOutputFilesTest(unittest.TestCase): + + def test_misc(self): + shell = MockShell() + f = run.StdOutputFile(shell, 'stdout') + self.assertIsInstance(f, io.TextIOBase) + self.assertEqual(f.encoding, 'utf-8') + self.assertEqual(f.errors, 'strict') + self.assertIsNone(f.newlines) + self.assertEqual(f.name, '') + self.assertFalse(f.closed) + self.assertTrue(f.isatty()) + self.assertFalse(f.readable()) + self.assertTrue(f.writable()) + self.assertFalse(f.seekable()) + + def test_unsupported(self): + shell = MockShell() + f = run.StdOutputFile(shell, 'stdout') + self.assertRaises(OSError, f.fileno) + self.assertRaises(OSError, f.tell) + self.assertRaises(OSError, f.seek, 0) + self.assertRaises(OSError, f.read, 0) + self.assertRaises(OSError, f.readline, 0) + + def test_write(self): + shell = MockShell() + f = run.StdOutputFile(shell, 'stdout') + f.write('test') + self.assertEqual(shell.written, [('test', 'stdout')]) + shell.reset() + f.write('t\xe8\u015b\U0001d599') + self.assertEqual(shell.written, [('t\xe8\u015b\U0001d599', 'stdout')]) + shell.reset() + + f.write(S('t\xe8\u015b\U0001d599')) + self.assertEqual(shell.written, [('t\xe8\u015b\U0001d599', 'stdout')]) + self.assertEqual(type(shell.written[0][0]), str) + shell.reset() + + self.assertRaises(TypeError, f.write) + self.assertEqual(shell.written, []) + self.assertRaises(TypeError, f.write, b'test') + self.assertRaises(TypeError, f.write, 123) + self.assertEqual(shell.written, []) + self.assertRaises(TypeError, f.write, 'test', 'spam') + self.assertEqual(shell.written, []) + + def test_write_stderr_nonencodable(self): + shell = MockShell() + f = run.StdOutputFile(shell, 'stderr', 'iso-8859-15', 'backslashreplace') + f.write('t\xe8\u015b\U0001d599\xa4') + self.assertEqual(shell.written, [('t\xe8\\u015b\\U0001d599\\xa4', 'stderr')]) + shell.reset() + + f.write(S('t\xe8\u015b\U0001d599\xa4')) + self.assertEqual(shell.written, [('t\xe8\\u015b\\U0001d599\\xa4', 'stderr')]) + self.assertEqual(type(shell.written[0][0]), str) + shell.reset() + + self.assertRaises(TypeError, f.write) + self.assertEqual(shell.written, []) + self.assertRaises(TypeError, f.write, b'test') + self.assertRaises(TypeError, f.write, 123) + self.assertEqual(shell.written, []) + self.assertRaises(TypeError, f.write, 'test', 'spam') + self.assertEqual(shell.written, []) + + def test_writelines(self): + shell = MockShell() + f = run.StdOutputFile(shell, 'stdout') + f.writelines([]) + self.assertEqual(shell.written, []) + shell.reset() + f.writelines(['one\n', 'two']) + self.assertEqual(shell.written, + [('one\n', 'stdout'), ('two', 'stdout')]) + shell.reset() + f.writelines(['on\xe8\n', 'tw\xf2']) + self.assertEqual(shell.written, + [('on\xe8\n', 'stdout'), ('tw\xf2', 'stdout')]) + shell.reset() + + f.writelines([S('t\xe8st')]) + self.assertEqual(shell.written, [('t\xe8st', 'stdout')]) + self.assertEqual(type(shell.written[0][0]), str) + shell.reset() + + self.assertRaises(TypeError, f.writelines) + self.assertEqual(shell.written, []) + self.assertRaises(TypeError, f.writelines, 123) + self.assertEqual(shell.written, []) + self.assertRaises(TypeError, f.writelines, [b'test']) + self.assertRaises(TypeError, f.writelines, [123]) + self.assertEqual(shell.written, []) + self.assertRaises(TypeError, f.writelines, [], []) + self.assertEqual(shell.written, []) + + def test_close(self): + shell = MockShell() + f = run.StdOutputFile(shell, 'stdout') + self.assertFalse(f.closed) + f.write('test') + f.close() + self.assertTrue(f.closed) + self.assertRaises(ValueError, f.write, 'x') + self.assertEqual(shell.written, [('test', 'stdout')]) + f.close() + self.assertRaises(TypeError, f.close, 1) + + +class RecursionLimitTest(unittest.TestCase): + # Test (un)install_recursionlimit_wrappers and fixdoc. + + def test_bad_setrecursionlimit_calls(self): + run.install_recursionlimit_wrappers() + self.addCleanup(run.uninstall_recursionlimit_wrappers) + f = sys.setrecursionlimit + self.assertRaises(TypeError, f, limit=100) + self.assertRaises(TypeError, f, 100, 1000) + self.assertRaises(ValueError, f, 0) + + def test_roundtrip(self): + run.install_recursionlimit_wrappers() + self.addCleanup(run.uninstall_recursionlimit_wrappers) + + # Check that setting the recursion limit works. + orig_reclimit = sys.getrecursionlimit() + self.addCleanup(sys.setrecursionlimit, orig_reclimit) + sys.setrecursionlimit(orig_reclimit + 3) + + # Check that the new limit is returned by sys.getrecursionlimit(). + new_reclimit = sys.getrecursionlimit() + self.assertEqual(new_reclimit, orig_reclimit + 3) + + def test_default_recursion_limit_preserved(self): + orig_reclimit = sys.getrecursionlimit() + run.install_recursionlimit_wrappers() + self.addCleanup(run.uninstall_recursionlimit_wrappers) + new_reclimit = sys.getrecursionlimit() + self.assertEqual(new_reclimit, orig_reclimit) + + def test_fixdoc(self): + # Put here until better place for miscellaneous test. + def func(): "docstring" + run.fixdoc(func, "more") + self.assertEqual(func.__doc__, "docstring\n\nmore") + func.__doc__ = None + run.fixdoc(func, "more") + self.assertEqual(func.__doc__, "more") + + +class HandleErrorTest(unittest.TestCase): + # Method of MyRPCServer + def test_fatal_error(self): + eq = self.assertEqual + with captured_output('__stderr__') as err,\ + mock.patch('idlelib.run.thread.interrupt_main', + new_callable=Func) as func: + try: + raise EOFError + except EOFError: + run.MyRPCServer.handle_error(None, 'abc', '123') + eq(run.exit_now, True) + run.exit_now = False + eq(err.getvalue(), '') + + try: + raise IndexError + except IndexError: + run.MyRPCServer.handle_error(None, 'abc', '123') + eq(run.quitting, True) + run.quitting = False + msg = err.getvalue() + self.assertIn('abc', msg) + self.assertIn('123', msg) + self.assertIn('IndexError', msg) + eq(func.called, 2) + + +class ExecRuncodeTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + cls.addClassCleanup(setattr,run,'print_exception',run.print_exception) + cls.prt = Func() # Need reference. + run.print_exception = cls.prt + mockrpc = mock.Mock() + mockrpc.console.getvar = Func(result=False) + cls.ex = run.Executive(mockrpc) + + @classmethod + def tearDownClass(cls): + assert sys.excepthook == sys.__excepthook__ + + def test_exceptions(self): + ex = self.ex + ex.runcode('1/0') + self.assertIs(ex.user_exc_info[0], ZeroDivisionError) + + self.addCleanup(setattr, sys, 'excepthook', sys.__excepthook__) + sys.excepthook = lambda t, e, tb: run.print_exception(t) + ex.runcode('1/0') + self.assertIs(self.prt.args[0], ZeroDivisionError) + + sys.excepthook = lambda: None + ex.runcode('1/0') + t, e, tb = ex.user_exc_info + self.assertIs(t, TypeError) + self.assertTrue(isinstance(e.__context__, ZeroDivisionError)) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_runscript.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_runscript.py new file mode 100644 index 0000000000000000000000000000000000000000..5fc60185a663e8f33d5fd10591df989190e038f8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_runscript.py @@ -0,0 +1,33 @@ +"Test runscript, coverage 16%." + +from idlelib import runscript +import unittest +from test.support import requires +from tkinter import Tk +from idlelib.editor import EditorWindow + + +class ScriptBindingTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + + @classmethod + def tearDownClass(cls): + cls.root.update_idletasks() + for id in cls.root.tk.call('after', 'info'): + cls.root.after_cancel(id) # Need for EditorWindow. + cls.root.destroy() + del cls.root + + def test_init(self): + ew = EditorWindow(root=self.root) + sb = runscript.ScriptBinding(ew) + ew._close() + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_scrolledlist.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_scrolledlist.py new file mode 100644 index 0000000000000000000000000000000000000000..2f819fda025ba3d453e081327a05ffc2fd7cf972 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_scrolledlist.py @@ -0,0 +1,27 @@ +"Test scrolledlist, coverage 38%." + +from idlelib.scrolledlist import ScrolledList +import unittest +from test.support import requires +requires('gui') +from tkinter import Tk + + +class ScrolledListTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + cls.root = Tk() + + @classmethod + def tearDownClass(cls): + cls.root.destroy() + del cls.root + + + def test_init(self): + ScrolledList(self.root) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_search.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_search.py new file mode 100644 index 0000000000000000000000000000000000000000..de703c195cd22900b92f3b239018f805bbf373da --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_search.py @@ -0,0 +1,80 @@ +"Test search, coverage 69%." + +from idlelib import search +import unittest +from test.support import requires +requires('gui') +from tkinter import Tk, Text, BooleanVar +from idlelib import searchengine + +# Does not currently test the event handler wrappers. +# A usage test should simulate clicks and check highlighting. +# Tests need to be coordinated with SearchDialogBase tests +# to avoid duplication. + + +class SearchDialogTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + cls.root = Tk() + + @classmethod + def tearDownClass(cls): + cls.root.destroy() + del cls.root + + def setUp(self): + self.engine = searchengine.SearchEngine(self.root) + self.dialog = search.SearchDialog(self.root, self.engine) + self.dialog.bell = lambda: None + self.text = Text(self.root) + self.text.insert('1.0', 'Hello World!') + + def test_find_again(self): + # Search for various expressions + text = self.text + + self.engine.setpat('') + self.assertFalse(self.dialog.find_again(text)) + self.dialog.bell = lambda: None + + self.engine.setpat('Hello') + self.assertTrue(self.dialog.find_again(text)) + + self.engine.setpat('Goodbye') + self.assertFalse(self.dialog.find_again(text)) + + self.engine.setpat('World!') + self.assertTrue(self.dialog.find_again(text)) + + self.engine.setpat('Hello World!') + self.assertTrue(self.dialog.find_again(text)) + + # Regular expression + self.engine.revar = BooleanVar(self.root, True) + self.engine.setpat('W[aeiouy]r') + self.assertTrue(self.dialog.find_again(text)) + + def test_find_selection(self): + # Select some text and make sure it's found + text = self.text + # Add additional line to find + self.text.insert('2.0', 'Hello World!') + + text.tag_add('sel', '1.0', '1.4') # Select 'Hello' + self.assertTrue(self.dialog.find_selection(text)) + + text.tag_remove('sel', '1.0', 'end') + text.tag_add('sel', '1.6', '1.11') # Select 'World!' + self.assertTrue(self.dialog.find_selection(text)) + + text.tag_remove('sel', '1.0', 'end') + text.tag_add('sel', '1.0', '1.11') # Select 'Hello World!' + self.assertTrue(self.dialog.find_selection(text)) + + # Remove additional line + text.delete('2.0', 'end') + +if __name__ == '__main__': + unittest.main(verbosity=2, exit=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_searchbase.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_searchbase.py new file mode 100644 index 0000000000000000000000000000000000000000..8c9c410ebaf47c0626655cffe0fda4db83960819 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_searchbase.py @@ -0,0 +1,160 @@ +"Test searchbase, coverage 98%." +# The only thing not covered is inconsequential -- +# testing skipping of suite when self.needwrapbutton is false. + +import unittest +from test.support import requires +from tkinter import Text, Tk, Toplevel +from tkinter.ttk import Frame +from idlelib import searchengine as se +from idlelib import searchbase as sdb +from idlelib.idle_test.mock_idle import Func +## from idlelib.idle_test.mock_tk import Var + +# The ## imports above & following could help make some tests gui-free. +# However, they currently make radiobutton tests fail. +##def setUpModule(): +## # Replace tk objects used to initialize se.SearchEngine. +## se.BooleanVar = Var +## se.StringVar = Var +## +##def tearDownModule(): +## se.BooleanVar = BooleanVar +## se.StringVar = StringVar + + +class SearchDialogBaseTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + + @classmethod + def tearDownClass(cls): + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def setUp(self): + self.engine = se.SearchEngine(self.root) # None also seems to work + self.dialog = sdb.SearchDialogBase(root=self.root, engine=self.engine) + + def tearDown(self): + self.dialog.close() + + def test_open_and_close(self): + # open calls create_widgets, which needs default_command + self.dialog.default_command = None + + toplevel = Toplevel(self.root) + text = Text(toplevel) + self.dialog.open(text) + self.assertEqual(self.dialog.top.state(), 'normal') + self.dialog.close() + self.assertEqual(self.dialog.top.state(), 'withdrawn') + + self.dialog.open(text, searchphrase="hello") + self.assertEqual(self.dialog.ent.get(), 'hello') + toplevel.update_idletasks() + toplevel.destroy() + + def test_create_widgets(self): + self.dialog.create_entries = Func() + self.dialog.create_option_buttons = Func() + self.dialog.create_other_buttons = Func() + self.dialog.create_command_buttons = Func() + + self.dialog.default_command = None + self.dialog.create_widgets() + + self.assertTrue(self.dialog.create_entries.called) + self.assertTrue(self.dialog.create_option_buttons.called) + self.assertTrue(self.dialog.create_other_buttons.called) + self.assertTrue(self.dialog.create_command_buttons.called) + + def test_make_entry(self): + equal = self.assertEqual + self.dialog.row = 0 + self.dialog.frame = Frame(self.root) + entry, label = self.dialog.make_entry("Test:", 'hello') + equal(label['text'], 'Test:') + + self.assertIn(entry.get(), 'hello') + egi = entry.grid_info() + equal(int(egi['row']), 0) + equal(int(egi['column']), 1) + equal(int(egi['rowspan']), 1) + equal(int(egi['columnspan']), 1) + equal(self.dialog.row, 1) + + def test_create_entries(self): + self.dialog.frame = Frame(self.root) + self.dialog.row = 0 + self.engine.setpat('hello') + self.dialog.create_entries() + self.assertIn(self.dialog.ent.get(), 'hello') + + def test_make_frame(self): + self.dialog.row = 0 + self.dialog.frame = Frame(self.root) + frame, label = self.dialog.make_frame() + self.assertEqual(label, '') + self.assertEqual(str(type(frame)), "") + # self.assertIsInstance(frame, Frame) fails when test is run by + # test_idle not run from IDLE editor. See issue 33987 PR. + + frame, label = self.dialog.make_frame('testlabel') + self.assertEqual(label['text'], 'testlabel') + + def btn_test_setup(self, meth): + self.dialog.frame = Frame(self.root) + self.dialog.row = 0 + return meth() + + def test_create_option_buttons(self): + e = self.engine + for state in (0, 1): + for var in (e.revar, e.casevar, e.wordvar, e.wrapvar): + var.set(state) + frame, options = self.btn_test_setup( + self.dialog.create_option_buttons) + for spec, button in zip (options, frame.pack_slaves()): + var, label = spec + self.assertEqual(button['text'], label) + self.assertEqual(var.get(), state) + + def test_create_other_buttons(self): + for state in (False, True): + var = self.engine.backvar + var.set(state) + frame, others = self.btn_test_setup( + self.dialog.create_other_buttons) + buttons = frame.pack_slaves() + for spec, button in zip(others, buttons): + val, label = spec + self.assertEqual(button['text'], label) + if val == state: + # hit other button, then this one + # indexes depend on button order + self.assertEqual(var.get(), state) + + def test_make_button(self): + self.dialog.frame = Frame(self.root) + self.dialog.buttonframe = Frame(self.dialog.frame) + btn = self.dialog.make_button('Test', self.dialog.close) + self.assertEqual(btn['text'], 'Test') + + def test_create_command_buttons(self): + self.dialog.frame = Frame(self.root) + self.dialog.create_command_buttons() + # Look for close button command in buttonframe + closebuttoncommand = '' + for child in self.dialog.buttonframe.winfo_children(): + if child['text'] == 'Close': + closebuttoncommand = child['command'] + self.assertIn('close', closebuttoncommand) + + +if __name__ == '__main__': + unittest.main(verbosity=2, exit=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_searchengine.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_searchengine.py new file mode 100644 index 0000000000000000000000000000000000000000..9d97983941958606af154d8a4f8bb70bf9695d00 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_searchengine.py @@ -0,0 +1,332 @@ +"Test searchengine, coverage 99%." + +from idlelib import searchengine as se +import unittest +# from test.support import requires +from tkinter import BooleanVar, StringVar, TclError # ,Tk, Text +from tkinter import messagebox +from idlelib.idle_test.mock_tk import Var, Mbox +from idlelib.idle_test.mock_tk import Text as mockText +import re + +# With mock replacements, the module does not use any gui widgets. +# The use of tk.Text is avoided (for now, until mock Text is improved) +# by patching instances with an index function returning what is needed. +# This works because mock Text.get does not use .index. +# The tkinter imports are used to restore searchengine. + +def setUpModule(): + # Replace s-e module tkinter imports other than non-gui TclError. + se.BooleanVar = Var + se.StringVar = Var + se.messagebox = Mbox + +def tearDownModule(): + # Restore 'just in case', though other tests should also replace. + se.BooleanVar = BooleanVar + se.StringVar = StringVar + se.messagebox = messagebox + + +class Mock: + def __init__(self, *args, **kwargs): pass + +class GetTest(unittest.TestCase): + # SearchEngine.get returns singleton created & saved on first call. + def test_get(self): + saved_Engine = se.SearchEngine + se.SearchEngine = Mock # monkey-patch class + try: + root = Mock() + engine = se.get(root) + self.assertIsInstance(engine, se.SearchEngine) + self.assertIs(root._searchengine, engine) + self.assertIs(se.get(root), engine) + finally: + se.SearchEngine = saved_Engine # restore class to module + +class GetLineColTest(unittest.TestCase): + # Test simple text-independent helper function + def test_get_line_col(self): + self.assertEqual(se.get_line_col('1.0'), (1, 0)) + self.assertEqual(se.get_line_col('1.11'), (1, 11)) + + self.assertRaises(ValueError, se.get_line_col, ('1.0 lineend')) + self.assertRaises(ValueError, se.get_line_col, ('end')) + +class GetSelectionTest(unittest.TestCase): + # Test text-dependent helper function. +## # Need gui for text.index('sel.first/sel.last/insert'). +## @classmethod +## def setUpClass(cls): +## requires('gui') +## cls.root = Tk() +## +## @classmethod +## def tearDownClass(cls): +## cls.root.destroy() +## del cls.root + + def test_get_selection(self): + # text = Text(master=self.root) + text = mockText() + text.insert('1.0', 'Hello World!') + + # fix text.index result when called in get_selection + def sel(s): + # select entire text, cursor irrelevant + if s == 'sel.first': return '1.0' + if s == 'sel.last': return '1.12' + raise TclError + text.index = sel # replaces .tag_add('sel', '1.0, '1.12') + self.assertEqual(se.get_selection(text), ('1.0', '1.12')) + + def mark(s): + # no selection, cursor after 'Hello' + if s == 'insert': return '1.5' + raise TclError + text.index = mark # replaces .mark_set('insert', '1.5') + self.assertEqual(se.get_selection(text), ('1.5', '1.5')) + + +class ReverseSearchTest(unittest.TestCase): + # Test helper function that searches backwards within a line. + def test_search_reverse(self): + Equal = self.assertEqual + line = "Here is an 'is' test text." + prog = re.compile('is') + Equal(se.search_reverse(prog, line, len(line)).span(), (12, 14)) + Equal(se.search_reverse(prog, line, 14).span(), (12, 14)) + Equal(se.search_reverse(prog, line, 13).span(), (5, 7)) + Equal(se.search_reverse(prog, line, 7).span(), (5, 7)) + Equal(se.search_reverse(prog, line, 6), None) + + +class SearchEngineTest(unittest.TestCase): + # Test class methods that do not use Text widget. + + def setUp(self): + self.engine = se.SearchEngine(root=None) + # Engine.root is only used to create error message boxes. + # The mock replacement ignores the root argument. + + def test_is_get(self): + engine = self.engine + Equal = self.assertEqual + + Equal(engine.getpat(), '') + engine.setpat('hello') + Equal(engine.getpat(), 'hello') + + Equal(engine.isre(), False) + engine.revar.set(1) + Equal(engine.isre(), True) + + Equal(engine.iscase(), False) + engine.casevar.set(1) + Equal(engine.iscase(), True) + + Equal(engine.isword(), False) + engine.wordvar.set(1) + Equal(engine.isword(), True) + + Equal(engine.iswrap(), True) + engine.wrapvar.set(0) + Equal(engine.iswrap(), False) + + Equal(engine.isback(), False) + engine.backvar.set(1) + Equal(engine.isback(), True) + + def test_setcookedpat(self): + engine = self.engine + engine.setcookedpat(r'\s') + self.assertEqual(engine.getpat(), r'\s') + engine.revar.set(1) + engine.setcookedpat(r'\s') + self.assertEqual(engine.getpat(), r'\\s') + + def test_getcookedpat(self): + engine = self.engine + Equal = self.assertEqual + + Equal(engine.getcookedpat(), '') + engine.setpat('hello') + Equal(engine.getcookedpat(), 'hello') + engine.wordvar.set(True) + Equal(engine.getcookedpat(), r'\bhello\b') + engine.wordvar.set(False) + + engine.setpat(r'\s') + Equal(engine.getcookedpat(), r'\\s') + engine.revar.set(True) + Equal(engine.getcookedpat(), r'\s') + + def test_getprog(self): + engine = self.engine + Equal = self.assertEqual + + engine.setpat('Hello') + temppat = engine.getprog() + Equal(temppat.pattern, re.compile('Hello', re.IGNORECASE).pattern) + engine.casevar.set(1) + temppat = engine.getprog() + Equal(temppat.pattern, re.compile('Hello').pattern, 0) + + engine.setpat('') + Equal(engine.getprog(), None) + Equal(Mbox.showerror.message, + 'Error: Empty regular expression') + engine.setpat('+') + engine.revar.set(1) + Equal(engine.getprog(), None) + Equal(Mbox.showerror.message, + 'Error: nothing to repeat\nPattern: +\nOffset: 0') + + def test_report_error(self): + showerror = Mbox.showerror + Equal = self.assertEqual + pat = '[a-z' + msg = 'unexpected end of regular expression' + + Equal(self.engine.report_error(pat, msg), None) + Equal(showerror.title, 'Regular expression error') + expected_message = ("Error: " + msg + "\nPattern: [a-z") + Equal(showerror.message, expected_message) + + Equal(self.engine.report_error(pat, msg, 5), None) + Equal(showerror.title, 'Regular expression error') + expected_message += "\nOffset: 5" + Equal(showerror.message, expected_message) + + +class SearchTest(unittest.TestCase): + # Test that search_text makes right call to right method. + + @classmethod + def setUpClass(cls): +## requires('gui') +## cls.root = Tk() +## cls.text = Text(master=cls.root) + cls.text = mockText() + test_text = ( + 'First line\n' + 'Line with target\n' + 'Last line\n') + cls.text.insert('1.0', test_text) + cls.pat = re.compile('target') + + cls.engine = se.SearchEngine(None) + cls.engine.search_forward = lambda *args: ('f', args) + cls.engine.search_backward = lambda *args: ('b', args) + +## @classmethod +## def tearDownClass(cls): +## cls.root.destroy() +## del cls.root + + def test_search(self): + Equal = self.assertEqual + engine = self.engine + search = engine.search_text + text = self.text + pat = self.pat + + engine.patvar.set(None) + #engine.revar.set(pat) + Equal(search(text), None) + + def mark(s): + # no selection, cursor after 'Hello' + if s == 'insert': return '1.5' + raise TclError + text.index = mark + Equal(search(text, pat), ('f', (text, pat, 1, 5, True, False))) + engine.wrapvar.set(False) + Equal(search(text, pat), ('f', (text, pat, 1, 5, False, False))) + engine.wrapvar.set(True) + engine.backvar.set(True) + Equal(search(text, pat), ('b', (text, pat, 1, 5, True, False))) + engine.backvar.set(False) + + def sel(s): + if s == 'sel.first': return '2.10' + if s == 'sel.last': return '2.16' + raise TclError + text.index = sel + Equal(search(text, pat), ('f', (text, pat, 2, 16, True, False))) + Equal(search(text, pat, True), ('f', (text, pat, 2, 10, True, True))) + engine.backvar.set(True) + Equal(search(text, pat), ('b', (text, pat, 2, 10, True, False))) + Equal(search(text, pat, True), ('b', (text, pat, 2, 16, True, True))) + + +class ForwardBackwardTest(unittest.TestCase): + # Test that search_forward method finds the target. +## @classmethod +## def tearDownClass(cls): +## cls.root.destroy() +## del cls.root + + @classmethod + def setUpClass(cls): + cls.engine = se.SearchEngine(None) +## requires('gui') +## cls.root = Tk() +## cls.text = Text(master=cls.root) + cls.text = mockText() + # search_backward calls index('end-1c') + cls.text.index = lambda index: '4.0' + test_text = ( + 'First line\n' + 'Line with target\n' + 'Last line\n') + cls.text.insert('1.0', test_text) + cls.pat = re.compile('target') + cls.res = (2, (10, 16)) # line, slice indexes of 'target' + cls.failpat = re.compile('xyz') # not in text + cls.emptypat = re.compile(r'\w*') # empty match possible + + def make_search(self, func): + def search(pat, line, col, wrap, ok=0): + res = func(self.text, pat, line, col, wrap, ok) + # res is (line, matchobject) or None + return (res[0], res[1].span()) if res else res + return search + + def test_search_forward(self): + # search for non-empty match + Equal = self.assertEqual + forward = self.make_search(self.engine.search_forward) + pat = self.pat + Equal(forward(pat, 1, 0, True), self.res) + Equal(forward(pat, 3, 0, True), self.res) # wrap + Equal(forward(pat, 3, 0, False), None) # no wrap + Equal(forward(pat, 2, 10, False), self.res) + + Equal(forward(self.failpat, 1, 0, True), None) + Equal(forward(self.emptypat, 2, 9, True, ok=True), (2, (9, 9))) + #Equal(forward(self.emptypat, 2, 9, True), self.res) + # While the initial empty match is correctly ignored, skipping + # the rest of the line and returning (3, (0,4)) seems buggy - tjr. + Equal(forward(self.emptypat, 2, 10, True), self.res) + + def test_search_backward(self): + # search for non-empty match + Equal = self.assertEqual + backward = self.make_search(self.engine.search_backward) + pat = self.pat + Equal(backward(pat, 3, 5, True), self.res) + Equal(backward(pat, 2, 0, True), self.res) # wrap + Equal(backward(pat, 2, 0, False), None) # no wrap + Equal(backward(pat, 2, 16, False), self.res) + + Equal(backward(self.failpat, 3, 9, True), None) + Equal(backward(self.emptypat, 2, 10, True, ok=True), (2, (9,9))) + # Accepted because 9 < 10, not because ok=True. + # It is not clear that ok=True is useful going back - tjr + Equal(backward(self.emptypat, 2, 9, True), (2, (5, 9))) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_sidebar.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_sidebar.py new file mode 100644 index 0000000000000000000000000000000000000000..605e7a892570d7d7003095551ce1a27c3a8e9e0f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_sidebar.py @@ -0,0 +1,775 @@ +"""Test sidebar, coverage 85%""" +from textwrap import dedent +import sys + +from itertools import chain +import unittest +import unittest.mock +from test.support import requires, swap_attr +from test import support +import tkinter as tk +from idlelib.idle_test.tkinter_testing_utils import run_in_tk_mainloop + +from idlelib.delegator import Delegator +from idlelib.editor import fixwordbreaks +from idlelib.percolator import Percolator +import idlelib.pyshell +from idlelib.pyshell import fix_x11_paste, PyShell, PyShellFileList +from idlelib.run import fix_scaling +import idlelib.sidebar +from idlelib.sidebar import get_end_linenumber, get_lineno + + +class Dummy_editwin: + def __init__(self, text): + self.text = text + self.text_frame = self.text.master + self.per = Percolator(text) + self.undo = Delegator() + self.per.insertfilter(self.undo) + + def setvar(self, name, value): + pass + + def getlineno(self, index): + return int(float(self.text.index(index))) + + +class LineNumbersTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = tk.Tk() + cls.root.withdraw() + + cls.text_frame = tk.Frame(cls.root) + cls.text_frame.pack(side=tk.LEFT, fill=tk.BOTH, expand=True) + cls.text_frame.rowconfigure(1, weight=1) + cls.text_frame.columnconfigure(1, weight=1) + + cls.text = tk.Text(cls.text_frame, width=80, height=24, wrap=tk.NONE) + cls.text.grid(row=1, column=1, sticky=tk.NSEW) + + cls.editwin = Dummy_editwin(cls.text) + cls.editwin.vbar = tk.Scrollbar(cls.text_frame) + + @classmethod + def tearDownClass(cls): + cls.editwin.per.close() + cls.root.update_idletasks() + cls.root.destroy() + del cls.text, cls.text_frame, cls.editwin, cls.root + + def setUp(self): + self.linenumber = idlelib.sidebar.LineNumbers(self.editwin) + + self.highlight_cfg = {"background": '#abcdef', + "foreground": '#123456'} + orig_idleConf_GetHighlight = idlelib.sidebar.idleConf.GetHighlight + def mock_idleconf_GetHighlight(theme, element): + if element == 'linenumber': + return self.highlight_cfg + return orig_idleConf_GetHighlight(theme, element) + GetHighlight_patcher = unittest.mock.patch.object( + idlelib.sidebar.idleConf, 'GetHighlight', mock_idleconf_GetHighlight) + GetHighlight_patcher.start() + self.addCleanup(GetHighlight_patcher.stop) + + self.font_override = 'TkFixedFont' + def mock_idleconf_GetFont(root, configType, section): + return self.font_override + GetFont_patcher = unittest.mock.patch.object( + idlelib.sidebar.idleConf, 'GetFont', mock_idleconf_GetFont) + GetFont_patcher.start() + self.addCleanup(GetFont_patcher.stop) + + def tearDown(self): + self.text.delete('1.0', 'end') + + def get_selection(self): + return tuple(map(str, self.text.tag_ranges('sel'))) + + def get_line_screen_position(self, line): + bbox = self.linenumber.sidebar_text.bbox(f'{line}.end -1c') + x = bbox[0] + 2 + y = bbox[1] + 2 + return x, y + + def assert_state_disabled(self): + state = self.linenumber.sidebar_text.config()['state'] + self.assertEqual(state[-1], tk.DISABLED) + + def get_sidebar_text_contents(self): + return self.linenumber.sidebar_text.get('1.0', tk.END) + + def assert_sidebar_n_lines(self, n_lines): + expected = '\n'.join(chain(map(str, range(1, n_lines + 1)), [''])) + self.assertEqual(self.get_sidebar_text_contents(), expected) + + def assert_text_equals(self, expected): + return self.assertEqual(self.text.get('1.0', 'end'), expected) + + def test_init_empty(self): + self.assert_sidebar_n_lines(1) + + def test_init_not_empty(self): + self.text.insert('insert', 'foo bar\n'*3) + self.assert_text_equals('foo bar\n'*3 + '\n') + self.assert_sidebar_n_lines(4) + + def test_toggle_linenumbering(self): + self.assertEqual(self.linenumber.is_shown, False) + self.linenumber.show_sidebar() + self.assertEqual(self.linenumber.is_shown, True) + self.linenumber.hide_sidebar() + self.assertEqual(self.linenumber.is_shown, False) + self.linenumber.hide_sidebar() + self.assertEqual(self.linenumber.is_shown, False) + self.linenumber.show_sidebar() + self.assertEqual(self.linenumber.is_shown, True) + self.linenumber.show_sidebar() + self.assertEqual(self.linenumber.is_shown, True) + + def test_insert(self): + self.text.insert('insert', 'foobar') + self.assert_text_equals('foobar\n') + self.assert_sidebar_n_lines(1) + self.assert_state_disabled() + + self.text.insert('insert', '\nfoo') + self.assert_text_equals('foobar\nfoo\n') + self.assert_sidebar_n_lines(2) + self.assert_state_disabled() + + self.text.insert('insert', 'hello\n'*2) + self.assert_text_equals('foobar\nfoohello\nhello\n\n') + self.assert_sidebar_n_lines(4) + self.assert_state_disabled() + + self.text.insert('insert', '\nworld') + self.assert_text_equals('foobar\nfoohello\nhello\n\nworld\n') + self.assert_sidebar_n_lines(5) + self.assert_state_disabled() + + def test_delete(self): + self.text.insert('insert', 'foobar') + self.assert_text_equals('foobar\n') + self.text.delete('1.1', '1.3') + self.assert_text_equals('fbar\n') + self.assert_sidebar_n_lines(1) + self.assert_state_disabled() + + self.text.insert('insert', 'foo\n'*2) + self.assert_text_equals('fbarfoo\nfoo\n\n') + self.assert_sidebar_n_lines(3) + self.assert_state_disabled() + + # Deleting up to "2.end" doesn't delete the final newline. + self.text.delete('2.0', '2.end') + self.assert_text_equals('fbarfoo\n\n\n') + self.assert_sidebar_n_lines(3) + self.assert_state_disabled() + + self.text.delete('1.3', 'end') + self.assert_text_equals('fba\n') + self.assert_sidebar_n_lines(1) + self.assert_state_disabled() + + # Text widgets always keep a single '\n' character at the end. + self.text.delete('1.0', 'end') + self.assert_text_equals('\n') + self.assert_sidebar_n_lines(1) + self.assert_state_disabled() + + def test_sidebar_text_width(self): + """ + Test that linenumber text widget is always at the minimum + width + """ + def get_width(): + return self.linenumber.sidebar_text.config()['width'][-1] + + self.assert_sidebar_n_lines(1) + self.assertEqual(get_width(), 1) + + self.text.insert('insert', 'foo') + self.assert_sidebar_n_lines(1) + self.assertEqual(get_width(), 1) + + self.text.insert('insert', 'foo\n'*8) + self.assert_sidebar_n_lines(9) + self.assertEqual(get_width(), 1) + + self.text.insert('insert', 'foo\n') + self.assert_sidebar_n_lines(10) + self.assertEqual(get_width(), 2) + + self.text.insert('insert', 'foo\n') + self.assert_sidebar_n_lines(11) + self.assertEqual(get_width(), 2) + + self.text.delete('insert -1l linestart', 'insert linestart') + self.assert_sidebar_n_lines(10) + self.assertEqual(get_width(), 2) + + self.text.delete('insert -1l linestart', 'insert linestart') + self.assert_sidebar_n_lines(9) + self.assertEqual(get_width(), 1) + + self.text.insert('insert', 'foo\n'*90) + self.assert_sidebar_n_lines(99) + self.assertEqual(get_width(), 2) + + self.text.insert('insert', 'foo\n') + self.assert_sidebar_n_lines(100) + self.assertEqual(get_width(), 3) + + self.text.insert('insert', 'foo\n') + self.assert_sidebar_n_lines(101) + self.assertEqual(get_width(), 3) + + self.text.delete('insert -1l linestart', 'insert linestart') + self.assert_sidebar_n_lines(100) + self.assertEqual(get_width(), 3) + + self.text.delete('insert -1l linestart', 'insert linestart') + self.assert_sidebar_n_lines(99) + self.assertEqual(get_width(), 2) + + self.text.delete('50.0 -1c', 'end -1c') + self.assert_sidebar_n_lines(49) + self.assertEqual(get_width(), 2) + + self.text.delete('5.0 -1c', 'end -1c') + self.assert_sidebar_n_lines(4) + self.assertEqual(get_width(), 1) + + # Text widgets always keep a single '\n' character at the end. + self.text.delete('1.0', 'end -1c') + self.assert_sidebar_n_lines(1) + self.assertEqual(get_width(), 1) + + # The following tests are temporarily disabled due to relying on + # simulated user input and inspecting which text is selected, which + # are fragile and can fail when several GUI tests are run in parallel + # or when the windows created by the test lose focus. + # + # TODO: Re-work these tests or remove them from the test suite. + + @unittest.skip('test disabled') + def test_click_selection(self): + self.linenumber.show_sidebar() + self.text.insert('1.0', 'one\ntwo\nthree\nfour\n') + self.root.update() + + # Click on the second line. + x, y = self.get_line_screen_position(2) + self.linenumber.sidebar_text.event_generate('', x=x, y=y) + self.linenumber.sidebar_text.update() + self.root.update() + + self.assertEqual(self.get_selection(), ('2.0', '3.0')) + + def simulate_drag(self, start_line, end_line): + start_x, start_y = self.get_line_screen_position(start_line) + end_x, end_y = self.get_line_screen_position(end_line) + + self.linenumber.sidebar_text.event_generate('', + x=start_x, y=start_y) + self.root.update() + + def lerp(a, b, steps): + """linearly interpolate from a to b (inclusive) in equal steps""" + last_step = steps - 1 + for i in range(steps): + yield ((last_step - i) / last_step) * a + (i / last_step) * b + + for x, y in zip( + map(int, lerp(start_x, end_x, steps=11)), + map(int, lerp(start_y, end_y, steps=11)), + ): + self.linenumber.sidebar_text.event_generate('', x=x, y=y) + self.root.update() + + self.linenumber.sidebar_text.event_generate('', + x=end_x, y=end_y) + self.root.update() + + @unittest.skip('test disabled') + def test_drag_selection_down(self): + self.linenumber.show_sidebar() + self.text.insert('1.0', 'one\ntwo\nthree\nfour\nfive\n') + self.root.update() + + # Drag from the second line to the fourth line. + self.simulate_drag(2, 4) + self.assertEqual(self.get_selection(), ('2.0', '5.0')) + + @unittest.skip('test disabled') + def test_drag_selection_up(self): + self.linenumber.show_sidebar() + self.text.insert('1.0', 'one\ntwo\nthree\nfour\nfive\n') + self.root.update() + + # Drag from the fourth line to the second line. + self.simulate_drag(4, 2) + self.assertEqual(self.get_selection(), ('2.0', '5.0')) + + def test_scroll(self): + self.linenumber.show_sidebar() + self.text.insert('1.0', 'line\n' * 100) + self.root.update() + + # Scroll down 10 lines. + self.text.yview_scroll(10, 'unit') + self.root.update() + self.assertEqual(self.text.index('@0,0'), '11.0') + self.assertEqual(self.linenumber.sidebar_text.index('@0,0'), '11.0') + + # Generate a mouse-wheel event and make sure it scrolled up or down. + # The meaning of the "delta" is OS-dependent, so this just checks for + # any change. + self.linenumber.sidebar_text.event_generate('', + x=0, y=0, + delta=10) + self.root.update() + self.assertNotEqual(self.text.index('@0,0'), '11.0') + self.assertNotEqual(self.linenumber.sidebar_text.index('@0,0'), '11.0') + + def test_font(self): + ln = self.linenumber + + orig_font = ln.sidebar_text['font'] + test_font = 'TkTextFont' + self.assertNotEqual(orig_font, test_font) + + # Ensure line numbers aren't shown. + ln.hide_sidebar() + + self.font_override = test_font + # Nothing breaks when line numbers aren't shown. + ln.update_font() + + # Activate line numbers, previous font change is immediately effective. + ln.show_sidebar() + self.assertEqual(ln.sidebar_text['font'], test_font) + + # Call the font update with line numbers shown, change is picked up. + self.font_override = orig_font + ln.update_font() + self.assertEqual(ln.sidebar_text['font'], orig_font) + + def test_highlight_colors(self): + ln = self.linenumber + + orig_colors = dict(self.highlight_cfg) + test_colors = {'background': '#222222', 'foreground': '#ffff00'} + + def assert_colors_are_equal(colors): + self.assertEqual(ln.sidebar_text['background'], colors['background']) + self.assertEqual(ln.sidebar_text['foreground'], colors['foreground']) + + # Ensure line numbers aren't shown. + ln.hide_sidebar() + + self.highlight_cfg = test_colors + # Nothing breaks with inactive line numbers. + ln.update_colors() + + # Show line numbers, previous colors change is immediately effective. + ln.show_sidebar() + assert_colors_are_equal(test_colors) + + # Call colors update with no change to the configured colors. + ln.update_colors() + assert_colors_are_equal(test_colors) + + # Call the colors update with line numbers shown, change is picked up. + self.highlight_cfg = orig_colors + ln.update_colors() + assert_colors_are_equal(orig_colors) + + +class ShellSidebarTest(unittest.TestCase): + root: tk.Tk = None + shell: PyShell = None + + @classmethod + def setUpClass(cls): + requires('gui') + + cls.root = root = tk.Tk() + root.withdraw() + + fix_scaling(root) + fixwordbreaks(root) + fix_x11_paste(root) + + cls.flist = flist = PyShellFileList(root) + # See #43981 about macosx.setupApp(root, flist) causing failure. + root.update_idletasks() + + cls.init_shell() + + @classmethod + def tearDownClass(cls): + if cls.shell is not None: + cls.shell.executing = False + cls.shell.close() + cls.shell = None + cls.flist = None + cls.root.update_idletasks() + cls.root.destroy() + cls.root = None + + @classmethod + def init_shell(cls): + cls.shell = cls.flist.open_shell() + cls.shell.pollinterval = 10 + cls.root.update() + cls.n_preface_lines = get_lineno(cls.shell.text, 'end-1c') - 1 + + @classmethod + def reset_shell(cls): + cls.shell.per.bottom.delete(f'{cls.n_preface_lines+1}.0', 'end-1c') + cls.shell.shell_sidebar.update_sidebar() + cls.root.update() + + def setUp(self): + # In some test environments, e.g. Azure Pipelines (as of + # Apr. 2021), sys.stdout is changed between tests. However, + # PyShell relies on overriding sys.stdout when run without a + # sub-process (as done here; see setUpClass). + self._saved_stdout = None + if sys.stdout != self.shell.stdout: + self._saved_stdout = sys.stdout + sys.stdout = self.shell.stdout + + self.reset_shell() + + def tearDown(self): + if self._saved_stdout is not None: + sys.stdout = self._saved_stdout + + def get_sidebar_lines(self): + canvas = self.shell.shell_sidebar.canvas + texts = list(canvas.find(tk.ALL)) + texts_by_y_coords = { + canvas.bbox(text)[1]: canvas.itemcget(text, 'text') + for text in texts + } + line_y_coords = self.get_shell_line_y_coords() + return [texts_by_y_coords.get(y, None) for y in line_y_coords] + + def assert_sidebar_lines_end_with(self, expected_lines): + self.shell.shell_sidebar.update_sidebar() + self.assertEqual( + self.get_sidebar_lines()[-len(expected_lines):], + expected_lines, + ) + + def get_shell_line_y_coords(self): + text = self.shell.text + y_coords = [] + index = text.index("@0,0") + if index.split('.', 1)[1] != '0': + index = text.index(f"{index} +1line linestart") + while (lineinfo := text.dlineinfo(index)) is not None: + y_coords.append(lineinfo[1]) + index = text.index(f"{index} +1line") + return y_coords + + def get_sidebar_line_y_coords(self): + canvas = self.shell.shell_sidebar.canvas + texts = list(canvas.find(tk.ALL)) + texts.sort(key=lambda text: canvas.bbox(text)[1]) + return [canvas.bbox(text)[1] for text in texts] + + def assert_sidebar_lines_synced(self): + self.assertLessEqual( + set(self.get_sidebar_line_y_coords()), + set(self.get_shell_line_y_coords()), + ) + + def do_input(self, input): + shell = self.shell + text = shell.text + for line_index, line in enumerate(input.split('\n')): + if line_index > 0: + text.event_generate('<>') + text.insert('insert', line, 'stdin') + + def test_initial_state(self): + sidebar_lines = self.get_sidebar_lines() + self.assertEqual( + sidebar_lines, + [None] * (len(sidebar_lines) - 1) + ['>>>'], + ) + self.assert_sidebar_lines_synced() + + @run_in_tk_mainloop() + def test_single_empty_input(self): + self.do_input('\n') + yield + self.assert_sidebar_lines_end_with(['>>>', '>>>']) + + @run_in_tk_mainloop() + def test_single_line_statement(self): + self.do_input('1\n') + yield + self.assert_sidebar_lines_end_with(['>>>', None, '>>>']) + + @run_in_tk_mainloop() + def test_multi_line_statement(self): + # Block statements are not indented because IDLE auto-indents. + self.do_input(dedent('''\ + if True: + print(1) + + ''')) + yield + self.assert_sidebar_lines_end_with([ + '>>>', + '...', + '...', + '...', + None, + '>>>', + ]) + + @run_in_tk_mainloop() + def test_single_long_line_wraps(self): + self.do_input('1' * 200 + '\n') + yield + self.assert_sidebar_lines_end_with(['>>>', None, '>>>']) + self.assert_sidebar_lines_synced() + + @run_in_tk_mainloop() + def test_squeeze_multi_line_output(self): + shell = self.shell + text = shell.text + + self.do_input('print("a\\nb\\nc")\n') + yield + self.assert_sidebar_lines_end_with(['>>>', None, None, None, '>>>']) + + text.mark_set('insert', f'insert -1line linestart') + text.event_generate('<>') + yield + self.assert_sidebar_lines_end_with(['>>>', None, '>>>']) + self.assert_sidebar_lines_synced() + + shell.squeezer.expandingbuttons[0].expand() + yield + self.assert_sidebar_lines_end_with(['>>>', None, None, None, '>>>']) + self.assert_sidebar_lines_synced() + + @run_in_tk_mainloop() + def test_interrupt_recall_undo_redo(self): + text = self.shell.text + # Block statements are not indented because IDLE auto-indents. + initial_sidebar_lines = self.get_sidebar_lines() + + self.do_input(dedent('''\ + if True: + print(1) + ''')) + yield + self.assert_sidebar_lines_end_with(['>>>', '...', '...']) + with_block_sidebar_lines = self.get_sidebar_lines() + self.assertNotEqual(with_block_sidebar_lines, initial_sidebar_lines) + + # Control-C + text.event_generate('<>') + yield + self.assert_sidebar_lines_end_with(['>>>', '...', '...', None, '>>>']) + + # Recall previous via history + text.event_generate('<>') + text.event_generate('<>') + yield + self.assert_sidebar_lines_end_with(['>>>', '...', None, '>>>']) + + # Recall previous via recall + text.mark_set('insert', text.index('insert -2l')) + text.event_generate('<>') + yield + + text.event_generate('<>') + yield + self.assert_sidebar_lines_end_with(['>>>']) + + text.event_generate('<>') + yield + self.assert_sidebar_lines_end_with(['>>>', '...']) + + text.event_generate('<>') + text.event_generate('<>') + yield + self.assert_sidebar_lines_end_with( + ['>>>', '...', '...', '...', None, '>>>'] + ) + + @run_in_tk_mainloop() + def test_very_long_wrapped_line(self): + with support.adjust_int_max_str_digits(11_111), \ + swap_attr(self.shell, 'squeezer', None): + self.do_input('x = ' + '1'*10_000 + '\n') + yield + self.assertEqual(self.get_sidebar_lines(), ['>>>']) + + def test_font(self): + sidebar = self.shell.shell_sidebar + + test_font = 'TkTextFont' + + def mock_idleconf_GetFont(root, configType, section): + return test_font + GetFont_patcher = unittest.mock.patch.object( + idlelib.sidebar.idleConf, 'GetFont', mock_idleconf_GetFont) + GetFont_patcher.start() + def cleanup(): + GetFont_patcher.stop() + sidebar.update_font() + self.addCleanup(cleanup) + + def get_sidebar_font(): + canvas = sidebar.canvas + texts = list(canvas.find(tk.ALL)) + fonts = {canvas.itemcget(text, 'font') for text in texts} + self.assertEqual(len(fonts), 1) + return next(iter(fonts)) + + self.assertNotEqual(get_sidebar_font(), test_font) + sidebar.update_font() + self.assertEqual(get_sidebar_font(), test_font) + + def test_highlight_colors(self): + sidebar = self.shell.shell_sidebar + + test_colors = {"background": '#abcdef', "foreground": '#123456'} + + orig_idleConf_GetHighlight = idlelib.sidebar.idleConf.GetHighlight + def mock_idleconf_GetHighlight(theme, element): + if element in ['linenumber', 'console']: + return test_colors + return orig_idleConf_GetHighlight(theme, element) + GetHighlight_patcher = unittest.mock.patch.object( + idlelib.sidebar.idleConf, 'GetHighlight', + mock_idleconf_GetHighlight) + GetHighlight_patcher.start() + def cleanup(): + GetHighlight_patcher.stop() + sidebar.update_colors() + self.addCleanup(cleanup) + + def get_sidebar_colors(): + canvas = sidebar.canvas + texts = list(canvas.find(tk.ALL)) + fgs = {canvas.itemcget(text, 'fill') for text in texts} + self.assertEqual(len(fgs), 1) + fg = next(iter(fgs)) + bg = canvas.cget('background') + return {"background": bg, "foreground": fg} + + self.assertNotEqual(get_sidebar_colors(), test_colors) + sidebar.update_colors() + self.assertEqual(get_sidebar_colors(), test_colors) + + @run_in_tk_mainloop() + def test_mousewheel(self): + sidebar = self.shell.shell_sidebar + text = self.shell.text + + # Enter a 100-line string to scroll the shell screen down. + self.do_input('x = """' + '\n'*100 + '"""\n') + yield + self.assertGreater(get_lineno(text, '@0,0'), 1) + + last_lineno = get_end_linenumber(text) + self.assertIsNotNone(text.dlineinfo(text.index(f'{last_lineno}.0'))) + + # Delta for , whose meaning is platform-dependent. + delta = 1 if sidebar.canvas._windowingsystem == 'aqua' else 120 + + # Scroll up. + if sidebar.canvas._windowingsystem == 'x11': + sidebar.canvas.event_generate('', x=0, y=0) + else: + sidebar.canvas.event_generate('', x=0, y=0, delta=delta) + yield + self.assertIsNone(text.dlineinfo(text.index(f'{last_lineno}.0'))) + + # Scroll back down. + if sidebar.canvas._windowingsystem == 'x11': + sidebar.canvas.event_generate('', x=0, y=0) + else: + sidebar.canvas.event_generate('', x=0, y=0, delta=-delta) + yield + self.assertIsNotNone(text.dlineinfo(text.index(f'{last_lineno}.0'))) + + @run_in_tk_mainloop() + def test_copy(self): + sidebar = self.shell.shell_sidebar + text = self.shell.text + + first_line = get_end_linenumber(text) + + self.do_input(dedent('''\ + if True: + print(1) + + ''')) + yield + + text.tag_add('sel', f'{first_line}.0', 'end-1c') + selected_text = text.get('sel.first', 'sel.last') + self.assertTrue(selected_text.startswith('if True:\n')) + self.assertIn('\n1\n', selected_text) + + text.event_generate('<>') + self.addCleanup(text.clipboard_clear) + + copied_text = text.clipboard_get() + self.assertEqual(copied_text, selected_text) + + @run_in_tk_mainloop() + def test_copy_with_prompts(self): + sidebar = self.shell.shell_sidebar + text = self.shell.text + + first_line = get_end_linenumber(text) + self.do_input(dedent('''\ + if True: + print(1) + + ''')) + yield + + text.tag_add('sel', f'{first_line}.3', 'end-1c') + selected_text = text.get('sel.first', 'sel.last') + self.assertTrue(selected_text.startswith('True:\n')) + + selected_lines_text = text.get('sel.first linestart', 'sel.last') + selected_lines = selected_lines_text.split('\n') + selected_lines.pop() # Final '' is a split artifact, not a line. + # Expect a block of input and a single output line. + expected_prompts = \ + ['>>>'] + ['...'] * (len(selected_lines) - 2) + [None] + selected_text_with_prompts = '\n'.join( + line if prompt is None else prompt + ' ' + line + for prompt, line in zip(expected_prompts, + selected_lines, + strict=True) + ) + '\n' + + text.event_generate('<>') + self.addCleanup(text.clipboard_clear) + + copied_text = text.clipboard_get() + self.assertEqual(copied_text, selected_text_with_prompts) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_squeezer.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_squeezer.py new file mode 100644 index 0000000000000000000000000000000000000000..86c5d41b6297192ff56f7ec07fcb28e136b9a3a8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_squeezer.py @@ -0,0 +1,466 @@ +"Test squeezer, coverage 95%" + +from textwrap import dedent +from tkinter import Text, Tk +import unittest +from unittest.mock import Mock, NonCallableMagicMock, patch, sentinel, ANY +from test.support import requires + +from idlelib.config import idleConf +from idlelib.percolator import Percolator +from idlelib.squeezer import count_lines_with_wrapping, ExpandingButton, \ + Squeezer +from idlelib import macosx +from idlelib.textview import view_text +from idlelib.tooltip import Hovertip + +SENTINEL_VALUE = sentinel.SENTINEL_VALUE + + +def get_test_tk_root(test_instance): + """Helper for tests: Create a root Tk object.""" + requires('gui') + root = Tk() + root.withdraw() + + def cleanup_root(): + root.update_idletasks() + root.destroy() + test_instance.addCleanup(cleanup_root) + + return root + + +class CountLinesTest(unittest.TestCase): + """Tests for the count_lines_with_wrapping function.""" + def check(self, expected, text, linewidth): + return self.assertEqual( + expected, + count_lines_with_wrapping(text, linewidth), + ) + + def test_count_empty(self): + """Test with an empty string.""" + self.assertEqual(count_lines_with_wrapping(""), 0) + + def test_count_begins_with_empty_line(self): + """Test with a string which begins with a newline.""" + self.assertEqual(count_lines_with_wrapping("\ntext"), 2) + + def test_count_ends_with_empty_line(self): + """Test with a string which ends with a newline.""" + self.assertEqual(count_lines_with_wrapping("text\n"), 1) + + def test_count_several_lines(self): + """Test with several lines of text.""" + self.assertEqual(count_lines_with_wrapping("1\n2\n3\n"), 3) + + def test_empty_lines(self): + self.check(expected=1, text='\n', linewidth=80) + self.check(expected=2, text='\n\n', linewidth=80) + self.check(expected=10, text='\n' * 10, linewidth=80) + + def test_long_line(self): + self.check(expected=3, text='a' * 200, linewidth=80) + self.check(expected=3, text='a' * 200 + '\n', linewidth=80) + + def test_several_lines_different_lengths(self): + text = dedent("""\ + 13 characters + 43 is the number of characters on this line + + 7 chars + 13 characters""") + self.check(expected=5, text=text, linewidth=80) + self.check(expected=5, text=text + '\n', linewidth=80) + self.check(expected=6, text=text, linewidth=40) + self.check(expected=7, text=text, linewidth=20) + self.check(expected=11, text=text, linewidth=10) + + +class SqueezerTest(unittest.TestCase): + """Tests for the Squeezer class.""" + def make_mock_editor_window(self, with_text_widget=False): + """Create a mock EditorWindow instance.""" + editwin = NonCallableMagicMock() + editwin.width = 80 + + if with_text_widget: + editwin.root = get_test_tk_root(self) + text_widget = self.make_text_widget(root=editwin.root) + editwin.text = editwin.per.bottom = text_widget + + return editwin + + def make_squeezer_instance(self, editor_window=None): + """Create an actual Squeezer instance with a mock EditorWindow.""" + if editor_window is None: + editor_window = self.make_mock_editor_window() + squeezer = Squeezer(editor_window) + return squeezer + + def make_text_widget(self, root=None): + if root is None: + root = get_test_tk_root(self) + text_widget = Text(root) + text_widget["font"] = ('Courier', 10) + text_widget.mark_set("iomark", "1.0") + return text_widget + + def set_idleconf_option_with_cleanup(self, configType, section, option, value): + prev_val = idleConf.GetOption(configType, section, option) + idleConf.SetOption(configType, section, option, value) + self.addCleanup(idleConf.SetOption, + configType, section, option, prev_val) + + def test_count_lines(self): + """Test Squeezer.count_lines() with various inputs.""" + editwin = self.make_mock_editor_window() + squeezer = self.make_squeezer_instance(editwin) + + for text_code, line_width, expected in [ + (r"'\n'", 80, 1), + (r"'\n' * 3", 80, 3), + (r"'a' * 40 + '\n'", 80, 1), + (r"'a' * 80 + '\n'", 80, 1), + (r"'a' * 200 + '\n'", 80, 3), + (r"'aa\t' * 20", 80, 2), + (r"'aa\t' * 21", 80, 3), + (r"'aa\t' * 20", 40, 4), + ]: + with self.subTest(text_code=text_code, + line_width=line_width, + expected=expected): + text = eval(text_code) + with patch.object(editwin, 'width', line_width): + self.assertEqual(squeezer.count_lines(text), expected) + + def test_init(self): + """Test the creation of Squeezer instances.""" + editwin = self.make_mock_editor_window() + squeezer = self.make_squeezer_instance(editwin) + self.assertIs(squeezer.editwin, editwin) + self.assertEqual(squeezer.expandingbuttons, []) + + def test_write_no_tags(self): + """Test Squeezer's overriding of the EditorWindow's write() method.""" + editwin = self.make_mock_editor_window() + for text in ['', 'TEXT', 'LONG TEXT' * 1000, 'MANY_LINES\n' * 100]: + editwin.write = orig_write = Mock(return_value=SENTINEL_VALUE) + squeezer = self.make_squeezer_instance(editwin) + + self.assertEqual(squeezer.editwin.write(text, ()), SENTINEL_VALUE) + self.assertEqual(orig_write.call_count, 1) + orig_write.assert_called_with(text, ()) + self.assertEqual(len(squeezer.expandingbuttons), 0) + + def test_write_not_stdout(self): + """Test Squeezer's overriding of the EditorWindow's write() method.""" + for text in ['', 'TEXT', 'LONG TEXT' * 1000, 'MANY_LINES\n' * 100]: + editwin = self.make_mock_editor_window() + editwin.write.return_value = SENTINEL_VALUE + orig_write = editwin.write + squeezer = self.make_squeezer_instance(editwin) + + self.assertEqual(squeezer.editwin.write(text, "stderr"), + SENTINEL_VALUE) + self.assertEqual(orig_write.call_count, 1) + orig_write.assert_called_with(text, "stderr") + self.assertEqual(len(squeezer.expandingbuttons), 0) + + def test_write_stdout(self): + """Test Squeezer's overriding of the EditorWindow's write() method.""" + editwin = self.make_mock_editor_window() + + for text in ['', 'TEXT']: + editwin.write = orig_write = Mock(return_value=SENTINEL_VALUE) + squeezer = self.make_squeezer_instance(editwin) + squeezer.auto_squeeze_min_lines = 50 + + self.assertEqual(squeezer.editwin.write(text, "stdout"), + SENTINEL_VALUE) + self.assertEqual(orig_write.call_count, 1) + orig_write.assert_called_with(text, "stdout") + self.assertEqual(len(squeezer.expandingbuttons), 0) + + for text in ['LONG TEXT' * 1000, 'MANY_LINES\n' * 100]: + editwin.write = orig_write = Mock(return_value=SENTINEL_VALUE) + squeezer = self.make_squeezer_instance(editwin) + squeezer.auto_squeeze_min_lines = 50 + + self.assertEqual(squeezer.editwin.write(text, "stdout"), None) + self.assertEqual(orig_write.call_count, 0) + self.assertEqual(len(squeezer.expandingbuttons), 1) + + def test_auto_squeeze(self): + """Test that the auto-squeezing creates an ExpandingButton properly.""" + editwin = self.make_mock_editor_window(with_text_widget=True) + text_widget = editwin.text + squeezer = self.make_squeezer_instance(editwin) + squeezer.auto_squeeze_min_lines = 5 + squeezer.count_lines = Mock(return_value=6) + + editwin.write('TEXT\n'*6, "stdout") + self.assertEqual(text_widget.get('1.0', 'end'), '\n') + self.assertEqual(len(squeezer.expandingbuttons), 1) + + def test_squeeze_current_text(self): + """Test the squeeze_current_text method.""" + # Squeezing text should work for both stdout and stderr. + for tag_name in ["stdout", "stderr"]: + editwin = self.make_mock_editor_window(with_text_widget=True) + text_widget = editwin.text + squeezer = self.make_squeezer_instance(editwin) + squeezer.count_lines = Mock(return_value=6) + + # Prepare some text in the Text widget. + text_widget.insert("1.0", "SOME\nTEXT\n", tag_name) + text_widget.mark_set("insert", "1.0") + self.assertEqual(text_widget.get('1.0', 'end'), 'SOME\nTEXT\n\n') + + self.assertEqual(len(squeezer.expandingbuttons), 0) + + # Test squeezing the current text. + retval = squeezer.squeeze_current_text() + self.assertEqual(retval, "break") + self.assertEqual(text_widget.get('1.0', 'end'), '\n\n') + self.assertEqual(len(squeezer.expandingbuttons), 1) + self.assertEqual(squeezer.expandingbuttons[0].s, 'SOME\nTEXT') + + # Test that expanding the squeezed text works and afterwards + # the Text widget contains the original text. + squeezer.expandingbuttons[0].expand() + self.assertEqual(text_widget.get('1.0', 'end'), 'SOME\nTEXT\n\n') + self.assertEqual(len(squeezer.expandingbuttons), 0) + + def test_squeeze_current_text_no_allowed_tags(self): + """Test that the event doesn't squeeze text without a relevant tag.""" + editwin = self.make_mock_editor_window(with_text_widget=True) + text_widget = editwin.text + squeezer = self.make_squeezer_instance(editwin) + squeezer.count_lines = Mock(return_value=6) + + # Prepare some text in the Text widget. + text_widget.insert("1.0", "SOME\nTEXT\n", "TAG") + text_widget.mark_set("insert", "1.0") + self.assertEqual(text_widget.get('1.0', 'end'), 'SOME\nTEXT\n\n') + + self.assertEqual(len(squeezer.expandingbuttons), 0) + + # Test squeezing the current text. + retval = squeezer.squeeze_current_text() + self.assertEqual(retval, "break") + self.assertEqual(text_widget.get('1.0', 'end'), 'SOME\nTEXT\n\n') + self.assertEqual(len(squeezer.expandingbuttons), 0) + + def test_squeeze_text_before_existing_squeezed_text(self): + """Test squeezing text before existing squeezed text.""" + editwin = self.make_mock_editor_window(with_text_widget=True) + text_widget = editwin.text + squeezer = self.make_squeezer_instance(editwin) + squeezer.count_lines = Mock(return_value=6) + + # Prepare some text in the Text widget and squeeze it. + text_widget.insert("1.0", "SOME\nTEXT\n", "stdout") + text_widget.mark_set("insert", "1.0") + squeezer.squeeze_current_text() + self.assertEqual(len(squeezer.expandingbuttons), 1) + + # Test squeezing the current text. + text_widget.insert("1.0", "MORE\nSTUFF\n", "stdout") + text_widget.mark_set("insert", "1.0") + retval = squeezer.squeeze_current_text() + self.assertEqual(retval, "break") + self.assertEqual(text_widget.get('1.0', 'end'), '\n\n\n') + self.assertEqual(len(squeezer.expandingbuttons), 2) + self.assertTrue(text_widget.compare( + squeezer.expandingbuttons[0], + '<', + squeezer.expandingbuttons[1], + )) + + def test_reload(self): + """Test the reload() class-method.""" + editwin = self.make_mock_editor_window(with_text_widget=True) + squeezer = self.make_squeezer_instance(editwin) + + orig_auto_squeeze_min_lines = squeezer.auto_squeeze_min_lines + + # Increase auto-squeeze-min-lines. + new_auto_squeeze_min_lines = orig_auto_squeeze_min_lines + 10 + self.set_idleconf_option_with_cleanup( + 'main', 'PyShell', 'auto-squeeze-min-lines', + str(new_auto_squeeze_min_lines)) + + Squeezer.reload() + self.assertEqual(squeezer.auto_squeeze_min_lines, + new_auto_squeeze_min_lines) + + def test_reload_no_squeezer_instances(self): + """Test that Squeezer.reload() runs without any instances existing.""" + Squeezer.reload() + + +class ExpandingButtonTest(unittest.TestCase): + """Tests for the ExpandingButton class.""" + # In these tests the squeezer instance is a mock, but actual tkinter + # Text and Button instances are created. + def make_mock_squeezer(self): + """Helper for tests: Create a mock Squeezer object.""" + root = get_test_tk_root(self) + squeezer = Mock() + squeezer.editwin.text = Text(root) + squeezer.editwin.per = Percolator(squeezer.editwin.text) + self.addCleanup(squeezer.editwin.per.close) + + # Set default values for the configuration settings. + squeezer.auto_squeeze_min_lines = 50 + return squeezer + + @patch('idlelib.squeezer.Hovertip', autospec=Hovertip) + def test_init(self, MockHovertip): + """Test the simplest creation of an ExpandingButton.""" + squeezer = self.make_mock_squeezer() + text_widget = squeezer.editwin.text + + expandingbutton = ExpandingButton('TEXT', 'TAGS', 50, squeezer) + self.assertEqual(expandingbutton.s, 'TEXT') + + # Check that the underlying tkinter.Button is properly configured. + self.assertEqual(expandingbutton.master, text_widget) + self.assertTrue('50 lines' in expandingbutton.cget('text')) + + # Check that the text widget still contains no text. + self.assertEqual(text_widget.get('1.0', 'end'), '\n') + + # Check that the mouse events are bound. + self.assertIn('', expandingbutton.bind()) + right_button_code = '' % ('2' if macosx.isAquaTk() else '3') + self.assertIn(right_button_code, expandingbutton.bind()) + + # Check that ToolTip was called once, with appropriate values. + self.assertEqual(MockHovertip.call_count, 1) + MockHovertip.assert_called_with(expandingbutton, ANY, hover_delay=ANY) + + # Check that 'right-click' appears in the tooltip text. + tooltip_text = MockHovertip.call_args[0][1] + self.assertIn('right-click', tooltip_text.lower()) + + def test_expand(self): + """Test the expand event.""" + squeezer = self.make_mock_squeezer() + expandingbutton = ExpandingButton('TEXT', 'TAGS', 50, squeezer) + + # Insert the button into the text widget + # (this is normally done by the Squeezer class). + text_widget = squeezer.editwin.text + text_widget.window_create("1.0", window=expandingbutton) + + # trigger the expand event + retval = expandingbutton.expand(event=Mock()) + self.assertEqual(retval, None) + + # Check that the text was inserted into the text widget. + self.assertEqual(text_widget.get('1.0', 'end'), 'TEXT\n') + + # Check that the 'TAGS' tag was set on the inserted text. + text_end_index = text_widget.index('end-1c') + self.assertEqual(text_widget.get('1.0', text_end_index), 'TEXT') + self.assertEqual(text_widget.tag_nextrange('TAGS', '1.0'), + ('1.0', text_end_index)) + + # Check that the button removed itself from squeezer.expandingbuttons. + self.assertEqual(squeezer.expandingbuttons.remove.call_count, 1) + squeezer.expandingbuttons.remove.assert_called_with(expandingbutton) + + def test_expand_dangerous_oupput(self): + """Test that expanding very long output asks user for confirmation.""" + squeezer = self.make_mock_squeezer() + text = 'a' * 10**5 + expandingbutton = ExpandingButton(text, 'TAGS', 50, squeezer) + expandingbutton.set_is_dangerous() + self.assertTrue(expandingbutton.is_dangerous) + + # Insert the button into the text widget + # (this is normally done by the Squeezer class). + text_widget = expandingbutton.text + text_widget.window_create("1.0", window=expandingbutton) + + # Patch the message box module to always return False. + with patch('idlelib.squeezer.messagebox') as mock_msgbox: + mock_msgbox.askokcancel.return_value = False + mock_msgbox.askyesno.return_value = False + # Trigger the expand event. + retval = expandingbutton.expand(event=Mock()) + + # Check that the event chain was broken and no text was inserted. + self.assertEqual(retval, 'break') + self.assertEqual(expandingbutton.text.get('1.0', 'end-1c'), '') + + # Patch the message box module to always return True. + with patch('idlelib.squeezer.messagebox') as mock_msgbox: + mock_msgbox.askokcancel.return_value = True + mock_msgbox.askyesno.return_value = True + # Trigger the expand event. + retval = expandingbutton.expand(event=Mock()) + + # Check that the event chain wasn't broken and the text was inserted. + self.assertEqual(retval, None) + self.assertEqual(expandingbutton.text.get('1.0', 'end-1c'), text) + + def test_copy(self): + """Test the copy event.""" + # Testing with the actual clipboard proved problematic, so this + # test replaces the clipboard manipulation functions with mocks + # and checks that they are called appropriately. + squeezer = self.make_mock_squeezer() + expandingbutton = ExpandingButton('TEXT', 'TAGS', 50, squeezer) + expandingbutton.clipboard_clear = Mock() + expandingbutton.clipboard_append = Mock() + + # Trigger the copy event. + retval = expandingbutton.copy(event=Mock()) + self.assertEqual(retval, None) + + # Vheck that the expanding button called clipboard_clear() and + # clipboard_append('TEXT') once each. + self.assertEqual(expandingbutton.clipboard_clear.call_count, 1) + self.assertEqual(expandingbutton.clipboard_append.call_count, 1) + expandingbutton.clipboard_append.assert_called_with('TEXT') + + def test_view(self): + """Test the view event.""" + squeezer = self.make_mock_squeezer() + expandingbutton = ExpandingButton('TEXT', 'TAGS', 50, squeezer) + expandingbutton.selection_own = Mock() + + with patch('idlelib.squeezer.view_text', autospec=view_text)\ + as mock_view_text: + # Trigger the view event. + expandingbutton.view(event=Mock()) + + # Check that the expanding button called view_text. + self.assertEqual(mock_view_text.call_count, 1) + + # Check that the proper text was passed. + self.assertEqual(mock_view_text.call_args[0][2], 'TEXT') + + def test_rmenu(self): + """Test the context menu.""" + squeezer = self.make_mock_squeezer() + expandingbutton = ExpandingButton('TEXT', 'TAGS', 50, squeezer) + with patch('tkinter.Menu') as mock_Menu: + mock_menu = Mock() + mock_Menu.return_value = mock_menu + mock_event = Mock() + mock_event.x = 10 + mock_event.y = 10 + expandingbutton.context_menu_event(event=mock_event) + self.assertEqual(mock_menu.add_command.call_count, + len(expandingbutton.rmenu_specs)) + for label, *data in expandingbutton.rmenu_specs: + mock_menu.add_command.assert_any_call(label=label, command=ANY) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_stackviewer.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_stackviewer.py new file mode 100644 index 0000000000000000000000000000000000000000..55f510382bf4c3699ab3baff416af72068660fc7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_stackviewer.py @@ -0,0 +1,41 @@ +"Test stackviewer, coverage 63%." + +from idlelib import stackviewer +import unittest +from test.support import requires +from tkinter import Tk + +from idlelib.tree import TreeNode, ScrolledCanvas + + +class StackBrowserTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + + requires('gui') + cls.root = Tk() + cls.root.withdraw() + + @classmethod + def tearDownClass(cls): + + cls.root.update_idletasks() +## for id in cls.root.tk.call('after', 'info'): +## cls.root.after_cancel(id) # Need for EditorWindow. + cls.root.destroy() + del cls.root + + def test_init(self): + try: + abc + except NameError as exc: + sb = stackviewer.StackBrowser(self.root, exc) + isi = self.assertIsInstance + isi(stackviewer.sc, ScrolledCanvas) + isi(stackviewer.item, stackviewer.StackTreeItem) + isi(stackviewer.node, TreeNode) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_statusbar.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_statusbar.py new file mode 100644 index 0000000000000000000000000000000000000000..203a57db89ca6a7df608cc7d24c4301299d222d8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_statusbar.py @@ -0,0 +1,41 @@ +"Test statusbar, coverage 100%." + +from idlelib import statusbar +import unittest +from test.support import requires +from tkinter import Tk + + +class Test(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + + @classmethod + def tearDownClass(cls): + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def test_init(self): + bar = statusbar.MultiStatusBar(self.root) + self.assertEqual(bar.labels, {}) + + def test_set_label(self): + bar = statusbar.MultiStatusBar(self.root) + bar.set_label('left', text='sometext', width=10) + self.assertIn('left', bar.labels) + left = bar.labels['left'] + self.assertEqual(left['text'], 'sometext') + self.assertEqual(left['width'], 10) + bar.set_label('left', text='revised text') + self.assertEqual(left['text'], 'revised text') + bar.set_label('right', text='correct text') + self.assertEqual(bar.labels['right']['text'], 'correct text') + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_text.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_text.py new file mode 100644 index 0000000000000000000000000000000000000000..43a9ba02c3d3c9a8739ec85e4780fc03743ef29c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_text.py @@ -0,0 +1,236 @@ +''' Test mock_tk.Text class against tkinter.Text class + +Run same tests with both by creating a mixin class. +''' +import unittest +from test.support import requires +from _tkinter import TclError + +class TextTest: + "Define items common to both sets of tests." + + hw = 'hello\nworld' # Several tests insert this after initialization. + hwn = hw+'\n' # \n present at initialization, before insert + + # setUpClass defines cls.Text and maybe cls.root. + # setUp defines self.text from Text and maybe root. + + def test_init(self): + self.assertEqual(self.text.get('1.0'), '\n') + self.assertEqual(self.text.get('end'), '') + + def test_index_empty(self): + index = self.text.index + + for dex in (-1.0, 0.3, '1.-1', '1.0', '1.0 lineend', '1.end', '1.33', + 'insert'): + self.assertEqual(index(dex), '1.0') + + for dex in 'end', 2.0, '2.1', '33.44': + self.assertEqual(index(dex), '2.0') + + def test_index_data(self): + index = self.text.index + self.text.insert('1.0', self.hw) + + for dex in -1.0, 0.3, '1.-1', '1.0': + self.assertEqual(index(dex), '1.0') + + for dex in '1.0 lineend', '1.end', '1.33': + self.assertEqual(index(dex), '1.5') + + for dex in 'end', '33.44': + self.assertEqual(index(dex), '3.0') + + def test_get(self): + get = self.text.get + Equal = self.assertEqual + self.text.insert('1.0', self.hw) + + Equal(get('end'), '') + Equal(get('end', 'end'), '') + Equal(get('1.0'), 'h') + Equal(get('1.0', '1.1'), 'h') + Equal(get('1.0', '1.3'), 'hel') + Equal(get('1.1', '1.3'), 'el') + Equal(get('1.0', '1.0 lineend'), 'hello') + Equal(get('1.0', '1.10'), 'hello') + Equal(get('1.0 lineend'), '\n') + Equal(get('1.1', '2.3'), 'ello\nwor') + Equal(get('1.0', '2.5'), self.hw) + Equal(get('1.0', 'end'), self.hwn) + Equal(get('0.0', '5.0'), self.hwn) + + def test_insert(self): + insert = self.text.insert + get = self.text.get + Equal = self.assertEqual + + insert('1.0', self.hw) + Equal(get('1.0', 'end'), self.hwn) + + insert('1.0', '') # nothing + Equal(get('1.0', 'end'), self.hwn) + + insert('1.0', '*') + Equal(get('1.0', 'end'), '*hello\nworld\n') + + insert('1.0 lineend', '*') + Equal(get('1.0', 'end'), '*hello*\nworld\n') + + insert('2.3', '*') + Equal(get('1.0', 'end'), '*hello*\nwor*ld\n') + + insert('end', 'x') + Equal(get('1.0', 'end'), '*hello*\nwor*ldx\n') + + insert('1.4', 'x\n') + Equal(get('1.0', 'end'), '*helx\nlo*\nwor*ldx\n') + + def test_no_delete(self): + # if index1 == 'insert' or 'end' or >= end, there is no deletion + delete = self.text.delete + get = self.text.get + Equal = self.assertEqual + self.text.insert('1.0', self.hw) + + delete('insert') + Equal(get('1.0', 'end'), self.hwn) + + delete('end') + Equal(get('1.0', 'end'), self.hwn) + + delete('insert', 'end') + Equal(get('1.0', 'end'), self.hwn) + + delete('insert', '5.5') + Equal(get('1.0', 'end'), self.hwn) + + delete('1.4', '1.0') + Equal(get('1.0', 'end'), self.hwn) + + delete('1.4', '1.4') + Equal(get('1.0', 'end'), self.hwn) + + def test_delete_char(self): + delete = self.text.delete + get = self.text.get + Equal = self.assertEqual + self.text.insert('1.0', self.hw) + + delete('1.0') + Equal(get('1.0', '1.end'), 'ello') + + delete('1.0', '1.1') + Equal(get('1.0', '1.end'), 'llo') + + # delete \n and combine 2 lines into 1 + delete('1.end') + Equal(get('1.0', '1.end'), 'lloworld') + + self.text.insert('1.3', '\n') + delete('1.10') + Equal(get('1.0', '1.end'), 'lloworld') + + self.text.insert('1.3', '\n') + delete('1.3', '2.0') + Equal(get('1.0', '1.end'), 'lloworld') + + def test_delete_slice(self): + delete = self.text.delete + get = self.text.get + Equal = self.assertEqual + self.text.insert('1.0', self.hw) + + delete('1.0', '1.0 lineend') + Equal(get('1.0', 'end'), '\nworld\n') + + delete('1.0', 'end') + Equal(get('1.0', 'end'), '\n') + + self.text.insert('1.0', self.hw) + delete('1.0', '2.0') + Equal(get('1.0', 'end'), 'world\n') + + delete('1.0', 'end') + Equal(get('1.0', 'end'), '\n') + + self.text.insert('1.0', self.hw) + delete('1.2', '2.3') + Equal(get('1.0', 'end'), 'held\n') + + def test_multiple_lines(self): # insert and delete + self.text.insert('1.0', 'hello') + + self.text.insert('1.3', '1\n2\n3\n4\n5') + self.assertEqual(self.text.get('1.0', 'end'), 'hel1\n2\n3\n4\n5lo\n') + + self.text.delete('1.3', '5.1') + self.assertEqual(self.text.get('1.0', 'end'), 'hello\n') + + def test_compare(self): + compare = self.text.compare + Equal = self.assertEqual + # need data so indexes not squished to 1,0 + self.text.insert('1.0', 'First\nSecond\nThird\n') + + self.assertRaises(TclError, compare, '2.2', 'op', '2.2') + + for op, less1, less0, equal, greater0, greater1 in ( + ('<', True, True, False, False, False), + ('<=', True, True, True, False, False), + ('>', False, False, False, True, True), + ('>=', False, False, True, True, True), + ('==', False, False, True, False, False), + ('!=', True, True, False, True, True), + ): + Equal(compare('1.1', op, '2.2'), less1, op) + Equal(compare('2.1', op, '2.2'), less0, op) + Equal(compare('2.2', op, '2.2'), equal, op) + Equal(compare('2.3', op, '2.2'), greater0, op) + Equal(compare('3.3', op, '2.2'), greater1, op) + + +class MockTextTest(TextTest, unittest.TestCase): + + @classmethod + def setUpClass(cls): + from idlelib.idle_test.mock_tk import Text + cls.Text = Text + + def setUp(self): + self.text = self.Text() + + + def test_decode(self): + # test endflags (-1, 0) not tested by test_index (which uses +1) + decode = self.text._decode + Equal = self.assertEqual + self.text.insert('1.0', self.hw) + + Equal(decode('end', -1), (2, 5)) + Equal(decode('3.1', -1), (2, 5)) + Equal(decode('end', 0), (2, 6)) + Equal(decode('3.1', 0), (2, 6)) + + +class TkTextTest(TextTest, unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + from tkinter import Tk, Text + cls.Text = Text + cls.root = Tk() + + @classmethod + def tearDownClass(cls): + cls.root.destroy() + del cls.root + + def setUp(self): + self.text = self.Text(self.root) + + +if __name__ == '__main__': + unittest.main(verbosity=2, exit=False) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_textview.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_textview.py new file mode 100644 index 0000000000000000000000000000000000000000..7189378ab3dd615e04cf17c2869e1fd611cb4eb1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_textview.py @@ -0,0 +1,233 @@ +"""Test textview, coverage 100%. + +Since all methods and functions create (or destroy) a ViewWindow, which +is a widget containing a widget, etcetera, all tests must be gui tests. +Using mock Text would not change this. Other mocks are used to retrieve +information about calls. +""" +from idlelib import textview as tv +from test.support import requires +requires('gui') + +import os +import unittest +from tkinter import Tk, TclError, CHAR, NONE, WORD +from tkinter.ttk import Button +from idlelib.idle_test.mock_idle import Func +from idlelib.idle_test.mock_tk import Mbox_func + +def setUpModule(): + global root + root = Tk() + root.withdraw() + +def tearDownModule(): + global root + root.update_idletasks() + root.destroy() + del root + +# If we call ViewWindow or wrapper functions with defaults +# modal=True, _utest=False, test hangs on call to wait_window. +# Have also gotten tk error 'can't invoke "event" command'. + + +class VW(tv.ViewWindow): # Used in ViewWindowTest. + transient = Func() + grab_set = Func() + wait_window = Func() + + +# Call wrapper class VW with mock wait_window. +class ViewWindowTest(unittest.TestCase): + + def setUp(self): + VW.transient.__init__() + VW.grab_set.__init__() + VW.wait_window.__init__() + + def test_init_modal(self): + view = VW(root, 'Title', 'test text') + self.assertTrue(VW.transient.called) + self.assertTrue(VW.grab_set.called) + self.assertTrue(VW.wait_window.called) + view.ok() + + def test_init_nonmodal(self): + view = VW(root, 'Title', 'test text', modal=False) + self.assertFalse(VW.transient.called) + self.assertFalse(VW.grab_set.called) + self.assertFalse(VW.wait_window.called) + view.ok() + + def test_ok(self): + view = VW(root, 'Title', 'test text', modal=False) + view.destroy = Func() + view.ok() + self.assertTrue(view.destroy.called) + del view.destroy # Unmask real function. + view.destroy() + + +class AutoHideScrollbarTest(unittest.TestCase): + # Method set is tested in ScrollableTextFrameTest + def test_forbidden_geometry(self): + scroll = tv.AutoHideScrollbar(root) + self.assertRaises(TclError, scroll.pack) + self.assertRaises(TclError, scroll.place) + + +class ScrollableTextFrameTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + cls.root = root = Tk() + root.withdraw() + + @classmethod + def tearDownClass(cls): + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def make_frame(self, wrap=NONE, **kwargs): + frame = tv.ScrollableTextFrame(self.root, wrap=wrap, **kwargs) + def cleanup_frame(): + frame.update_idletasks() + frame.destroy() + self.addCleanup(cleanup_frame) + return frame + + def test_line1(self): + frame = self.make_frame() + frame.text.insert('1.0', 'test text') + self.assertEqual(frame.text.get('1.0', '1.end'), 'test text') + + def test_horiz_scrollbar(self): + # The horizontal scrollbar should be shown/hidden according to + # the 'wrap' setting: It should only be shown when 'wrap' is + # set to NONE. + + # wrap = NONE -> with horizontal scrolling + frame = self.make_frame(wrap=NONE) + self.assertEqual(frame.text.cget('wrap'), NONE) + self.assertIsNotNone(frame.xscroll) + + # wrap != NONE -> no horizontal scrolling + for wrap in [CHAR, WORD]: + with self.subTest(wrap=wrap): + frame = self.make_frame(wrap=wrap) + self.assertEqual(frame.text.cget('wrap'), wrap) + self.assertIsNone(frame.xscroll) + + +class ViewFrameTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + cls.root = root = Tk() + root.withdraw() + cls.frame = tv.ViewFrame(root, 'test text') + + @classmethod + def tearDownClass(cls): + del cls.frame + cls.root.update_idletasks() + cls.root.destroy() + del cls.root + + def test_line1(self): + get = self.frame.text.get + self.assertEqual(get('1.0', '1.end'), 'test text') + + +# Call ViewWindow with modal=False. +class ViewFunctionTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + cls.orig_error = tv.showerror + tv.showerror = Mbox_func() + + @classmethod + def tearDownClass(cls): + tv.showerror = cls.orig_error + del cls.orig_error + + def test_view_text(self): + view = tv.view_text(root, 'Title', 'test text', modal=False) + self.assertIsInstance(view, tv.ViewWindow) + self.assertIsInstance(view.viewframe, tv.ViewFrame) + view.viewframe.ok() + + def test_view_file(self): + view = tv.view_file(root, 'Title', __file__, 'ascii', modal=False) + self.assertIsInstance(view, tv.ViewWindow) + self.assertIsInstance(view.viewframe, tv.ViewFrame) + get = view.viewframe.textframe.text.get + self.assertIn('Test', get('1.0', '1.end')) + view.ok() + + def test_bad_file(self): + # Mock showerror will be used; view_file will return None. + view = tv.view_file(root, 'Title', 'abc.xyz', 'ascii', modal=False) + self.assertIsNone(view) + self.assertEqual(tv.showerror.title, 'File Load Error') + + def test_bad_encoding(self): + p = os.path + fn = p.abspath(p.join(p.dirname(__file__), '..', 'CREDITS.txt')) + view = tv.view_file(root, 'Title', fn, 'ascii', modal=False) + self.assertIsNone(view) + self.assertEqual(tv.showerror.title, 'Unicode Decode Error') + + def test_nowrap(self): + view = tv.view_text(root, 'Title', 'test', modal=False, wrap='none') + text_widget = view.viewframe.textframe.text + self.assertEqual(text_widget.cget('wrap'), 'none') + + +# Call ViewWindow with _utest=True. +class ButtonClickTest(unittest.TestCase): + + def setUp(self): + self.view = None + self.called = False + + def tearDown(self): + if self.view: + self.view.destroy() + + def test_view_text_bind_with_button(self): + def _command(): + self.called = True + self.view = tv.view_text(root, 'TITLE_TEXT', 'COMMAND', _utest=True) + button = Button(root, text='BUTTON', command=_command) + button.invoke() + self.addCleanup(button.destroy) + + self.assertEqual(self.called, True) + self.assertEqual(self.view.title(), 'TITLE_TEXT') + self.assertEqual(self.view.viewframe.textframe.text.get('1.0', '1.end'), + 'COMMAND') + + def test_view_file_bind_with_button(self): + def _command(): + self.called = True + self.view = tv.view_file(root, 'TITLE_FILE', __file__, + encoding='ascii', _utest=True) + button = Button(root, text='BUTTON', command=_command) + button.invoke() + self.addCleanup(button.destroy) + + self.assertEqual(self.called, True) + self.assertEqual(self.view.title(), 'TITLE_FILE') + get = self.view.viewframe.textframe.text.get + with open(__file__) as f: + self.assertEqual(get('1.0', '1.end'), f.readline().strip()) + f.readline() + self.assertEqual(get('3.0', '3.end'), f.readline().strip()) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_tooltip.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_tooltip.py new file mode 100644 index 0000000000000000000000000000000000000000..c616d4fde3b6d30433c0e163206059c1c55f1ea2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_tooltip.py @@ -0,0 +1,161 @@ +"""Test tooltip, coverage 100%. + +Coverage is 100% after excluding 6 lines with "# pragma: no cover". +They involve TclErrors that either should or should not happen in a +particular situation, and which are 'pass'ed if they do. +""" + +from idlelib.tooltip import TooltipBase, Hovertip +from test.support import requires +requires('gui') + +from functools import wraps +import time +from tkinter import Button, Tk, Toplevel +import unittest + + +def setUpModule(): + global root + root = Tk() + +def tearDownModule(): + global root + root.update_idletasks() + root.destroy() + del root + + +def add_call_counting(func): + @wraps(func) + def wrapped_func(*args, **kwargs): + wrapped_func.call_args_list.append((args, kwargs)) + return func(*args, **kwargs) + wrapped_func.call_args_list = [] + return wrapped_func + + +def _make_top_and_button(testobj): + global root + top = Toplevel(root) + testobj.addCleanup(top.destroy) + top.title("Test tooltip") + button = Button(top, text='ToolTip test button') + button.pack() + testobj.addCleanup(button.destroy) + top.lift() + return top, button + + +class ToolTipBaseTest(unittest.TestCase): + def setUp(self): + self.top, self.button = _make_top_and_button(self) + + def test_base_class_is_unusable(self): + global root + top = Toplevel(root) + self.addCleanup(top.destroy) + + button = Button(top, text='ToolTip test button') + button.pack() + self.addCleanup(button.destroy) + + with self.assertRaises(NotImplementedError): + tooltip = TooltipBase(button) + tooltip.showtip() + + +class HovertipTest(unittest.TestCase): + def setUp(self): + self.top, self.button = _make_top_and_button(self) + + def is_tipwindow_shown(self, tooltip): + return tooltip.tipwindow and tooltip.tipwindow.winfo_viewable() + + def test_showtip(self): + tooltip = Hovertip(self.button, 'ToolTip text') + self.addCleanup(tooltip.hidetip) + self.assertFalse(self.is_tipwindow_shown(tooltip)) + tooltip.showtip() + self.assertTrue(self.is_tipwindow_shown(tooltip)) + + def test_showtip_twice(self): + tooltip = Hovertip(self.button, 'ToolTip text') + self.addCleanup(tooltip.hidetip) + self.assertFalse(self.is_tipwindow_shown(tooltip)) + tooltip.showtip() + self.assertTrue(self.is_tipwindow_shown(tooltip)) + orig_tipwindow = tooltip.tipwindow + tooltip.showtip() + self.assertTrue(self.is_tipwindow_shown(tooltip)) + self.assertIs(tooltip.tipwindow, orig_tipwindow) + + def test_hidetip(self): + tooltip = Hovertip(self.button, 'ToolTip text') + self.addCleanup(tooltip.hidetip) + tooltip.showtip() + tooltip.hidetip() + self.assertFalse(self.is_tipwindow_shown(tooltip)) + + def test_showtip_on_mouse_enter_no_delay(self): + tooltip = Hovertip(self.button, 'ToolTip text', hover_delay=None) + self.addCleanup(tooltip.hidetip) + tooltip.showtip = add_call_counting(tooltip.showtip) + root.update() + self.assertFalse(self.is_tipwindow_shown(tooltip)) + self.button.event_generate('', x=0, y=0) + root.update() + self.assertTrue(self.is_tipwindow_shown(tooltip)) + self.assertGreater(len(tooltip.showtip.call_args_list), 0) + + def test_hover_with_delay(self): + # Run multiple tests requiring an actual delay simultaneously. + + # Test #1: A hover tip with a non-zero delay appears after the delay. + tooltip1 = Hovertip(self.button, 'ToolTip text', hover_delay=100) + self.addCleanup(tooltip1.hidetip) + tooltip1.showtip = add_call_counting(tooltip1.showtip) + root.update() + self.assertFalse(self.is_tipwindow_shown(tooltip1)) + self.button.event_generate('', x=0, y=0) + root.update() + self.assertFalse(self.is_tipwindow_shown(tooltip1)) + + # Test #2: A hover tip with a non-zero delay doesn't appear when + # the mouse stops hovering over the base widget before the delay + # expires. + tooltip2 = Hovertip(self.button, 'ToolTip text', hover_delay=100) + self.addCleanup(tooltip2.hidetip) + tooltip2.showtip = add_call_counting(tooltip2.showtip) + root.update() + self.button.event_generate('', x=0, y=0) + root.update() + self.button.event_generate('', x=0, y=0) + root.update() + + time.sleep(0.15) + root.update() + + # Test #1 assertions. + self.assertTrue(self.is_tipwindow_shown(tooltip1)) + self.assertGreater(len(tooltip1.showtip.call_args_list), 0) + + # Test #2 assertions. + self.assertFalse(self.is_tipwindow_shown(tooltip2)) + self.assertEqual(tooltip2.showtip.call_args_list, []) + + def test_hidetip_on_mouse_leave(self): + tooltip = Hovertip(self.button, 'ToolTip text', hover_delay=None) + self.addCleanup(tooltip.hidetip) + tooltip.showtip = add_call_counting(tooltip.showtip) + root.update() + self.button.event_generate('', x=0, y=0) + root.update() + self.button.event_generate('', x=0, y=0) + root.update() + self.assertFalse(self.is_tipwindow_shown(tooltip)) + self.assertGreater(len(tooltip.showtip.call_args_list), 0) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_tree.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_tree.py new file mode 100644 index 0000000000000000000000000000000000000000..b3e4c10cf9e38e7efc183352f6de98673841d9fd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_tree.py @@ -0,0 +1,60 @@ +"Test tree. coverage 56%." + +from idlelib import tree +import unittest +from test.support import requires +requires('gui') +from tkinter import Tk, EventType, SCROLL + + +class TreeTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + cls.root = Tk() + cls.root.withdraw() + + @classmethod + def tearDownClass(cls): + cls.root.destroy() + del cls.root + + def test_init(self): + # Start with code slightly adapted from htest. + sc = tree.ScrolledCanvas( + self.root, bg="white", highlightthickness=0, takefocus=1) + sc.frame.pack(expand=1, fill="both", side='left') + item = tree.FileTreeItem(tree.ICONDIR) + node = tree.TreeNode(sc.canvas, None, item) + node.expand() + + +class TestScrollEvent(unittest.TestCase): + + def test_wheel_event(self): + # Fake widget class containing `yview` only. + class _Widget: + def __init__(widget, *expected): + widget.expected = expected + def yview(widget, *args): + self.assertTupleEqual(widget.expected, args) + # Fake event class + class _Event: + pass + # (type, delta, num, amount) + tests = ((EventType.MouseWheel, 120, -1, -5), + (EventType.MouseWheel, -120, -1, 5), + (EventType.ButtonPress, -1, 4, -5), + (EventType.ButtonPress, -1, 5, 5)) + + event = _Event() + for ty, delta, num, amount in tests: + event.type = ty + event.delta = delta + event.num = num + res = tree.wheel_event(event, _Widget(SCROLL, amount, "units")) + self.assertEqual(res, "break") + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_undo.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_undo.py new file mode 100644 index 0000000000000000000000000000000000000000..beb5b582039f8844dd179561c7bb939606184375 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_undo.py @@ -0,0 +1,135 @@ +"Test undo, coverage 77%." +# Only test UndoDelegator so far. + +from idlelib.undo import UndoDelegator +import unittest +from test.support import requires +requires('gui') + +from unittest.mock import Mock +from tkinter import Text, Tk +from idlelib.percolator import Percolator + + +class UndoDelegatorTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + cls.root = Tk() + cls.text = Text(cls.root) + cls.percolator = Percolator(cls.text) + + @classmethod + def tearDownClass(cls): + cls.percolator.redir.close() + del cls.percolator, cls.text + cls.root.destroy() + del cls.root + + def setUp(self): + self.delegator = UndoDelegator() + self.delegator.bell = Mock() + self.percolator.insertfilter(self.delegator) + + def tearDown(self): + self.percolator.removefilter(self.delegator) + self.text.delete('1.0', 'end') + self.delegator.resetcache() + + def test_undo_event(self): + text = self.text + + text.insert('insert', 'foobar') + text.insert('insert', 'h') + text.event_generate('<>') + self.assertEqual(text.get('1.0', 'end'), '\n') + + text.insert('insert', 'foo') + text.insert('insert', 'bar') + text.delete('1.2', '1.4') + text.insert('insert', 'hello') + text.event_generate('<>') + self.assertEqual(text.get('1.0', '1.4'), 'foar') + text.event_generate('<>') + self.assertEqual(text.get('1.0', '1.6'), 'foobar') + text.event_generate('<>') + self.assertEqual(text.get('1.0', '1.3'), 'foo') + text.event_generate('<>') + self.delegator.undo_event('event') + self.assertTrue(self.delegator.bell.called) + + def test_redo_event(self): + text = self.text + + text.insert('insert', 'foo') + text.insert('insert', 'bar') + text.delete('1.0', '1.3') + text.event_generate('<>') + text.event_generate('<>') + self.assertEqual(text.get('1.0', '1.3'), 'bar') + text.event_generate('<>') + self.assertTrue(self.delegator.bell.called) + + def test_dump_event(self): + """ + Dump_event cannot be tested directly without changing + environment variables. So, test statements in dump_event + indirectly + """ + text = self.text + d = self.delegator + + text.insert('insert', 'foo') + text.insert('insert', 'bar') + text.delete('1.2', '1.4') + self.assertTupleEqual((d.pointer, d.can_merge), (3, True)) + text.event_generate('<>') + self.assertTupleEqual((d.pointer, d.can_merge), (2, False)) + + def test_get_set_saved(self): + # test the getter method get_saved + # test the setter method set_saved + # indirectly test check_saved + d = self.delegator + + self.assertTrue(d.get_saved()) + self.text.insert('insert', 'a') + self.assertFalse(d.get_saved()) + d.saved_change_hook = Mock() + + d.set_saved(True) + self.assertEqual(d.pointer, d.saved) + self.assertTrue(d.saved_change_hook.called) + + d.set_saved(False) + self.assertEqual(d.saved, -1) + self.assertTrue(d.saved_change_hook.called) + + def test_undo_start_stop(self): + # test the undo_block_start and undo_block_stop methods + text = self.text + + text.insert('insert', 'foo') + self.delegator.undo_block_start() + text.insert('insert', 'bar') + text.insert('insert', 'bar') + self.delegator.undo_block_stop() + self.assertEqual(text.get('1.0', '1.3'), 'foo') + + # test another code path + self.delegator.undo_block_start() + text.insert('insert', 'bar') + self.delegator.undo_block_stop() + self.assertEqual(text.get('1.0', '1.3'), 'foo') + + def test_addcmd(self): + text = self.text + # when number of undo operations exceeds max_undo + self.delegator.max_undo = max_undo = 10 + for i in range(max_undo + 10): + text.insert('insert', 'foo') + self.assertLessEqual(len(self.delegator.undolist), max_undo) + + +if __name__ == '__main__': + unittest.main(verbosity=2, exit=False) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_util.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_util.py new file mode 100644 index 0000000000000000000000000000000000000000..20721fe980c784e1497ef96c7e52d11f834d9740 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_util.py @@ -0,0 +1,14 @@ +"""Test util, coverage 100%""" + +import unittest +from idlelib import util + + +class UtilTest(unittest.TestCase): + def test_extensions(self): + for extension in {'.pyi', '.py', '.pyw'}: + self.assertIn(extension, util.py_extensions) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_warning.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_warning.py new file mode 100644 index 0000000000000000000000000000000000000000..221068c5885fcbad118283b6c1702a1c55896ec7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_warning.py @@ -0,0 +1,73 @@ +'''Test warnings replacement in pyshell.py and run.py. + +This file could be expanded to include traceback overrides +(in same two modules). If so, change name. +Revise if output destination changes (http://bugs.python.org/issue18318). +Make sure warnings module is left unaltered (http://bugs.python.org/issue18081). +''' +from idlelib import run +from idlelib import pyshell as shell +import unittest +from test.support import captured_stderr +import warnings + +# Try to capture default showwarning before Idle modules are imported. +showwarning = warnings.showwarning +# But if we run this file within idle, we are in the middle of the run.main loop +# and default showwarnings has already been replaced. +running_in_idle = 'idle' in showwarning.__name__ + +# The following was generated from pyshell.idle_formatwarning +# and checked as matching expectation. +idlemsg = ''' +Warning (from warnings module): + File "test_warning.py", line 99 + Line of code +UserWarning: Test +''' +shellmsg = idlemsg + ">>> " + + +class RunWarnTest(unittest.TestCase): + + @unittest.skipIf(running_in_idle, "Does not work when run within Idle.") + def test_showwarnings(self): + self.assertIs(warnings.showwarning, showwarning) + run.capture_warnings(True) + self.assertIs(warnings.showwarning, run.idle_showwarning_subproc) + run.capture_warnings(False) + self.assertIs(warnings.showwarning, showwarning) + + def test_run_show(self): + with captured_stderr() as f: + run.idle_showwarning_subproc( + 'Test', UserWarning, 'test_warning.py', 99, f, 'Line of code') + # The following uses .splitlines to erase line-ending differences + self.assertEqual(idlemsg.splitlines(), f.getvalue().splitlines()) + + +class ShellWarnTest(unittest.TestCase): + + @unittest.skipIf(running_in_idle, "Does not work when run within Idle.") + def test_showwarnings(self): + self.assertIs(warnings.showwarning, showwarning) + shell.capture_warnings(True) + self.assertIs(warnings.showwarning, shell.idle_showwarning) + shell.capture_warnings(False) + self.assertIs(warnings.showwarning, showwarning) + + def test_idle_formatter(self): + # Will fail if format changed without regenerating idlemsg + s = shell.idle_formatwarning( + 'Test', UserWarning, 'test_warning.py', 99, 'Line of code') + self.assertEqual(idlemsg, s) + + def test_shell_show(self): + with captured_stderr() as f: + shell.idle_showwarning( + 'Test', UserWarning, 'test_warning.py', 99, f, 'Line of code') + self.assertEqual(shellmsg.splitlines(), f.getvalue().splitlines()) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_window.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_window.py new file mode 100644 index 0000000000000000000000000000000000000000..5a2645b9cc27dcee4ceea7e8443dad8e9e0d80c7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_window.py @@ -0,0 +1,45 @@ +"Test window, coverage 47%." + +from idlelib import window +import unittest +from test.support import requires +from tkinter import Tk + + +class WindowListTest(unittest.TestCase): + + def test_init(self): + wl = window.WindowList() + self.assertEqual(wl.dict, {}) + self.assertEqual(wl.callbacks, []) + + # Further tests need mock Window. + + +class ListedToplevelTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + window.registry = set() + requires('gui') + cls.root = Tk() + cls.root.withdraw() + + @classmethod + def tearDownClass(cls): + window.registry = window.WindowList() + cls.root.update_idletasks() +## for id in cls.root.tk.call('after', 'info'): +## cls.root.after_cancel(id) # Need for EditorWindow. + cls.root.destroy() + del cls.root + + def test_init(self): + + win = window.ListedToplevel(self.root) + self.assertIn(win, window.registry) + self.assertEqual(win.focused_widget, win) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_zoomheight.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_zoomheight.py new file mode 100644 index 0000000000000000000000000000000000000000..aa5bdfb4fbd4c62f97d04669e9e8de667cbce0aa --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_zoomheight.py @@ -0,0 +1,39 @@ +"Test zoomheight, coverage 66%." +# Some code is system dependent. + +from idlelib import zoomheight +import unittest +from test.support import requires +from tkinter import Tk +from idlelib.editor import EditorWindow + + +class Test(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + cls.root = Tk() + cls.root.withdraw() + cls.editwin = EditorWindow(root=cls.root) + + @classmethod + def tearDownClass(cls): + cls.editwin._close() + cls.root.update_idletasks() + for id in cls.root.tk.call('after', 'info'): + cls.root.after_cancel(id) # Need for EditorWindow. + cls.root.destroy() + del cls.root + + def test_init(self): + zoom = zoomheight.ZoomHeight(self.editwin) + self.assertIs(zoom.editwin, self.editwin) + + def test_zoom_height_event(self): + zoom = zoomheight.ZoomHeight(self.editwin) + zoom.zoom_height_event() + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_zzdummy.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_zzdummy.py new file mode 100644 index 0000000000000000000000000000000000000000..209d8564da06641f38e352846a24592636186c77 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/test_zzdummy.py @@ -0,0 +1,152 @@ +"Test zzdummy, coverage 100%." + +from idlelib import zzdummy +import unittest +from test.support import requires +from tkinter import Tk, Text +from unittest import mock +from idlelib import config +from idlelib import editor +from idlelib import format + + +usercfg = zzdummy.idleConf.userCfg +testcfg = { + 'main': config.IdleUserConfParser(''), + 'highlight': config.IdleUserConfParser(''), + 'keys': config.IdleUserConfParser(''), + 'extensions': config.IdleUserConfParser(''), +} +code_sample = """\ + +class C1: + # Class comment. + def __init__(self, a, b): + self.a = a + self.b = b +""" + + +class DummyEditwin: + get_selection_indices = editor.EditorWindow.get_selection_indices + def __init__(self, root, text): + self.root = root + self.top = root + self.text = text + self.fregion = format.FormatRegion(self) + self.text.undo_block_start = mock.Mock() + self.text.undo_block_stop = mock.Mock() + + +class ZZDummyTest(unittest.TestCase): + + @classmethod + def setUpClass(cls): + requires('gui') + root = cls.root = Tk() + root.withdraw() + text = cls.text = Text(cls.root) + cls.editor = DummyEditwin(root, text) + zzdummy.idleConf.userCfg = testcfg + + @classmethod + def tearDownClass(cls): + zzdummy.idleConf.userCfg = usercfg + del cls.editor, cls.text + cls.root.update_idletasks() + for id in cls.root.tk.call('after', 'info'): + cls.root.after_cancel(id) # Need for EditorWindow. + cls.root.destroy() + del cls.root + + def setUp(self): + text = self.text + text.insert('1.0', code_sample) + text.undo_block_start.reset_mock() + text.undo_block_stop.reset_mock() + zz = self.zz = zzdummy.ZzDummy(self.editor) + zzdummy.ZzDummy.ztext = '# ignore #' + + def tearDown(self): + self.text.delete('1.0', 'end') + del self.zz + + def checklines(self, text, value): + # Verify that there are lines being checked. + end_line = int(float(text.index('end'))) + + # Check each line for the starting text. + actual = [] + for line in range(1, end_line): + txt = text.get(f'{line}.0', f'{line}.end') + actual.append(txt.startswith(value)) + return actual + + def test_init(self): + zz = self.zz + self.assertEqual(zz.editwin, self.editor) + self.assertEqual(zz.text, self.editor.text) + + def test_reload(self): + self.assertEqual(self.zz.ztext, '# ignore #') + testcfg['extensions'].SetOption('ZzDummy', 'z-text', 'spam') + zzdummy.ZzDummy.reload() + self.assertEqual(self.zz.ztext, 'spam') + + def test_z_in_event(self): + eq = self.assertEqual + zz = self.zz + text = zz.text + eq(self.zz.ztext, '# ignore #') + + # No lines have the leading text. + expected = [False, False, False, False, False, False, False] + actual = self.checklines(text, zz.ztext) + eq(expected, actual) + + text.tag_add('sel', '2.0', '4.end') + eq(zz.z_in_event(), 'break') + expected = [False, True, True, True, False, False, False] + actual = self.checklines(text, zz.ztext) + eq(expected, actual) + + text.undo_block_start.assert_called_once() + text.undo_block_stop.assert_called_once() + + def test_z_out_event(self): + eq = self.assertEqual + zz = self.zz + text = zz.text + eq(self.zz.ztext, '# ignore #') + + # Prepend text. + text.tag_add('sel', '2.0', '5.end') + zz.z_in_event() + text.undo_block_start.reset_mock() + text.undo_block_stop.reset_mock() + + # Select a few lines to remove text. + text.tag_remove('sel', '1.0', 'end') + text.tag_add('sel', '3.0', '4.end') + eq(zz.z_out_event(), 'break') + expected = [False, True, False, False, True, False, False] + actual = self.checklines(text, zz.ztext) + eq(expected, actual) + + text.undo_block_start.assert_called_once() + text.undo_block_stop.assert_called_once() + + def test_roundtrip(self): + # Insert and remove to all code should give back original text. + zz = self.zz + text = zz.text + + text.tag_add('sel', '1.0', 'end-1c') + zz.z_in_event() + zz.z_out_event() + + self.assertEqual(text.get('1.0', 'end-1c'), code_sample) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/tkinter_testing_utils.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/tkinter_testing_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..a89839bbe38add465aa20b89b327a5732d50f9fd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/idle_test/tkinter_testing_utils.py @@ -0,0 +1,62 @@ +"""Utilities for testing with Tkinter""" +import functools + + +def run_in_tk_mainloop(delay=1): + """Decorator for running a test method with a real Tk mainloop. + + This starts a Tk mainloop before running the test, and stops it + at the end. This is faster and more robust than the common + alternative method of calling .update() and/or .update_idletasks(). + + Test methods using this must be written as generator functions, + using "yield" to allow the mainloop to process events and "after" + callbacks, and then continue the test from that point. + + The delay argument is passed into root.after(...) calls as the number + of ms to wait before passing execution back to the generator function. + + This also assumes that the test class has a .root attribute, + which is a tkinter.Tk object. + + For example (from test_sidebar.py): + + @run_test_with_tk_mainloop() + def test_single_empty_input(self): + self.do_input('\n') + yield + self.assert_sidebar_lines_end_with(['>>>', '>>>']) + """ + def decorator(test_method): + @functools.wraps(test_method) + def new_test_method(self): + test_generator = test_method(self) + root = self.root + # Exceptions raised by self.assert...() need to be raised + # outside of the after() callback in order for the test + # harness to capture them. + exception = None + def after_callback(): + nonlocal exception + try: + next(test_generator) + except StopIteration: + root.quit() + except Exception as exc: + exception = exc + root.quit() + else: + # Schedule the Tk mainloop to call this function again, + # using a robust method of ensuring that it gets a + # chance to process queued events before doing so. + # See: https://stackoverflow.com/q/18499082#comment65004099_38817470 + root.after(delay, root.after_idle, after_callback) + root.after(0, root.after_idle, after_callback) + root.mainloop() + + if exception: + raise exception + + return new_test_method + + return decorator diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..544ad39a74882e21a1afa4816e148d88fd50dc1a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/_abc.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/_abc.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4188fcde4ad252ad7ae270494e65e7cb3c4871b6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/_abc.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/_bootstrap.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/_bootstrap.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..81aa974b95d726d512354b20ed6ff5444d43dd6d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/_bootstrap.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/_bootstrap_external.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/_bootstrap_external.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..98d2caf68f4d185e7a5eac925b8a78ea2b35e817 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/_bootstrap_external.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/abc.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/abc.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1ff1b145f57fba22e87c5954557dc32479195ffb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/abc.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/machinery.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/machinery.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bc4ffa83149e1a786230df8a696cea27db9c0ef5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/machinery.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/readers.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/readers.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..32bc9f3b1283b9d9e9a0068a15c37acb1751ada0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/readers.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/simple.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/simple.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..57ef62f3f0e7172e16efe3cdc09c889ce753c52a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/simple.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/util.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/util.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..631152a9531611d3151b611ce56ab50a2d2172f9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/__pycache__/util.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7b2858f8621d006b2a773251914189f76b0e41c8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__init__.py @@ -0,0 +1,1089 @@ +import os +import re +import abc +import csv +import sys +import email +import pathlib +import zipfile +import operator +import textwrap +import warnings +import functools +import itertools +import posixpath +import collections + +from . import _adapters, _meta +from ._collections import FreezableDefaultDict, Pair +from ._functools import method_cache, pass_none +from ._itertools import always_iterable, unique_everseen +from ._meta import PackageMetadata, SimplePath + +from contextlib import suppress +from importlib import import_module +from importlib.abc import MetaPathFinder +from itertools import starmap +from typing import List, Mapping, Optional, Union + + +__all__ = [ + 'Distribution', + 'DistributionFinder', + 'PackageMetadata', + 'PackageNotFoundError', + 'distribution', + 'distributions', + 'entry_points', + 'files', + 'metadata', + 'packages_distributions', + 'requires', + 'version', +] + + +class PackageNotFoundError(ModuleNotFoundError): + """The package was not found.""" + + def __str__(self): + return f"No package metadata was found for {self.name}" + + @property + def name(self): + (name,) = self.args + return name + + +class Sectioned: + """ + A simple entry point config parser for performance + + >>> for item in Sectioned.read(Sectioned._sample): + ... print(item) + Pair(name='sec1', value='# comments ignored') + Pair(name='sec1', value='a = 1') + Pair(name='sec1', value='b = 2') + Pair(name='sec2', value='a = 2') + + >>> res = Sectioned.section_pairs(Sectioned._sample) + >>> item = next(res) + >>> item.name + 'sec1' + >>> item.value + Pair(name='a', value='1') + >>> item = next(res) + >>> item.value + Pair(name='b', value='2') + >>> item = next(res) + >>> item.name + 'sec2' + >>> item.value + Pair(name='a', value='2') + >>> list(res) + [] + """ + + _sample = textwrap.dedent( + """ + [sec1] + # comments ignored + a = 1 + b = 2 + + [sec2] + a = 2 + """ + ).lstrip() + + @classmethod + def section_pairs(cls, text): + return ( + section._replace(value=Pair.parse(section.value)) + for section in cls.read(text, filter_=cls.valid) + if section.name is not None + ) + + @staticmethod + def read(text, filter_=None): + lines = filter(filter_, map(str.strip, text.splitlines())) + name = None + for value in lines: + section_match = value.startswith('[') and value.endswith(']') + if section_match: + name = value.strip('[]') + continue + yield Pair(name, value) + + @staticmethod + def valid(line): + return line and not line.startswith('#') + + +class DeprecatedTuple: + """ + Provide subscript item access for backward compatibility. + + >>> recwarn = getfixture('recwarn') + >>> ep = EntryPoint(name='name', value='value', group='group') + >>> ep[:] + ('name', 'value', 'group') + >>> ep[0] + 'name' + >>> len(recwarn) + 1 + """ + + _warn = functools.partial( + warnings.warn, + "EntryPoint tuple interface is deprecated. Access members by name.", + DeprecationWarning, + stacklevel=2, + ) + + def __getitem__(self, item): + self._warn() + return self._key()[item] + + +class EntryPoint(DeprecatedTuple): + """An entry point as defined by Python packaging conventions. + + See `the packaging docs on entry points + `_ + for more information. + + >>> ep = EntryPoint( + ... name=None, group=None, value='package.module:attr [extra1, extra2]') + >>> ep.module + 'package.module' + >>> ep.attr + 'attr' + >>> ep.extras + ['extra1', 'extra2'] + """ + + pattern = re.compile( + r'(?P[\w.]+)\s*' + r'(:\s*(?P[\w.]+)\s*)?' + r'((?P\[.*\])\s*)?$' + ) + """ + A regular expression describing the syntax for an entry point, + which might look like: + + - module + - package.module + - package.module:attribute + - package.module:object.attribute + - package.module:attr [extra1, extra2] + + Other combinations are possible as well. + + The expression is lenient about whitespace around the ':', + following the attr, and following any extras. + """ + + name: str + value: str + group: str + + dist: Optional['Distribution'] = None + + def __init__(self, name, value, group): + vars(self).update(name=name, value=value, group=group) + + def load(self): + """Load the entry point from its definition. If only a module + is indicated by the value, return that module. Otherwise, + return the named object. + """ + match = self.pattern.match(self.value) + module = import_module(match.group('module')) + attrs = filter(None, (match.group('attr') or '').split('.')) + return functools.reduce(getattr, attrs, module) + + @property + def module(self): + match = self.pattern.match(self.value) + return match.group('module') + + @property + def attr(self): + match = self.pattern.match(self.value) + return match.group('attr') + + @property + def extras(self): + match = self.pattern.match(self.value) + return re.findall(r'\w+', match.group('extras') or '') + + def _for(self, dist): + vars(self).update(dist=dist) + return self + + def __iter__(self): + """ + Supply iter so one may construct dicts of EntryPoints by name. + """ + msg = ( + "Construction of dict of EntryPoints is deprecated in " + "favor of EntryPoints." + ) + warnings.warn(msg, DeprecationWarning) + return iter((self.name, self)) + + def matches(self, **params): + """ + EntryPoint matches the given parameters. + + >>> ep = EntryPoint(group='foo', name='bar', value='bing:bong [extra1, extra2]') + >>> ep.matches(group='foo') + True + >>> ep.matches(name='bar', value='bing:bong [extra1, extra2]') + True + >>> ep.matches(group='foo', name='other') + False + >>> ep.matches() + True + >>> ep.matches(extras=['extra1', 'extra2']) + True + >>> ep.matches(module='bing') + True + >>> ep.matches(attr='bong') + True + """ + attrs = (getattr(self, param) for param in params) + return all(map(operator.eq, params.values(), attrs)) + + def _key(self): + return self.name, self.value, self.group + + def __lt__(self, other): + return self._key() < other._key() + + def __eq__(self, other): + return self._key() == other._key() + + def __setattr__(self, name, value): + raise AttributeError("EntryPoint objects are immutable.") + + def __repr__(self): + return ( + f'EntryPoint(name={self.name!r}, value={self.value!r}, ' + f'group={self.group!r})' + ) + + def __hash__(self): + return hash(self._key()) + + +class DeprecatedList(list): + """ + Allow an otherwise immutable object to implement mutability + for compatibility. + + >>> recwarn = getfixture('recwarn') + >>> dl = DeprecatedList(range(3)) + >>> dl[0] = 1 + >>> dl.append(3) + >>> del dl[3] + >>> dl.reverse() + >>> dl.sort() + >>> dl.extend([4]) + >>> dl.pop(-1) + 4 + >>> dl.remove(1) + >>> dl += [5] + >>> dl + [6] + [1, 2, 5, 6] + >>> dl + (6,) + [1, 2, 5, 6] + >>> dl.insert(0, 0) + >>> dl + [0, 1, 2, 5] + >>> dl == [0, 1, 2, 5] + True + >>> dl == (0, 1, 2, 5) + True + >>> len(recwarn) + 1 + """ + + __slots__ = () + + _warn = functools.partial( + warnings.warn, + "EntryPoints list interface is deprecated. Cast to list if needed.", + DeprecationWarning, + stacklevel=2, + ) + + def _wrap_deprecated_method(method_name: str): # type: ignore + def wrapped(self, *args, **kwargs): + self._warn() + return getattr(super(), method_name)(*args, **kwargs) + + return method_name, wrapped + + locals().update( + map( + _wrap_deprecated_method, + '__setitem__ __delitem__ append reverse extend pop remove ' + '__iadd__ insert sort'.split(), + ) + ) + + def __add__(self, other): + if not isinstance(other, tuple): + self._warn() + other = tuple(other) + return self.__class__(tuple(self) + other) + + def __eq__(self, other): + if not isinstance(other, tuple): + self._warn() + other = tuple(other) + + return tuple(self).__eq__(other) + + +class EntryPoints(DeprecatedList): + """ + An immutable collection of selectable EntryPoint objects. + """ + + __slots__ = () + + def __getitem__(self, name): # -> EntryPoint: + """ + Get the EntryPoint in self matching name. + """ + if isinstance(name, int): + warnings.warn( + "Accessing entry points by index is deprecated. " + "Cast to tuple if needed.", + DeprecationWarning, + stacklevel=2, + ) + return super().__getitem__(name) + try: + return next(iter(self.select(name=name))) + except StopIteration: + raise KeyError(name) + + def select(self, **params): + """ + Select entry points from self that match the + given parameters (typically group and/or name). + """ + return EntryPoints(ep for ep in self if ep.matches(**params)) + + @property + def names(self): + """ + Return the set of all names of all entry points. + """ + return {ep.name for ep in self} + + @property + def groups(self): + """ + Return the set of all groups of all entry points. + + For coverage while SelectableGroups is present. + >>> EntryPoints().groups + set() + """ + return {ep.group for ep in self} + + @classmethod + def _from_text_for(cls, text, dist): + return cls(ep._for(dist) for ep in cls._from_text(text)) + + @staticmethod + def _from_text(text): + return ( + EntryPoint(name=item.value.name, value=item.value.value, group=item.name) + for item in Sectioned.section_pairs(text or '') + ) + + +class Deprecated: + """ + Compatibility add-in for mapping to indicate that + mapping behavior is deprecated. + + >>> recwarn = getfixture('recwarn') + >>> class DeprecatedDict(Deprecated, dict): pass + >>> dd = DeprecatedDict(foo='bar') + >>> dd.get('baz', None) + >>> dd['foo'] + 'bar' + >>> list(dd) + ['foo'] + >>> list(dd.keys()) + ['foo'] + >>> 'foo' in dd + True + >>> list(dd.values()) + ['bar'] + >>> len(recwarn) + 1 + """ + + _warn = functools.partial( + warnings.warn, + "SelectableGroups dict interface is deprecated. Use select.", + DeprecationWarning, + stacklevel=2, + ) + + def __getitem__(self, name): + self._warn() + return super().__getitem__(name) + + def get(self, name, default=None): + self._warn() + return super().get(name, default) + + def __iter__(self): + self._warn() + return super().__iter__() + + def __contains__(self, *args): + self._warn() + return super().__contains__(*args) + + def keys(self): + self._warn() + return super().keys() + + def values(self): + self._warn() + return super().values() + + +class SelectableGroups(Deprecated, dict): + """ + A backward- and forward-compatible result from + entry_points that fully implements the dict interface. + """ + + @classmethod + def load(cls, eps): + by_group = operator.attrgetter('group') + ordered = sorted(eps, key=by_group) + grouped = itertools.groupby(ordered, by_group) + return cls((group, EntryPoints(eps)) for group, eps in grouped) + + @property + def _all(self): + """ + Reconstruct a list of all entrypoints from the groups. + """ + groups = super(Deprecated, self).values() + return EntryPoints(itertools.chain.from_iterable(groups)) + + @property + def groups(self): + return self._all.groups + + @property + def names(self): + """ + for coverage: + >>> SelectableGroups().names + set() + """ + return self._all.names + + def select(self, **params): + if not params: + return self + return self._all.select(**params) + + +class PackagePath(pathlib.PurePosixPath): + """A reference to a path in a package""" + + def read_text(self, encoding='utf-8'): + with self.locate().open(encoding=encoding) as stream: + return stream.read() + + def read_binary(self): + with self.locate().open('rb') as stream: + return stream.read() + + def locate(self): + """Return a path-like object for this path""" + return self.dist.locate_file(self) + + +class FileHash: + def __init__(self, spec): + self.mode, _, self.value = spec.partition('=') + + def __repr__(self): + return f'' + + +class Distribution: + """A Python distribution package.""" + + @abc.abstractmethod + def read_text(self, filename): + """Attempt to load metadata file given by the name. + + :param filename: The name of the file in the distribution info. + :return: The text if found, otherwise None. + """ + + @abc.abstractmethod + def locate_file(self, path): + """ + Given a path to a file in this distribution, return a path + to it. + """ + + @classmethod + def from_name(cls, name: str): + """Return the Distribution for the given package name. + + :param name: The name of the distribution package to search for. + :return: The Distribution instance (or subclass thereof) for the named + package, if found. + :raises PackageNotFoundError: When the named package's distribution + metadata cannot be found. + :raises ValueError: When an invalid value is supplied for name. + """ + if not name: + raise ValueError("A distribution name is required.") + try: + return next(cls.discover(name=name)) + except StopIteration: + raise PackageNotFoundError(name) + + @classmethod + def discover(cls, **kwargs): + """Return an iterable of Distribution objects for all packages. + + Pass a ``context`` or pass keyword arguments for constructing + a context. + + :context: A ``DistributionFinder.Context`` object. + :return: Iterable of Distribution objects for all packages. + """ + context = kwargs.pop('context', None) + if context and kwargs: + raise ValueError("cannot accept context and kwargs") + context = context or DistributionFinder.Context(**kwargs) + return itertools.chain.from_iterable( + resolver(context) for resolver in cls._discover_resolvers() + ) + + @staticmethod + def at(path): + """Return a Distribution for the indicated metadata path + + :param path: a string or path-like object + :return: a concrete Distribution instance for the path + """ + return PathDistribution(pathlib.Path(path)) + + @staticmethod + def _discover_resolvers(): + """Search the meta_path for resolvers.""" + declared = ( + getattr(finder, 'find_distributions', None) for finder in sys.meta_path + ) + return filter(None, declared) + + @property + def metadata(self) -> _meta.PackageMetadata: + """Return the parsed metadata for this Distribution. + + The returned object will have keys that name the various bits of + metadata. See PEP 566 for details. + """ + text = ( + self.read_text('METADATA') + or self.read_text('PKG-INFO') + # This last clause is here to support old egg-info files. Its + # effect is to just end up using the PathDistribution's self._path + # (which points to the egg-info file) attribute unchanged. + or self.read_text('') + ) + return _adapters.Message(email.message_from_string(text)) + + @property + def name(self): + """Return the 'Name' metadata for the distribution package.""" + return self.metadata['Name'] + + @property + def _normalized_name(self): + """Return a normalized version of the name.""" + return Prepared.normalize(self.name) + + @property + def version(self): + """Return the 'Version' metadata for the distribution package.""" + return self.metadata['Version'] + + @property + def entry_points(self): + return EntryPoints._from_text_for(self.read_text('entry_points.txt'), self) + + @property + def files(self): + """Files in this distribution. + + :return: List of PackagePath for this distribution or None + + Result is `None` if the metadata file that enumerates files + (i.e. RECORD for dist-info or SOURCES.txt for egg-info) is + missing. + Result may be empty if the metadata exists but is empty. + """ + + def make_file(name, hash=None, size_str=None): + result = PackagePath(name) + result.hash = FileHash(hash) if hash else None + result.size = int(size_str) if size_str else None + result.dist = self + return result + + @pass_none + def make_files(lines): + return list(starmap(make_file, csv.reader(lines))) + + return make_files(self._read_files_distinfo() or self._read_files_egginfo()) + + def _read_files_distinfo(self): + """ + Read the lines of RECORD + """ + text = self.read_text('RECORD') + return text and text.splitlines() + + def _read_files_egginfo(self): + """ + SOURCES.txt might contain literal commas, so wrap each line + in quotes. + """ + text = self.read_text('SOURCES.txt') + return text and map('"{}"'.format, text.splitlines()) + + @property + def requires(self): + """Generated requirements specified for this Distribution""" + reqs = self._read_dist_info_reqs() or self._read_egg_info_reqs() + return reqs and list(reqs) + + def _read_dist_info_reqs(self): + return self.metadata.get_all('Requires-Dist') + + def _read_egg_info_reqs(self): + source = self.read_text('requires.txt') + return pass_none(self._deps_from_requires_text)(source) + + @classmethod + def _deps_from_requires_text(cls, source): + return cls._convert_egg_info_reqs_to_simple_reqs(Sectioned.read(source)) + + @staticmethod + def _convert_egg_info_reqs_to_simple_reqs(sections): + """ + Historically, setuptools would solicit and store 'extra' + requirements, including those with environment markers, + in separate sections. More modern tools expect each + dependency to be defined separately, with any relevant + extras and environment markers attached directly to that + requirement. This method converts the former to the + latter. See _test_deps_from_requires_text for an example. + """ + + def make_condition(name): + return name and f'extra == "{name}"' + + def quoted_marker(section): + section = section or '' + extra, sep, markers = section.partition(':') + if extra and markers: + markers = f'({markers})' + conditions = list(filter(None, [markers, make_condition(extra)])) + return '; ' + ' and '.join(conditions) if conditions else '' + + def url_req_space(req): + """ + PEP 508 requires a space between the url_spec and the quoted_marker. + Ref python/importlib_metadata#357. + """ + # '@' is uniquely indicative of a url_req. + return ' ' * ('@' in req) + + for section in sections: + space = url_req_space(section.value) + yield section.value + space + quoted_marker(section.name) + + +class DistributionFinder(MetaPathFinder): + """ + A MetaPathFinder capable of discovering installed distributions. + """ + + class Context: + """ + Keyword arguments presented by the caller to + ``distributions()`` or ``Distribution.discover()`` + to narrow the scope of a search for distributions + in all DistributionFinders. + + Each DistributionFinder may expect any parameters + and should attempt to honor the canonical + parameters defined below when appropriate. + """ + + name = None + """ + Specific name for which a distribution finder should match. + A name of ``None`` matches all distributions. + """ + + def __init__(self, **kwargs): + vars(self).update(kwargs) + + @property + def path(self): + """ + The sequence of directory path that a distribution finder + should search. + + Typically refers to Python installed package paths such as + "site-packages" directories and defaults to ``sys.path``. + """ + return vars(self).get('path', sys.path) + + @abc.abstractmethod + def find_distributions(self, context=Context()): + """ + Find distributions. + + Return an iterable of all Distribution instances capable of + loading the metadata for packages matching the ``context``, + a DistributionFinder.Context instance. + """ + + +class FastPath: + """ + Micro-optimized class for searching a path for + children. + + >>> FastPath('').children() + ['...'] + """ + + @functools.lru_cache() # type: ignore + def __new__(cls, root): + return super().__new__(cls) + + def __init__(self, root): + self.root = root + + def joinpath(self, child): + return pathlib.Path(self.root, child) + + def children(self): + with suppress(Exception): + return os.listdir(self.root or '.') + with suppress(Exception): + return self.zip_children() + return [] + + def zip_children(self): + zip_path = zipfile.Path(self.root) + names = zip_path.root.namelist() + self.joinpath = zip_path.joinpath + + return dict.fromkeys(child.split(posixpath.sep, 1)[0] for child in names) + + def search(self, name): + return self.lookup(self.mtime).search(name) + + @property + def mtime(self): + with suppress(OSError): + return os.stat(self.root).st_mtime + self.lookup.cache_clear() + + @method_cache + def lookup(self, mtime): + return Lookup(self) + + +class Lookup: + def __init__(self, path: FastPath): + base = os.path.basename(path.root).lower() + base_is_egg = base.endswith(".egg") + self.infos = FreezableDefaultDict(list) + self.eggs = FreezableDefaultDict(list) + + for child in path.children(): + low = child.lower() + if low.endswith((".dist-info", ".egg-info")): + # rpartition is faster than splitext and suitable for this purpose. + name = low.rpartition(".")[0].partition("-")[0] + normalized = Prepared.normalize(name) + self.infos[normalized].append(path.joinpath(child)) + elif base_is_egg and low == "egg-info": + name = base.rpartition(".")[0].partition("-")[0] + legacy_normalized = Prepared.legacy_normalize(name) + self.eggs[legacy_normalized].append(path.joinpath(child)) + + self.infos.freeze() + self.eggs.freeze() + + def search(self, prepared): + infos = ( + self.infos[prepared.normalized] + if prepared + else itertools.chain.from_iterable(self.infos.values()) + ) + eggs = ( + self.eggs[prepared.legacy_normalized] + if prepared + else itertools.chain.from_iterable(self.eggs.values()) + ) + return itertools.chain(infos, eggs) + + +class Prepared: + """ + A prepared search for metadata on a possibly-named package. + """ + + normalized = None + legacy_normalized = None + + def __init__(self, name): + self.name = name + if name is None: + return + self.normalized = self.normalize(name) + self.legacy_normalized = self.legacy_normalize(name) + + @staticmethod + def normalize(name): + """ + PEP 503 normalization plus dashes as underscores. + """ + return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_') + + @staticmethod + def legacy_normalize(name): + """ + Normalize the package name as found in the convention in + older packaging tools versions and specs. + """ + return name.lower().replace('-', '_') + + def __bool__(self): + return bool(self.name) + + +class MetadataPathFinder(DistributionFinder): + @classmethod + def find_distributions(cls, context=DistributionFinder.Context()): + """ + Find distributions. + + Return an iterable of all Distribution instances capable of + loading the metadata for packages matching ``context.name`` + (or all names if ``None`` indicated) along the paths in the list + of directories ``context.path``. + """ + found = cls._search_paths(context.name, context.path) + return map(PathDistribution, found) + + @classmethod + def _search_paths(cls, name, paths): + """Find metadata directories in paths heuristically.""" + prepared = Prepared(name) + return itertools.chain.from_iterable( + path.search(prepared) for path in map(FastPath, paths) + ) + + @classmethod + def invalidate_caches(cls): + FastPath.__new__.cache_clear() + + +class PathDistribution(Distribution): + def __init__(self, path: SimplePath): + """Construct a distribution. + + :param path: SimplePath indicating the metadata directory. + """ + self._path = path + + def read_text(self, filename): + with suppress( + FileNotFoundError, + IsADirectoryError, + KeyError, + NotADirectoryError, + PermissionError, + ): + return self._path.joinpath(filename).read_text(encoding='utf-8') + + read_text.__doc__ = Distribution.read_text.__doc__ + + def locate_file(self, path): + return self._path.parent / path + + @property + def _normalized_name(self): + """ + Performance optimization: where possible, resolve the + normalized name from the file system path. + """ + stem = os.path.basename(str(self._path)) + return ( + pass_none(Prepared.normalize)(self._name_from_stem(stem)) + or super()._normalized_name + ) + + @staticmethod + def _name_from_stem(stem): + """ + >>> PathDistribution._name_from_stem('foo-3.0.egg-info') + 'foo' + >>> PathDistribution._name_from_stem('CherryPy-3.0.dist-info') + 'CherryPy' + >>> PathDistribution._name_from_stem('face.egg-info') + 'face' + >>> PathDistribution._name_from_stem('foo.bar') + """ + filename, ext = os.path.splitext(stem) + if ext not in ('.dist-info', '.egg-info'): + return + name, sep, rest = filename.partition('-') + return name + + +def distribution(distribution_name): + """Get the ``Distribution`` instance for the named package. + + :param distribution_name: The name of the distribution package as a string. + :return: A ``Distribution`` instance (or subclass thereof). + """ + return Distribution.from_name(distribution_name) + + +def distributions(**kwargs): + """Get all ``Distribution`` instances in the current environment. + + :return: An iterable of ``Distribution`` instances. + """ + return Distribution.discover(**kwargs) + + +def metadata(distribution_name) -> _meta.PackageMetadata: + """Get the metadata for the named package. + + :param distribution_name: The name of the distribution package to query. + :return: A PackageMetadata containing the parsed metadata. + """ + return Distribution.from_name(distribution_name).metadata + + +def version(distribution_name): + """Get the version string for the named package. + + :param distribution_name: The name of the distribution package to query. + :return: The version string for the package as defined in the package's + "Version" metadata key. + """ + return distribution(distribution_name).version + + +_unique = functools.partial( + unique_everseen, + key=operator.attrgetter('_normalized_name'), +) +""" +Wrapper for ``distributions`` to return unique distributions by name. +""" + + +def entry_points(**params) -> Union[EntryPoints, SelectableGroups]: + """Return EntryPoint objects for all installed packages. + + Pass selection parameters (group or name) to filter the + result to entry points matching those properties (see + EntryPoints.select()). + + For compatibility, returns ``SelectableGroups`` object unless + selection parameters are supplied. In the future, this function + will return ``EntryPoints`` instead of ``SelectableGroups`` + even when no selection parameters are supplied. + + For maximum future compatibility, pass selection parameters + or invoke ``.select`` with parameters on the result. + + :return: EntryPoints or SelectableGroups for all installed packages. + """ + eps = itertools.chain.from_iterable( + dist.entry_points for dist in _unique(distributions()) + ) + return SelectableGroups.load(eps).select(**params) + + +def files(distribution_name): + """Return a list of files for the named package. + + :param distribution_name: The name of the distribution package to query. + :return: List of files composing the distribution. + """ + return distribution(distribution_name).files + + +def requires(distribution_name): + """ + Return a list of requirements for the named package. + + :return: An iterator of requirements, suitable for + packaging.requirement.Requirement. + """ + return distribution(distribution_name).requires + + +def packages_distributions() -> Mapping[str, List[str]]: + """ + Return a mapping of top-level packages to their + distributions. + + >>> import collections.abc + >>> pkgs = packages_distributions() + >>> all(isinstance(dist, collections.abc.Sequence) for dist in pkgs.values()) + True + """ + pkg_to_dist = collections.defaultdict(list) + for dist in distributions(): + for pkg in _top_level_declared(dist) or _top_level_inferred(dist): + pkg_to_dist[pkg].append(dist.metadata['Name']) + return dict(pkg_to_dist) + + +def _top_level_declared(dist): + return (dist.read_text('top_level.txt') or '').split() + + +def _top_level_inferred(dist): + return { + f.parts[0] if len(f.parts) > 1 else f.with_suffix('').name + for f in always_iterable(dist.files) + if f.suffix == ".py" + } diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..246fbbcd938087840edb7010845ca8482d523167 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/_adapters.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/_adapters.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..20cecf42a279121deddf75454cd6d1e55faafdc0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/_adapters.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/_collections.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/_collections.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..57a40320dbe3d2f99887e1ab73228f2193eee5fd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/_collections.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/_functools.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/_functools.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f51d4651985963eb5695d5db0b17f5d530dc9133 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/_functools.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/_itertools.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/_itertools.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9dba0b71712d0cfd65a8a54f6df49a87d34c1d22 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/_itertools.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/_meta.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/_meta.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..159275ed068e713fa1b5f20f34a3f2587bb327ee Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/_meta.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/_text.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/_text.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0de33515233bfe3f591397e47f1780b219c84229 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/__pycache__/_text.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/_adapters.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/_adapters.py new file mode 100644 index 0000000000000000000000000000000000000000..aa460d3eda50fbb174623a1b5bbca54645fd588a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/_adapters.py @@ -0,0 +1,68 @@ +import re +import textwrap +import email.message + +from ._text import FoldedCase + + +class Message(email.message.Message): + multiple_use_keys = set( + map( + FoldedCase, + [ + 'Classifier', + 'Obsoletes-Dist', + 'Platform', + 'Project-URL', + 'Provides-Dist', + 'Provides-Extra', + 'Requires-Dist', + 'Requires-External', + 'Supported-Platform', + 'Dynamic', + ], + ) + ) + """ + Keys that may be indicated multiple times per PEP 566. + """ + + def __new__(cls, orig: email.message.Message): + res = super().__new__(cls) + vars(res).update(vars(orig)) + return res + + def __init__(self, *args, **kwargs): + self._headers = self._repair_headers() + + # suppress spurious error from mypy + def __iter__(self): + return super().__iter__() + + def _repair_headers(self): + def redent(value): + "Correct for RFC822 indentation" + if not value or '\n' not in value: + return value + return textwrap.dedent(' ' * 8 + value) + + headers = [(key, redent(value)) for key, value in vars(self)['_headers']] + if self._payload: + headers.append(('Description', self.get_payload())) + return headers + + @property + def json(self): + """ + Convert PackageMetadata to a JSON-compatible format + per PEP 0566. + """ + + def transform(key): + value = self.get_all(key) if key in self.multiple_use_keys else self[key] + if key == 'Keywords': + value = re.split(r'\s+', value) + tk = key.lower().replace('-', '_') + return tk, value + + return dict(map(transform, map(FoldedCase, self))) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/_collections.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/_collections.py new file mode 100644 index 0000000000000000000000000000000000000000..cf0954e1a30546d781bf25781ec716ef92a77e32 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/_collections.py @@ -0,0 +1,30 @@ +import collections + + +# from jaraco.collections 3.3 +class FreezableDefaultDict(collections.defaultdict): + """ + Often it is desirable to prevent the mutation of + a default dict after its initial construction, such + as to prevent mutation during iteration. + + >>> dd = FreezableDefaultDict(list) + >>> dd[0].append('1') + >>> dd.freeze() + >>> dd[1] + [] + >>> len(dd) + 1 + """ + + def __missing__(self, key): + return getattr(self, '_frozen', super().__missing__)(key) + + def freeze(self): + self._frozen = lambda key: self.default_factory() + + +class Pair(collections.namedtuple('Pair', 'name value')): + @classmethod + def parse(cls, text): + return cls(*map(str.strip, text.split("=", 1))) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/_functools.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/_functools.py new file mode 100644 index 0000000000000000000000000000000000000000..71f66bd03cb713a2190853bdf7170c4ea80d2425 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/_functools.py @@ -0,0 +1,104 @@ +import types +import functools + + +# from jaraco.functools 3.3 +def method_cache(method, cache_wrapper=None): + """ + Wrap lru_cache to support storing the cache data in the object instances. + + Abstracts the common paradigm where the method explicitly saves an + underscore-prefixed protected property on first call and returns that + subsequently. + + >>> class MyClass: + ... calls = 0 + ... + ... @method_cache + ... def method(self, value): + ... self.calls += 1 + ... return value + + >>> a = MyClass() + >>> a.method(3) + 3 + >>> for x in range(75): + ... res = a.method(x) + >>> a.calls + 75 + + Note that the apparent behavior will be exactly like that of lru_cache + except that the cache is stored on each instance, so values in one + instance will not flush values from another, and when an instance is + deleted, so are the cached values for that instance. + + >>> b = MyClass() + >>> for x in range(35): + ... res = b.method(x) + >>> b.calls + 35 + >>> a.method(0) + 0 + >>> a.calls + 75 + + Note that if method had been decorated with ``functools.lru_cache()``, + a.calls would have been 76 (due to the cached value of 0 having been + flushed by the 'b' instance). + + Clear the cache with ``.cache_clear()`` + + >>> a.method.cache_clear() + + Same for a method that hasn't yet been called. + + >>> c = MyClass() + >>> c.method.cache_clear() + + Another cache wrapper may be supplied: + + >>> cache = functools.lru_cache(maxsize=2) + >>> MyClass.method2 = method_cache(lambda self: 3, cache_wrapper=cache) + >>> a = MyClass() + >>> a.method2() + 3 + + Caution - do not subsequently wrap the method with another decorator, such + as ``@property``, which changes the semantics of the function. + + See also + http://code.activestate.com/recipes/577452-a-memoize-decorator-for-instance-methods/ + for another implementation and additional justification. + """ + cache_wrapper = cache_wrapper or functools.lru_cache() + + def wrapper(self, *args, **kwargs): + # it's the first call, replace the method with a cached, bound method + bound_method = types.MethodType(method, self) + cached_method = cache_wrapper(bound_method) + setattr(self, method.__name__, cached_method) + return cached_method(*args, **kwargs) + + # Support cache clear even before cache has been created. + wrapper.cache_clear = lambda: None + + return wrapper + + +# From jaraco.functools 3.3 +def pass_none(func): + """ + Wrap func so it's not called if its first param is None + + >>> print_text = pass_none(print) + >>> print_text('text') + text + >>> print_text(None) + """ + + @functools.wraps(func) + def wrapper(param, *args, **kwargs): + if param is not None: + return func(param, *args, **kwargs) + + return wrapper diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/_itertools.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/_itertools.py new file mode 100644 index 0000000000000000000000000000000000000000..d4ca9b9140e3f085b36609bb8dfdaea79c78e144 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/_itertools.py @@ -0,0 +1,73 @@ +from itertools import filterfalse + + +def unique_everseen(iterable, key=None): + "List unique elements, preserving order. Remember all elements ever seen." + # unique_everseen('AAAABBBCCDAABBB') --> A B C D + # unique_everseen('ABBCcAD', str.lower) --> A B C D + seen = set() + seen_add = seen.add + if key is None: + for element in filterfalse(seen.__contains__, iterable): + seen_add(element) + yield element + else: + for element in iterable: + k = key(element) + if k not in seen: + seen_add(k) + yield element + + +# copied from more_itertools 8.8 +def always_iterable(obj, base_type=(str, bytes)): + """If *obj* is iterable, return an iterator over its items:: + + >>> obj = (1, 2, 3) + >>> list(always_iterable(obj)) + [1, 2, 3] + + If *obj* is not iterable, return a one-item iterable containing *obj*:: + + >>> obj = 1 + >>> list(always_iterable(obj)) + [1] + + If *obj* is ``None``, return an empty iterable: + + >>> obj = None + >>> list(always_iterable(None)) + [] + + By default, binary and text strings are not considered iterable:: + + >>> obj = 'foo' + >>> list(always_iterable(obj)) + ['foo'] + + If *base_type* is set, objects for which ``isinstance(obj, base_type)`` + returns ``True`` won't be considered iterable. + + >>> obj = {'a': 1} + >>> list(always_iterable(obj)) # Iterate over the dict's keys + ['a'] + >>> list(always_iterable(obj, base_type=dict)) # Treat dicts as a unit + [{'a': 1}] + + Set *base_type* to ``None`` to avoid any special handling and treat objects + Python considers iterable as iterable: + + >>> obj = 'foo' + >>> list(always_iterable(obj, base_type=None)) + ['f', 'o', 'o'] + """ + if obj is None: + return iter(()) + + if (base_type is not None) and isinstance(obj, base_type): + return iter((obj,)) + + try: + return iter(obj) + except TypeError: + return iter((obj,)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/_meta.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/_meta.py new file mode 100644 index 0000000000000000000000000000000000000000..d5c0576194ece238b6062b97dcdea443c5630bc8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/_meta.py @@ -0,0 +1,47 @@ +from typing import Any, Dict, Iterator, List, Protocol, TypeVar, Union + + +_T = TypeVar("_T") + + +class PackageMetadata(Protocol): + def __len__(self) -> int: + ... # pragma: no cover + + def __contains__(self, item: str) -> bool: + ... # pragma: no cover + + def __getitem__(self, key: str) -> str: + ... # pragma: no cover + + def __iter__(self) -> Iterator[str]: + ... # pragma: no cover + + def get_all(self, name: str, failobj: _T = ...) -> Union[List[Any], _T]: + """ + Return all values associated with a possibly multi-valued key. + """ + + @property + def json(self) -> Dict[str, Union[str, List[str]]]: + """ + A JSON-compatible form of the metadata. + """ + + +class SimplePath(Protocol): + """ + A minimal subset of pathlib.Path required by PathDistribution. + """ + + def joinpath(self) -> 'SimplePath': + ... # pragma: no cover + + def __truediv__(self) -> 'SimplePath': + ... # pragma: no cover + + def parent(self) -> 'SimplePath': + ... # pragma: no cover + + def read_text(self) -> str: + ... # pragma: no cover diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/_text.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/_text.py new file mode 100644 index 0000000000000000000000000000000000000000..c88cfbb2349c6401336bc5ba6623f51afd1eb59d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/metadata/_text.py @@ -0,0 +1,99 @@ +import re + +from ._functools import method_cache + + +# from jaraco.text 3.5 +class FoldedCase(str): + """ + A case insensitive string class; behaves just like str + except compares equal when the only variation is case. + + >>> s = FoldedCase('hello world') + + >>> s == 'Hello World' + True + + >>> 'Hello World' == s + True + + >>> s != 'Hello World' + False + + >>> s.index('O') + 4 + + >>> s.split('O') + ['hell', ' w', 'rld'] + + >>> sorted(map(FoldedCase, ['GAMMA', 'alpha', 'Beta'])) + ['alpha', 'Beta', 'GAMMA'] + + Sequence membership is straightforward. + + >>> "Hello World" in [s] + True + >>> s in ["Hello World"] + True + + You may test for set inclusion, but candidate and elements + must both be folded. + + >>> FoldedCase("Hello World") in {s} + True + >>> s in {FoldedCase("Hello World")} + True + + String inclusion works as long as the FoldedCase object + is on the right. + + >>> "hello" in FoldedCase("Hello World") + True + + But not if the FoldedCase object is on the left: + + >>> FoldedCase('hello') in 'Hello World' + False + + In that case, use in_: + + >>> FoldedCase('hello').in_('Hello World') + True + + >>> FoldedCase('hello') > FoldedCase('Hello') + False + """ + + def __lt__(self, other): + return self.lower() < other.lower() + + def __gt__(self, other): + return self.lower() > other.lower() + + def __eq__(self, other): + return self.lower() == other.lower() + + def __ne__(self, other): + return self.lower() != other.lower() + + def __hash__(self): + return hash(self.lower()) + + def __contains__(self, other): + return super().lower().__contains__(other.lower()) + + def in_(self, other): + "Does self appear in other?" + return self in FoldedCase(other) + + # cache lower since it's likely to be called frequently. + @method_cache + def lower(self): + return super().lower() + + def index(self, sub): + return self.lower().index(sub.lower()) + + def split(self, splitter=' ', maxsplit=0): + pattern = re.compile(re.escape(splitter), re.I) + return pattern.split(self, maxsplit) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..34e3a9950cc557879af8d797f9382b18a870fb56 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__init__.py @@ -0,0 +1,36 @@ +"""Read resources contained within a package.""" + +from ._common import ( + as_file, + files, + Package, +) + +from ._legacy import ( + contents, + open_binary, + read_binary, + open_text, + read_text, + is_resource, + path, + Resource, +) + +from .abc import ResourceReader + + +__all__ = [ + 'Package', + 'Resource', + 'ResourceReader', + 'as_file', + 'contents', + 'files', + 'is_resource', + 'open_binary', + 'open_text', + 'path', + 'read_binary', + 'read_text', +] diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7aa06d8e77690bd623125da466b8a0336d8991a2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/_adapters.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/_adapters.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4f1fb9b97c3072a238ca421f5c2a6939d9e71e44 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/_adapters.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/_common.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/_common.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0b64c18e2fec6919005a620cf39fce9de8e9618f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/_common.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/_itertools.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/_itertools.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..994bb6ca91022a5cae358ed5f58d22698901051c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/_itertools.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/_legacy.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/_legacy.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8d21f7c58835a41ef5083a8432a407d688ef30e2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/_legacy.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/abc.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/abc.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..698ec1284b47b92e9c34fad655fadce2274a8259 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/abc.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/readers.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/readers.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0295097b35f7a71ac421611662529a3f931d71b8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/readers.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/simple.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/simple.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2452478ac8cc1d2838e5cdcf0696cea5e79406cb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/__pycache__/simple.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/_adapters.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/_adapters.py new file mode 100644 index 0000000000000000000000000000000000000000..ea363d86a564b5450666aa00aecd46353326a75a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/_adapters.py @@ -0,0 +1,170 @@ +from contextlib import suppress +from io import TextIOWrapper + +from . import abc + + +class SpecLoaderAdapter: + """ + Adapt a package spec to adapt the underlying loader. + """ + + def __init__(self, spec, adapter=lambda spec: spec.loader): + self.spec = spec + self.loader = adapter(spec) + + def __getattr__(self, name): + return getattr(self.spec, name) + + +class TraversableResourcesLoader: + """ + Adapt a loader to provide TraversableResources. + """ + + def __init__(self, spec): + self.spec = spec + + def get_resource_reader(self, name): + return CompatibilityFiles(self.spec)._native() + + +def _io_wrapper(file, mode='r', *args, **kwargs): + if mode == 'r': + return TextIOWrapper(file, *args, **kwargs) + elif mode == 'rb': + return file + raise ValueError( + "Invalid mode value '{}', only 'r' and 'rb' are supported".format(mode) + ) + + +class CompatibilityFiles: + """ + Adapter for an existing or non-existent resource reader + to provide a compatibility .files(). + """ + + class SpecPath(abc.Traversable): + """ + Path tied to a module spec. + Can be read and exposes the resource reader children. + """ + + def __init__(self, spec, reader): + self._spec = spec + self._reader = reader + + def iterdir(self): + if not self._reader: + return iter(()) + return iter( + CompatibilityFiles.ChildPath(self._reader, path) + for path in self._reader.contents() + ) + + def is_file(self): + return False + + is_dir = is_file + + def joinpath(self, other): + if not self._reader: + return CompatibilityFiles.OrphanPath(other) + return CompatibilityFiles.ChildPath(self._reader, other) + + @property + def name(self): + return self._spec.name + + def open(self, mode='r', *args, **kwargs): + return _io_wrapper(self._reader.open_resource(None), mode, *args, **kwargs) + + class ChildPath(abc.Traversable): + """ + Path tied to a resource reader child. + Can be read but doesn't expose any meaningful children. + """ + + def __init__(self, reader, name): + self._reader = reader + self._name = name + + def iterdir(self): + return iter(()) + + def is_file(self): + return self._reader.is_resource(self.name) + + def is_dir(self): + return not self.is_file() + + def joinpath(self, other): + return CompatibilityFiles.OrphanPath(self.name, other) + + @property + def name(self): + return self._name + + def open(self, mode='r', *args, **kwargs): + return _io_wrapper( + self._reader.open_resource(self.name), mode, *args, **kwargs + ) + + class OrphanPath(abc.Traversable): + """ + Orphan path, not tied to a module spec or resource reader. + Can't be read and doesn't expose any meaningful children. + """ + + def __init__(self, *path_parts): + if len(path_parts) < 1: + raise ValueError('Need at least one path part to construct a path') + self._path = path_parts + + def iterdir(self): + return iter(()) + + def is_file(self): + return False + + is_dir = is_file + + def joinpath(self, other): + return CompatibilityFiles.OrphanPath(*self._path, other) + + @property + def name(self): + return self._path[-1] + + def open(self, mode='r', *args, **kwargs): + raise FileNotFoundError("Can't open orphan path") + + def __init__(self, spec): + self.spec = spec + + @property + def _reader(self): + with suppress(AttributeError): + return self.spec.loader.get_resource_reader(self.spec.name) + + def _native(self): + """ + Return the native reader if it supports files(). + """ + reader = self._reader + return reader if hasattr(reader, 'files') else self + + def __getattr__(self, attr): + return getattr(self._reader, attr) + + def files(self): + return CompatibilityFiles.SpecPath(self.spec, self._reader) + + +def wrap_spec(package): + """ + Construct a package spec with traversable compatibility + on the spec/loader/reader. + """ + return SpecLoaderAdapter(package.__spec__, TraversableResourcesLoader) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/_common.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/_common.py new file mode 100644 index 0000000000000000000000000000000000000000..ca1fa8ab2fe6ff28313134ef37d7c71676280b35 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/_common.py @@ -0,0 +1,107 @@ +import os +import pathlib +import tempfile +import functools +import contextlib +import types +import importlib + +from typing import Union, Optional +from .abc import ResourceReader, Traversable + +from ._adapters import wrap_spec + +Package = Union[types.ModuleType, str] + + +def files(package): + # type: (Package) -> Traversable + """ + Get a Traversable resource from a package + """ + return from_package(get_package(package)) + + +def get_resource_reader(package): + # type: (types.ModuleType) -> Optional[ResourceReader] + """ + Return the package's loader if it's a ResourceReader. + """ + # We can't use + # a issubclass() check here because apparently abc.'s __subclasscheck__() + # hook wants to create a weak reference to the object, but + # zipimport.zipimporter does not support weak references, resulting in a + # TypeError. That seems terrible. + spec = package.__spec__ + reader = getattr(spec.loader, 'get_resource_reader', None) # type: ignore + if reader is None: + return None + return reader(spec.name) # type: ignore + + +def resolve(cand): + # type: (Package) -> types.ModuleType + return cand if isinstance(cand, types.ModuleType) else importlib.import_module(cand) + + +def get_package(package): + # type: (Package) -> types.ModuleType + """Take a package name or module object and return the module. + + Raise an exception if the resolved module is not a package. + """ + resolved = resolve(package) + if wrap_spec(resolved).submodule_search_locations is None: + raise TypeError(f'{package!r} is not a package') + return resolved + + +def from_package(package): + """ + Return a Traversable object for the given package. + + """ + spec = wrap_spec(package) + reader = spec.loader.get_resource_reader(spec.name) + return reader.files() + + +@contextlib.contextmanager +def _tempfile(reader, suffix='', + # gh-93353: Keep a reference to call os.remove() in late Python + # finalization. + *, _os_remove=os.remove): + # Not using tempfile.NamedTemporaryFile as it leads to deeper 'try' + # blocks due to the need to close the temporary file to work on Windows + # properly. + fd, raw_path = tempfile.mkstemp(suffix=suffix) + try: + try: + os.write(fd, reader()) + finally: + os.close(fd) + del reader + yield pathlib.Path(raw_path) + finally: + try: + _os_remove(raw_path) + except FileNotFoundError: + pass + + +@functools.singledispatch +def as_file(path): + """ + Given a Traversable object, return that object as a + path on the local file system in a context manager. + """ + return _tempfile(path.read_bytes, suffix=path.name) + + +@as_file.register(pathlib.Path) +@contextlib.contextmanager +def _(path): + """ + Degenerate behavior for pathlib.Path objects. + """ + yield path diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/_itertools.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/_itertools.py new file mode 100644 index 0000000000000000000000000000000000000000..cce05582ffc6fe6d72027194f4ccc44ee42f1fcd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/_itertools.py @@ -0,0 +1,35 @@ +from itertools import filterfalse + +from typing import ( + Callable, + Iterable, + Iterator, + Optional, + Set, + TypeVar, + Union, +) + +# Type and type variable definitions +_T = TypeVar('_T') +_U = TypeVar('_U') + + +def unique_everseen( + iterable: Iterable[_T], key: Optional[Callable[[_T], _U]] = None +) -> Iterator[_T]: + "List unique elements, preserving order. Remember all elements ever seen." + # unique_everseen('AAAABBBCCDAABBB') --> A B C D + # unique_everseen('ABBCcAD', str.lower) --> A B C D + seen: Set[Union[_T, _U]] = set() + seen_add = seen.add + if key is None: + for element in filterfalse(seen.__contains__, iterable): + seen_add(element) + yield element + else: + for element in iterable: + k = key(element) + if k not in seen: + seen_add(k) + yield element diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/_legacy.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/_legacy.py new file mode 100644 index 0000000000000000000000000000000000000000..1d5d3f1fbb1f6c69d0da2a50e1d4492ad3378f17 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/_legacy.py @@ -0,0 +1,121 @@ +import functools +import os +import pathlib +import types +import warnings + +from typing import Union, Iterable, ContextManager, BinaryIO, TextIO, Any + +from . import _common + +Package = Union[types.ModuleType, str] +Resource = str + + +def deprecated(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + warnings.warn( + f"{func.__name__} is deprecated. Use files() instead. " + "Refer to https://importlib-resources.readthedocs.io" + "/en/latest/using.html#migrating-from-legacy for migration advice.", + DeprecationWarning, + stacklevel=2, + ) + return func(*args, **kwargs) + + return wrapper + + +def normalize_path(path): + # type: (Any) -> str + """Normalize a path by ensuring it is a string. + + If the resulting string contains path separators, an exception is raised. + """ + str_path = str(path) + parent, file_name = os.path.split(str_path) + if parent: + raise ValueError(f'{path!r} must be only a file name') + return file_name + + +@deprecated +def open_binary(package: Package, resource: Resource) -> BinaryIO: + """Return a file-like object opened for binary reading of the resource.""" + return (_common.files(package) / normalize_path(resource)).open('rb') + + +@deprecated +def read_binary(package: Package, resource: Resource) -> bytes: + """Return the binary contents of the resource.""" + return (_common.files(package) / normalize_path(resource)).read_bytes() + + +@deprecated +def open_text( + package: Package, + resource: Resource, + encoding: str = 'utf-8', + errors: str = 'strict', +) -> TextIO: + """Return a file-like object opened for text reading of the resource.""" + return (_common.files(package) / normalize_path(resource)).open( + 'r', encoding=encoding, errors=errors + ) + + +@deprecated +def read_text( + package: Package, + resource: Resource, + encoding: str = 'utf-8', + errors: str = 'strict', +) -> str: + """Return the decoded string of the resource. + + The decoding-related arguments have the same semantics as those of + bytes.decode(). + """ + with open_text(package, resource, encoding, errors) as fp: + return fp.read() + + +@deprecated +def contents(package: Package) -> Iterable[str]: + """Return an iterable of entries in `package`. + + Note that not all entries are resources. Specifically, directories are + not considered resources. Use `is_resource()` on each entry returned here + to check if it is a resource or not. + """ + return [path.name for path in _common.files(package).iterdir()] + + +@deprecated +def is_resource(package: Package, name: str) -> bool: + """True if `name` is a resource inside `package`. + + Directories are *not* resources. + """ + resource = normalize_path(name) + return any( + traversable.name == resource and traversable.is_file() + for traversable in _common.files(package).iterdir() + ) + + +@deprecated +def path( + package: Package, + resource: Resource, +) -> ContextManager[pathlib.Path]: + """A context manager providing a file path object to the resource. + + If the resource does not already exist on its own on the file system, + a temporary file will be created. If the file was created, the file + will be deleted upon exiting the context manager (no exception is + raised if the file was deleted prior to the context manager + exiting). + """ + return _common.as_file(_common.files(package) / normalize_path(resource)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/abc.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/abc.py new file mode 100644 index 0000000000000000000000000000000000000000..0b7bfdc415829e15a77ac94420a0e5258e359d79 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/abc.py @@ -0,0 +1,151 @@ +import abc +import io +import os +from typing import Any, BinaryIO, Iterable, Iterator, NoReturn, Text, Optional +from typing import runtime_checkable, Protocol +from typing import Union + + +StrPath = Union[str, os.PathLike[str]] + +__all__ = ["ResourceReader", "Traversable", "TraversableResources"] + + +class ResourceReader(metaclass=abc.ABCMeta): + """Abstract base class for loaders to provide resource reading support.""" + + @abc.abstractmethod + def open_resource(self, resource: Text) -> BinaryIO: + """Return an opened, file-like object for binary reading. + + The 'resource' argument is expected to represent only a file name. + If the resource cannot be found, FileNotFoundError is raised. + """ + # This deliberately raises FileNotFoundError instead of + # NotImplementedError so that if this method is accidentally called, + # it'll still do the right thing. + raise FileNotFoundError + + @abc.abstractmethod + def resource_path(self, resource: Text) -> Text: + """Return the file system path to the specified resource. + + The 'resource' argument is expected to represent only a file name. + If the resource does not exist on the file system, raise + FileNotFoundError. + """ + # This deliberately raises FileNotFoundError instead of + # NotImplementedError so that if this method is accidentally called, + # it'll still do the right thing. + raise FileNotFoundError + + @abc.abstractmethod + def is_resource(self, path: Text) -> bool: + """Return True if the named 'path' is a resource. + + Files are resources, directories are not. + """ + raise FileNotFoundError + + @abc.abstractmethod + def contents(self) -> Iterable[str]: + """Return an iterable of entries in `package`.""" + raise FileNotFoundError + + +@runtime_checkable +class Traversable(Protocol): + """ + An object with a subset of pathlib.Path methods suitable for + traversing directories and opening files. + + Any exceptions that occur when accessing the backing resource + may propagate unaltered. + """ + + @abc.abstractmethod + def iterdir(self) -> Iterator["Traversable"]: + """ + Yield Traversable objects in self + """ + + def read_bytes(self) -> bytes: + """ + Read contents of self as bytes + """ + with self.open('rb') as strm: + return strm.read() + + def read_text(self, encoding: Optional[str] = None) -> str: + """ + Read contents of self as text + """ + with self.open(encoding=encoding) as strm: + return strm.read() + + @abc.abstractmethod + def is_dir(self) -> bool: + """ + Return True if self is a directory + """ + + @abc.abstractmethod + def is_file(self) -> bool: + """ + Return True if self is a file + """ + + @abc.abstractmethod + def joinpath(self, *descendants: StrPath) -> "Traversable": + """ + Return Traversable resolved with any descendants applied. + + Each descendant should be a path segment relative to self + and each may contain multiple levels separated by + ``posixpath.sep`` (``/``). + """ + + def __truediv__(self, child: StrPath) -> "Traversable": + """ + Return Traversable child in self + """ + return self.joinpath(child) + + @abc.abstractmethod + def open(self, mode='r', *args, **kwargs): + """ + mode may be 'r' or 'rb' to open as text or binary. Return a handle + suitable for reading (same as pathlib.Path.open). + + When opening as text, accepts encoding parameters such as those + accepted by io.TextIOWrapper. + """ + + @abc.abstractproperty + def name(self) -> str: + """ + The base name of this object without any parent references. + """ + + +class TraversableResources(ResourceReader): + """ + The required interface for providing traversable + resources. + """ + + @abc.abstractmethod + def files(self) -> "Traversable": + """Return a Traversable object for the loaded package.""" + + def open_resource(self, resource: StrPath) -> io.BufferedReader: + return self.files().joinpath(resource).open('rb') + + def resource_path(self, resource: Any) -> NoReturn: + raise FileNotFoundError(resource) + + def is_resource(self, path: StrPath) -> bool: + return self.files().joinpath(path).is_file() + + def contents(self) -> Iterator[str]: + return (item.name for item in self.files().iterdir()) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/readers.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/readers.py new file mode 100644 index 0000000000000000000000000000000000000000..b470a2062b2b3acad0a29528a78ba898b296abd9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/readers.py @@ -0,0 +1,122 @@ +import collections +import operator +import pathlib +import zipfile + +from . import abc + +from ._itertools import unique_everseen + + +def remove_duplicates(items): + return iter(collections.OrderedDict.fromkeys(items)) + + +class FileReader(abc.TraversableResources): + def __init__(self, loader): + self.path = pathlib.Path(loader.path).parent + + def resource_path(self, resource): + """ + Return the file system path to prevent + `resources.path()` from creating a temporary + copy. + """ + return str(self.path.joinpath(resource)) + + def files(self): + return self.path + + +class ZipReader(abc.TraversableResources): + def __init__(self, loader, module): + _, _, name = module.rpartition('.') + self.prefix = loader.prefix.replace('\\', '/') + name + '/' + self.archive = loader.archive + + def open_resource(self, resource): + try: + return super().open_resource(resource) + except KeyError as exc: + raise FileNotFoundError(exc.args[0]) + + def is_resource(self, path): + # workaround for `zipfile.Path.is_file` returning true + # for non-existent paths. + target = self.files().joinpath(path) + return target.is_file() and target.exists() + + def files(self): + return zipfile.Path(self.archive, self.prefix) + + +class MultiplexedPath(abc.Traversable): + """ + Given a series of Traversable objects, implement a merged + version of the interface across all objects. Useful for + namespace packages which may be multihomed at a single + name. + """ + + def __init__(self, *paths): + self._paths = list(map(pathlib.Path, remove_duplicates(paths))) + if not self._paths: + message = 'MultiplexedPath must contain at least one path' + raise FileNotFoundError(message) + if not all(path.is_dir() for path in self._paths): + raise NotADirectoryError('MultiplexedPath only supports directories') + + def iterdir(self): + files = (file for path in self._paths for file in path.iterdir()) + return unique_everseen(files, key=operator.attrgetter('name')) + + def read_bytes(self): + raise FileNotFoundError(f'{self} is not a file') + + def read_text(self, *args, **kwargs): + raise FileNotFoundError(f'{self} is not a file') + + def is_dir(self): + return True + + def is_file(self): + return False + + def joinpath(self, child): + # first try to find child in current paths + for file in self.iterdir(): + if file.name == child: + return file + # if it does not exist, construct it with the first path + return self._paths[0] / child + + __truediv__ = joinpath + + def open(self, *args, **kwargs): + raise FileNotFoundError(f'{self} is not a file') + + @property + def name(self): + return self._paths[0].name + + def __repr__(self): + paths = ', '.join(f"'{path}'" for path in self._paths) + return f'MultiplexedPath({paths})' + + +class NamespaceReader(abc.TraversableResources): + def __init__(self, namespace_path): + if 'NamespacePath' not in str(namespace_path): + raise ValueError('Invalid path') + self.path = MultiplexedPath(*list(namespace_path)) + + def resource_path(self, resource): + """ + Return the file system path to prevent + `resources.path()` from creating a temporary + copy. + """ + return str(self.path.joinpath(resource)) + + def files(self): + return self.path diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/simple.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/simple.py new file mode 100644 index 0000000000000000000000000000000000000000..3d1b0a1acd1ec1248550d7b94d19f434f6859ba2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/importlib/resources/simple.py @@ -0,0 +1,125 @@ +""" +Interface adapters for low-level readers. +""" + +import abc +import io +import itertools +from typing import BinaryIO, List + +from .abc import Traversable, TraversableResources + + +class SimpleReader(abc.ABC): + """ + The minimum, low-level interface required from a resource + provider. + """ + + @abc.abstractproperty + def package(self): + # type: () -> str + """ + The name of the package for which this reader loads resources. + """ + + @abc.abstractmethod + def children(self): + # type: () -> List['SimpleReader'] + """ + Obtain an iterable of SimpleReader for available + child containers (e.g. directories). + """ + + @abc.abstractmethod + def resources(self): + # type: () -> List[str] + """ + Obtain available named resources for this virtual package. + """ + + @abc.abstractmethod + def open_binary(self, resource): + # type: (str) -> BinaryIO + """ + Obtain a File-like for a named resource. + """ + + @property + def name(self): + return self.package.split('.')[-1] + + +class ResourceHandle(Traversable): + """ + Handle to a named resource in a ResourceReader. + """ + + def __init__(self, parent, name): + # type: (ResourceContainer, str) -> None + self.parent = parent + self.name = name # type: ignore + + def is_file(self): + return True + + def is_dir(self): + return False + + def open(self, mode='r', *args, **kwargs): + stream = self.parent.reader.open_binary(self.name) + if 'b' not in mode: + stream = io.TextIOWrapper(stream, *args, **kwargs) + return stream + + def joinpath(self, name): + raise RuntimeError("Cannot traverse into a resource") + + +class ResourceContainer(Traversable): + """ + Traversable container for a package's resources via its reader. + """ + + def __init__(self, reader): + # type: (SimpleReader) -> None + self.reader = reader + + def is_dir(self): + return True + + def is_file(self): + return False + + def iterdir(self): + files = (ResourceHandle(self, name) for name in self.reader.resources) + dirs = map(ResourceContainer, self.reader.children()) + return itertools.chain(files, dirs) + + def open(self, *args, **kwargs): + raise IsADirectoryError() + + @staticmethod + def _flatten(compound_names): + for name in compound_names: + yield from name.split('/') + + def joinpath(self, *descendants): + if not descendants: + return self + names = self._flatten(descendants) + target = next(names) + return next( + traversable for traversable in self.iterdir() if traversable.name == target + ).joinpath(*names) + + +class TraversableReader(TraversableResources, SimpleReader): + """ + A TraversableResources based on SimpleReader. Resource providers + may derive from this class to provide the TraversableResources + interface by supplying the SimpleReader interface. + """ + + def files(self): + return ResourceContainer(self) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/json/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/json/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d30505e512e0cf12acdd693f14f74bc62519663a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/json/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/json/__pycache__/decoder.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/json/__pycache__/decoder.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3ef3226c7935c78729ebd44480971be1145dc70c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/json/__pycache__/decoder.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/json/__pycache__/encoder.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/json/__pycache__/encoder.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d93e7bac09c7eea816ec8d5e5677428804f08612 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/json/__pycache__/encoder.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/json/__pycache__/scanner.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/json/__pycache__/scanner.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..30e422040d540f5062f6aac7c281947c5e9cc620 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/json/__pycache__/scanner.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/json/__pycache__/tool.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/json/__pycache__/tool.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a4073ea4698fb6742de16d4d10d838c0b74d232c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/json/__pycache__/tool.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0c6d8339501a94afab97fb01ca17a025415b2464 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/__main__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/__main__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fcfa78b0066a36f350b486ac36fe284d59010d1e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/__main__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/btm_matcher.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/btm_matcher.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..10eaecc0abdbf8b8165a2d83f85d9e6d83776f76 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/btm_matcher.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/btm_utils.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/btm_utils.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5be48d9e5a2f04ac15a1419d543d71947470c702 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/btm_utils.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/fixer_base.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/fixer_base.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4eada53dc8c73515fad3eae3feae259235452e9d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/fixer_base.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/fixer_util.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/fixer_util.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..99ddd6b583c6dd4f6a7d54009997d1909d3aaa64 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/fixer_util.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/main.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/main.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2ad1f104180403296eaee5fc938492f2a0e3ff2f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/main.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/patcomp.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/patcomp.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6fc1c9b52da37ac55e64a058ca0273080a70cb15 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/patcomp.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/pygram.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/pygram.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1420746043b868bf35db57a147f74fe8c2f322c8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/pygram.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/pytree.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/pytree.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..71b3d0890de2d7c78272dae9cbf461fa40999f65 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/pytree.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/refactor.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/refactor.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..656ef1de5d405157dc4d00071bbd91004f8c963d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/__pycache__/refactor.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b93054b3ecf3a5af96f4772e7208e7a18b5dd4a4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__init__.py @@ -0,0 +1 @@ +# Dummy file to make this directory a package. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..be05ad4cd6c7a1e34ed85110025ce02163464b08 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_apply.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_apply.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ce5d1deb536b1302c1c5198456fc7e7612d33808 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_apply.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_asserts.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_asserts.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b9955030db0900d499946c91a8f0813930e31253 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_asserts.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_basestring.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_basestring.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2658299a344ac306f3097988821622d9261cb700 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_basestring.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_buffer.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_buffer.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d5f912652d3c41544b2b3b837782a4419bc14525 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_buffer.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_dict.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_dict.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f1ccd2c644f4c305823dad64cfa196fbc92cba43 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_dict.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_except.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_except.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..50ef05bf0ba1dc6c702f20c41cd67e3a4342e53e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_except.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_exec.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_exec.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..689841b43ced3e61ca572acbf7a7e91da25a69f0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_exec.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_execfile.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_execfile.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..85d0a0249ee8d278504e21014d148cf15d3a37a3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_execfile.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_exitfunc.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_exitfunc.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..55587911c2a0bb10ec62ce7cf7b818ef3fc7465e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_exitfunc.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_filter.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_filter.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6af0b07704039d44725207d1ebe89255af9018dc Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_filter.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_funcattrs.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_funcattrs.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ee3a79b9a047cd2759a12352376c96d14287b4fd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_funcattrs.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_future.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_future.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1e54ca2bc2f791f0b6f8d196b4332bbee4aed816 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_future.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_getcwdu.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_getcwdu.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..18ac300772d564da5c8d93dd9d30ba059e90c93b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_getcwdu.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_has_key.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_has_key.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7845d5bf349f7d340950eceec02aace3bb26bfcf Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_has_key.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_idioms.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_idioms.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f7afa9a669b65577d7eeed39510bab85f535f4a2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_idioms.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_import.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_import.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8421fec0f04c02ccf7e973ddf194a8473e3851d2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_import.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_imports.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_imports.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4e1b431627714607b12ab6d58f2c9e2e342bce01 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_imports.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_imports2.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_imports2.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c4bfde631ef5e43ebcd2c9d7aa5043b8135a62d5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_imports2.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_input.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_input.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..496ee432fe2588fb12c2227d26ac4f9b70a9d4e4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_input.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_intern.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_intern.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0805adfabc5686422323a508f6e0113a63282d3d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_intern.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_isinstance.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_isinstance.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7ce143f9e3b3bbdfb1967dfe20d59288efa7b4ac Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_isinstance.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_itertools.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_itertools.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..acee6d9cd9debdadca7989b78c46eeced06c6a94 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_itertools.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_itertools_imports.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_itertools_imports.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..97bd2fd5eea29b76070b69d5e121d6922b615d18 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_itertools_imports.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_long.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_long.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..61d1e617000d9e69954a689bb2e4250f81d7ef9b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_long.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_map.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_map.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2c084ec2995e92c4e341bfff1d79d4a55869efb0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_map.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_metaclass.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_metaclass.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1a143869e26b4637162ed743cf8ff02b0399c17e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_metaclass.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_methodattrs.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_methodattrs.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1a2a3dd587a19bd94a64351cbf3249fb2dafdb3a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_methodattrs.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_ne.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_ne.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a58e82cf3962374244bfd651bfa01472fb93860f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_ne.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_next.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_next.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1a86931da12f95e8672536a6db2c90374e1df810 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_next.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_nonzero.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_nonzero.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1b88261bc86b8340d1961b138f7870c093c49611 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_nonzero.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_numliterals.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_numliterals.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f0d533f9ea979c2bf7f1676c7c04fc505d7c9f95 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_numliterals.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_operator.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_operator.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8ea71b57f1959bf370145ce23c7c17510734c71e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_operator.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_paren.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_paren.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9e6c6e87580238f5e68abd240526f390eefc2f4b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_paren.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_print.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_print.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5352dd3aa8f13a1160bb6726f7b0af6886c5ec67 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_print.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_raise.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_raise.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e18665ba24e8b7551b017e2bf1d5431fd8154c7c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_raise.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_raw_input.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_raw_input.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f39cb3e1eecebc96ad6d34874264437c4d69992c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_raw_input.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_reduce.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_reduce.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0ea6b5a02c8fa29f067252506da46dfded3c7a4f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_reduce.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_reload.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_reload.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..94c96a2a4d3e5f4d3710c92a94518b4be9720964 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_reload.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_renames.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_renames.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..189790e98aa70d0eb73a4bac63504541ee8289c8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_renames.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_repr.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_repr.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..25fa64e6064e93fc82f11c78796c9b776d30b316 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_repr.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_set_literal.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_set_literal.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..27863ffe00f1b4563d1ad04db9d372106c1351f2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_set_literal.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_standarderror.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_standarderror.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8d1ba7ff8f3c8e2ed2db6f135f863c786bea6b45 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_standarderror.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_sys_exc.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_sys_exc.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fbcd081b4f5d94b7ed6719a86e8803ca6d3a3f19 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_sys_exc.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_throw.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_throw.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..282753a6c37205f661c94447ceee4d05d0ad27ca Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_throw.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_tuple_params.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_tuple_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..31ad7f4c8f49b8070bd72fb15ab61adf7547ede6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_tuple_params.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_types.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_types.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c4d78c3f7a3fa196f2d5609c37222339b622f3db Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_types.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_unicode.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_unicode.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9561c5af5e25ad8738625aff6ade154a8994ae24 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_unicode.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_urllib.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_urllib.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..32d13ff8fad764bdfaa9c22b2097d0f5857ff249 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_urllib.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_ws_comma.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_ws_comma.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..59d4072ae8bab3a6b15b2eb0f2102e817989d240 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_ws_comma.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_xrange.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_xrange.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d3152ff033849fe80244bd567bb5a3691acb74a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_xrange.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_xreadlines.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_xreadlines.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0be3e7878277044616dbd301b03b1e42a0d46c42 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_xreadlines.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_zip.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_zip.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..462435f53f2176ea3429ba6f7f55007cb6ab9b0a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/__pycache__/fix_zip.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_apply.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_apply.py new file mode 100644 index 0000000000000000000000000000000000000000..6408582c42647741416968f92c351a5581bc5e3e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_apply.py @@ -0,0 +1,68 @@ +# Copyright 2006 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer for apply(). + +This converts apply(func, v, k) into (func)(*v, **k).""" + +# Local imports +from .. import pytree +from ..pgen2 import token +from .. import fixer_base +from ..fixer_util import Call, Comma, parenthesize + +class FixApply(fixer_base.BaseFix): + BM_compatible = True + + PATTERN = """ + power< 'apply' + trailer< + '(' + arglist< + (not argument + ')' + > + > + """ + + def transform(self, node, results): + syms = self.syms + assert results + func = results["func"] + args = results["args"] + kwds = results.get("kwds") + # I feel like we should be able to express this logic in the + # PATTERN above but I don't know how to do it so... + if args: + if (args.type == self.syms.argument and + args.children[0].value in {'**', '*'}): + return # Make no change. + if kwds and (kwds.type == self.syms.argument and + kwds.children[0].value == '**'): + return # Make no change. + prefix = node.prefix + func = func.clone() + if (func.type not in (token.NAME, syms.atom) and + (func.type != syms.power or + func.children[-2].type == token.DOUBLESTAR)): + # Need to parenthesize + func = parenthesize(func) + func.prefix = "" + args = args.clone() + args.prefix = "" + if kwds is not None: + kwds = kwds.clone() + kwds.prefix = "" + l_newargs = [pytree.Leaf(token.STAR, "*"), args] + if kwds is not None: + l_newargs.extend([Comma(), + pytree.Leaf(token.DOUBLESTAR, "**"), + kwds]) + l_newargs[-2].prefix = " " # that's the ** token + # XXX Sometimes we could be cleverer, e.g. apply(f, (x, y) + t) + # can be translated into f(x, y, *t) instead of f(*(x, y) + t) + #new = pytree.Node(syms.power, (func, ArgList(l_newargs))) + return Call(func, l_newargs, prefix=prefix) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_asserts.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_asserts.py new file mode 100644 index 0000000000000000000000000000000000000000..5bcec885f52cbf3a8a4a7bcf3331402a54f76967 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_asserts.py @@ -0,0 +1,34 @@ +"""Fixer that replaces deprecated unittest method names.""" + +# Author: Ezio Melotti + +from ..fixer_base import BaseFix +from ..fixer_util import Name + +NAMES = dict( + assert_="assertTrue", + assertEquals="assertEqual", + assertNotEquals="assertNotEqual", + assertAlmostEquals="assertAlmostEqual", + assertNotAlmostEquals="assertNotAlmostEqual", + assertRegexpMatches="assertRegex", + assertRaisesRegexp="assertRaisesRegex", + failUnlessEqual="assertEqual", + failIfEqual="assertNotEqual", + failUnlessAlmostEqual="assertAlmostEqual", + failIfAlmostEqual="assertNotAlmostEqual", + failUnless="assertTrue", + failUnlessRaises="assertRaises", + failIf="assertFalse", +) + + +class FixAsserts(BaseFix): + + PATTERN = """ + power< any+ trailer< '.' meth=(%s)> any* > + """ % '|'.join(map(repr, NAMES)) + + def transform(self, node, results): + name = results["meth"][0] + name.replace(Name(NAMES[str(name)], prefix=name.prefix)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_basestring.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_basestring.py new file mode 100644 index 0000000000000000000000000000000000000000..5fe69a0f03b1b885e28e508a8670406c67a4896a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_basestring.py @@ -0,0 +1,14 @@ +"""Fixer for basestring -> str.""" +# Author: Christian Heimes + +# Local imports +from .. import fixer_base +from ..fixer_util import Name + +class FixBasestring(fixer_base.BaseFix): + BM_compatible = True + + PATTERN = "'basestring'" + + def transform(self, node, results): + return Name("str", prefix=node.prefix) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_buffer.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_buffer.py new file mode 100644 index 0000000000000000000000000000000000000000..f9a1958ad3b93e502126396e02caca773f1f01fa --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_buffer.py @@ -0,0 +1,22 @@ +# Copyright 2007 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer that changes buffer(...) into memoryview(...).""" + +# Local imports +from .. import fixer_base +from ..fixer_util import Name + + +class FixBuffer(fixer_base.BaseFix): + BM_compatible = True + + explicit = True # The user must ask for this fixer + + PATTERN = """ + power< name='buffer' trailer< '(' [any] ')' > any* > + """ + + def transform(self, node, results): + name = results["name"] + name.replace(Name("memoryview", prefix=name.prefix)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_dict.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_dict.py new file mode 100644 index 0000000000000000000000000000000000000000..d3655c9f1b2d9bf82d8ce3a2140cfeff9ba97323 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_dict.py @@ -0,0 +1,106 @@ +# Copyright 2007 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer for dict methods. + +d.keys() -> list(d.keys()) +d.items() -> list(d.items()) +d.values() -> list(d.values()) + +d.iterkeys() -> iter(d.keys()) +d.iteritems() -> iter(d.items()) +d.itervalues() -> iter(d.values()) + +d.viewkeys() -> d.keys() +d.viewitems() -> d.items() +d.viewvalues() -> d.values() + +Except in certain very specific contexts: the iter() can be dropped +when the context is list(), sorted(), iter() or for...in; the list() +can be dropped when the context is list() or sorted() (but not iter() +or for...in!). Special contexts that apply to both: list(), sorted(), tuple() +set(), any(), all(), sum(). + +Note: iter(d.keys()) could be written as iter(d) but since the +original d.iterkeys() was also redundant we don't fix this. And there +are (rare) contexts where it makes a difference (e.g. when passing it +as an argument to a function that introspects the argument). +""" + +# Local imports +from .. import pytree +from .. import patcomp +from .. import fixer_base +from ..fixer_util import Name, Call, Dot +from .. import fixer_util + + +iter_exempt = fixer_util.consuming_calls | {"iter"} + + +class FixDict(fixer_base.BaseFix): + BM_compatible = True + + PATTERN = """ + power< head=any+ + trailer< '.' method=('keys'|'items'|'values'| + 'iterkeys'|'iteritems'|'itervalues'| + 'viewkeys'|'viewitems'|'viewvalues') > + parens=trailer< '(' ')' > + tail=any* + > + """ + + def transform(self, node, results): + head = results["head"] + method = results["method"][0] # Extract node for method name + tail = results["tail"] + syms = self.syms + method_name = method.value + isiter = method_name.startswith("iter") + isview = method_name.startswith("view") + if isiter or isview: + method_name = method_name[4:] + assert method_name in ("keys", "items", "values"), repr(method) + head = [n.clone() for n in head] + tail = [n.clone() for n in tail] + special = not tail and self.in_special_context(node, isiter) + args = head + [pytree.Node(syms.trailer, + [Dot(), + Name(method_name, + prefix=method.prefix)]), + results["parens"].clone()] + new = pytree.Node(syms.power, args) + if not (special or isview): + new.prefix = "" + new = Call(Name("iter" if isiter else "list"), [new]) + if tail: + new = pytree.Node(syms.power, [new] + tail) + new.prefix = node.prefix + return new + + P1 = "power< func=NAME trailer< '(' node=any ')' > any* >" + p1 = patcomp.compile_pattern(P1) + + P2 = """for_stmt< 'for' any 'in' node=any ':' any* > + | comp_for< 'for' any 'in' node=any any* > + """ + p2 = patcomp.compile_pattern(P2) + + def in_special_context(self, node, isiter): + if node.parent is None: + return False + results = {} + if (node.parent.parent is not None and + self.p1.match(node.parent.parent, results) and + results["node"] is node): + if isiter: + # iter(d.iterkeys()) -> iter(d.keys()), etc. + return results["func"].value in iter_exempt + else: + # list(d.keys()) -> list(d.keys()), etc. + return results["func"].value in fixer_util.consuming_calls + if not isiter: + return False + # for ... in d.iterkeys() -> for ... in d.keys(), etc. + return self.p2.match(node.parent, results) and results["node"] is node diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_except.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_except.py new file mode 100644 index 0000000000000000000000000000000000000000..49bd3d5ab7d6ccd8a98016a12b4ed54ff0c800de --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_except.py @@ -0,0 +1,93 @@ +"""Fixer for except statements with named exceptions. + +The following cases will be converted: + +- "except E, T:" where T is a name: + + except E as T: + +- "except E, T:" where T is not a name, tuple or list: + + except E as t: + T = t + + This is done because the target of an "except" clause must be a + name. + +- "except E, T:" where T is a tuple or list literal: + + except E as t: + T = t.args +""" +# Author: Collin Winter + +# Local imports +from .. import pytree +from ..pgen2 import token +from .. import fixer_base +from ..fixer_util import Assign, Attr, Name, is_tuple, is_list, syms + +def find_excepts(nodes): + for i, n in enumerate(nodes): + if n.type == syms.except_clause: + if n.children[0].value == 'except': + yield (n, nodes[i+2]) + +class FixExcept(fixer_base.BaseFix): + BM_compatible = True + + PATTERN = """ + try_stmt< 'try' ':' (simple_stmt | suite) + cleanup=(except_clause ':' (simple_stmt | suite))+ + tail=(['except' ':' (simple_stmt | suite)] + ['else' ':' (simple_stmt | suite)] + ['finally' ':' (simple_stmt | suite)]) > + """ + + def transform(self, node, results): + syms = self.syms + + tail = [n.clone() for n in results["tail"]] + + try_cleanup = [ch.clone() for ch in results["cleanup"]] + for except_clause, e_suite in find_excepts(try_cleanup): + if len(except_clause.children) == 4: + (E, comma, N) = except_clause.children[1:4] + comma.replace(Name("as", prefix=" ")) + + if N.type != token.NAME: + # Generate a new N for the except clause + new_N = Name(self.new_name(), prefix=" ") + target = N.clone() + target.prefix = "" + N.replace(new_N) + new_N = new_N.clone() + + # Insert "old_N = new_N" as the first statement in + # the except body. This loop skips leading whitespace + # and indents + #TODO(cwinter) suite-cleanup + suite_stmts = e_suite.children + for i, stmt in enumerate(suite_stmts): + if isinstance(stmt, pytree.Node): + break + + # The assignment is different if old_N is a tuple or list + # In that case, the assignment is old_N = new_N.args + if is_tuple(N) or is_list(N): + assign = Assign(target, Attr(new_N, Name('args'))) + else: + assign = Assign(target, new_N) + + #TODO(cwinter) stopgap until children becomes a smart list + for child in reversed(suite_stmts[:i]): + e_suite.insert_child(0, child) + e_suite.insert_child(i, assign) + elif N.prefix == "": + # No space after a comma is legal; no space after "as", + # not so much. + N.prefix = " " + + #TODO(cwinter) fix this when children becomes a smart list + children = [c.clone() for c in node.children[:3]] + try_cleanup + tail + return pytree.Node(node.type, children) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_exec.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_exec.py new file mode 100644 index 0000000000000000000000000000000000000000..ab921ee80cdf366532f027b2549e5bcba55a4fd5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_exec.py @@ -0,0 +1,39 @@ +# Copyright 2006 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer for exec. + +This converts usages of the exec statement into calls to a built-in +exec() function. + +exec code in ns1, ns2 -> exec(code, ns1, ns2) +""" + +# Local imports +from .. import fixer_base +from ..fixer_util import Comma, Name, Call + + +class FixExec(fixer_base.BaseFix): + BM_compatible = True + + PATTERN = """ + exec_stmt< 'exec' a=any 'in' b=any [',' c=any] > + | + exec_stmt< 'exec' (not atom<'(' [any] ')'>) a=any > + """ + + def transform(self, node, results): + assert results + syms = self.syms + a = results["a"] + b = results.get("b") + c = results.get("c") + args = [a.clone()] + args[0].prefix = "" + if b is not None: + args.extend([Comma(), b.clone()]) + if c is not None: + args.extend([Comma(), c.clone()]) + + return Call(Name("exec"), args, prefix=node.prefix) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_execfile.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_execfile.py new file mode 100644 index 0000000000000000000000000000000000000000..b6c786fd4e8b6a141ab3619ba2b2576db158fcd4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_execfile.py @@ -0,0 +1,53 @@ +# Copyright 2006 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer for execfile. + +This converts usages of the execfile function into calls to the built-in +exec() function. +""" + +from .. import fixer_base +from ..fixer_util import (Comma, Name, Call, LParen, RParen, Dot, Node, + ArgList, String, syms) + + +class FixExecfile(fixer_base.BaseFix): + BM_compatible = True + + PATTERN = """ + power< 'execfile' trailer< '(' arglist< filename=any [',' globals=any [',' locals=any ] ] > ')' > > + | + power< 'execfile' trailer< '(' filename=any ')' > > + """ + + def transform(self, node, results): + assert results + filename = results["filename"] + globals = results.get("globals") + locals = results.get("locals") + + # Copy over the prefix from the right parentheses end of the execfile + # call. + execfile_paren = node.children[-1].children[-1].clone() + # Construct open().read(). + open_args = ArgList([filename.clone(), Comma(), String('"rb"', ' ')], + rparen=execfile_paren) + open_call = Node(syms.power, [Name("open"), open_args]) + read = [Node(syms.trailer, [Dot(), Name('read')]), + Node(syms.trailer, [LParen(), RParen()])] + open_expr = [open_call] + read + # Wrap the open call in a compile call. This is so the filename will be + # preserved in the execed code. + filename_arg = filename.clone() + filename_arg.prefix = " " + exec_str = String("'exec'", " ") + compile_args = open_expr + [Comma(), filename_arg, Comma(), exec_str] + compile_call = Call(Name("compile"), compile_args, "") + # Finally, replace the execfile call with an exec call. + args = [compile_call] + if globals is not None: + args.extend([Comma(), globals.clone()]) + if locals is not None: + args.extend([Comma(), locals.clone()]) + return Call(Name("exec"), args, prefix=node.prefix) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_exitfunc.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_exitfunc.py new file mode 100644 index 0000000000000000000000000000000000000000..2e47887afead368518e7930397410335887d60f9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_exitfunc.py @@ -0,0 +1,72 @@ +""" +Convert use of sys.exitfunc to use the atexit module. +""" + +# Author: Benjamin Peterson + +from lib2to3 import pytree, fixer_base +from lib2to3.fixer_util import Name, Attr, Call, Comma, Newline, syms + + +class FixExitfunc(fixer_base.BaseFix): + keep_line_order = True + BM_compatible = True + + PATTERN = """ + ( + sys_import=import_name<'import' + ('sys' + | + dotted_as_names< (any ',')* 'sys' (',' any)* > + ) + > + | + expr_stmt< + power< 'sys' trailer< '.' 'exitfunc' > > + '=' func=any > + ) + """ + + def __init__(self, *args): + super(FixExitfunc, self).__init__(*args) + + def start_tree(self, tree, filename): + super(FixExitfunc, self).start_tree(tree, filename) + self.sys_import = None + + def transform(self, node, results): + # First, find the sys import. We'll just hope it's global scope. + if "sys_import" in results: + if self.sys_import is None: + self.sys_import = results["sys_import"] + return + + func = results["func"].clone() + func.prefix = "" + register = pytree.Node(syms.power, + Attr(Name("atexit"), Name("register")) + ) + call = Call(register, [func], node.prefix) + node.replace(call) + + if self.sys_import is None: + # That's interesting. + self.warning(node, "Can't find sys import; Please add an atexit " + "import at the top of your file.") + return + + # Now add an atexit import after the sys import. + names = self.sys_import.children[1] + if names.type == syms.dotted_as_names: + names.append_child(Comma()) + names.append_child(Name("atexit", " ")) + else: + containing_stmt = self.sys_import.parent + position = containing_stmt.children.index(self.sys_import) + stmt_container = containing_stmt.parent + new_import = pytree.Node(syms.import_name, + [Name("import"), Name("atexit", " ")] + ) + new = pytree.Node(syms.simple_stmt, [new_import]) + containing_stmt.insert_child(position + 1, Newline()) + containing_stmt.insert_child(position + 2, new) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_filter.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_filter.py new file mode 100644 index 0000000000000000000000000000000000000000..38e9078f11ac88f346b7ba2468c69dc5a4f74dd5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_filter.py @@ -0,0 +1,94 @@ +# Copyright 2007 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer that changes filter(F, X) into list(filter(F, X)). + +We avoid the transformation if the filter() call is directly contained +in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or +for V in <>:. + +NOTE: This is still not correct if the original code was depending on +filter(F, X) to return a string if X is a string and a tuple if X is a +tuple. That would require type inference, which we don't do. Let +Python 2.6 figure it out. +""" + +# Local imports +from .. import fixer_base +from ..pytree import Node +from ..pygram import python_symbols as syms +from ..fixer_util import Name, ArgList, ListComp, in_special_context, parenthesize + + +class FixFilter(fixer_base.ConditionalFix): + BM_compatible = True + + PATTERN = """ + filter_lambda=power< + 'filter' + trailer< + '(' + arglist< + lambdef< 'lambda' + (fp=NAME | vfpdef< '(' fp=NAME ')'> ) ':' xp=any + > + ',' + it=any + > + ')' + > + [extra_trailers=trailer*] + > + | + power< + 'filter' + trailer< '(' arglist< none='None' ',' seq=any > ')' > + [extra_trailers=trailer*] + > + | + power< + 'filter' + args=trailer< '(' [any] ')' > + [extra_trailers=trailer*] + > + """ + + skip_on = "future_builtins.filter" + + def transform(self, node, results): + if self.should_skip(node): + return + + trailers = [] + if 'extra_trailers' in results: + for t in results['extra_trailers']: + trailers.append(t.clone()) + + if "filter_lambda" in results: + xp = results.get("xp").clone() + if xp.type == syms.test: + xp.prefix = "" + xp = parenthesize(xp) + + new = ListComp(results.get("fp").clone(), + results.get("fp").clone(), + results.get("it").clone(), xp) + new = Node(syms.power, [new] + trailers, prefix="") + + elif "none" in results: + new = ListComp(Name("_f"), + Name("_f"), + results["seq"].clone(), + Name("_f")) + new = Node(syms.power, [new] + trailers, prefix="") + + else: + if in_special_context(node): + return None + + args = results['args'].clone() + new = Node(syms.power, [Name("filter"), args], prefix="") + new = Node(syms.power, [Name("list"), ArgList([new])] + trailers) + new.prefix = "" + new.prefix = node.prefix + return new diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_funcattrs.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_funcattrs.py new file mode 100644 index 0000000000000000000000000000000000000000..67f3e18e061bdb10395bf73e82f440ad6842e2bd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_funcattrs.py @@ -0,0 +1,21 @@ +"""Fix function attribute names (f.func_x -> f.__x__).""" +# Author: Collin Winter + +# Local imports +from .. import fixer_base +from ..fixer_util import Name + + +class FixFuncattrs(fixer_base.BaseFix): + BM_compatible = True + + PATTERN = """ + power< any+ trailer< '.' attr=('func_closure' | 'func_doc' | 'func_globals' + | 'func_name' | 'func_defaults' | 'func_code' + | 'func_dict') > any* > + """ + + def transform(self, node, results): + attr = results["attr"][0] + attr.replace(Name(("__%s__" % attr.value[5:]), + prefix=attr.prefix)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_future.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_future.py new file mode 100644 index 0000000000000000000000000000000000000000..fbcb86af0791338e4edebd2f68bd49cd7a9160c2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_future.py @@ -0,0 +1,22 @@ +"""Remove __future__ imports + +from __future__ import foo is replaced with an empty line. +""" +# Author: Christian Heimes + +# Local imports +from .. import fixer_base +from ..fixer_util import BlankLine + +class FixFuture(fixer_base.BaseFix): + BM_compatible = True + + PATTERN = """import_from< 'from' module_name="__future__" 'import' any >""" + + # This should be run last -- some things check for the import + run_order = 10 + + def transform(self, node, results): + new = BlankLine() + new.prefix = node.prefix + return new diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_getcwdu.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_getcwdu.py new file mode 100644 index 0000000000000000000000000000000000000000..087eaedcb26f9cfa139f524a67464154a23d79ac --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_getcwdu.py @@ -0,0 +1,19 @@ +""" +Fixer that changes os.getcwdu() to os.getcwd(). +""" +# Author: Victor Stinner + +# Local imports +from .. import fixer_base +from ..fixer_util import Name + +class FixGetcwdu(fixer_base.BaseFix): + BM_compatible = True + + PATTERN = """ + power< 'os' trailer< dot='.' name='getcwdu' > any* > + """ + + def transform(self, node, results): + name = results["name"] + name.replace(Name("getcwd", prefix=name.prefix)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_has_key.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_has_key.py new file mode 100644 index 0000000000000000000000000000000000000000..439708c9923404312dfabb964615062ea32c0aea --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_has_key.py @@ -0,0 +1,109 @@ +# Copyright 2006 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer for has_key(). + +Calls to .has_key() methods are expressed in terms of the 'in' +operator: + + d.has_key(k) -> k in d + +CAVEATS: +1) While the primary target of this fixer is dict.has_key(), the + fixer will change any has_key() method call, regardless of its + class. + +2) Cases like this will not be converted: + + m = d.has_key + if m(k): + ... + + Only *calls* to has_key() are converted. While it is possible to + convert the above to something like + + m = d.__contains__ + if m(k): + ... + + this is currently not done. +""" + +# Local imports +from .. import pytree +from .. import fixer_base +from ..fixer_util import Name, parenthesize + + +class FixHasKey(fixer_base.BaseFix): + BM_compatible = True + + PATTERN = """ + anchor=power< + before=any+ + trailer< '.' 'has_key' > + trailer< + '(' + ( not(arglist | argument) arg=any ','> + ) + ')' + > + after=any* + > + | + negation=not_test< + 'not' + anchor=power< + before=any+ + trailer< '.' 'has_key' > + trailer< + '(' + ( not(arglist | argument) arg=any ','> + ) + ')' + > + > + > + """ + + def transform(self, node, results): + assert results + syms = self.syms + if (node.parent.type == syms.not_test and + self.pattern.match(node.parent)): + # Don't transform a node matching the first alternative of the + # pattern when its parent matches the second alternative + return None + negation = results.get("negation") + anchor = results["anchor"] + prefix = node.prefix + before = [n.clone() for n in results["before"]] + arg = results["arg"].clone() + after = results.get("after") + if after: + after = [n.clone() for n in after] + if arg.type in (syms.comparison, syms.not_test, syms.and_test, + syms.or_test, syms.test, syms.lambdef, syms.argument): + arg = parenthesize(arg) + if len(before) == 1: + before = before[0] + else: + before = pytree.Node(syms.power, before) + before.prefix = " " + n_op = Name("in", prefix=" ") + if negation: + n_not = Name("not", prefix=" ") + n_op = pytree.Node(syms.comp_op, (n_not, n_op)) + new = pytree.Node(syms.comparison, (arg, n_op, before)) + if after: + new = parenthesize(new) + new = pytree.Node(syms.power, (new,) + tuple(after)) + if node.parent.type in (syms.comparison, syms.expr, syms.xor_expr, + syms.and_expr, syms.shift_expr, + syms.arith_expr, syms.term, + syms.factor, syms.power): + new = parenthesize(new) + new.prefix = prefix + return new diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_idioms.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_idioms.py new file mode 100644 index 0000000000000000000000000000000000000000..6905913d7cb79d2ead79ca7c0c88ea6c9b98d79d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_idioms.py @@ -0,0 +1,152 @@ +"""Adjust some old Python 2 idioms to their modern counterparts. + +* Change some type comparisons to isinstance() calls: + type(x) == T -> isinstance(x, T) + type(x) is T -> isinstance(x, T) + type(x) != T -> not isinstance(x, T) + type(x) is not T -> not isinstance(x, T) + +* Change "while 1:" into "while True:". + +* Change both + + v = list(EXPR) + v.sort() + foo(v) + +and the more general + + v = EXPR + v.sort() + foo(v) + +into + + v = sorted(EXPR) + foo(v) +""" +# Author: Jacques Frechet, Collin Winter + +# Local imports +from .. import fixer_base +from ..fixer_util import Call, Comma, Name, Node, BlankLine, syms + +CMP = "(n='!=' | '==' | 'is' | n=comp_op< 'is' 'not' >)" +TYPE = "power< 'type' trailer< '(' x=any ')' > >" + +class FixIdioms(fixer_base.BaseFix): + explicit = True # The user must ask for this fixer + + PATTERN = r""" + isinstance=comparison< %s %s T=any > + | + isinstance=comparison< T=any %s %s > + | + while_stmt< 'while' while='1' ':' any+ > + | + sorted=any< + any* + simple_stmt< + expr_stmt< id1=any '=' + power< list='list' trailer< '(' (not arglist) any ')' > > + > + '\n' + > + sort= + simple_stmt< + power< id2=any + trailer< '.' 'sort' > trailer< '(' ')' > + > + '\n' + > + next=any* + > + | + sorted=any< + any* + simple_stmt< expr_stmt< id1=any '=' expr=any > '\n' > + sort= + simple_stmt< + power< id2=any + trailer< '.' 'sort' > trailer< '(' ')' > + > + '\n' + > + next=any* + > + """ % (TYPE, CMP, CMP, TYPE) + + def match(self, node): + r = super(FixIdioms, self).match(node) + # If we've matched one of the sort/sorted subpatterns above, we + # want to reject matches where the initial assignment and the + # subsequent .sort() call involve different identifiers. + if r and "sorted" in r: + if r["id1"] == r["id2"]: + return r + return None + return r + + def transform(self, node, results): + if "isinstance" in results: + return self.transform_isinstance(node, results) + elif "while" in results: + return self.transform_while(node, results) + elif "sorted" in results: + return self.transform_sort(node, results) + else: + raise RuntimeError("Invalid match") + + def transform_isinstance(self, node, results): + x = results["x"].clone() # The thing inside of type() + T = results["T"].clone() # The type being compared against + x.prefix = "" + T.prefix = " " + test = Call(Name("isinstance"), [x, Comma(), T]) + if "n" in results: + test.prefix = " " + test = Node(syms.not_test, [Name("not"), test]) + test.prefix = node.prefix + return test + + def transform_while(self, node, results): + one = results["while"] + one.replace(Name("True", prefix=one.prefix)) + + def transform_sort(self, node, results): + sort_stmt = results["sort"] + next_stmt = results["next"] + list_call = results.get("list") + simple_expr = results.get("expr") + + if list_call: + list_call.replace(Name("sorted", prefix=list_call.prefix)) + elif simple_expr: + new = simple_expr.clone() + new.prefix = "" + simple_expr.replace(Call(Name("sorted"), [new], + prefix=simple_expr.prefix)) + else: + raise RuntimeError("should not have reached here") + sort_stmt.remove() + + btwn = sort_stmt.prefix + # Keep any prefix lines between the sort_stmt and the list_call and + # shove them right after the sorted() call. + if "\n" in btwn: + if next_stmt: + # The new prefix should be everything from the sort_stmt's + # prefix up to the last newline, then the old prefix after a new + # line. + prefix_lines = (btwn.rpartition("\n")[0], next_stmt[0].prefix) + next_stmt[0].prefix = "\n".join(prefix_lines) + else: + assert list_call.parent + assert list_call.next_sibling is None + # Put a blank line after list_call and set its prefix. + end_line = BlankLine() + list_call.parent.append_child(end_line) + assert list_call.next_sibling is end_line + # The new prefix should be everything up to the first new line + # of sort_stmt's prefix. + end_line.prefix = btwn.rpartition("\n")[0] diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_import.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_import.py new file mode 100644 index 0000000000000000000000000000000000000000..734ca294699c36400b2c1d59c1badfb9c296ec14 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_import.py @@ -0,0 +1,99 @@ +"""Fixer for import statements. +If spam is being imported from the local directory, this import: + from spam import eggs +Becomes: + from .spam import eggs + +And this import: + import spam +Becomes: + from . import spam +""" + +# Local imports +from .. import fixer_base +from os.path import dirname, join, exists, sep +from ..fixer_util import FromImport, syms, token + + +def traverse_imports(names): + """ + Walks over all the names imported in a dotted_as_names node. + """ + pending = [names] + while pending: + node = pending.pop() + if node.type == token.NAME: + yield node.value + elif node.type == syms.dotted_name: + yield "".join([ch.value for ch in node.children]) + elif node.type == syms.dotted_as_name: + pending.append(node.children[0]) + elif node.type == syms.dotted_as_names: + pending.extend(node.children[::-2]) + else: + raise AssertionError("unknown node type") + + +class FixImport(fixer_base.BaseFix): + BM_compatible = True + + PATTERN = """ + import_from< 'from' imp=any 'import' ['('] any [')'] > + | + import_name< 'import' imp=any > + """ + + def start_tree(self, tree, name): + super(FixImport, self).start_tree(tree, name) + self.skip = "absolute_import" in tree.future_features + + def transform(self, node, results): + if self.skip: + return + imp = results['imp'] + + if node.type == syms.import_from: + # Some imps are top-level (eg: 'import ham') + # some are first level (eg: 'import ham.eggs') + # some are third level (eg: 'import ham.eggs as spam') + # Hence, the loop + while not hasattr(imp, 'value'): + imp = imp.children[0] + if self.probably_a_local_import(imp.value): + imp.value = "." + imp.value + imp.changed() + else: + have_local = False + have_absolute = False + for mod_name in traverse_imports(imp): + if self.probably_a_local_import(mod_name): + have_local = True + else: + have_absolute = True + if have_absolute: + if have_local: + # We won't handle both sibling and absolute imports in the + # same statement at the moment. + self.warning(node, "absolute and local imports together") + return + + new = FromImport(".", [imp]) + new.prefix = node.prefix + return new + + def probably_a_local_import(self, imp_name): + if imp_name.startswith("."): + # Relative imports are certainly not local imports. + return False + imp_name = imp_name.split(".", 1)[0] + base_path = dirname(self.filename) + base_path = join(base_path, imp_name) + # If there is no __init__.py next to the file its not in a package + # so can't be a relative import. + if not exists(join(dirname(base_path), "__init__.py")): + return False + for ext in [".py", sep, ".pyc", ".so", ".sl", ".pyd"]: + if exists(base_path + ext): + return True + return False diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_imports.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_imports.py new file mode 100644 index 0000000000000000000000000000000000000000..aaf4f2f642efb52d50eabdca67527a3cbf60014e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_imports.py @@ -0,0 +1,145 @@ +"""Fix incompatible imports and module references.""" +# Authors: Collin Winter, Nick Edds + +# Local imports +from .. import fixer_base +from ..fixer_util import Name, attr_chain + +MAPPING = {'StringIO': 'io', + 'cStringIO': 'io', + 'cPickle': 'pickle', + '__builtin__' : 'builtins', + 'copy_reg': 'copyreg', + 'Queue': 'queue', + 'SocketServer': 'socketserver', + 'ConfigParser': 'configparser', + 'repr': 'reprlib', + 'FileDialog': 'tkinter.filedialog', + 'tkFileDialog': 'tkinter.filedialog', + 'SimpleDialog': 'tkinter.simpledialog', + 'tkSimpleDialog': 'tkinter.simpledialog', + 'tkColorChooser': 'tkinter.colorchooser', + 'tkCommonDialog': 'tkinter.commondialog', + 'Dialog': 'tkinter.dialog', + 'Tkdnd': 'tkinter.dnd', + 'tkFont': 'tkinter.font', + 'tkMessageBox': 'tkinter.messagebox', + 'ScrolledText': 'tkinter.scrolledtext', + 'Tkconstants': 'tkinter.constants', + 'Tix': 'tkinter.tix', + 'ttk': 'tkinter.ttk', + 'Tkinter': 'tkinter', + 'markupbase': '_markupbase', + '_winreg': 'winreg', + 'thread': '_thread', + 'dummy_thread': '_dummy_thread', + # anydbm and whichdb are handled by fix_imports2 + 'dbhash': 'dbm.bsd', + 'dumbdbm': 'dbm.dumb', + 'dbm': 'dbm.ndbm', + 'gdbm': 'dbm.gnu', + 'xmlrpclib': 'xmlrpc.client', + 'DocXMLRPCServer': 'xmlrpc.server', + 'SimpleXMLRPCServer': 'xmlrpc.server', + 'httplib': 'http.client', + 'htmlentitydefs' : 'html.entities', + 'HTMLParser' : 'html.parser', + 'Cookie': 'http.cookies', + 'cookielib': 'http.cookiejar', + 'BaseHTTPServer': 'http.server', + 'SimpleHTTPServer': 'http.server', + 'CGIHTTPServer': 'http.server', + #'test.test_support': 'test.support', + 'commands': 'subprocess', + 'UserString' : 'collections', + 'UserList' : 'collections', + 'urlparse' : 'urllib.parse', + 'robotparser' : 'urllib.robotparser', +} + + +def alternates(members): + return "(" + "|".join(map(repr, members)) + ")" + + +def build_pattern(mapping=MAPPING): + mod_list = ' | '.join(["module_name='%s'" % key for key in mapping]) + bare_names = alternates(mapping.keys()) + + yield """name_import=import_name< 'import' ((%s) | + multiple_imports=dotted_as_names< any* (%s) any* >) > + """ % (mod_list, mod_list) + yield """import_from< 'from' (%s) 'import' ['('] + ( any | import_as_name< any 'as' any > | + import_as_names< any* >) [')'] > + """ % mod_list + yield """import_name< 'import' (dotted_as_name< (%s) 'as' any > | + multiple_imports=dotted_as_names< + any* dotted_as_name< (%s) 'as' any > any* >) > + """ % (mod_list, mod_list) + + # Find usages of module members in code e.g. thread.foo(bar) + yield "power< bare_with_attr=(%s) trailer<'.' any > any* >" % bare_names + + +class FixImports(fixer_base.BaseFix): + + BM_compatible = True + keep_line_order = True + # This is overridden in fix_imports2. + mapping = MAPPING + + # We want to run this fixer late, so fix_import doesn't try to make stdlib + # renames into relative imports. + run_order = 6 + + def build_pattern(self): + return "|".join(build_pattern(self.mapping)) + + def compile_pattern(self): + # We override this, so MAPPING can be pragmatically altered and the + # changes will be reflected in PATTERN. + self.PATTERN = self.build_pattern() + super(FixImports, self).compile_pattern() + + # Don't match the node if it's within another match. + def match(self, node): + match = super(FixImports, self).match + results = match(node) + if results: + # Module usage could be in the trailer of an attribute lookup, so we + # might have nested matches when "bare_with_attr" is present. + if "bare_with_attr" not in results and \ + any(match(obj) for obj in attr_chain(node, "parent")): + return False + return results + return False + + def start_tree(self, tree, filename): + super(FixImports, self).start_tree(tree, filename) + self.replace = {} + + def transform(self, node, results): + import_mod = results.get("module_name") + if import_mod: + mod_name = import_mod.value + new_name = self.mapping[mod_name] + import_mod.replace(Name(new_name, prefix=import_mod.prefix)) + if "name_import" in results: + # If it's not a "from x import x, y" or "import x as y" import, + # marked its usage to be replaced. + self.replace[mod_name] = new_name + if "multiple_imports" in results: + # This is a nasty hack to fix multiple imports on a line (e.g., + # "import StringIO, urlparse"). The problem is that I can't + # figure out an easy way to make a pattern recognize the keys of + # MAPPING randomly sprinkled in an import statement. + results = self.match(node) + if results: + self.transform(node, results) + else: + # Replace usage of the module. + bare_name = results["bare_with_attr"][0] + new_name = self.replace.get(bare_name.value) + if new_name: + bare_name.replace(Name(new_name, prefix=bare_name.prefix)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_imports2.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_imports2.py new file mode 100644 index 0000000000000000000000000000000000000000..9a33c67b1dc1940b2e271fad30b73f8e06b24e33 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_imports2.py @@ -0,0 +1,16 @@ +"""Fix incompatible imports and module references that must be fixed after +fix_imports.""" +from . import fix_imports + + +MAPPING = { + 'whichdb': 'dbm', + 'anydbm': 'dbm', + } + + +class FixImports2(fix_imports.FixImports): + + run_order = 7 + + mapping = MAPPING diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_input.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_input.py new file mode 100644 index 0000000000000000000000000000000000000000..9cf9a48c471f35e39fa0e99a40a1cc75fae6fe6d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_input.py @@ -0,0 +1,26 @@ +"""Fixer that changes input(...) into eval(input(...)).""" +# Author: Andre Roberge + +# Local imports +from .. import fixer_base +from ..fixer_util import Call, Name +from .. import patcomp + + +context = patcomp.compile_pattern("power< 'eval' trailer< '(' any ')' > >") + + +class FixInput(fixer_base.BaseFix): + BM_compatible = True + PATTERN = """ + power< 'input' args=trailer< '(' [any] ')' > > + """ + + def transform(self, node, results): + # If we're already wrapped in an eval() call, we're done. + if context.match(node.parent.parent): + return + + new = node.clone() + new.prefix = "" + return Call(Name("eval"), [new], prefix=node.prefix) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_intern.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_intern.py new file mode 100644 index 0000000000000000000000000000000000000000..d752843092aacd8bc6e84c80f5bc6116563b9d25 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_intern.py @@ -0,0 +1,39 @@ +# Copyright 2006 Georg Brandl. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer for intern(). + +intern(s) -> sys.intern(s)""" + +# Local imports +from .. import fixer_base +from ..fixer_util import ImportAndCall, touch_import + + +class FixIntern(fixer_base.BaseFix): + BM_compatible = True + order = "pre" + + PATTERN = """ + power< 'intern' + trailer< lpar='(' + ( not(arglist | argument) any ','> ) + rpar=')' > + after=any* + > + """ + + def transform(self, node, results): + if results: + # I feel like we should be able to express this logic in the + # PATTERN above but I don't know how to do it so... + obj = results['obj'] + if obj: + if (obj.type == self.syms.argument and + obj.children[0].value in {'**', '*'}): + return # Make no change. + names = ('sys', 'intern') + new = ImportAndCall(node, results, names) + touch_import(None, 'sys', node) + return new diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_isinstance.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_isinstance.py new file mode 100644 index 0000000000000000000000000000000000000000..bebb1de120424b6b568ae3243eab55ad12305194 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_isinstance.py @@ -0,0 +1,52 @@ +# Copyright 2008 Armin Ronacher. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer that cleans up a tuple argument to isinstance after the tokens +in it were fixed. This is mainly used to remove double occurrences of +tokens as a leftover of the long -> int / unicode -> str conversion. + +eg. isinstance(x, (int, long)) -> isinstance(x, (int, int)) + -> isinstance(x, int) +""" + +from .. import fixer_base +from ..fixer_util import token + + +class FixIsinstance(fixer_base.BaseFix): + BM_compatible = True + PATTERN = """ + power< + 'isinstance' + trailer< '(' arglist< any ',' atom< '(' + args=testlist_gexp< any+ > + ')' > > ')' > + > + """ + + run_order = 6 + + def transform(self, node, results): + names_inserted = set() + testlist = results["args"] + args = testlist.children + new_args = [] + iterator = enumerate(args) + for idx, arg in iterator: + if arg.type == token.NAME and arg.value in names_inserted: + if idx < len(args) - 1 and args[idx + 1].type == token.COMMA: + next(iterator) + continue + else: + new_args.append(arg) + if arg.type == token.NAME: + names_inserted.add(arg.value) + if new_args and new_args[-1].type == token.COMMA: + del new_args[-1] + if len(new_args) == 1: + atom = testlist.parent + new_args[0].prefix = atom.prefix + atom.replace(new_args[0]) + else: + args[:] = new_args + node.changed() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_itertools.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_itertools.py new file mode 100644 index 0000000000000000000000000000000000000000..8e78d6c689f4396421414248f15b39e01a844833 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_itertools.py @@ -0,0 +1,43 @@ +""" Fixer for itertools.(imap|ifilter|izip) --> (map|filter|zip) and + itertools.ifilterfalse --> itertools.filterfalse (bugs 2360-2363) + + imports from itertools are fixed in fix_itertools_import.py + + If itertools is imported as something else (ie: import itertools as it; + it.izip(spam, eggs)) method calls will not get fixed. + """ + +# Local imports +from .. import fixer_base +from ..fixer_util import Name + +class FixItertools(fixer_base.BaseFix): + BM_compatible = True + it_funcs = "('imap'|'ifilter'|'izip'|'izip_longest'|'ifilterfalse')" + PATTERN = """ + power< it='itertools' + trailer< + dot='.' func=%(it_funcs)s > trailer< '(' [any] ')' > > + | + power< func=%(it_funcs)s trailer< '(' [any] ')' > > + """ %(locals()) + + # Needs to be run after fix_(map|zip|filter) + run_order = 6 + + def transform(self, node, results): + prefix = None + func = results['func'][0] + if ('it' in results and + func.value not in ('ifilterfalse', 'izip_longest')): + dot, it = (results['dot'], results['it']) + # Remove the 'itertools' + prefix = it.prefix + it.remove() + # Replace the node which contains ('.', 'function') with the + # function (to be consistent with the second part of the pattern) + dot.remove() + func.parent.replace(func) + + prefix = prefix or func.prefix + func.replace(Name(func.value[1:], prefix=prefix)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_itertools_imports.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_itertools_imports.py new file mode 100644 index 0000000000000000000000000000000000000000..0ddbc7b8422991bacc398d8641091a478ee84f55 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_itertools_imports.py @@ -0,0 +1,57 @@ +""" Fixer for imports of itertools.(imap|ifilter|izip|ifilterfalse) """ + +# Local imports +from lib2to3 import fixer_base +from lib2to3.fixer_util import BlankLine, syms, token + + +class FixItertoolsImports(fixer_base.BaseFix): + BM_compatible = True + PATTERN = """ + import_from< 'from' 'itertools' 'import' imports=any > + """ %(locals()) + + def transform(self, node, results): + imports = results['imports'] + if imports.type == syms.import_as_name or not imports.children: + children = [imports] + else: + children = imports.children + for child in children[::2]: + if child.type == token.NAME: + member = child.value + name_node = child + elif child.type == token.STAR: + # Just leave the import as is. + return + else: + assert child.type == syms.import_as_name + name_node = child.children[0] + member_name = name_node.value + if member_name in ('imap', 'izip', 'ifilter'): + child.value = None + child.remove() + elif member_name in ('ifilterfalse', 'izip_longest'): + node.changed() + name_node.value = ('filterfalse' if member_name[1] == 'f' + else 'zip_longest') + + # Make sure the import statement is still sane + children = imports.children[:] or [imports] + remove_comma = True + for child in children: + if remove_comma and child.type == token.COMMA: + child.remove() + else: + remove_comma ^= True + + while children and children[-1].type == token.COMMA: + children.pop().remove() + + # If there are no imports left, just get rid of the entire statement + if (not (imports.children or getattr(imports, 'value', None)) or + imports.parent is None): + p = node.prefix + node = BlankLine() + node.prefix = p + return node diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_long.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_long.py new file mode 100644 index 0000000000000000000000000000000000000000..f227c9f49815388ed58a79e773c8114bced1e58f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_long.py @@ -0,0 +1,19 @@ +# Copyright 2006 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer that turns 'long' into 'int' everywhere. +""" + +# Local imports +from lib2to3 import fixer_base +from lib2to3.fixer_util import is_probably_builtin + + +class FixLong(fixer_base.BaseFix): + BM_compatible = True + PATTERN = "'long'" + + def transform(self, node, results): + if is_probably_builtin(node): + node.value = "int" + node.changed() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_map.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_map.py new file mode 100644 index 0000000000000000000000000000000000000000..78cf81c6f94098aad11edf351ff0f31da9cdbccd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_map.py @@ -0,0 +1,110 @@ +# Copyright 2007 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer that changes map(F, ...) into list(map(F, ...)) unless there +exists a 'from future_builtins import map' statement in the top-level +namespace. + +As a special case, map(None, X) is changed into list(X). (This is +necessary because the semantics are changed in this case -- the new +map(None, X) is equivalent to [(x,) for x in X].) + +We avoid the transformation (except for the special case mentioned +above) if the map() call is directly contained in iter(<>), list(<>), +tuple(<>), sorted(<>), ...join(<>), or for V in <>:. + +NOTE: This is still not correct if the original code was depending on +map(F, X, Y, ...) to go on until the longest argument is exhausted, +substituting None for missing values -- like zip(), it now stops as +soon as the shortest argument is exhausted. +""" + +# Local imports +from ..pgen2 import token +from .. import fixer_base +from ..fixer_util import Name, ArgList, Call, ListComp, in_special_context +from ..pygram import python_symbols as syms +from ..pytree import Node + + +class FixMap(fixer_base.ConditionalFix): + BM_compatible = True + + PATTERN = """ + map_none=power< + 'map' + trailer< '(' arglist< 'None' ',' arg=any [','] > ')' > + [extra_trailers=trailer*] + > + | + map_lambda=power< + 'map' + trailer< + '(' + arglist< + lambdef< 'lambda' + (fp=NAME | vfpdef< '(' fp=NAME ')'> ) ':' xp=any + > + ',' + it=any + > + ')' + > + [extra_trailers=trailer*] + > + | + power< + 'map' args=trailer< '(' [any] ')' > + [extra_trailers=trailer*] + > + """ + + skip_on = 'future_builtins.map' + + def transform(self, node, results): + if self.should_skip(node): + return + + trailers = [] + if 'extra_trailers' in results: + for t in results['extra_trailers']: + trailers.append(t.clone()) + + if node.parent.type == syms.simple_stmt: + self.warning(node, "You should use a for loop here") + new = node.clone() + new.prefix = "" + new = Call(Name("list"), [new]) + elif "map_lambda" in results: + new = ListComp(results["xp"].clone(), + results["fp"].clone(), + results["it"].clone()) + new = Node(syms.power, [new] + trailers, prefix="") + + else: + if "map_none" in results: + new = results["arg"].clone() + new.prefix = "" + else: + if "args" in results: + args = results["args"] + if args.type == syms.trailer and \ + args.children[1].type == syms.arglist and \ + args.children[1].children[0].type == token.NAME and \ + args.children[1].children[0].value == "None": + self.warning(node, "cannot convert map(None, ...) " + "with multiple arguments because map() " + "now truncates to the shortest sequence") + return + + new = Node(syms.power, [Name("map"), args.clone()]) + new.prefix = "" + + if in_special_context(node): + return None + + new = Node(syms.power, [Name("list"), ArgList([new])] + trailers) + new.prefix = "" + + new.prefix = node.prefix + return new diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_metaclass.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_metaclass.py new file mode 100644 index 0000000000000000000000000000000000000000..fe547b2228072a3cf436733f40154004e98c215c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_metaclass.py @@ -0,0 +1,228 @@ +"""Fixer for __metaclass__ = X -> (metaclass=X) methods. + + The various forms of classef (inherits nothing, inherits once, inherits + many) don't parse the same in the CST so we look at ALL classes for + a __metaclass__ and if we find one normalize the inherits to all be + an arglist. + + For one-liner classes ('class X: pass') there is no indent/dedent so + we normalize those into having a suite. + + Moving the __metaclass__ into the classdef can also cause the class + body to be empty so there is some special casing for that as well. + + This fixer also tries very hard to keep original indenting and spacing + in all those corner cases. + +""" +# Author: Jack Diederich + +# Local imports +from .. import fixer_base +from ..pygram import token +from ..fixer_util import syms, Node, Leaf + + +def has_metaclass(parent): + """ we have to check the cls_node without changing it. + There are two possibilities: + 1) clsdef => suite => simple_stmt => expr_stmt => Leaf('__meta') + 2) clsdef => simple_stmt => expr_stmt => Leaf('__meta') + """ + for node in parent.children: + if node.type == syms.suite: + return has_metaclass(node) + elif node.type == syms.simple_stmt and node.children: + expr_node = node.children[0] + if expr_node.type == syms.expr_stmt and expr_node.children: + left_side = expr_node.children[0] + if isinstance(left_side, Leaf) and \ + left_side.value == '__metaclass__': + return True + return False + + +def fixup_parse_tree(cls_node): + """ one-line classes don't get a suite in the parse tree so we add + one to normalize the tree + """ + for node in cls_node.children: + if node.type == syms.suite: + # already in the preferred format, do nothing + return + + # !%@#! one-liners have no suite node, we have to fake one up + for i, node in enumerate(cls_node.children): + if node.type == token.COLON: + break + else: + raise ValueError("No class suite and no ':'!") + + # move everything into a suite node + suite = Node(syms.suite, []) + while cls_node.children[i+1:]: + move_node = cls_node.children[i+1] + suite.append_child(move_node.clone()) + move_node.remove() + cls_node.append_child(suite) + node = suite + + +def fixup_simple_stmt(parent, i, stmt_node): + """ if there is a semi-colon all the parts count as part of the same + simple_stmt. We just want the __metaclass__ part so we move + everything after the semi-colon into its own simple_stmt node + """ + for semi_ind, node in enumerate(stmt_node.children): + if node.type == token.SEMI: # *sigh* + break + else: + return + + node.remove() # kill the semicolon + new_expr = Node(syms.expr_stmt, []) + new_stmt = Node(syms.simple_stmt, [new_expr]) + while stmt_node.children[semi_ind:]: + move_node = stmt_node.children[semi_ind] + new_expr.append_child(move_node.clone()) + move_node.remove() + parent.insert_child(i, new_stmt) + new_leaf1 = new_stmt.children[0].children[0] + old_leaf1 = stmt_node.children[0].children[0] + new_leaf1.prefix = old_leaf1.prefix + + +def remove_trailing_newline(node): + if node.children and node.children[-1].type == token.NEWLINE: + node.children[-1].remove() + + +def find_metas(cls_node): + # find the suite node (Mmm, sweet nodes) + for node in cls_node.children: + if node.type == syms.suite: + break + else: + raise ValueError("No class suite!") + + # look for simple_stmt[ expr_stmt[ Leaf('__metaclass__') ] ] + for i, simple_node in list(enumerate(node.children)): + if simple_node.type == syms.simple_stmt and simple_node.children: + expr_node = simple_node.children[0] + if expr_node.type == syms.expr_stmt and expr_node.children: + # Check if the expr_node is a simple assignment. + left_node = expr_node.children[0] + if isinstance(left_node, Leaf) and \ + left_node.value == '__metaclass__': + # We found an assignment to __metaclass__. + fixup_simple_stmt(node, i, simple_node) + remove_trailing_newline(simple_node) + yield (node, i, simple_node) + + +def fixup_indent(suite): + """ If an INDENT is followed by a thing with a prefix then nuke the prefix + Otherwise we get in trouble when removing __metaclass__ at suite start + """ + kids = suite.children[::-1] + # find the first indent + while kids: + node = kids.pop() + if node.type == token.INDENT: + break + + # find the first Leaf + while kids: + node = kids.pop() + if isinstance(node, Leaf) and node.type != token.DEDENT: + if node.prefix: + node.prefix = '' + return + else: + kids.extend(node.children[::-1]) + + +class FixMetaclass(fixer_base.BaseFix): + BM_compatible = True + + PATTERN = """ + classdef + """ + + def transform(self, node, results): + if not has_metaclass(node): + return + + fixup_parse_tree(node) + + # find metaclasses, keep the last one + last_metaclass = None + for suite, i, stmt in find_metas(node): + last_metaclass = stmt + stmt.remove() + + text_type = node.children[0].type # always Leaf(nnn, 'class') + + # figure out what kind of classdef we have + if len(node.children) == 7: + # Node(classdef, ['class', 'name', '(', arglist, ')', ':', suite]) + # 0 1 2 3 4 5 6 + if node.children[3].type == syms.arglist: + arglist = node.children[3] + # Node(classdef, ['class', 'name', '(', 'Parent', ')', ':', suite]) + else: + parent = node.children[3].clone() + arglist = Node(syms.arglist, [parent]) + node.set_child(3, arglist) + elif len(node.children) == 6: + # Node(classdef, ['class', 'name', '(', ')', ':', suite]) + # 0 1 2 3 4 5 + arglist = Node(syms.arglist, []) + node.insert_child(3, arglist) + elif len(node.children) == 4: + # Node(classdef, ['class', 'name', ':', suite]) + # 0 1 2 3 + arglist = Node(syms.arglist, []) + node.insert_child(2, Leaf(token.RPAR, ')')) + node.insert_child(2, arglist) + node.insert_child(2, Leaf(token.LPAR, '(')) + else: + raise ValueError("Unexpected class definition") + + # now stick the metaclass in the arglist + meta_txt = last_metaclass.children[0].children[0] + meta_txt.value = 'metaclass' + orig_meta_prefix = meta_txt.prefix + + if arglist.children: + arglist.append_child(Leaf(token.COMMA, ',')) + meta_txt.prefix = ' ' + else: + meta_txt.prefix = '' + + # compact the expression "metaclass = Meta" -> "metaclass=Meta" + expr_stmt = last_metaclass.children[0] + assert expr_stmt.type == syms.expr_stmt + expr_stmt.children[1].prefix = '' + expr_stmt.children[2].prefix = '' + + arglist.append_child(last_metaclass) + + fixup_indent(suite) + + # check for empty suite + if not suite.children: + # one-liner that was just __metaclass_ + suite.remove() + pass_leaf = Leaf(text_type, 'pass') + pass_leaf.prefix = orig_meta_prefix + node.append_child(pass_leaf) + node.append_child(Leaf(token.NEWLINE, '\n')) + + elif len(suite.children) > 1 and \ + (suite.children[-2].type == token.INDENT and + suite.children[-1].type == token.DEDENT): + # there was only one line in the class body and it was __metaclass__ + pass_leaf = Leaf(text_type, 'pass') + suite.insert_child(-1, pass_leaf) + suite.insert_child(-1, Leaf(token.NEWLINE, '\n')) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_methodattrs.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_methodattrs.py new file mode 100644 index 0000000000000000000000000000000000000000..7f9004f00e6e8f2a7d4f72d90b6af3a2674d0fa0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_methodattrs.py @@ -0,0 +1,24 @@ +"""Fix bound method attributes (method.im_? -> method.__?__). +""" +# Author: Christian Heimes + +# Local imports +from .. import fixer_base +from ..fixer_util import Name + +MAP = { + "im_func" : "__func__", + "im_self" : "__self__", + "im_class" : "__self__.__class__" + } + +class FixMethodattrs(fixer_base.BaseFix): + BM_compatible = True + PATTERN = """ + power< any+ trailer< '.' attr=('im_func' | 'im_self' | 'im_class') > any* > + """ + + def transform(self, node, results): + attr = results["attr"][0] + new = MAP[attr.value] + attr.replace(Name(new, prefix=attr.prefix)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_ne.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_ne.py new file mode 100644 index 0000000000000000000000000000000000000000..e3ee10f4a63e0c211d2fb430095dfd784d68518e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_ne.py @@ -0,0 +1,23 @@ +# Copyright 2006 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer that turns <> into !=.""" + +# Local imports +from .. import pytree +from ..pgen2 import token +from .. import fixer_base + + +class FixNe(fixer_base.BaseFix): + # This is so simple that we don't need the pattern compiler. + + _accept_type = token.NOTEQUAL + + def match(self, node): + # Override + return node.value == "<>" + + def transform(self, node, results): + new = pytree.Leaf(token.NOTEQUAL, "!=", prefix=node.prefix) + return new diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_next.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_next.py new file mode 100644 index 0000000000000000000000000000000000000000..9f6305e1d49dc5327338912f2e6ed0b5794c5062 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_next.py @@ -0,0 +1,103 @@ +"""Fixer for it.next() -> next(it), per PEP 3114.""" +# Author: Collin Winter + +# Things that currently aren't covered: +# - listcomp "next" names aren't warned +# - "with" statement targets aren't checked + +# Local imports +from ..pgen2 import token +from ..pygram import python_symbols as syms +from .. import fixer_base +from ..fixer_util import Name, Call, find_binding + +bind_warning = "Calls to builtin next() possibly shadowed by global binding" + + +class FixNext(fixer_base.BaseFix): + BM_compatible = True + PATTERN = """ + power< base=any+ trailer< '.' attr='next' > trailer< '(' ')' > > + | + power< head=any+ trailer< '.' attr='next' > not trailer< '(' ')' > > + | + classdef< 'class' any+ ':' + suite< any* + funcdef< 'def' + name='next' + parameters< '(' NAME ')' > any+ > + any* > > + | + global=global_stmt< 'global' any* 'next' any* > + """ + + order = "pre" # Pre-order tree traversal + + def start_tree(self, tree, filename): + super(FixNext, self).start_tree(tree, filename) + + n = find_binding('next', tree) + if n: + self.warning(n, bind_warning) + self.shadowed_next = True + else: + self.shadowed_next = False + + def transform(self, node, results): + assert results + + base = results.get("base") + attr = results.get("attr") + name = results.get("name") + + if base: + if self.shadowed_next: + attr.replace(Name("__next__", prefix=attr.prefix)) + else: + base = [n.clone() for n in base] + base[0].prefix = "" + node.replace(Call(Name("next", prefix=node.prefix), base)) + elif name: + n = Name("__next__", prefix=name.prefix) + name.replace(n) + elif attr: + # We don't do this transformation if we're assigning to "x.next". + # Unfortunately, it doesn't seem possible to do this in PATTERN, + # so it's being done here. + if is_assign_target(node): + head = results["head"] + if "".join([str(n) for n in head]).strip() == '__builtin__': + self.warning(node, bind_warning) + return + attr.replace(Name("__next__")) + elif "global" in results: + self.warning(node, bind_warning) + self.shadowed_next = True + + +### The following functions help test if node is part of an assignment +### target. + +def is_assign_target(node): + assign = find_assign(node) + if assign is None: + return False + + for child in assign.children: + if child.type == token.EQUAL: + return False + elif is_subtree(child, node): + return True + return False + +def find_assign(node): + if node.type == syms.expr_stmt: + return node + if node.type == syms.simple_stmt or node.parent is None: + return None + return find_assign(node.parent) + +def is_subtree(root, node): + if root == node: + return True + return any(is_subtree(c, node) for c in root.children) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_nonzero.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_nonzero.py new file mode 100644 index 0000000000000000000000000000000000000000..c2295969a7728f78617677b01aac8122fa15539c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_nonzero.py @@ -0,0 +1,21 @@ +"""Fixer for __nonzero__ -> __bool__ methods.""" +# Author: Collin Winter + +# Local imports +from .. import fixer_base +from ..fixer_util import Name + +class FixNonzero(fixer_base.BaseFix): + BM_compatible = True + PATTERN = """ + classdef< 'class' any+ ':' + suite< any* + funcdef< 'def' name='__nonzero__' + parameters< '(' NAME ')' > any+ > + any* > > + """ + + def transform(self, node, results): + name = results["name"] + new = Name("__bool__", prefix=name.prefix) + name.replace(new) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_numliterals.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_numliterals.py new file mode 100644 index 0000000000000000000000000000000000000000..79207d4aa368aee20a2ac9ae1e44072aabb2afd2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_numliterals.py @@ -0,0 +1,28 @@ +"""Fixer that turns 1L into 1, 0755 into 0o755. +""" +# Copyright 2007 Georg Brandl. +# Licensed to PSF under a Contributor Agreement. + +# Local imports +from ..pgen2 import token +from .. import fixer_base +from ..fixer_util import Number + + +class FixNumliterals(fixer_base.BaseFix): + # This is so simple that we don't need the pattern compiler. + + _accept_type = token.NUMBER + + def match(self, node): + # Override + return (node.value.startswith("0") or node.value[-1] in "Ll") + + def transform(self, node, results): + val = node.value + if val[-1] in 'Ll': + val = val[:-1] + elif val.startswith('0') and val.isdigit() and len(set(val)) > 1: + val = "0o" + val[1:] + + return Number(val, prefix=node.prefix) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_operator.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_operator.py new file mode 100644 index 0000000000000000000000000000000000000000..d303cd2018befb0745f2868068becf9f350b9b3d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_operator.py @@ -0,0 +1,97 @@ +"""Fixer for operator functions. + +operator.isCallable(obj) -> callable(obj) +operator.sequenceIncludes(obj) -> operator.contains(obj) +operator.isSequenceType(obj) -> isinstance(obj, collections.abc.Sequence) +operator.isMappingType(obj) -> isinstance(obj, collections.abc.Mapping) +operator.isNumberType(obj) -> isinstance(obj, numbers.Number) +operator.repeat(obj, n) -> operator.mul(obj, n) +operator.irepeat(obj, n) -> operator.imul(obj, n) +""" + +import collections.abc + +# Local imports +from lib2to3 import fixer_base +from lib2to3.fixer_util import Call, Name, String, touch_import + + +def invocation(s): + def dec(f): + f.invocation = s + return f + return dec + + +class FixOperator(fixer_base.BaseFix): + BM_compatible = True + order = "pre" + + methods = """ + method=('isCallable'|'sequenceIncludes' + |'isSequenceType'|'isMappingType'|'isNumberType' + |'repeat'|'irepeat') + """ + obj = "'(' obj=any ')'" + PATTERN = """ + power< module='operator' + trailer< '.' %(methods)s > trailer< %(obj)s > > + | + power< %(methods)s trailer< %(obj)s > > + """ % dict(methods=methods, obj=obj) + + def transform(self, node, results): + method = self._check_method(node, results) + if method is not None: + return method(node, results) + + @invocation("operator.contains(%s)") + def _sequenceIncludes(self, node, results): + return self._handle_rename(node, results, "contains") + + @invocation("callable(%s)") + def _isCallable(self, node, results): + obj = results["obj"] + return Call(Name("callable"), [obj.clone()], prefix=node.prefix) + + @invocation("operator.mul(%s)") + def _repeat(self, node, results): + return self._handle_rename(node, results, "mul") + + @invocation("operator.imul(%s)") + def _irepeat(self, node, results): + return self._handle_rename(node, results, "imul") + + @invocation("isinstance(%s, collections.abc.Sequence)") + def _isSequenceType(self, node, results): + return self._handle_type2abc(node, results, "collections.abc", "Sequence") + + @invocation("isinstance(%s, collections.abc.Mapping)") + def _isMappingType(self, node, results): + return self._handle_type2abc(node, results, "collections.abc", "Mapping") + + @invocation("isinstance(%s, numbers.Number)") + def _isNumberType(self, node, results): + return self._handle_type2abc(node, results, "numbers", "Number") + + def _handle_rename(self, node, results, name): + method = results["method"][0] + method.value = name + method.changed() + + def _handle_type2abc(self, node, results, module, abc): + touch_import(None, module, node) + obj = results["obj"] + args = [obj.clone(), String(", " + ".".join([module, abc]))] + return Call(Name("isinstance"), args, prefix=node.prefix) + + def _check_method(self, node, results): + method = getattr(self, "_" + results["method"][0].value) + if isinstance(method, collections.abc.Callable): + if "module" in results: + return method + else: + sub = (str(results["obj"]),) + invocation_str = method.invocation % sub + self.warning(node, "You should use '%s' here." % invocation_str) + return None diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_paren.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_paren.py new file mode 100644 index 0000000000000000000000000000000000000000..df3da5f5232c9c42fc53c904f8c0b886b4dd4a51 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_paren.py @@ -0,0 +1,44 @@ +"""Fixer that adds parentheses where they are required + +This converts ``[x for x in 1, 2]`` to ``[x for x in (1, 2)]``.""" + +# By Taek Joo Kim and Benjamin Peterson + +# Local imports +from .. import fixer_base +from ..fixer_util import LParen, RParen + +# XXX This doesn't support nested for loops like [x for x in 1, 2 for x in 1, 2] +class FixParen(fixer_base.BaseFix): + BM_compatible = True + + PATTERN = """ + atom< ('[' | '(') + (listmaker< any + comp_for< + 'for' NAME 'in' + target=testlist_safe< any (',' any)+ [','] + > + [any] + > + > + | + testlist_gexp< any + comp_for< + 'for' NAME 'in' + target=testlist_safe< any (',' any)+ [','] + > + [any] + > + >) + (']' | ')') > + """ + + def transform(self, node, results): + target = results["target"] + + lparen = LParen() + lparen.prefix = target.prefix + target.prefix = "" # Make it hug the parentheses + target.insert_child(0, lparen) + target.append_child(RParen()) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_print.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_print.py new file mode 100644 index 0000000000000000000000000000000000000000..8780322265f6fe526cb35e7961f3cfb5aaa8e052 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_print.py @@ -0,0 +1,87 @@ +# Copyright 2006 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer for print. + +Change: + 'print' into 'print()' + 'print ...' into 'print(...)' + 'print ... ,' into 'print(..., end=" ")' + 'print >>x, ...' into 'print(..., file=x)' + +No changes are applied if print_function is imported from __future__ + +""" + +# Local imports +from .. import patcomp +from .. import pytree +from ..pgen2 import token +from .. import fixer_base +from ..fixer_util import Name, Call, Comma, String + + +parend_expr = patcomp.compile_pattern( + """atom< '(' [atom|STRING|NAME] ')' >""" + ) + + +class FixPrint(fixer_base.BaseFix): + + BM_compatible = True + + PATTERN = """ + simple_stmt< any* bare='print' any* > | print_stmt + """ + + def transform(self, node, results): + assert results + + bare_print = results.get("bare") + + if bare_print: + # Special-case print all by itself + bare_print.replace(Call(Name("print"), [], + prefix=bare_print.prefix)) + return + assert node.children[0] == Name("print") + args = node.children[1:] + if len(args) == 1 and parend_expr.match(args[0]): + # We don't want to keep sticking parens around an + # already-parenthesised expression. + return + + sep = end = file = None + if args and args[-1] == Comma(): + args = args[:-1] + end = " " + if args and args[0] == pytree.Leaf(token.RIGHTSHIFT, ">>"): + assert len(args) >= 2 + file = args[1].clone() + args = args[3:] # Strip a possible comma after the file expression + # Now synthesize a print(args, sep=..., end=..., file=...) node. + l_args = [arg.clone() for arg in args] + if l_args: + l_args[0].prefix = "" + if sep is not None or end is not None or file is not None: + if sep is not None: + self.add_kwarg(l_args, "sep", String(repr(sep))) + if end is not None: + self.add_kwarg(l_args, "end", String(repr(end))) + if file is not None: + self.add_kwarg(l_args, "file", file) + n_stmt = Call(Name("print"), l_args) + n_stmt.prefix = node.prefix + return n_stmt + + def add_kwarg(self, l_nodes, s_kwd, n_expr): + # XXX All this prefix-setting may lose comments (though rarely) + n_expr.prefix = "" + n_argument = pytree.Node(self.syms.argument, + (Name(s_kwd), + pytree.Leaf(token.EQUAL, "="), + n_expr)) + if l_nodes: + l_nodes.append(Comma()) + n_argument.prefix = " " + l_nodes.append(n_argument) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_raise.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_raise.py new file mode 100644 index 0000000000000000000000000000000000000000..05aa21e74a30ff101c593dc03514efc26f10cecf --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_raise.py @@ -0,0 +1,90 @@ +"""Fixer for 'raise E, V, T' + +raise -> raise +raise E -> raise E +raise E, V -> raise E(V) +raise E, V, T -> raise E(V).with_traceback(T) +raise E, None, T -> raise E.with_traceback(T) + +raise (((E, E'), E''), E'''), V -> raise E(V) +raise "foo", V, T -> warns about string exceptions + + +CAVEATS: +1) "raise E, V" will be incorrectly translated if V is an exception + instance. The correct Python 3 idiom is + + raise E from V + + but since we can't detect instance-hood by syntax alone and since + any client code would have to be changed as well, we don't automate + this. +""" +# Author: Collin Winter + +# Local imports +from .. import pytree +from ..pgen2 import token +from .. import fixer_base +from ..fixer_util import Name, Call, Attr, ArgList, is_tuple + +class FixRaise(fixer_base.BaseFix): + + BM_compatible = True + PATTERN = """ + raise_stmt< 'raise' exc=any [',' val=any [',' tb=any]] > + """ + + def transform(self, node, results): + syms = self.syms + + exc = results["exc"].clone() + if exc.type == token.STRING: + msg = "Python 3 does not support string exceptions" + self.cannot_convert(node, msg) + return + + # Python 2 supports + # raise ((((E1, E2), E3), E4), E5), V + # as a synonym for + # raise E1, V + # Since Python 3 will not support this, we recurse down any tuple + # literals, always taking the first element. + if is_tuple(exc): + while is_tuple(exc): + # exc.children[1:-1] is the unparenthesized tuple + # exc.children[1].children[0] is the first element of the tuple + exc = exc.children[1].children[0].clone() + exc.prefix = " " + + if "val" not in results: + # One-argument raise + new = pytree.Node(syms.raise_stmt, [Name("raise"), exc]) + new.prefix = node.prefix + return new + + val = results["val"].clone() + if is_tuple(val): + args = [c.clone() for c in val.children[1:-1]] + else: + val.prefix = "" + args = [val] + + if "tb" in results: + tb = results["tb"].clone() + tb.prefix = "" + + e = exc + # If there's a traceback and None is passed as the value, then don't + # add a call, since the user probably just wants to add a + # traceback. See issue #9661. + if val.type != token.NAME or val.value != "None": + e = Call(exc, args) + with_tb = Attr(e, Name('with_traceback')) + [ArgList([tb])] + new = pytree.Node(syms.simple_stmt, [Name("raise")] + with_tb) + new.prefix = node.prefix + return new + else: + return pytree.Node(syms.raise_stmt, + [Name("raise"), Call(exc, args)], + prefix=node.prefix) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_raw_input.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_raw_input.py new file mode 100644 index 0000000000000000000000000000000000000000..a51bb694b9e01e8d6f382f359118df1d74135924 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_raw_input.py @@ -0,0 +1,17 @@ +"""Fixer that changes raw_input(...) into input(...).""" +# Author: Andre Roberge + +# Local imports +from .. import fixer_base +from ..fixer_util import Name + +class FixRawInput(fixer_base.BaseFix): + + BM_compatible = True + PATTERN = """ + power< name='raw_input' trailer< '(' [any] ')' > any* > + """ + + def transform(self, node, results): + name = results["name"] + name.replace(Name("input", prefix=name.prefix)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_reduce.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_reduce.py new file mode 100644 index 0000000000000000000000000000000000000000..00e5aa1c33d4826e976cccee05b8f7398954459f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_reduce.py @@ -0,0 +1,35 @@ +# Copyright 2008 Armin Ronacher. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer for reduce(). + +Makes sure reduce() is imported from the functools module if reduce is +used in that module. +""" + +from lib2to3 import fixer_base +from lib2to3.fixer_util import touch_import + + + +class FixReduce(fixer_base.BaseFix): + + BM_compatible = True + order = "pre" + + PATTERN = """ + power< 'reduce' + trailer< '(' + arglist< ( + (not(argument) any ',' + not(argument + > + """ + + def transform(self, node, results): + touch_import('functools', 'reduce', node) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_reload.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_reload.py new file mode 100644 index 0000000000000000000000000000000000000000..b30841131c51f9b6311d1e10629dd9e5049fd6ab --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_reload.py @@ -0,0 +1,36 @@ +"""Fixer for reload(). + +reload(s) -> importlib.reload(s)""" + +# Local imports +from .. import fixer_base +from ..fixer_util import ImportAndCall, touch_import + + +class FixReload(fixer_base.BaseFix): + BM_compatible = True + order = "pre" + + PATTERN = """ + power< 'reload' + trailer< lpar='(' + ( not(arglist | argument) any ','> ) + rpar=')' > + after=any* + > + """ + + def transform(self, node, results): + if results: + # I feel like we should be able to express this logic in the + # PATTERN above but I don't know how to do it so... + obj = results['obj'] + if obj: + if (obj.type == self.syms.argument and + obj.children[0].value in {'**', '*'}): + return # Make no change. + names = ('importlib', 'reload') + new = ImportAndCall(node, results, names) + touch_import(None, 'importlib', node) + return new diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_renames.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_renames.py new file mode 100644 index 0000000000000000000000000000000000000000..c0e3705ab7be19c037b833bc43e76eafc21067d8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_renames.py @@ -0,0 +1,70 @@ +"""Fix incompatible renames + +Fixes: + * sys.maxint -> sys.maxsize +""" +# Author: Christian Heimes +# based on Collin Winter's fix_import + +# Local imports +from .. import fixer_base +from ..fixer_util import Name, attr_chain + +MAPPING = {"sys": {"maxint" : "maxsize"}, + } +LOOKUP = {} + +def alternates(members): + return "(" + "|".join(map(repr, members)) + ")" + + +def build_pattern(): + #bare = set() + for module, replace in list(MAPPING.items()): + for old_attr, new_attr in list(replace.items()): + LOOKUP[(module, old_attr)] = new_attr + #bare.add(module) + #bare.add(old_attr) + #yield """ + # import_name< 'import' (module=%r + # | dotted_as_names< any* module=%r any* >) > + # """ % (module, module) + yield """ + import_from< 'from' module_name=%r 'import' + ( attr_name=%r | import_as_name< attr_name=%r 'as' any >) > + """ % (module, old_attr, old_attr) + yield """ + power< module_name=%r trailer< '.' attr_name=%r > any* > + """ % (module, old_attr) + #yield """bare_name=%s""" % alternates(bare) + + +class FixRenames(fixer_base.BaseFix): + BM_compatible = True + PATTERN = "|".join(build_pattern()) + + order = "pre" # Pre-order tree traversal + + # Don't match the node if it's within another match + def match(self, node): + match = super(FixRenames, self).match + results = match(node) + if results: + if any(match(obj) for obj in attr_chain(node, "parent")): + return False + return results + return False + + #def start_tree(self, tree, filename): + # super(FixRenames, self).start_tree(tree, filename) + # self.replace = {} + + def transform(self, node, results): + mod_name = results.get("module_name") + attr_name = results.get("attr_name") + #bare_name = results.get("bare_name") + #import_mod = results.get("module") + + if mod_name and attr_name: + new_attr = LOOKUP[(mod_name.value, attr_name.value)] + attr_name.replace(Name(new_attr, prefix=attr_name.prefix)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_repr.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_repr.py new file mode 100644 index 0000000000000000000000000000000000000000..1150bb8b9db2afba11a18f2661fdfd4d9bd4b633 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_repr.py @@ -0,0 +1,23 @@ +# Copyright 2006 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer that transforms `xyzzy` into repr(xyzzy).""" + +# Local imports +from .. import fixer_base +from ..fixer_util import Call, Name, parenthesize + + +class FixRepr(fixer_base.BaseFix): + + BM_compatible = True + PATTERN = """ + atom < '`' expr=any '`' > + """ + + def transform(self, node, results): + expr = results["expr"].clone() + + if expr.type == self.syms.testlist1: + expr = parenthesize(expr) + return Call(Name("repr"), [expr], prefix=node.prefix) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_set_literal.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_set_literal.py new file mode 100644 index 0000000000000000000000000000000000000000..762550cf73dc0b627612465e63f0368d06847ae1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_set_literal.py @@ -0,0 +1,53 @@ +""" +Optional fixer to transform set() calls to set literals. +""" + +# Author: Benjamin Peterson + +from lib2to3 import fixer_base, pytree +from lib2to3.fixer_util import token, syms + + + +class FixSetLiteral(fixer_base.BaseFix): + + BM_compatible = True + explicit = True + + PATTERN = """power< 'set' trailer< '(' + (atom=atom< '[' (items=listmaker< any ((',' any)* [',']) > + | + single=any) ']' > + | + atom< '(' items=testlist_gexp< any ((',' any)* [',']) > ')' > + ) + ')' > > + """ + + def transform(self, node, results): + single = results.get("single") + if single: + # Make a fake listmaker + fake = pytree.Node(syms.listmaker, [single.clone()]) + single.replace(fake) + items = fake + else: + items = results["items"] + + # Build the contents of the literal + literal = [pytree.Leaf(token.LBRACE, "{")] + literal.extend(n.clone() for n in items.children) + literal.append(pytree.Leaf(token.RBRACE, "}")) + # Set the prefix of the right brace to that of the ')' or ']' + literal[-1].prefix = items.next_sibling.prefix + maker = pytree.Node(syms.dictsetmaker, literal) + maker.prefix = node.prefix + + # If the original was a one tuple, we need to remove the extra comma. + if len(maker.children) == 4: + n = maker.children[2] + n.remove() + maker.children[-1].prefix = n.prefix + + # Finally, replace the set call with our shiny new literal. + return maker diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_standarderror.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_standarderror.py new file mode 100644 index 0000000000000000000000000000000000000000..dc742167e6e9d4680afb7afcfc64524f4c14aca3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_standarderror.py @@ -0,0 +1,18 @@ +# Copyright 2007 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer for StandardError -> Exception.""" + +# Local imports +from .. import fixer_base +from ..fixer_util import Name + + +class FixStandarderror(fixer_base.BaseFix): + BM_compatible = True + PATTERN = """ + 'StandardError' + """ + + def transform(self, node, results): + return Name("Exception", prefix=node.prefix) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_sys_exc.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_sys_exc.py new file mode 100644 index 0000000000000000000000000000000000000000..f6039690374ab26d383bc8e0309438c051d0d405 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_sys_exc.py @@ -0,0 +1,30 @@ +"""Fixer for sys.exc_{type, value, traceback} + +sys.exc_type -> sys.exc_info()[0] +sys.exc_value -> sys.exc_info()[1] +sys.exc_traceback -> sys.exc_info()[2] +""" + +# By Jeff Balogh and Benjamin Peterson + +# Local imports +from .. import fixer_base +from ..fixer_util import Attr, Call, Name, Number, Subscript, Node, syms + +class FixSysExc(fixer_base.BaseFix): + # This order matches the ordering of sys.exc_info(). + exc_info = ["exc_type", "exc_value", "exc_traceback"] + BM_compatible = True + PATTERN = """ + power< 'sys' trailer< dot='.' attribute=(%s) > > + """ % '|'.join("'%s'" % e for e in exc_info) + + def transform(self, node, results): + sys_attr = results["attribute"][0] + index = Number(self.exc_info.index(sys_attr.value)) + + call = Call(Name("exc_info"), prefix=sys_attr.prefix) + attr = Attr(Name("sys"), call) + attr[1].children[0].prefix = results["dot"].prefix + attr.append(Subscript(index)) + return Node(syms.power, attr, prefix=node.prefix) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_throw.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_throw.py new file mode 100644 index 0000000000000000000000000000000000000000..aac29169b4e98e26d0aa78c3fbce641742b04952 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_throw.py @@ -0,0 +1,56 @@ +"""Fixer for generator.throw(E, V, T). + +g.throw(E) -> g.throw(E) +g.throw(E, V) -> g.throw(E(V)) +g.throw(E, V, T) -> g.throw(E(V).with_traceback(T)) + +g.throw("foo"[, V[, T]]) will warn about string exceptions.""" +# Author: Collin Winter + +# Local imports +from .. import pytree +from ..pgen2 import token +from .. import fixer_base +from ..fixer_util import Name, Call, ArgList, Attr, is_tuple + +class FixThrow(fixer_base.BaseFix): + BM_compatible = True + PATTERN = """ + power< any trailer< '.' 'throw' > + trailer< '(' args=arglist< exc=any ',' val=any [',' tb=any] > ')' > + > + | + power< any trailer< '.' 'throw' > trailer< '(' exc=any ')' > > + """ + + def transform(self, node, results): + syms = self.syms + + exc = results["exc"].clone() + if exc.type is token.STRING: + self.cannot_convert(node, "Python 3 does not support string exceptions") + return + + # Leave "g.throw(E)" alone + val = results.get("val") + if val is None: + return + + val = val.clone() + if is_tuple(val): + args = [c.clone() for c in val.children[1:-1]] + else: + val.prefix = "" + args = [val] + + throw_args = results["args"] + + if "tb" in results: + tb = results["tb"].clone() + tb.prefix = "" + + e = Call(exc, args) + with_tb = Attr(e, Name('with_traceback')) + [ArgList([tb])] + throw_args.replace(pytree.Node(syms.power, with_tb)) + else: + throw_args.replace(Call(exc, args)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_tuple_params.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_tuple_params.py new file mode 100644 index 0000000000000000000000000000000000000000..cad755ffdbefb39431b2ffa4f5c8cf3c7a920c06 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_tuple_params.py @@ -0,0 +1,175 @@ +"""Fixer for function definitions with tuple parameters. + +def func(((a, b), c), d): + ... + + -> + +def func(x, d): + ((a, b), c) = x + ... + +It will also support lambdas: + + lambda (x, y): x + y -> lambda t: t[0] + t[1] + + # The parens are a syntax error in Python 3 + lambda (x): x + y -> lambda x: x + y +""" +# Author: Collin Winter + +# Local imports +from .. import pytree +from ..pgen2 import token +from .. import fixer_base +from ..fixer_util import Assign, Name, Newline, Number, Subscript, syms + +def is_docstring(stmt): + return isinstance(stmt, pytree.Node) and \ + stmt.children[0].type == token.STRING + +class FixTupleParams(fixer_base.BaseFix): + run_order = 4 #use a lower order since lambda is part of other + #patterns + BM_compatible = True + + PATTERN = """ + funcdef< 'def' any parameters< '(' args=any ')' > + ['->' any] ':' suite=any+ > + | + lambda= + lambdef< 'lambda' args=vfpdef< '(' inner=any ')' > + ':' body=any + > + """ + + def transform(self, node, results): + if "lambda" in results: + return self.transform_lambda(node, results) + + new_lines = [] + suite = results["suite"] + args = results["args"] + # This crap is so "def foo(...): x = 5; y = 7" is handled correctly. + # TODO(cwinter): suite-cleanup + if suite[0].children[1].type == token.INDENT: + start = 2 + indent = suite[0].children[1].value + end = Newline() + else: + start = 0 + indent = "; " + end = pytree.Leaf(token.INDENT, "") + + # We need access to self for new_name(), and making this a method + # doesn't feel right. Closing over self and new_lines makes the + # code below cleaner. + def handle_tuple(tuple_arg, add_prefix=False): + n = Name(self.new_name()) + arg = tuple_arg.clone() + arg.prefix = "" + stmt = Assign(arg, n.clone()) + if add_prefix: + n.prefix = " " + tuple_arg.replace(n) + new_lines.append(pytree.Node(syms.simple_stmt, + [stmt, end.clone()])) + + if args.type == syms.tfpdef: + handle_tuple(args) + elif args.type == syms.typedargslist: + for i, arg in enumerate(args.children): + if arg.type == syms.tfpdef: + # Without add_prefix, the emitted code is correct, + # just ugly. + handle_tuple(arg, add_prefix=(i > 0)) + + if not new_lines: + return + + # This isn't strictly necessary, but it plays nicely with other fixers. + # TODO(cwinter) get rid of this when children becomes a smart list + for line in new_lines: + line.parent = suite[0] + + # TODO(cwinter) suite-cleanup + after = start + if start == 0: + new_lines[0].prefix = " " + elif is_docstring(suite[0].children[start]): + new_lines[0].prefix = indent + after = start + 1 + + for line in new_lines: + line.parent = suite[0] + suite[0].children[after:after] = new_lines + for i in range(after+1, after+len(new_lines)+1): + suite[0].children[i].prefix = indent + suite[0].changed() + + def transform_lambda(self, node, results): + args = results["args"] + body = results["body"] + inner = simplify_args(results["inner"]) + + # Replace lambda ((((x)))): x with lambda x: x + if inner.type == token.NAME: + inner = inner.clone() + inner.prefix = " " + args.replace(inner) + return + + params = find_params(args) + to_index = map_to_index(params) + tup_name = self.new_name(tuple_name(params)) + + new_param = Name(tup_name, prefix=" ") + args.replace(new_param.clone()) + for n in body.post_order(): + if n.type == token.NAME and n.value in to_index: + subscripts = [c.clone() for c in to_index[n.value]] + new = pytree.Node(syms.power, + [new_param.clone()] + subscripts) + new.prefix = n.prefix + n.replace(new) + + +### Helper functions for transform_lambda() + +def simplify_args(node): + if node.type in (syms.vfplist, token.NAME): + return node + elif node.type == syms.vfpdef: + # These look like vfpdef< '(' x ')' > where x is NAME + # or another vfpdef instance (leading to recursion). + while node.type == syms.vfpdef: + node = node.children[1] + return node + raise RuntimeError("Received unexpected node %s" % node) + +def find_params(node): + if node.type == syms.vfpdef: + return find_params(node.children[1]) + elif node.type == token.NAME: + return node.value + return [find_params(c) for c in node.children if c.type != token.COMMA] + +def map_to_index(param_list, prefix=[], d=None): + if d is None: + d = {} + for i, obj in enumerate(param_list): + trailer = [Subscript(Number(str(i)))] + if isinstance(obj, list): + map_to_index(obj, trailer, d=d) + else: + d[obj] = prefix + trailer + return d + +def tuple_name(param_list): + l = [] + for obj in param_list: + if isinstance(obj, list): + l.append(tuple_name(obj)) + else: + l.append(obj) + return "_".join(l) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_types.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_types.py new file mode 100644 index 0000000000000000000000000000000000000000..67bf51f2f5b85a6a2f6a4c6427a5d9893f0c4350 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_types.py @@ -0,0 +1,61 @@ +# Copyright 2007 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer for removing uses of the types module. + +These work for only the known names in the types module. The forms above +can include types. or not. ie, It is assumed the module is imported either as: + + import types + from types import ... # either * or specific types + +The import statements are not modified. + +There should be another fixer that handles at least the following constants: + + type([]) -> list + type(()) -> tuple + type('') -> str + +""" + +# Local imports +from .. import fixer_base +from ..fixer_util import Name + +_TYPE_MAPPING = { + 'BooleanType' : 'bool', + 'BufferType' : 'memoryview', + 'ClassType' : 'type', + 'ComplexType' : 'complex', + 'DictType': 'dict', + 'DictionaryType' : 'dict', + 'EllipsisType' : 'type(Ellipsis)', + #'FileType' : 'io.IOBase', + 'FloatType': 'float', + 'IntType': 'int', + 'ListType': 'list', + 'LongType': 'int', + 'ObjectType' : 'object', + 'NoneType': 'type(None)', + 'NotImplementedType' : 'type(NotImplemented)', + 'SliceType' : 'slice', + 'StringType': 'bytes', # XXX ? + 'StringTypes' : '(str,)', # XXX ? + 'TupleType': 'tuple', + 'TypeType' : 'type', + 'UnicodeType': 'str', + 'XRangeType' : 'range', + } + +_pats = ["power< 'types' trailer< '.' name='%s' > >" % t for t in _TYPE_MAPPING] + +class FixTypes(fixer_base.BaseFix): + BM_compatible = True + PATTERN = '|'.join(_pats) + + def transform(self, node, results): + new_value = _TYPE_MAPPING.get(results["name"].value) + if new_value: + return Name(new_value, prefix=node.prefix) + return None diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_unicode.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_unicode.py new file mode 100644 index 0000000000000000000000000000000000000000..c7982c2b97c3e1cacf5812a9ddd9d20fdda66496 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_unicode.py @@ -0,0 +1,42 @@ +r"""Fixer for unicode. + +* Changes unicode to str and unichr to chr. + +* If "...\u..." is not unicode literal change it into "...\\u...". + +* Change u"..." into "...". + +""" + +from ..pgen2 import token +from .. import fixer_base + +_mapping = {"unichr" : "chr", "unicode" : "str"} + +class FixUnicode(fixer_base.BaseFix): + BM_compatible = True + PATTERN = "STRING | 'unicode' | 'unichr'" + + def start_tree(self, tree, filename): + super(FixUnicode, self).start_tree(tree, filename) + self.unicode_literals = 'unicode_literals' in tree.future_features + + def transform(self, node, results): + if node.type == token.NAME: + new = node.clone() + new.value = _mapping[node.value] + return new + elif node.type == token.STRING: + val = node.value + if not self.unicode_literals and val[0] in '\'"' and '\\' in val: + val = r'\\'.join([ + v.replace('\\u', r'\\u').replace('\\U', r'\\U') + for v in val.split(r'\\') + ]) + if val[0] in 'uU': + val = val[1:] + if val == node.value: + return node + new = node.clone() + new.value = val + return new diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_urllib.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_urllib.py new file mode 100644 index 0000000000000000000000000000000000000000..ab892bc52494c25bf5b46f92ca862965b4d99e5c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_urllib.py @@ -0,0 +1,196 @@ +"""Fix changes imports of urllib which are now incompatible. + This is rather similar to fix_imports, but because of the more + complex nature of the fixing for urllib, it has its own fixer. +""" +# Author: Nick Edds + +# Local imports +from lib2to3.fixes.fix_imports import alternates, FixImports +from lib2to3.fixer_util import (Name, Comma, FromImport, Newline, + find_indentation, Node, syms) + +MAPPING = {"urllib": [ + ("urllib.request", + ["URLopener", "FancyURLopener", "urlretrieve", + "_urlopener", "urlopen", "urlcleanup", + "pathname2url", "url2pathname", "getproxies"]), + ("urllib.parse", + ["quote", "quote_plus", "unquote", "unquote_plus", + "urlencode", "splitattr", "splithost", "splitnport", + "splitpasswd", "splitport", "splitquery", "splittag", + "splittype", "splituser", "splitvalue", ]), + ("urllib.error", + ["ContentTooShortError"])], + "urllib2" : [ + ("urllib.request", + ["urlopen", "install_opener", "build_opener", + "Request", "OpenerDirector", "BaseHandler", + "HTTPDefaultErrorHandler", "HTTPRedirectHandler", + "HTTPCookieProcessor", "ProxyHandler", + "HTTPPasswordMgr", + "HTTPPasswordMgrWithDefaultRealm", + "AbstractBasicAuthHandler", + "HTTPBasicAuthHandler", "ProxyBasicAuthHandler", + "AbstractDigestAuthHandler", + "HTTPDigestAuthHandler", "ProxyDigestAuthHandler", + "HTTPHandler", "HTTPSHandler", "FileHandler", + "FTPHandler", "CacheFTPHandler", + "UnknownHandler"]), + ("urllib.error", + ["URLError", "HTTPError"]), + ] +} + +# Duplicate the url parsing functions for urllib2. +MAPPING["urllib2"].append(MAPPING["urllib"][1]) + + +def build_pattern(): + bare = set() + for old_module, changes in MAPPING.items(): + for change in changes: + new_module, members = change + members = alternates(members) + yield """import_name< 'import' (module=%r + | dotted_as_names< any* module=%r any* >) > + """ % (old_module, old_module) + yield """import_from< 'from' mod_member=%r 'import' + ( member=%s | import_as_name< member=%s 'as' any > | + import_as_names< members=any* >) > + """ % (old_module, members, members) + yield """import_from< 'from' module_star=%r 'import' star='*' > + """ % old_module + yield """import_name< 'import' + dotted_as_name< module_as=%r 'as' any > > + """ % old_module + # bare_with_attr has a special significance for FixImports.match(). + yield """power< bare_with_attr=%r trailer< '.' member=%s > any* > + """ % (old_module, members) + + +class FixUrllib(FixImports): + + def build_pattern(self): + return "|".join(build_pattern()) + + def transform_import(self, node, results): + """Transform for the basic import case. Replaces the old + import name with a comma separated list of its + replacements. + """ + import_mod = results.get("module") + pref = import_mod.prefix + + names = [] + + # create a Node list of the replacement modules + for name in MAPPING[import_mod.value][:-1]: + names.extend([Name(name[0], prefix=pref), Comma()]) + names.append(Name(MAPPING[import_mod.value][-1][0], prefix=pref)) + import_mod.replace(names) + + def transform_member(self, node, results): + """Transform for imports of specific module elements. Replaces + the module to be imported from with the appropriate new + module. + """ + mod_member = results.get("mod_member") + pref = mod_member.prefix + member = results.get("member") + + # Simple case with only a single member being imported + if member: + # this may be a list of length one, or just a node + if isinstance(member, list): + member = member[0] + new_name = None + for change in MAPPING[mod_member.value]: + if member.value in change[1]: + new_name = change[0] + break + if new_name: + mod_member.replace(Name(new_name, prefix=pref)) + else: + self.cannot_convert(node, "This is an invalid module element") + + # Multiple members being imported + else: + # a dictionary for replacements, order matters + modules = [] + mod_dict = {} + members = results["members"] + for member in members: + # we only care about the actual members + if member.type == syms.import_as_name: + as_name = member.children[2].value + member_name = member.children[0].value + else: + member_name = member.value + as_name = None + if member_name != ",": + for change in MAPPING[mod_member.value]: + if member_name in change[1]: + if change[0] not in mod_dict: + modules.append(change[0]) + mod_dict.setdefault(change[0], []).append(member) + + new_nodes = [] + indentation = find_indentation(node) + first = True + def handle_name(name, prefix): + if name.type == syms.import_as_name: + kids = [Name(name.children[0].value, prefix=prefix), + name.children[1].clone(), + name.children[2].clone()] + return [Node(syms.import_as_name, kids)] + return [Name(name.value, prefix=prefix)] + for module in modules: + elts = mod_dict[module] + names = [] + for elt in elts[:-1]: + names.extend(handle_name(elt, pref)) + names.append(Comma()) + names.extend(handle_name(elts[-1], pref)) + new = FromImport(module, names) + if not first or node.parent.prefix.endswith(indentation): + new.prefix = indentation + new_nodes.append(new) + first = False + if new_nodes: + nodes = [] + for new_node in new_nodes[:-1]: + nodes.extend([new_node, Newline()]) + nodes.append(new_nodes[-1]) + node.replace(nodes) + else: + self.cannot_convert(node, "All module elements are invalid") + + def transform_dot(self, node, results): + """Transform for calls to module members in code.""" + module_dot = results.get("bare_with_attr") + member = results.get("member") + new_name = None + if isinstance(member, list): + member = member[0] + for change in MAPPING[module_dot.value]: + if member.value in change[1]: + new_name = change[0] + break + if new_name: + module_dot.replace(Name(new_name, + prefix=module_dot.prefix)) + else: + self.cannot_convert(node, "This is an invalid module element") + + def transform(self, node, results): + if results.get("module"): + self.transform_import(node, results) + elif results.get("mod_member"): + self.transform_member(node, results) + elif results.get("bare_with_attr"): + self.transform_dot(node, results) + # Renaming and star imports are not supported for these modules. + elif results.get("module_star"): + self.cannot_convert(node, "Cannot handle star imports.") + elif results.get("module_as"): + self.cannot_convert(node, "This module is now multiple modules") diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_ws_comma.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_ws_comma.py new file mode 100644 index 0000000000000000000000000000000000000000..a54a376c472afbff3f23f011d329af24813e5760 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_ws_comma.py @@ -0,0 +1,39 @@ +"""Fixer that changes 'a ,b' into 'a, b'. + +This also changes '{a :b}' into '{a: b}', but does not touch other +uses of colons. It does not touch other uses of whitespace. + +""" + +from .. import pytree +from ..pgen2 import token +from .. import fixer_base + +class FixWsComma(fixer_base.BaseFix): + + explicit = True # The user must ask for this fixers + + PATTERN = """ + any<(not(',') any)+ ',' ((not(',') any)+ ',')* [not(',') any]> + """ + + COMMA = pytree.Leaf(token.COMMA, ",") + COLON = pytree.Leaf(token.COLON, ":") + SEPS = (COMMA, COLON) + + def transform(self, node, results): + new = node.clone() + comma = False + for child in new.children: + if child in self.SEPS: + prefix = child.prefix + if prefix.isspace() and "\n" not in prefix: + child.prefix = "" + comma = True + else: + if comma: + prefix = child.prefix + if not prefix: + child.prefix = " " + comma = False + return new diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_xrange.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_xrange.py new file mode 100644 index 0000000000000000000000000000000000000000..1e491e166a3f1c4223d306b9ad5817bc31fab2ee --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_xrange.py @@ -0,0 +1,73 @@ +# Copyright 2007 Google, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Fixer that changes xrange(...) into range(...).""" + +# Local imports +from .. import fixer_base +from ..fixer_util import Name, Call, consuming_calls +from .. import patcomp + + +class FixXrange(fixer_base.BaseFix): + BM_compatible = True + PATTERN = """ + power< + (name='range'|name='xrange') trailer< '(' args=any ')' > + rest=any* > + """ + + def start_tree(self, tree, filename): + super(FixXrange, self).start_tree(tree, filename) + self.transformed_xranges = set() + + def finish_tree(self, tree, filename): + self.transformed_xranges = None + + def transform(self, node, results): + name = results["name"] + if name.value == "xrange": + return self.transform_xrange(node, results) + elif name.value == "range": + return self.transform_range(node, results) + else: + raise ValueError(repr(name)) + + def transform_xrange(self, node, results): + name = results["name"] + name.replace(Name("range", prefix=name.prefix)) + # This prevents the new range call from being wrapped in a list later. + self.transformed_xranges.add(id(node)) + + def transform_range(self, node, results): + if (id(node) not in self.transformed_xranges and + not self.in_special_context(node)): + range_call = Call(Name("range"), [results["args"].clone()]) + # Encase the range call in list(). + list_call = Call(Name("list"), [range_call], + prefix=node.prefix) + # Put things that were after the range() call after the list call. + for n in results["rest"]: + list_call.append_child(n) + return list_call + + P1 = "power< func=NAME trailer< '(' node=any ')' > any* >" + p1 = patcomp.compile_pattern(P1) + + P2 = """for_stmt< 'for' any 'in' node=any ':' any* > + | comp_for< 'for' any 'in' node=any any* > + | comparison< any 'in' node=any any*> + """ + p2 = patcomp.compile_pattern(P2) + + def in_special_context(self, node): + if node.parent is None: + return False + results = {} + if (node.parent.parent is not None and + self.p1.match(node.parent.parent, results) and + results["node"] is node): + # list(d.keys()) -> list(d.keys()), etc. + return results["func"].value in consuming_calls + # for ... in d.iterkeys() -> for ... in d.keys(), etc. + return self.p2.match(node.parent, results) and results["node"] is node diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_xreadlines.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_xreadlines.py new file mode 100644 index 0000000000000000000000000000000000000000..3e3f71ab045573d9438bcbe5da6115b77dc3d7e9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_xreadlines.py @@ -0,0 +1,25 @@ +"""Fix "for x in f.xreadlines()" -> "for x in f". + +This fixer will also convert g(f.xreadlines) into g(f.__iter__).""" +# Author: Collin Winter + +# Local imports +from .. import fixer_base +from ..fixer_util import Name + + +class FixXreadlines(fixer_base.BaseFix): + BM_compatible = True + PATTERN = """ + power< call=any+ trailer< '.' 'xreadlines' > trailer< '(' ')' > > + | + power< any+ trailer< '.' no_call='xreadlines' > > + """ + + def transform(self, node, results): + no_call = results.get("no_call") + + if no_call: + no_call.replace(Name("__iter__", prefix=no_call.prefix)) + else: + node.replace([x.clone() for x in results["call"]]) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_zip.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_zip.py new file mode 100644 index 0000000000000000000000000000000000000000..52c28df6aab411ad1ea64af74b14edf35e80b5bb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/fixes/fix_zip.py @@ -0,0 +1,46 @@ +""" +Fixer that changes zip(seq0, seq1, ...) into list(zip(seq0, seq1, ...) +unless there exists a 'from future_builtins import zip' statement in the +top-level namespace. + +We avoid the transformation if the zip() call is directly contained in +iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:. +""" + +# Local imports +from .. import fixer_base +from ..pytree import Node +from ..pygram import python_symbols as syms +from ..fixer_util import Name, ArgList, in_special_context + + +class FixZip(fixer_base.ConditionalFix): + + BM_compatible = True + PATTERN = """ + power< 'zip' args=trailer< '(' [any] ')' > [trailers=trailer*] + > + """ + + skip_on = "future_builtins.zip" + + def transform(self, node, results): + if self.should_skip(node): + return + + if in_special_context(node): + return None + + args = results['args'].clone() + args.prefix = "" + + trailers = [] + if 'trailers' in results: + trailers = [n.clone() for n in results['trailers']] + for n in trailers: + n.prefix = "" + + new = Node(syms.power, [Name("zip"), args], prefix="") + new = Node(syms.power, [Name("list"), ArgList([new])] + trailers) + new.prefix = node.prefix + return new diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..af390484528d87bfb78377b228b47480d2284ea5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""The pgen2 package.""" diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b5fe75e2075c25da96c2e2234e097065bba0b17f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/conv.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/conv.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b2bc50af7b793336ed7970abb1cdbd3d4ffa1ecc Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/conv.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/driver.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/driver.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b6ba9d259ed1bece0d51f1c5fa43a1dd618039d1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/driver.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/grammar.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/grammar.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0dc193f55d42be6618193c43d55f3813e1053449 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/grammar.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/literals.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/literals.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7c7074f818e5be48a658e9ed9d330ba3fcc00dd0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/literals.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/parse.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/parse.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..471811dde8a87c0d34fa6691f6a3985b0f3f6457 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/parse.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/pgen.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/pgen.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..63b6a8277bbb9cc328eef27868835df32bc8cca8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/pgen.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/token.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/token.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..be0a2f08ee0f56347271eeb0bbb70cc4174c00c2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/token.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/tokenize.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/tokenize.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..75d01645775126498bdbcb8e6a79481b39007b76 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/__pycache__/tokenize.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/conv.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/conv.py new file mode 100644 index 0000000000000000000000000000000000000000..ed0cac532e424952b460788a1d6f54d279627af6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/conv.py @@ -0,0 +1,257 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Convert graminit.[ch] spit out by pgen to Python code. + +Pgen is the Python parser generator. It is useful to quickly create a +parser from a grammar file in Python's grammar notation. But I don't +want my parsers to be written in C (yet), so I'm translating the +parsing tables to Python data structures and writing a Python parse +engine. + +Note that the token numbers are constants determined by the standard +Python tokenizer. The standard token module defines these numbers and +their names (the names are not used much). The token numbers are +hardcoded into the Python tokenizer and into pgen. A Python +implementation of the Python tokenizer is also available, in the +standard tokenize module. + +On the other hand, symbol numbers (representing the grammar's +non-terminals) are assigned by pgen based on the actual grammar +input. + +Note: this module is pretty much obsolete; the pgen module generates +equivalent grammar tables directly from the Grammar.txt input file +without having to invoke the Python pgen C program. + +""" + +# Python imports +import re + +# Local imports +from pgen2 import grammar, token + + +class Converter(grammar.Grammar): + """Grammar subclass that reads classic pgen output files. + + The run() method reads the tables as produced by the pgen parser + generator, typically contained in two C files, graminit.h and + graminit.c. The other methods are for internal use only. + + See the base class for more documentation. + + """ + + def run(self, graminit_h, graminit_c): + """Load the grammar tables from the text files written by pgen.""" + self.parse_graminit_h(graminit_h) + self.parse_graminit_c(graminit_c) + self.finish_off() + + def parse_graminit_h(self, filename): + """Parse the .h file written by pgen. (Internal) + + This file is a sequence of #define statements defining the + nonterminals of the grammar as numbers. We build two tables + mapping the numbers to names and back. + + """ + try: + f = open(filename) + except OSError as err: + print("Can't open %s: %s" % (filename, err)) + return False + self.symbol2number = {} + self.number2symbol = {} + lineno = 0 + for line in f: + lineno += 1 + mo = re.match(r"^#define\s+(\w+)\s+(\d+)$", line) + if not mo and line.strip(): + print("%s(%s): can't parse %s" % (filename, lineno, + line.strip())) + else: + symbol, number = mo.groups() + number = int(number) + assert symbol not in self.symbol2number + assert number not in self.number2symbol + self.symbol2number[symbol] = number + self.number2symbol[number] = symbol + return True + + def parse_graminit_c(self, filename): + """Parse the .c file written by pgen. (Internal) + + The file looks as follows. The first two lines are always this: + + #include "pgenheaders.h" + #include "grammar.h" + + After that come four blocks: + + 1) one or more state definitions + 2) a table defining dfas + 3) a table defining labels + 4) a struct defining the grammar + + A state definition has the following form: + - one or more arc arrays, each of the form: + static arc arcs__[] = { + {, }, + ... + }; + - followed by a state array, of the form: + static state states_[] = { + {, arcs__}, + ... + }; + + """ + try: + f = open(filename) + except OSError as err: + print("Can't open %s: %s" % (filename, err)) + return False + # The code below essentially uses f's iterator-ness! + lineno = 0 + + # Expect the two #include lines + lineno, line = lineno+1, next(f) + assert line == '#include "pgenheaders.h"\n', (lineno, line) + lineno, line = lineno+1, next(f) + assert line == '#include "grammar.h"\n', (lineno, line) + + # Parse the state definitions + lineno, line = lineno+1, next(f) + allarcs = {} + states = [] + while line.startswith("static arc "): + while line.startswith("static arc "): + mo = re.match(r"static arc arcs_(\d+)_(\d+)\[(\d+)\] = {$", + line) + assert mo, (lineno, line) + n, m, k = list(map(int, mo.groups())) + arcs = [] + for _ in range(k): + lineno, line = lineno+1, next(f) + mo = re.match(r"\s+{(\d+), (\d+)},$", line) + assert mo, (lineno, line) + i, j = list(map(int, mo.groups())) + arcs.append((i, j)) + lineno, line = lineno+1, next(f) + assert line == "};\n", (lineno, line) + allarcs[(n, m)] = arcs + lineno, line = lineno+1, next(f) + mo = re.match(r"static state states_(\d+)\[(\d+)\] = {$", line) + assert mo, (lineno, line) + s, t = list(map(int, mo.groups())) + assert s == len(states), (lineno, line) + state = [] + for _ in range(t): + lineno, line = lineno+1, next(f) + mo = re.match(r"\s+{(\d+), arcs_(\d+)_(\d+)},$", line) + assert mo, (lineno, line) + k, n, m = list(map(int, mo.groups())) + arcs = allarcs[n, m] + assert k == len(arcs), (lineno, line) + state.append(arcs) + states.append(state) + lineno, line = lineno+1, next(f) + assert line == "};\n", (lineno, line) + lineno, line = lineno+1, next(f) + self.states = states + + # Parse the dfas + dfas = {} + mo = re.match(r"static dfa dfas\[(\d+)\] = {$", line) + assert mo, (lineno, line) + ndfas = int(mo.group(1)) + for i in range(ndfas): + lineno, line = lineno+1, next(f) + mo = re.match(r'\s+{(\d+), "(\w+)", (\d+), (\d+), states_(\d+),$', + line) + assert mo, (lineno, line) + symbol = mo.group(2) + number, x, y, z = list(map(int, mo.group(1, 3, 4, 5))) + assert self.symbol2number[symbol] == number, (lineno, line) + assert self.number2symbol[number] == symbol, (lineno, line) + assert x == 0, (lineno, line) + state = states[z] + assert y == len(state), (lineno, line) + lineno, line = lineno+1, next(f) + mo = re.match(r'\s+("(?:\\\d\d\d)*")},$', line) + assert mo, (lineno, line) + first = {} + rawbitset = eval(mo.group(1)) + for i, c in enumerate(rawbitset): + byte = ord(c) + for j in range(8): + if byte & (1<= os.path.getmtime(b) + + +def load_packaged_grammar(package, grammar_source): + """Normally, loads a pickled grammar by doing + pkgutil.get_data(package, pickled_grammar) + where *pickled_grammar* is computed from *grammar_source* by adding the + Python version and using a ``.pickle`` extension. + + However, if *grammar_source* is an extant file, load_grammar(grammar_source) + is called instead. This facilitates using a packaged grammar file when needed + but preserves load_grammar's automatic regeneration behavior when possible. + + """ + if os.path.isfile(grammar_source): + return load_grammar(grammar_source) + pickled_name = _generate_pickle_name(os.path.basename(grammar_source)) + data = pkgutil.get_data(package, pickled_name) + g = grammar.Grammar() + g.loads(data) + return g + + +def main(*args): + """Main program, when run as a script: produce grammar pickle files. + + Calls load_grammar for each argument, a path to a grammar text file. + """ + if not args: + args = sys.argv[1:] + logging.basicConfig(level=logging.INFO, stream=sys.stdout, + format='%(message)s') + for gt in args: + load_grammar(gt, save=True, force=True) + return True + +if __name__ == "__main__": + sys.exit(int(not main())) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/grammar.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/grammar.py new file mode 100644 index 0000000000000000000000000000000000000000..5d550aeb65e8dd10bb286267a7132ae380bbd038 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/grammar.py @@ -0,0 +1,189 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""This module defines the data structures used to represent a grammar. + +These are a bit arcane because they are derived from the data +structures used by Python's 'pgen' parser generator. + +There's also a table here mapping operators to their names in the +token module; the Python tokenize module reports all operators as the +fallback token code OP, but the parser needs the actual token code. + +""" + +# Python imports +import pickle + +# Local imports +from . import token + + +class Grammar(object): + """Pgen parsing tables conversion class. + + Once initialized, this class supplies the grammar tables for the + parsing engine implemented by parse.py. The parsing engine + accesses the instance variables directly. The class here does not + provide initialization of the tables; several subclasses exist to + do this (see the conv and pgen modules). + + The load() method reads the tables from a pickle file, which is + much faster than the other ways offered by subclasses. The pickle + file is written by calling dump() (after loading the grammar + tables using a subclass). The report() method prints a readable + representation of the tables to stdout, for debugging. + + The instance variables are as follows: + + symbol2number -- a dict mapping symbol names to numbers. Symbol + numbers are always 256 or higher, to distinguish + them from token numbers, which are between 0 and + 255 (inclusive). + + number2symbol -- a dict mapping numbers to symbol names; + these two are each other's inverse. + + states -- a list of DFAs, where each DFA is a list of + states, each state is a list of arcs, and each + arc is a (i, j) pair where i is a label and j is + a state number. The DFA number is the index into + this list. (This name is slightly confusing.) + Final states are represented by a special arc of + the form (0, j) where j is its own state number. + + dfas -- a dict mapping symbol numbers to (DFA, first) + pairs, where DFA is an item from the states list + above, and first is a set of tokens that can + begin this grammar rule (represented by a dict + whose values are always 1). + + labels -- a list of (x, y) pairs where x is either a token + number or a symbol number, and y is either None + or a string; the strings are keywords. The label + number is the index in this list; label numbers + are used to mark state transitions (arcs) in the + DFAs. + + start -- the number of the grammar's start symbol. + + keywords -- a dict mapping keyword strings to arc labels. + + tokens -- a dict mapping token numbers to arc labels. + + """ + + def __init__(self): + self.symbol2number = {} + self.number2symbol = {} + self.states = [] + self.dfas = {} + self.labels = [(0, "EMPTY")] + self.keywords = {} + self.tokens = {} + self.symbol2label = {} + self.start = 256 + + def dump(self, filename): + """Dump the grammar tables to a pickle file.""" + with open(filename, "wb") as f: + pickle.dump(self.__dict__, f, pickle.HIGHEST_PROTOCOL) + + def load(self, filename): + """Load the grammar tables from a pickle file.""" + with open(filename, "rb") as f: + d = pickle.load(f) + self.__dict__.update(d) + + def loads(self, pkl): + """Load the grammar tables from a pickle bytes object.""" + self.__dict__.update(pickle.loads(pkl)) + + def copy(self): + """ + Copy the grammar. + """ + new = self.__class__() + for dict_attr in ("symbol2number", "number2symbol", "dfas", "keywords", + "tokens", "symbol2label"): + setattr(new, dict_attr, getattr(self, dict_attr).copy()) + new.labels = self.labels[:] + new.states = self.states[:] + new.start = self.start + return new + + def report(self): + """Dump the grammar tables to standard output, for debugging.""" + from pprint import pprint + print("s2n") + pprint(self.symbol2number) + print("n2s") + pprint(self.number2symbol) + print("states") + pprint(self.states) + print("dfas") + pprint(self.dfas) + print("labels") + pprint(self.labels) + print("start", self.start) + + +# Map from operator to number (since tokenize doesn't do this) + +opmap_raw = """ +( LPAR +) RPAR +[ LSQB +] RSQB +: COLON +, COMMA +; SEMI ++ PLUS +- MINUS +* STAR +/ SLASH +| VBAR +& AMPER +< LESS +> GREATER += EQUAL +. DOT +% PERCENT +` BACKQUOTE +{ LBRACE +} RBRACE +@ AT +@= ATEQUAL +== EQEQUAL +!= NOTEQUAL +<> NOTEQUAL +<= LESSEQUAL +>= GREATEREQUAL +~ TILDE +^ CIRCUMFLEX +<< LEFTSHIFT +>> RIGHTSHIFT +** DOUBLESTAR ++= PLUSEQUAL +-= MINEQUAL +*= STAREQUAL +/= SLASHEQUAL +%= PERCENTEQUAL +&= AMPEREQUAL +|= VBAREQUAL +^= CIRCUMFLEXEQUAL +<<= LEFTSHIFTEQUAL +>>= RIGHTSHIFTEQUAL +**= DOUBLESTAREQUAL +// DOUBLESLASH +//= DOUBLESLASHEQUAL +-> RARROW +:= COLONEQUAL +""" + +opmap = {} +for line in opmap_raw.splitlines(): + if line: + op, name = line.split() + opmap[op] = getattr(token, name) +del line, op, name diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/literals.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/literals.py new file mode 100644 index 0000000000000000000000000000000000000000..b9b63e6e5572c1bc35526c6126db2b31b798d270 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/literals.py @@ -0,0 +1,60 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Safely evaluate Python string literals without using eval().""" + +import re + +simple_escapes = {"a": "\a", + "b": "\b", + "f": "\f", + "n": "\n", + "r": "\r", + "t": "\t", + "v": "\v", + "'": "'", + '"': '"', + "\\": "\\"} + +def escape(m): + all, tail = m.group(0, 1) + assert all.startswith("\\") + esc = simple_escapes.get(tail) + if esc is not None: + return esc + if tail.startswith("x"): + hexes = tail[1:] + if len(hexes) < 2: + raise ValueError("invalid hex string escape ('\\%s')" % tail) + try: + i = int(hexes, 16) + except ValueError: + raise ValueError("invalid hex string escape ('\\%s')" % tail) from None + else: + try: + i = int(tail, 8) + except ValueError: + raise ValueError("invalid octal string escape ('\\%s')" % tail) from None + return chr(i) + +def evalString(s): + assert s.startswith("'") or s.startswith('"'), repr(s[:1]) + q = s[0] + if s[:3] == q*3: + q = q*3 + assert s.endswith(q), repr(s[-len(q):]) + assert len(s) >= 2*len(q) + s = s[len(q):-len(q)] + return re.sub(r"\\(\'|\"|\\|[abfnrtv]|x.{0,2}|[0-7]{1,3})", escape, s) + +def test(): + for i in range(256): + c = chr(i) + s = repr(c) + e = evalString(s) + if e != c: + print(i, c, s, e) + + +if __name__ == "__main__": + test() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/parse.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/parse.py new file mode 100644 index 0000000000000000000000000000000000000000..cf3fcf7e99fd11d55fa5567801632f73629ba58c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/parse.py @@ -0,0 +1,204 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Parser engine for the grammar tables generated by pgen. + +The grammar table must be loaded first. + +See Parser/parser.c in the Python distribution for additional info on +how this parsing engine works. + +""" + +# Local imports +from . import token + +class ParseError(Exception): + """Exception to signal the parser is stuck.""" + + def __init__(self, msg, type, value, context): + Exception.__init__(self, "%s: type=%r, value=%r, context=%r" % + (msg, type, value, context)) + self.msg = msg + self.type = type + self.value = value + self.context = context + + def __reduce__(self): + return type(self), (self.msg, self.type, self.value, self.context) + +class Parser(object): + """Parser engine. + + The proper usage sequence is: + + p = Parser(grammar, [converter]) # create instance + p.setup([start]) # prepare for parsing + : + if p.addtoken(...): # parse a token; may raise ParseError + break + root = p.rootnode # root of abstract syntax tree + + A Parser instance may be reused by calling setup() repeatedly. + + A Parser instance contains state pertaining to the current token + sequence, and should not be used concurrently by different threads + to parse separate token sequences. + + See driver.py for how to get input tokens by tokenizing a file or + string. + + Parsing is complete when addtoken() returns True; the root of the + abstract syntax tree can then be retrieved from the rootnode + instance variable. When a syntax error occurs, addtoken() raises + the ParseError exception. There is no error recovery; the parser + cannot be used after a syntax error was reported (but it can be + reinitialized by calling setup()). + + """ + + def __init__(self, grammar, convert=None): + """Constructor. + + The grammar argument is a grammar.Grammar instance; see the + grammar module for more information. + + The parser is not ready yet for parsing; you must call the + setup() method to get it started. + + The optional convert argument is a function mapping concrete + syntax tree nodes to abstract syntax tree nodes. If not + given, no conversion is done and the syntax tree produced is + the concrete syntax tree. If given, it must be a function of + two arguments, the first being the grammar (a grammar.Grammar + instance), and the second being the concrete syntax tree node + to be converted. The syntax tree is converted from the bottom + up. + + A concrete syntax tree node is a (type, value, context, nodes) + tuple, where type is the node type (a token or symbol number), + value is None for symbols and a string for tokens, context is + None or an opaque value used for error reporting (typically a + (lineno, offset) pair), and nodes is a list of children for + symbols, and None for tokens. + + An abstract syntax tree node may be anything; this is entirely + up to the converter function. + + """ + self.grammar = grammar + self.convert = convert or (lambda grammar, node: node) + + def setup(self, start=None): + """Prepare for parsing. + + This *must* be called before starting to parse. + + The optional argument is an alternative start symbol; it + defaults to the grammar's start symbol. + + You can use a Parser instance to parse any number of programs; + each time you call setup() the parser is reset to an initial + state determined by the (implicit or explicit) start symbol. + + """ + if start is None: + start = self.grammar.start + # Each stack entry is a tuple: (dfa, state, node). + # A node is a tuple: (type, value, context, children), + # where children is a list of nodes or None, and context may be None. + newnode = (start, None, None, []) + stackentry = (self.grammar.dfas[start], 0, newnode) + self.stack = [stackentry] + self.rootnode = None + self.used_names = set() # Aliased to self.rootnode.used_names in pop() + + def addtoken(self, type, value, context): + """Add a token; return True iff this is the end of the program.""" + # Map from token to label + ilabel = self.classify(type, value, context) + # Loop until the token is shifted; may raise exceptions + while True: + dfa, state, node = self.stack[-1] + states, first = dfa + arcs = states[state] + # Look for a state with this label + for i, newstate in arcs: + t, v = self.grammar.labels[i] + if ilabel == i: + # Look it up in the list of labels + assert t < 256 + # Shift a token; we're done with it + self.shift(type, value, newstate, context) + # Pop while we are in an accept-only state + state = newstate + while states[state] == [(0, state)]: + self.pop() + if not self.stack: + # Done parsing! + return True + dfa, state, node = self.stack[-1] + states, first = dfa + # Done with this token + return False + elif t >= 256: + # See if it's a symbol and if we're in its first set + itsdfa = self.grammar.dfas[t] + itsstates, itsfirst = itsdfa + if ilabel in itsfirst: + # Push a symbol + self.push(t, self.grammar.dfas[t], newstate, context) + break # To continue the outer while loop + else: + if (0, state) in arcs: + # An accepting state, pop it and try something else + self.pop() + if not self.stack: + # Done parsing, but another token is input + raise ParseError("too much input", + type, value, context) + else: + # No success finding a transition + raise ParseError("bad input", type, value, context) + + def classify(self, type, value, context): + """Turn a token into a label. (Internal)""" + if type == token.NAME: + # Keep a listing of all used names + self.used_names.add(value) + # Check for reserved words + ilabel = self.grammar.keywords.get(value) + if ilabel is not None: + return ilabel + ilabel = self.grammar.tokens.get(type) + if ilabel is None: + raise ParseError("bad token", type, value, context) + return ilabel + + def shift(self, type, value, newstate, context): + """Shift a token. (Internal)""" + dfa, state, node = self.stack[-1] + newnode = (type, value, context, None) + newnode = self.convert(self.grammar, newnode) + if newnode is not None: + node[-1].append(newnode) + self.stack[-1] = (dfa, newstate, node) + + def push(self, type, newdfa, newstate, context): + """Push a nonterminal. (Internal)""" + dfa, state, node = self.stack[-1] + newnode = (type, None, context, []) + self.stack[-1] = (dfa, newstate, node) + self.stack.append((newdfa, 0, newnode)) + + def pop(self): + """Pop a nonterminal. (Internal)""" + popdfa, popstate, popnode = self.stack.pop() + newnode = self.convert(self.grammar, popnode) + if newnode is not None: + if self.stack: + dfa, state, node = self.stack[-1] + node[-1].append(newnode) + else: + self.rootnode = newnode + self.rootnode.used_names = self.used_names diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/pgen.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/pgen.py new file mode 100644 index 0000000000000000000000000000000000000000..7abd5cef1c36bb90f340fa6d308672537292ef1f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/pgen.py @@ -0,0 +1,386 @@ +# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +# Pgen imports +from . import grammar, token, tokenize + +class PgenGrammar(grammar.Grammar): + pass + +class ParserGenerator(object): + + def __init__(self, filename, stream=None): + close_stream = None + if stream is None: + stream = open(filename, encoding="utf-8") + close_stream = stream.close + self.filename = filename + self.stream = stream + self.generator = tokenize.generate_tokens(stream.readline) + self.gettoken() # Initialize lookahead + self.dfas, self.startsymbol = self.parse() + if close_stream is not None: + close_stream() + self.first = {} # map from symbol name to set of tokens + self.addfirstsets() + + def make_grammar(self): + c = PgenGrammar() + names = list(self.dfas.keys()) + names.sort() + names.remove(self.startsymbol) + names.insert(0, self.startsymbol) + for name in names: + i = 256 + len(c.symbol2number) + c.symbol2number[name] = i + c.number2symbol[i] = name + for name in names: + dfa = self.dfas[name] + states = [] + for state in dfa: + arcs = [] + for label, next in sorted(state.arcs.items()): + arcs.append((self.make_label(c, label), dfa.index(next))) + if state.isfinal: + arcs.append((0, dfa.index(state))) + states.append(arcs) + c.states.append(states) + c.dfas[c.symbol2number[name]] = (states, self.make_first(c, name)) + c.start = c.symbol2number[self.startsymbol] + return c + + def make_first(self, c, name): + rawfirst = self.first[name] + first = {} + for label in sorted(rawfirst): + ilabel = self.make_label(c, label) + ##assert ilabel not in first # XXX failed on <> ... != + first[ilabel] = 1 + return first + + def make_label(self, c, label): + # XXX Maybe this should be a method on a subclass of converter? + ilabel = len(c.labels) + if label[0].isalpha(): + # Either a symbol name or a named token + if label in c.symbol2number: + # A symbol name (a non-terminal) + if label in c.symbol2label: + return c.symbol2label[label] + else: + c.labels.append((c.symbol2number[label], None)) + c.symbol2label[label] = ilabel + return ilabel + else: + # A named token (NAME, NUMBER, STRING) + itoken = getattr(token, label, None) + assert isinstance(itoken, int), label + assert itoken in token.tok_name, label + if itoken in c.tokens: + return c.tokens[itoken] + else: + c.labels.append((itoken, None)) + c.tokens[itoken] = ilabel + return ilabel + else: + # Either a keyword or an operator + assert label[0] in ('"', "'"), label + value = eval(label) + if value[0].isalpha(): + # A keyword + if value in c.keywords: + return c.keywords[value] + else: + c.labels.append((token.NAME, value)) + c.keywords[value] = ilabel + return ilabel + else: + # An operator (any non-numeric token) + itoken = grammar.opmap[value] # Fails if unknown token + if itoken in c.tokens: + return c.tokens[itoken] + else: + c.labels.append((itoken, None)) + c.tokens[itoken] = ilabel + return ilabel + + def addfirstsets(self): + names = list(self.dfas.keys()) + names.sort() + for name in names: + if name not in self.first: + self.calcfirst(name) + #print name, self.first[name].keys() + + def calcfirst(self, name): + dfa = self.dfas[name] + self.first[name] = None # dummy to detect left recursion + state = dfa[0] + totalset = {} + overlapcheck = {} + for label, next in state.arcs.items(): + if label in self.dfas: + if label in self.first: + fset = self.first[label] + if fset is None: + raise ValueError("recursion for rule %r" % name) + else: + self.calcfirst(label) + fset = self.first[label] + totalset.update(fset) + overlapcheck[label] = fset + else: + totalset[label] = 1 + overlapcheck[label] = {label: 1} + inverse = {} + for label, itsfirst in overlapcheck.items(): + for symbol in itsfirst: + if symbol in inverse: + raise ValueError("rule %s is ambiguous; %s is in the" + " first sets of %s as well as %s" % + (name, symbol, label, inverse[symbol])) + inverse[symbol] = label + self.first[name] = totalset + + def parse(self): + dfas = {} + startsymbol = None + # MSTART: (NEWLINE | RULE)* ENDMARKER + while self.type != token.ENDMARKER: + while self.type == token.NEWLINE: + self.gettoken() + # RULE: NAME ':' RHS NEWLINE + name = self.expect(token.NAME) + self.expect(token.OP, ":") + a, z = self.parse_rhs() + self.expect(token.NEWLINE) + #self.dump_nfa(name, a, z) + dfa = self.make_dfa(a, z) + #self.dump_dfa(name, dfa) + oldlen = len(dfa) + self.simplify_dfa(dfa) + newlen = len(dfa) + dfas[name] = dfa + #print name, oldlen, newlen + if startsymbol is None: + startsymbol = name + return dfas, startsymbol + + def make_dfa(self, start, finish): + # To turn an NFA into a DFA, we define the states of the DFA + # to correspond to *sets* of states of the NFA. Then do some + # state reduction. Let's represent sets as dicts with 1 for + # values. + assert isinstance(start, NFAState) + assert isinstance(finish, NFAState) + def closure(state): + base = {} + addclosure(state, base) + return base + def addclosure(state, base): + assert isinstance(state, NFAState) + if state in base: + return + base[state] = 1 + for label, next in state.arcs: + if label is None: + addclosure(next, base) + states = [DFAState(closure(start), finish)] + for state in states: # NB states grows while we're iterating + arcs = {} + for nfastate in state.nfaset: + for label, next in nfastate.arcs: + if label is not None: + addclosure(next, arcs.setdefault(label, {})) + for label, nfaset in sorted(arcs.items()): + for st in states: + if st.nfaset == nfaset: + break + else: + st = DFAState(nfaset, finish) + states.append(st) + state.addarc(st, label) + return states # List of DFAState instances; first one is start + + def dump_nfa(self, name, start, finish): + print("Dump of NFA for", name) + todo = [start] + for i, state in enumerate(todo): + print(" State", i, state is finish and "(final)" or "") + for label, next in state.arcs: + if next in todo: + j = todo.index(next) + else: + j = len(todo) + todo.append(next) + if label is None: + print(" -> %d" % j) + else: + print(" %s -> %d" % (label, j)) + + def dump_dfa(self, name, dfa): + print("Dump of DFA for", name) + for i, state in enumerate(dfa): + print(" State", i, state.isfinal and "(final)" or "") + for label, next in sorted(state.arcs.items()): + print(" %s -> %d" % (label, dfa.index(next))) + + def simplify_dfa(self, dfa): + # This is not theoretically optimal, but works well enough. + # Algorithm: repeatedly look for two states that have the same + # set of arcs (same labels pointing to the same nodes) and + # unify them, until things stop changing. + + # dfa is a list of DFAState instances + changes = True + while changes: + changes = False + for i, state_i in enumerate(dfa): + for j in range(i+1, len(dfa)): + state_j = dfa[j] + if state_i == state_j: + #print " unify", i, j + del dfa[j] + for state in dfa: + state.unifystate(state_j, state_i) + changes = True + break + + def parse_rhs(self): + # RHS: ALT ('|' ALT)* + a, z = self.parse_alt() + if self.value != "|": + return a, z + else: + aa = NFAState() + zz = NFAState() + aa.addarc(a) + z.addarc(zz) + while self.value == "|": + self.gettoken() + a, z = self.parse_alt() + aa.addarc(a) + z.addarc(zz) + return aa, zz + + def parse_alt(self): + # ALT: ITEM+ + a, b = self.parse_item() + while (self.value in ("(", "[") or + self.type in (token.NAME, token.STRING)): + c, d = self.parse_item() + b.addarc(c) + b = d + return a, b + + def parse_item(self): + # ITEM: '[' RHS ']' | ATOM ['+' | '*'] + if self.value == "[": + self.gettoken() + a, z = self.parse_rhs() + self.expect(token.OP, "]") + a.addarc(z) + return a, z + else: + a, z = self.parse_atom() + value = self.value + if value not in ("+", "*"): + return a, z + self.gettoken() + z.addarc(a) + if value == "+": + return a, z + else: + return a, a + + def parse_atom(self): + # ATOM: '(' RHS ')' | NAME | STRING + if self.value == "(": + self.gettoken() + a, z = self.parse_rhs() + self.expect(token.OP, ")") + return a, z + elif self.type in (token.NAME, token.STRING): + a = NFAState() + z = NFAState() + a.addarc(z, self.value) + self.gettoken() + return a, z + else: + self.raise_error("expected (...) or NAME or STRING, got %s/%s", + self.type, self.value) + + def expect(self, type, value=None): + if self.type != type or (value is not None and self.value != value): + self.raise_error("expected %s/%s, got %s/%s", + type, value, self.type, self.value) + value = self.value + self.gettoken() + return value + + def gettoken(self): + tup = next(self.generator) + while tup[0] in (tokenize.COMMENT, tokenize.NL): + tup = next(self.generator) + self.type, self.value, self.begin, self.end, self.line = tup + #print token.tok_name[self.type], repr(self.value) + + def raise_error(self, msg, *args): + if args: + try: + msg = msg % args + except: + msg = " ".join([msg] + list(map(str, args))) + raise SyntaxError(msg, (self.filename, self.end[0], + self.end[1], self.line)) + +class NFAState(object): + + def __init__(self): + self.arcs = [] # list of (label, NFAState) pairs + + def addarc(self, next, label=None): + assert label is None or isinstance(label, str) + assert isinstance(next, NFAState) + self.arcs.append((label, next)) + +class DFAState(object): + + def __init__(self, nfaset, final): + assert isinstance(nfaset, dict) + assert isinstance(next(iter(nfaset)), NFAState) + assert isinstance(final, NFAState) + self.nfaset = nfaset + self.isfinal = final in nfaset + self.arcs = {} # map from label to DFAState + + def addarc(self, next, label): + assert isinstance(label, str) + assert label not in self.arcs + assert isinstance(next, DFAState) + self.arcs[label] = next + + def unifystate(self, old, new): + for label, next in self.arcs.items(): + if next is old: + self.arcs[label] = new + + def __eq__(self, other): + # Equality test -- ignore the nfaset instance variable + assert isinstance(other, DFAState) + if self.isfinal != other.isfinal: + return False + # Can't just return self.arcs == other.arcs, because that + # would invoke this method recursively, with cycles... + if len(self.arcs) != len(other.arcs): + return False + for label, next in self.arcs.items(): + if next is not other.arcs.get(label): + return False + return True + + __hash__ = None # For Py3 compatibility. + +def generate_grammar(filename="Grammar.txt"): + p = ParserGenerator(filename) + return p.make_grammar() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/token.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/token.py new file mode 100644 index 0000000000000000000000000000000000000000..5f6612f5b30681dab79e4f71800850202c43a9aa --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/token.py @@ -0,0 +1,86 @@ +#! /usr/bin/env python3 + +"""Token constants (from "token.h").""" + +# Taken from Python (r53757) and modified to include some tokens +# originally monkeypatched in by pgen2.tokenize + +#--start constants-- +ENDMARKER = 0 +NAME = 1 +NUMBER = 2 +STRING = 3 +NEWLINE = 4 +INDENT = 5 +DEDENT = 6 +LPAR = 7 +RPAR = 8 +LSQB = 9 +RSQB = 10 +COLON = 11 +COMMA = 12 +SEMI = 13 +PLUS = 14 +MINUS = 15 +STAR = 16 +SLASH = 17 +VBAR = 18 +AMPER = 19 +LESS = 20 +GREATER = 21 +EQUAL = 22 +DOT = 23 +PERCENT = 24 +BACKQUOTE = 25 +LBRACE = 26 +RBRACE = 27 +EQEQUAL = 28 +NOTEQUAL = 29 +LESSEQUAL = 30 +GREATEREQUAL = 31 +TILDE = 32 +CIRCUMFLEX = 33 +LEFTSHIFT = 34 +RIGHTSHIFT = 35 +DOUBLESTAR = 36 +PLUSEQUAL = 37 +MINEQUAL = 38 +STAREQUAL = 39 +SLASHEQUAL = 40 +PERCENTEQUAL = 41 +AMPEREQUAL = 42 +VBAREQUAL = 43 +CIRCUMFLEXEQUAL = 44 +LEFTSHIFTEQUAL = 45 +RIGHTSHIFTEQUAL = 46 +DOUBLESTAREQUAL = 47 +DOUBLESLASH = 48 +DOUBLESLASHEQUAL = 49 +AT = 50 +ATEQUAL = 51 +OP = 52 +COMMENT = 53 +NL = 54 +RARROW = 55 +AWAIT = 56 +ASYNC = 57 +ERRORTOKEN = 58 +COLONEQUAL = 59 +N_TOKENS = 60 +NT_OFFSET = 256 +#--end constants-- + +tok_name = {} +for _name, _value in list(globals().items()): + if type(_value) is type(0): + tok_name[_value] = _name + + +def ISTERMINAL(x): + return x < NT_OFFSET + +def ISNONTERMINAL(x): + return x >= NT_OFFSET + +def ISEOF(x): + return x == ENDMARKER diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/tokenize.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/tokenize.py new file mode 100644 index 0000000000000000000000000000000000000000..099dfa7798afd44b3e819e971bf4e9f376d765d4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/lib2to3/pgen2/tokenize.py @@ -0,0 +1,564 @@ +# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation. +# All rights reserved. + +"""Tokenization help for Python programs. + +generate_tokens(readline) is a generator that breaks a stream of +text into Python tokens. It accepts a readline-like method which is called +repeatedly to get the next line of input (or "" for EOF). It generates +5-tuples with these members: + + the token type (see token.py) + the token (a string) + the starting (row, column) indices of the token (a 2-tuple of ints) + the ending (row, column) indices of the token (a 2-tuple of ints) + the original line (string) + +It is designed to match the working of the Python tokenizer exactly, except +that it produces COMMENT tokens for comments and gives type OP for all +operators + +Older entry points + tokenize_loop(readline, tokeneater) + tokenize(readline, tokeneater=printtoken) +are the same, except instead of generating tokens, tokeneater is a callback +function to which the 5 fields described above are passed as 5 arguments, +each time a new token is found.""" + +__author__ = 'Ka-Ping Yee ' +__credits__ = \ + 'GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro' + +import string, re +from codecs import BOM_UTF8, lookup +from lib2to3.pgen2.token import * + +from . import token +__all__ = [x for x in dir(token) if x[0] != '_'] + ["tokenize", + "generate_tokens", "untokenize"] +del token + +try: + bytes +except NameError: + # Support bytes type in Python <= 2.5, so 2to3 turns itself into + # valid Python 3 code. + bytes = str + +def group(*choices): return '(' + '|'.join(choices) + ')' +def any(*choices): return group(*choices) + '*' +def maybe(*choices): return group(*choices) + '?' +def _combinations(*l): + return set( + x + y for x in l for y in l + ("",) if x.casefold() != y.casefold() + ) + +Whitespace = r'[ \f\t]*' +Comment = r'#[^\r\n]*' +Ignore = Whitespace + any(r'\\\r?\n' + Whitespace) + maybe(Comment) +Name = r'\w+' + +Binnumber = r'0[bB]_?[01]+(?:_[01]+)*' +Hexnumber = r'0[xX]_?[\da-fA-F]+(?:_[\da-fA-F]+)*[lL]?' +Octnumber = r'0[oO]?_?[0-7]+(?:_[0-7]+)*[lL]?' +Decnumber = group(r'[1-9]\d*(?:_\d+)*[lL]?', '0[lL]?') +Intnumber = group(Binnumber, Hexnumber, Octnumber, Decnumber) +Exponent = r'[eE][-+]?\d+(?:_\d+)*' +Pointfloat = group(r'\d+(?:_\d+)*\.(?:\d+(?:_\d+)*)?', r'\.\d+(?:_\d+)*') + maybe(Exponent) +Expfloat = r'\d+(?:_\d+)*' + Exponent +Floatnumber = group(Pointfloat, Expfloat) +Imagnumber = group(r'\d+(?:_\d+)*[jJ]', Floatnumber + r'[jJ]') +Number = group(Imagnumber, Floatnumber, Intnumber) + +# Tail end of ' string. +Single = r"[^'\\]*(?:\\.[^'\\]*)*'" +# Tail end of " string. +Double = r'[^"\\]*(?:\\.[^"\\]*)*"' +# Tail end of ''' string. +Single3 = r"[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''" +# Tail end of """ string. +Double3 = r'[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""' +_litprefix = r"(?:[uUrRbBfF]|[rR][fFbB]|[fFbBuU][rR])?" +Triple = group(_litprefix + "'''", _litprefix + '"""') +# Single-line ' or " string. +String = group(_litprefix + r"'[^\n'\\]*(?:\\.[^\n'\\]*)*'", + _litprefix + r'"[^\n"\\]*(?:\\.[^\n"\\]*)*"') + +# Because of leftmost-then-longest match semantics, be sure to put the +# longest operators first (e.g., if = came before ==, == would get +# recognized as two instances of =). +Operator = group(r"\*\*=?", r">>=?", r"<<=?", r"<>", r"!=", + r"//=?", r"->", + r"[+\-*/%&@|^=<>]=?", + r"~") + +Bracket = '[][(){}]' +Special = group(r'\r?\n', r':=', r'[:;.,`@]') +Funny = group(Operator, Bracket, Special) + +PlainToken = group(Number, Funny, String, Name) +Token = Ignore + PlainToken + +# First (or only) line of ' or " string. +ContStr = group(_litprefix + r"'[^\n'\\]*(?:\\.[^\n'\\]*)*" + + group("'", r'\\\r?\n'), + _litprefix + r'"[^\n"\\]*(?:\\.[^\n"\\]*)*' + + group('"', r'\\\r?\n')) +PseudoExtras = group(r'\\\r?\n', Comment, Triple) +PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name) + +tokenprog, pseudoprog, single3prog, double3prog = map( + re.compile, (Token, PseudoToken, Single3, Double3)) + +_strprefixes = ( + _combinations('r', 'R', 'f', 'F') | + _combinations('r', 'R', 'b', 'B') | + {'u', 'U', 'ur', 'uR', 'Ur', 'UR'} +) + +endprogs = {"'": re.compile(Single), '"': re.compile(Double), + "'''": single3prog, '"""': double3prog, + **{f"{prefix}'''": single3prog for prefix in _strprefixes}, + **{f'{prefix}"""': double3prog for prefix in _strprefixes}, + **{prefix: None for prefix in _strprefixes}} + +triple_quoted = ( + {"'''", '"""'} | + {f"{prefix}'''" for prefix in _strprefixes} | + {f'{prefix}"""' for prefix in _strprefixes} +) +single_quoted = ( + {"'", '"'} | + {f"{prefix}'" for prefix in _strprefixes} | + {f'{prefix}"' for prefix in _strprefixes} +) + +tabsize = 8 + +class TokenError(Exception): pass + +class StopTokenizing(Exception): pass + +def printtoken(type, token, xxx_todo_changeme, xxx_todo_changeme1, line): # for testing + (srow, scol) = xxx_todo_changeme + (erow, ecol) = xxx_todo_changeme1 + print("%d,%d-%d,%d:\t%s\t%s" % \ + (srow, scol, erow, ecol, tok_name[type], repr(token))) + +def tokenize(readline, tokeneater=printtoken): + """ + The tokenize() function accepts two parameters: one representing the + input stream, and one providing an output mechanism for tokenize(). + + The first parameter, readline, must be a callable object which provides + the same interface as the readline() method of built-in file objects. + Each call to the function should return one line of input as a string. + + The second parameter, tokeneater, must also be a callable object. It is + called once for each token, with five arguments, corresponding to the + tuples generated by generate_tokens(). + """ + try: + tokenize_loop(readline, tokeneater) + except StopTokenizing: + pass + +# backwards compatible interface +def tokenize_loop(readline, tokeneater): + for token_info in generate_tokens(readline): + tokeneater(*token_info) + +class Untokenizer: + + def __init__(self): + self.tokens = [] + self.prev_row = 1 + self.prev_col = 0 + + def add_whitespace(self, start): + row, col = start + assert row <= self.prev_row + col_offset = col - self.prev_col + if col_offset: + self.tokens.append(" " * col_offset) + + def untokenize(self, iterable): + for t in iterable: + if len(t) == 2: + self.compat(t, iterable) + break + tok_type, token, start, end, line = t + self.add_whitespace(start) + self.tokens.append(token) + self.prev_row, self.prev_col = end + if tok_type in (NEWLINE, NL): + self.prev_row += 1 + self.prev_col = 0 + return "".join(self.tokens) + + def compat(self, token, iterable): + startline = False + indents = [] + toks_append = self.tokens.append + toknum, tokval = token + if toknum in (NAME, NUMBER): + tokval += ' ' + if toknum in (NEWLINE, NL): + startline = True + for tok in iterable: + toknum, tokval = tok[:2] + + if toknum in (NAME, NUMBER, ASYNC, AWAIT): + tokval += ' ' + + if toknum == INDENT: + indents.append(tokval) + continue + elif toknum == DEDENT: + indents.pop() + continue + elif toknum in (NEWLINE, NL): + startline = True + elif startline and indents: + toks_append(indents[-1]) + startline = False + toks_append(tokval) + +cookie_re = re.compile(r'^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)', re.ASCII) +blank_re = re.compile(br'^[ \t\f]*(?:[#\r\n]|$)', re.ASCII) + +def _get_normal_name(orig_enc): + """Imitates get_normal_name in tokenizer.c.""" + # Only care about the first 12 characters. + enc = orig_enc[:12].lower().replace("_", "-") + if enc == "utf-8" or enc.startswith("utf-8-"): + return "utf-8" + if enc in ("latin-1", "iso-8859-1", "iso-latin-1") or \ + enc.startswith(("latin-1-", "iso-8859-1-", "iso-latin-1-")): + return "iso-8859-1" + return orig_enc + +def detect_encoding(readline): + """ + The detect_encoding() function is used to detect the encoding that should + be used to decode a Python source file. It requires one argument, readline, + in the same way as the tokenize() generator. + + It will call readline a maximum of twice, and return the encoding used + (as a string) and a list of any lines (left as bytes) it has read + in. + + It detects the encoding from the presence of a utf-8 bom or an encoding + cookie as specified in pep-0263. If both a bom and a cookie are present, but + disagree, a SyntaxError will be raised. If the encoding cookie is an invalid + charset, raise a SyntaxError. Note that if a utf-8 bom is found, + 'utf-8-sig' is returned. + + If no encoding is specified, then the default of 'utf-8' will be returned. + """ + bom_found = False + encoding = None + default = 'utf-8' + def read_or_stop(): + try: + return readline() + except StopIteration: + return bytes() + + def find_cookie(line): + try: + line_string = line.decode('ascii') + except UnicodeDecodeError: + return None + match = cookie_re.match(line_string) + if not match: + return None + encoding = _get_normal_name(match.group(1)) + try: + codec = lookup(encoding) + except LookupError: + # This behaviour mimics the Python interpreter + raise SyntaxError("unknown encoding: " + encoding) + + if bom_found: + if codec.name != 'utf-8': + # This behaviour mimics the Python interpreter + raise SyntaxError('encoding problem: utf-8') + encoding += '-sig' + return encoding + + first = read_or_stop() + if first.startswith(BOM_UTF8): + bom_found = True + first = first[3:] + default = 'utf-8-sig' + if not first: + return default, [] + + encoding = find_cookie(first) + if encoding: + return encoding, [first] + if not blank_re.match(first): + return default, [first] + + second = read_or_stop() + if not second: + return default, [first] + + encoding = find_cookie(second) + if encoding: + return encoding, [first, second] + + return default, [first, second] + +def untokenize(iterable): + """Transform tokens back into Python source code. + + Each element returned by the iterable must be a token sequence + with at least two elements, a token number and token value. If + only two tokens are passed, the resulting output is poor. + + Round-trip invariant for full input: + Untokenized source will match input source exactly + + Round-trip invariant for limited input: + # Output text will tokenize the back to the input + t1 = [tok[:2] for tok in generate_tokens(f.readline)] + newcode = untokenize(t1) + readline = iter(newcode.splitlines(1)).next + t2 = [tok[:2] for tokin generate_tokens(readline)] + assert t1 == t2 + """ + ut = Untokenizer() + return ut.untokenize(iterable) + +def generate_tokens(readline): + """ + The generate_tokens() generator requires one argument, readline, which + must be a callable object which provides the same interface as the + readline() method of built-in file objects. Each call to the function + should return one line of input as a string. Alternately, readline + can be a callable function terminating with StopIteration: + readline = open(myfile).next # Example of alternate readline + + The generator produces 5-tuples with these members: the token type; the + token string; a 2-tuple (srow, scol) of ints specifying the row and + column where the token begins in the source; a 2-tuple (erow, ecol) of + ints specifying the row and column where the token ends in the source; + and the line on which the token was found. The line passed is the + physical line. + """ + lnum = parenlev = continued = 0 + contstr, needcont = '', 0 + contline = None + indents = [0] + + # 'stashed' and 'async_*' are used for async/await parsing + stashed = None + async_def = False + async_def_indent = 0 + async_def_nl = False + + while 1: # loop over lines in stream + try: + line = readline() + except StopIteration: + line = '' + lnum = lnum + 1 + pos, max = 0, len(line) + + if contstr: # continued string + if not line: + raise TokenError("EOF in multi-line string", strstart) + endmatch = endprog.match(line) + if endmatch: + pos = end = endmatch.end(0) + yield (STRING, contstr + line[:end], + strstart, (lnum, end), contline + line) + contstr, needcont = '', 0 + contline = None + elif needcont and line[-2:] != '\\\n' and line[-3:] != '\\\r\n': + yield (ERRORTOKEN, contstr + line, + strstart, (lnum, len(line)), contline) + contstr = '' + contline = None + continue + else: + contstr = contstr + line + contline = contline + line + continue + + elif parenlev == 0 and not continued: # new statement + if not line: break + column = 0 + while pos < max: # measure leading whitespace + if line[pos] == ' ': column = column + 1 + elif line[pos] == '\t': column = (column//tabsize + 1)*tabsize + elif line[pos] == '\f': column = 0 + else: break + pos = pos + 1 + if pos == max: break + + if stashed: + yield stashed + stashed = None + + if line[pos] in '#\r\n': # skip comments or blank lines + if line[pos] == '#': + comment_token = line[pos:].rstrip('\r\n') + nl_pos = pos + len(comment_token) + yield (COMMENT, comment_token, + (lnum, pos), (lnum, pos + len(comment_token)), line) + yield (NL, line[nl_pos:], + (lnum, nl_pos), (lnum, len(line)), line) + else: + yield ((NL, COMMENT)[line[pos] == '#'], line[pos:], + (lnum, pos), (lnum, len(line)), line) + continue + + if column > indents[-1]: # count indents or dedents + indents.append(column) + yield (INDENT, line[:pos], (lnum, 0), (lnum, pos), line) + while column < indents[-1]: + if column not in indents: + raise IndentationError( + "unindent does not match any outer indentation level", + ("", lnum, pos, line)) + indents = indents[:-1] + + if async_def and async_def_indent >= indents[-1]: + async_def = False + async_def_nl = False + async_def_indent = 0 + + yield (DEDENT, '', (lnum, pos), (lnum, pos), line) + + if async_def and async_def_nl and async_def_indent >= indents[-1]: + async_def = False + async_def_nl = False + async_def_indent = 0 + + else: # continued statement + if not line: + raise TokenError("EOF in multi-line statement", (lnum, 0)) + continued = 0 + + while pos < max: + pseudomatch = pseudoprog.match(line, pos) + if pseudomatch: # scan for tokens + start, end = pseudomatch.span(1) + spos, epos, pos = (lnum, start), (lnum, end), end + token, initial = line[start:end], line[start] + + if initial in string.digits or \ + (initial == '.' and token != '.'): # ordinary number + yield (NUMBER, token, spos, epos, line) + elif initial in '\r\n': + newline = NEWLINE + if parenlev > 0: + newline = NL + elif async_def: + async_def_nl = True + if stashed: + yield stashed + stashed = None + yield (newline, token, spos, epos, line) + + elif initial == '#': + assert not token.endswith("\n") + if stashed: + yield stashed + stashed = None + yield (COMMENT, token, spos, epos, line) + elif token in triple_quoted: + endprog = endprogs[token] + endmatch = endprog.match(line, pos) + if endmatch: # all on one line + pos = endmatch.end(0) + token = line[start:pos] + if stashed: + yield stashed + stashed = None + yield (STRING, token, spos, (lnum, pos), line) + else: + strstart = (lnum, start) # multiple lines + contstr = line[start:] + contline = line + break + elif initial in single_quoted or \ + token[:2] in single_quoted or \ + token[:3] in single_quoted: + if token[-1] == '\n': # continued string + strstart = (lnum, start) + endprog = (endprogs[initial] or endprogs[token[1]] or + endprogs[token[2]]) + contstr, needcont = line[start:], 1 + contline = line + break + else: # ordinary string + if stashed: + yield stashed + stashed = None + yield (STRING, token, spos, epos, line) + elif initial.isidentifier(): # ordinary name + if token in ('async', 'await'): + if async_def: + yield (ASYNC if token == 'async' else AWAIT, + token, spos, epos, line) + continue + + tok = (NAME, token, spos, epos, line) + if token == 'async' and not stashed: + stashed = tok + continue + + if token in ('def', 'for'): + if (stashed + and stashed[0] == NAME + and stashed[1] == 'async'): + + if token == 'def': + async_def = True + async_def_indent = indents[-1] + + yield (ASYNC, stashed[1], + stashed[2], stashed[3], + stashed[4]) + stashed = None + + if stashed: + yield stashed + stashed = None + + yield tok + elif initial == '\\': # continued stmt + # This yield is new; needed for better idempotency: + if stashed: + yield stashed + stashed = None + yield (NL, token, spos, (lnum, pos), line) + continued = 1 + else: + if initial in '([{': parenlev = parenlev + 1 + elif initial in ')]}': parenlev = parenlev - 1 + if stashed: + yield stashed + stashed = None + yield (OP, token, spos, epos, line) + else: + yield (ERRORTOKEN, line[pos], + (lnum, pos), (lnum, pos+1), line) + pos = pos + 1 + + if stashed: + yield stashed + stashed = None + + for indent in indents[1:]: # pop remaining indent levels + yield (DEDENT, '', (lnum, 0), (lnum, 0), '') + yield (ENDMARKER, '', (lnum, 0), (lnum, 0), '') + +if __name__ == '__main__': # testing + import sys + if len(sys.argv) > 1: tokenize(open(sys.argv[1]).readline) + else: tokenize(sys.stdin.readline) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/logging/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/logging/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a6033ae6eadb89a8ca1a1a9eb2cc48f6210ec74 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/logging/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/logging/__pycache__/config.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/logging/__pycache__/config.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..27b0d2d634cae854aa951475ff8d5424955cedd7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/logging/__pycache__/config.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/logging/__pycache__/handlers.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/logging/__pycache__/handlers.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d45da46e3751b6d3d672c2637cc9ada959692b3d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/logging/__pycache__/handlers.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/msilib/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/msilib/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2cd3fca4b1761e9ca4ecf75d70f7bf9e6390e497 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/msilib/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/msilib/__pycache__/schema.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/msilib/__pycache__/schema.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3e66026669acae3da3a3918d813d4c30362420c1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/msilib/__pycache__/schema.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/msilib/__pycache__/sequence.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/msilib/__pycache__/sequence.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1624a22da1cc9954b5be3e98b479c1bf0c89cde7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/msilib/__pycache__/sequence.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/msilib/__pycache__/text.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/msilib/__pycache__/text.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9cc8dc5934d583778e332887471d9f43ad3e3568 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/msilib/__pycache__/text.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0628e80718141e28bcf3bae0de12d6bd75a4e18b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/connection.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/connection.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..83b8daa4ab1682eee713555a3e7750f6d1d0b201 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/connection.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/context.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/context.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3ff077678fccdb29de032273f9c4b4f3ad5d6058 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/context.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/forkserver.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/forkserver.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0dd07e1d775248ed3cfbb167fccbada02c123d0a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/forkserver.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/heap.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/heap.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6460de71af85d0ae128dfb3ffeeb6079d16b9ad9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/heap.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/managers.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/managers.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..39a416f41ae9a48a378fbe5ea4b2626e2566e094 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/managers.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/pool.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/pool.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ff37b1ec8d6952f61b53428edeb3fe923c8a98f8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/pool.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/popen_fork.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/popen_fork.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8a783f4a1c521efd6d9c9d8145820959fdb4c065 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/popen_fork.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/popen_forkserver.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/popen_forkserver.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..213303b2c363acdd1a793278fef59963a31f4c92 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/popen_forkserver.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/popen_spawn_posix.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/popen_spawn_posix.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a7b4016d3397d16acffce46da4fd3b319bda265f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/popen_spawn_posix.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/popen_spawn_win32.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/popen_spawn_win32.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9f01ce687fa87b0286d3896585f3430855806a0c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/popen_spawn_win32.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/process.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/process.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..840206fe2a77c14b5593409cb9b3fd800831bc13 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/process.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/queues.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/queues.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d6620501ae6794a1d69592ec17c16d8a8a9c5b9d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/queues.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/reduction.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/reduction.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..476171b5b8d5f6c04eda8d1386c453aa0b75a3c9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/reduction.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/resource_sharer.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/resource_sharer.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2e3135502ea702f3a74da121edbf7252d505f5aa Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/resource_sharer.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/resource_tracker.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/resource_tracker.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b7862e91556734847b203b77888290a02463e7ae Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/resource_tracker.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/shared_memory.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/shared_memory.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..57e0ab12212ea39142e18992ba50910f4961b420 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/shared_memory.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/sharedctypes.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/sharedctypes.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f0a900ea40265f93613b4c6c7e16a3d542c65b3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/sharedctypes.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/spawn.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/spawn.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ca4e90e597a646478247cbcd826e7d1cb4f54f63 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/spawn.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/synchronize.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/synchronize.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1ad85bcb08a5f47e64f0ee02a9e7bfdba8a947ba Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/synchronize.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/util.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/util.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..381fd832eeee186137223eefd49aaf8154468d23 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/__pycache__/util.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/dummy/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/dummy/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6a1468609e347b3a0b9281e5c9e6ec311fcb37e5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/dummy/__init__.py @@ -0,0 +1,126 @@ +# +# Support for the API of the multiprocessing package using threads +# +# multiprocessing/dummy/__init__.py +# +# Copyright (c) 2006-2008, R Oudkerk +# Licensed to PSF under a Contributor Agreement. +# + +__all__ = [ + 'Process', 'current_process', 'active_children', 'freeze_support', + 'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Condition', + 'Event', 'Barrier', 'Queue', 'Manager', 'Pipe', 'Pool', 'JoinableQueue' + ] + +# +# Imports +# + +import threading +import sys +import weakref +import array + +from .connection import Pipe +from threading import Lock, RLock, Semaphore, BoundedSemaphore +from threading import Event, Condition, Barrier +from queue import Queue + +# +# +# + +class DummyProcess(threading.Thread): + + def __init__(self, group=None, target=None, name=None, args=(), kwargs={}): + threading.Thread.__init__(self, group, target, name, args, kwargs) + self._pid = None + self._children = weakref.WeakKeyDictionary() + self._start_called = False + self._parent = current_process() + + def start(self): + if self._parent is not current_process(): + raise RuntimeError( + "Parent is {0!r} but current_process is {1!r}".format( + self._parent, current_process())) + self._start_called = True + if hasattr(self._parent, '_children'): + self._parent._children[self] = None + threading.Thread.start(self) + + @property + def exitcode(self): + if self._start_called and not self.is_alive(): + return 0 + else: + return None + +# +# +# + +Process = DummyProcess +current_process = threading.current_thread +current_process()._children = weakref.WeakKeyDictionary() + +def active_children(): + children = current_process()._children + for p in list(children): + if not p.is_alive(): + children.pop(p, None) + return list(children) + +def freeze_support(): + pass + +# +# +# + +class Namespace(object): + def __init__(self, /, **kwds): + self.__dict__.update(kwds) + def __repr__(self): + items = list(self.__dict__.items()) + temp = [] + for name, value in items: + if not name.startswith('_'): + temp.append('%s=%r' % (name, value)) + temp.sort() + return '%s(%s)' % (self.__class__.__name__, ', '.join(temp)) + +dict = dict +list = list + +def Array(typecode, sequence, lock=True): + return array.array(typecode, sequence) + +class Value(object): + def __init__(self, typecode, value, lock=True): + self._typecode = typecode + self._value = value + + @property + def value(self): + return self._value + + @value.setter + def value(self, value): + self._value = value + + def __repr__(self): + return '<%s(%r, %r)>'%(type(self).__name__,self._typecode,self._value) + +def Manager(): + return sys.modules[__name__] + +def shutdown(): + pass + +def Pool(processes=None, initializer=None, initargs=()): + from ..pool import ThreadPool + return ThreadPool(processes, initializer, initargs) + +JoinableQueue = Queue diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/dummy/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/dummy/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e099a18be286241f3418713d935ba614596d62fe Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/dummy/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/dummy/__pycache__/connection.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/dummy/__pycache__/connection.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ee71682ed47a344b21fc3ed84ff5c077cc760b21 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/dummy/__pycache__/connection.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/dummy/connection.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/dummy/connection.py new file mode 100644 index 0000000000000000000000000000000000000000..f0ce320fcf514083f3a6477e87abf40e9719285a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/multiprocessing/dummy/connection.py @@ -0,0 +1,75 @@ +# +# Analogue of `multiprocessing.connection` which uses queues instead of sockets +# +# multiprocessing/dummy/connection.py +# +# Copyright (c) 2006-2008, R Oudkerk +# Licensed to PSF under a Contributor Agreement. +# + +__all__ = [ 'Client', 'Listener', 'Pipe' ] + +from queue import Queue + + +families = [None] + + +class Listener(object): + + def __init__(self, address=None, family=None, backlog=1): + self._backlog_queue = Queue(backlog) + + def accept(self): + return Connection(*self._backlog_queue.get()) + + def close(self): + self._backlog_queue = None + + @property + def address(self): + return self._backlog_queue + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, exc_tb): + self.close() + + +def Client(address): + _in, _out = Queue(), Queue() + address.put((_out, _in)) + return Connection(_in, _out) + + +def Pipe(duplex=True): + a, b = Queue(), Queue() + return Connection(a, b), Connection(b, a) + + +class Connection(object): + + def __init__(self, _in, _out): + self._out = _out + self._in = _in + self.send = self.send_bytes = _out.put + self.recv = self.recv_bytes = _in.get + + def poll(self, timeout=0.0): + if self._in.qsize() > 0: + return True + if timeout <= 0.0: + return False + with self._in.not_empty: + self._in.not_empty.wait(timeout) + return self._in.qsize() > 0 + + def close(self): + pass + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, exc_tb): + self.close() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/pydoc_data/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/pydoc_data/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..646e567e63ec93a413eca686ed22473de737c10f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/pydoc_data/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/re/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/re/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a969b9efc7a41d3d8e68c9c3236b6e7d5d19509a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/re/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/re/__pycache__/_casefix.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/re/__pycache__/_casefix.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3c6a0ff006b3338cad180968bad7dd5b168cf6d7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/re/__pycache__/_casefix.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/re/__pycache__/_compiler.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/re/__pycache__/_compiler.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9c4c9812ce1f126126527a38b73a4c069af17686 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/re/__pycache__/_compiler.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/re/__pycache__/_constants.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/re/__pycache__/_constants.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ab6d1ce9fd39fa4c356196e4fe2222b302b9ad77 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/re/__pycache__/_constants.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/re/__pycache__/_parser.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/re/__pycache__/_parser.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..25dc707764d3578539d096cabda538af4593d1da Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/re/__pycache__/_parser.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/sqlite3/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/sqlite3/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..413e1430d00877a076d91e9770921f60db77af9a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/sqlite3/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/sqlite3/__pycache__/dbapi2.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/sqlite3/__pycache__/dbapi2.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..05d3a993bc9ff31a55fd1947429657ece6cb8377 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/sqlite3/__pycache__/dbapi2.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/sqlite3/__pycache__/dump.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/sqlite3/__pycache__/dump.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dcf4caa8c1145c6e0a80cdfaf736d6d4bb246d03 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/sqlite3/__pycache__/dump.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/bytecode_helper.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/bytecode_helper.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7460f60d0fc1724052955f0371df4788143e1fe7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/bytecode_helper.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/hashlib_helper.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/hashlib_helper.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f0b2bb7e2c8943462b66606856b446e2b86b4b6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/hashlib_helper.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/import_helper.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/import_helper.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8ffbbe7c864899af8c0df9745c361891796c3d92 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/import_helper.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/interpreters.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/interpreters.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0b90b47c2c0d4edb62460d2eb9ae24b034dbd3d8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/interpreters.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/logging_helper.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/logging_helper.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b0038a90fdffbe179cc11ae072f054f67904f5b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/logging_helper.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/os_helper.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/os_helper.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ed429e5bdc989ee2284743a21a52a337b3ed2fb3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/os_helper.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/pty_helper.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/pty_helper.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d6ee082a2e6c142b83e4f559946fb0c155faf0eb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/pty_helper.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/script_helper.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/script_helper.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..49d0ac38767ebb0e31ee62b8d84ec7d322e9bcbf Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/script_helper.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/socket_helper.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/socket_helper.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8c285dd4ee54e3ee86c6709966f9f54d32de3051 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/socket_helper.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/threading_helper.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/threading_helper.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a0fc5a9b6aa88a0bc87cade4f987023752012f0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/threading_helper.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/warnings_helper.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/warnings_helper.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e93a85bc8f903c1fd2c2fb7a42a32c3b738690c9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/warnings_helper.cpython-311.pyc differ