diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__phello__/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__phello__/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a20564dbf72078c7108e76814f255a75219dbbf0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__phello__/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__phello__/__pycache__/spam.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__phello__/__pycache__/spam.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f27cf378558e2e83ad1d8ae35f48c833f4bdf036 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__phello__/__pycache__/spam.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__phello__/ham/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__phello__/ham/__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.14.4-h7c1dbca_0_cp314t/Lib/__phello__/ham/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__phello__/ham/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2015db410a04223a06a8704bb227dd9f5a2504ef Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__phello__/ham/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__phello__/ham/__pycache__/eggs.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__phello__/ham/__pycache__/eggs.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5cf316aac31d448235542a394e9ac082af80fa86 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__phello__/ham/__pycache__/eggs.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__phello__/ham/eggs.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__phello__/ham/eggs.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/__future__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/__future__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..42603260e557790e0505e856316a10be6ec97634 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/__future__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/__hello__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/__hello__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..325a248d30660144674aef40839bc6f3c8981df2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/__hello__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_aix_support.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_aix_support.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..201a2fce5b4d46ba362de20b722c4fdfafbebf31 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_aix_support.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_android_support.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_android_support.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..43b3ae765a5fa894fd5a3c19b20aca16bfcee308 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_android_support.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_apple_support.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_apple_support.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6eaad08ba1a91b1b4a19a81c51d50faefb91fa63 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_apple_support.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_ast_unparse.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_ast_unparse.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..159bf13234c3af1ae55711468a72b55e2aec5c39 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_ast_unparse.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_collections_abc.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_collections_abc.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c461f3ee4616ee47625131a92137af802ae67440 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_collections_abc.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_colorize.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_colorize.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f17359751e9dbdaa7a7bc188d220b0890688c958 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_colorize.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_compat_pickle.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_compat_pickle.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b58e70a954d09a46d6f60473996f0b23d20a7aa3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_compat_pickle.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_ios_support.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_ios_support.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..793a73876ebccb243d92a2800950da5331c98cee Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_ios_support.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_markupbase.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_markupbase.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..602cb4f1821d974e07846bf28974cf4868de7aed Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_markupbase.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_opcode_metadata.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_opcode_metadata.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8e5208cf6fd86339fc2a2d89aec1106eef5efd4c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_opcode_metadata.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_osx_support.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_osx_support.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e632dbe093d6b1cc6603d85d740707f3753d3784 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_osx_support.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_py_abc.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_py_abc.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4a245fb2f8f62da04d977d4d37c3e030068a0ed0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_py_abc.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_py_warnings.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_py_warnings.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bd90a9482246cd0a0b5c32411741a0f3fc3d41a1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_py_warnings.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_pylong.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_pylong.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6d5841ea79483071977c2ab3c220b2eaa9f8ca5e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_pylong.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_sitebuiltins.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_sitebuiltins.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e23ad47ab6d3a41f5c142c9a668dbc2c1c7df63a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_sitebuiltins.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_strptime.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_strptime.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e99915c0b524d6d867d29702f7f0888772997d33 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_strptime.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_threading_local.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_threading_local.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..57cc3703c5af81f2376c2b271d5136b47ee30980 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_threading_local.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_weakrefset.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_weakrefset.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..894da9fc67cde302b5dc1d4a08089725619100af Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_weakrefset.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/modulefinder.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/modulefinder.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..208164f01c5798babe48d3d4e4475b7a89a6dd35 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/modulefinder.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/netrc.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/netrc.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..074cc88d86b916b29776f1f60220faa1affd730d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/netrc.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/ntpath.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/ntpath.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a5840f2dc769fbb3ae6169a13a7eed8102da63f5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/ntpath.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/nturl2path.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/nturl2path.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f94b171ce56f4f913291862d3058afbb0b49b52f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/nturl2path.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/numbers.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/numbers.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b419502ef77e0f946383bccec447262bc7dc9d79 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/numbers.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/opcode.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/opcode.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cc98171c7d8cb603d2211df0fd66d71451166877 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/opcode.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/operator.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/operator.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7d9c1cd0a5ef2c6b7c70c8ad8437d3f3fad4d230 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/operator.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/optparse.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/optparse.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e2ece89b9323e5cecfcd171f578c80b5574104b0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/optparse.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/os.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/os.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fb0273fe325006a5fbde7f82bfc1fbc13d4508ea Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/os.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pickle.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pickle.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c71f8392df0c5f52898613bee8ab16f6c3bf0f55 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pickle.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pickletools.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pickletools.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c0607596b5ea4894b3a75674d88880eb0c80f225 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pickletools.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pkgutil.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pkgutil.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f68ffb3726a5eb17a0709fdabbf3b4fb0fafde33 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pkgutil.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/platform.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/platform.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5caa2dcbabd63723ac45ec1b242ef464cc552cc5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/platform.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/plistlib.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/plistlib.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8a05dcd6123282e6c574679f18ca89899834e701 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/plistlib.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/poplib.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/poplib.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ba0d15d3aaee3fc547e5a533b79a1ad8421a7a68 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/poplib.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/posixpath.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/posixpath.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d6f0a9db4b02f89bd9a36f62fe80f5b7e307d1d0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/posixpath.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pprint.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pprint.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..25a74ae17c2b5f3121b4458f26dfc73e146e9766 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pprint.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/profile.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/profile.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c42a1fac8a0992d7e31c2df1daee0b3c08367e50 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/profile.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pstats.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pstats.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e1a665c837dc59f8a5c77fa250fec62c1b198ee8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pstats.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pty.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pty.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..378cf2c07d710fedd385c5b6c19ab3bcae5c18ef Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pty.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/py_compile.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/py_compile.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f64f4aa9aee205349733bd0ef816d0fb7289bfcf Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/py_compile.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pyclbr.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pyclbr.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bd825384235842b6cf0a894f2f31331d24229c08 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pyclbr.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/queue.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/queue.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..464cae034ca362babea0ca28b758fe4f97676555 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/queue.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/quopri.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/quopri.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..50712906d57bf291b210b1e03753f2363fcee2a7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/quopri.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/random.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/random.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ddc51c3330e4acd2757d77c810eee50df4e0ba80 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/random.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/reprlib.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/reprlib.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2eff51c3c947dd7fce28271461fa9cf4488c2fa0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/reprlib.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/rlcompleter.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/rlcompleter.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..de51928e1153b0f6c5a47c33d1d39797073a9cd3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/rlcompleter.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/runpy.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/runpy.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bec52d6f6fd996ee771be95e33338b56557fbe25 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/runpy.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/sched.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/sched.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6c06395f9c81953ab559eff62ffbb61d092e032a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/sched.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/secrets.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/secrets.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..19e8d48cf078b34934d68ec373b53093ae25b779 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/secrets.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/selectors.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/selectors.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..215b2b2e70d31153094321af1ebbb2ddc6c441d0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/selectors.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/shelve.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/shelve.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1f9608f13da67fc543de629def6bad17c396cc1d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/shelve.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/shlex.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/shlex.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5e3ed8ef8d1ab598eca096168c4c3f0344b7eb6f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/shlex.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/shutil.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/shutil.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3e46334bae5cfd506c65f4a753e78cade04b0235 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/shutil.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/signal.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/signal.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0169ae2700d57b9e1286f987725a255015c28b34 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/signal.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/site.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/site.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..644cf0f3c194cd27b233120262b754babd9e60ca Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/site.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/smtplib.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/smtplib.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2b09fa16f20c295801281f7bb5f1cbcb6f7eea3b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/smtplib.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/socket.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/socket.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e02d72134792fa54174af697099e4e93ae81b6e0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/socket.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/socketserver.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/socketserver.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f51b6a2d013cc510ab8f1b304fd7c3c3d2ba59fd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/socketserver.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/sre_compile.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/sre_compile.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6a64b0b766a2a61eea052e08de53b9047fbb278c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/sre_compile.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/sre_constants.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/sre_constants.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1f53d1488a326aa7395774c1cfe538aee168b7a1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/sre_constants.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/sre_parse.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/sre_parse.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..edc15aebb74b0b6e7969b4143ce3f08016eb5245 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/sre_parse.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/ssl.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/ssl.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5d6f2660bb0386bd318c6cc913e07033135c2670 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/ssl.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/stat.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/stat.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..47a9d60925ac26bab1625515a7169d4524ba4928 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/stat.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/statistics.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/statistics.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c9a2c791435fbc5cc80f8d5ea549291d7936ef39 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/statistics.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/stringprep.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/stringprep.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2bb277e2e7dc3fb0f30af6c4a30ec3ae98be6b11 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/stringprep.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/struct.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/struct.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a87fdfbab4b5574030a9691e50053e5d0bf442d8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/struct.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/subprocess.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/subprocess.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3584f79c29c824e79f10e0073855ae1864caa7d3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/subprocess.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/symtable.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/symtable.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8f5950dc711b9f6f34ccccdaed88143483d088d4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/symtable.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/tabnanny.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/tabnanny.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3353d9cf997257ca389c0b9516baf56a75e0abec Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/tabnanny.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/tempfile.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/tempfile.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..65c8b1e30267a4cd9898e0852d1ee93005244464 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/tempfile.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/textwrap.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/textwrap.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a1c786d1bf1762db298694cfecc3d03a048ccf7d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/textwrap.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/this.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/this.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7fb1c2f68fbf23181ce2cdef31101bfc4964254a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/this.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/threading.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/threading.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a5360ccbf2d8510ca03a2391b23f94f283fea11a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/threading.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/timeit.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/timeit.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1e630e94fe552f60133b13468549289163671886 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/timeit.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/token.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/token.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4fd7a1426608c946fbfe838758be8da579b7c17f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/token.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/tokenize.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/tokenize.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..885ed8c8e3fc92bea7104e3b2af585450ae77457 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/tokenize.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/trace.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/trace.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c5dff3139cdec599b6dcdacfc7c29a7a49bf3a92 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/trace.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/traceback.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/traceback.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d150fe088fda2f0881f0571180afb49e653ba989 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/traceback.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/tracemalloc.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/tracemalloc.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4469754eed452f5bea2e8781da313b618094e316 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/tracemalloc.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/tty.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/tty.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cc0bc3fe719196f24261f0c182dc9e63de1a5f1b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/tty.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/types.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/types.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8e44e129410bb017ca4fc08be27794097a71c8d3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/types.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/uuid.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/uuid.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..94c102f75f1454eabbbdbabd2b091d673d14e0be Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/uuid.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/warnings.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/warnings.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dd157889389ac1fd191846e1f779cb701ec1190a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/warnings.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/wave.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/wave.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fdfc89c146f0018fb239e0f88e1fd58b998caf4f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/wave.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/weakref.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/weakref.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..95748b7e1c30a907b6580a1ad79e256e876d66bc Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/weakref.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/webbrowser.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/webbrowser.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c48890c59bee6fc9114d4fdd9c626364d5802975 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/webbrowser.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/zipapp.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/zipapp.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fdf4654db3495d66a1413477a515ff760b5cc67b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/zipapp.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/zipimport.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/zipimport.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8388bb31ecd79ecc6154ec7f9ae79c9cd80de66a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/zipimport.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..15b98c8926b4e128c56daf387de5dfea7abcbbff Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/__main__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/__main__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e2fcabf3390cb54c70945ee1f1e5bbe8c6e63688 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/__main__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/_module_completer.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/_module_completer.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..979741ce992ae489881d5b5e4a075c4a2a113622 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/_module_completer.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/_threading_handler.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/_threading_handler.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9f714a521762ce4d3674a26f712835392abd620c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/_threading_handler.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/base_eventqueue.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/base_eventqueue.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bd087102e26f18688913f82b13c41b9fe5097a90 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/base_eventqueue.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/commands.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/commands.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8639aefd8c69078d05e44b2a79a005ceefbf3acf Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/commands.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/completing_reader.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/completing_reader.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8371f38628f299a1a7c7505ee671338d0be914ab Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/completing_reader.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/console.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/console.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b9a65dc18a4665448a18b30c4a629e3a736820d4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/console.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/fancy_termios.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/fancy_termios.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7e38b243cf8099282c73cdbdcbaf9debcc65a535 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/fancy_termios.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/historical_reader.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/historical_reader.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..be7b0860d6bd51c1b3dbdc72455004acf09c75e6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/historical_reader.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/input.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/input.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0e56e72386623dd2641dc28aa0597c632df4bbd2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/input.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/keymap.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/keymap.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5d5c8de1bd48102b9cad6927ecff4fece20e325f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/keymap.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/main.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/main.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f417db967a019179b378513bda73bf10d60ff66b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/main.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/pager.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/pager.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d3e917baa7822fc28ae33df2d56120285ecdf8c8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/pager.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/reader.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/reader.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7af8cfd05b5fbf382376ba919fcfa03bb4b5d975 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/reader.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/readline.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/readline.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f4491cd46ef0cbebc18c8fdb313d1f92a3860977 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/readline.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/simple_interact.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/simple_interact.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..baf3ec5c57f280efb7fa40b0f18b519835a5a91c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/simple_interact.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/terminfo.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/terminfo.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..11b499b06193d5923c8375e013aaba186f94f3d8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/terminfo.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/trace.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/trace.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..98d0ed53ea7ee7fd5bed30fd81283ad1a75e512a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/trace.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/types.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/types.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d206461e06b8a4ac9e4b1e06de8f5a659d4ad989 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/types.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/unix_console.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/unix_console.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a04ebbcb9baaea541c95850b558c7ba7815779c2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/unix_console.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/unix_eventqueue.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/unix_eventqueue.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..966203eeb5026fcd31e2036d500aa848328a8855 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/unix_eventqueue.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/utils.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/utils.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b10b998f624a35b2bdce8b4ee9c180fe6eacac32 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/utils.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/windows_console.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/windows_console.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0eebe94c1ead4bff80808c0983e2468d86574b2c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/windows_console.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/windows_eventqueue.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/windows_eventqueue.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9e4209f2b25f4999ab6d36060f48449cb5ff88f4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/_pyrepl/__pycache__/windows_eventqueue.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b2085745fda9fcac31df78eebe180f6c038596ac Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/__main__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/__main__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..346a9877adabfb496380e7f4a91c3f2a7a10256a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/__main__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/base_events.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/base_events.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1f99a1e6b92216ac42c77bbbe2b82f7dc1a32efb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/base_events.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/base_futures.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/base_futures.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f121481821665ed88dd48bbb5ec4e69aa5e70e1c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/base_futures.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/base_subprocess.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/base_subprocess.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..518c693732d4d79035c3074894b1c16ba2cc37d3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/base_subprocess.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/base_tasks.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/base_tasks.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fe71fbf65908c421b5abdfb4d5dcd0a55e9068e2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/base_tasks.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/constants.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/constants.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7e2745332c1552eac79cc0f3fa86995796b5a526 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/constants.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/coroutines.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/coroutines.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f29b1672b791f26d408f8183d380ffe6ca60bd1e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/coroutines.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/events.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/events.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5bc6f2be9d28ea20a6dda8479cfa6d1d841a3cff Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/events.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/exceptions.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/exceptions.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..782be84bde6af1652aa7b1919cb87376987f1bf6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/exceptions.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/format_helpers.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/format_helpers.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2164a2b27a55d6ffb01c5514c1ac1b08f2a96ea1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/format_helpers.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/futures.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/futures.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0f1f02b8c5372c956fcbce9b547f6e8b3c439fbd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/futures.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/graph.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/graph.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3e1f965a8b1450caec68fc9db7e6fa4c8a601f7a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/graph.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/locks.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/locks.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e467e747a519dcfa232005c54ddbfe1855c463b6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/locks.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/log.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/log.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bddd784d9011f77c1d2d1ed5a02f4b38c0cc05c5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/log.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/mixins.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/mixins.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dc0a306dc101acb1b82dcf558b1acf5c39588656 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/mixins.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/proactor_events.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/proactor_events.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..00d85e3cacfcff8003c7918235def64427d94d33 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/proactor_events.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/protocols.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/protocols.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d564527237ebd9450203b91023c895c04b7abc80 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/protocols.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/queues.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/queues.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d2d583d26aa6ec6a4ee61c3cdcda20d6c1e2f125 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/queues.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/runners.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/runners.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c4c13bceaede03415978b50993d0e8198a388e32 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/runners.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/selector_events.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/selector_events.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fc82dc0a74fe00f2890107e30616bd1347647d21 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/selector_events.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/sslproto.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/sslproto.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f03f5f9b1cfe698ca8f9863a0fb4ec5ba8fabb12 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/sslproto.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/staggered.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/staggered.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e208250f869c9ee69109dd51d90886c01e52ad1f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/staggered.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/streams.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/streams.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..31a09607b59a0b1f2da7fb01ea48deb801323515 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/streams.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/subprocess.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/subprocess.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d6a8bd66cc591d454917aba54ef0aa2b991510bd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/subprocess.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/taskgroups.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/taskgroups.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dd76c9dc18fda00d3afe92fbd5805687f0362c94 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/taskgroups.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/tasks.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/tasks.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..411b9d239bf411d292d5288632e2e72ccb9c8a2e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/tasks.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/threads.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/threads.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e1dd16e3bbac4a43749de2272b9059d66623af2a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/threads.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/timeouts.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/timeouts.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f5662b3ed655477996013132390418c7b37488ea Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/timeouts.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/tools.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/tools.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f1d7f22349f00cf763cab5ba43c8a713422cf7dd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/tools.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/transports.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/transports.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..26a528da8295c0210fae2be16c69a9fc8b59e12b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/transports.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/trsock.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/trsock.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f3702fd57bed207d6ba96cd1785337aa5125a535 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/trsock.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/unix_events.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/unix_events.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..480d6754f9237ec95f39130dcae0a136b263c274 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/unix_events.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/windows_events.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/windows_events.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..85d3026c140b777ea6df4914278640a00082d39b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/windows_events.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/windows_utils.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/windows_utils.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e3d7a618f8f4ea1d948103f0fe37ceb4f947104a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/asyncio/__pycache__/windows_utils.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/collections/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/collections/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..747543a2b05b205cda80ee43a1617e78a784c972 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/collections/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..250de8fbc33886e3c3b7b08abf164ebd03e5a6e6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/__pycache__/bz2.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/__pycache__/bz2.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2cf037436645283b51d76b465dad0e37c28a04f7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/__pycache__/bz2.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/__pycache__/gzip.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/__pycache__/gzip.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eb571e1a1e8fa72f4a4f8ae32f4816ad76b3313c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/__pycache__/gzip.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/__pycache__/lzma.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/__pycache__/lzma.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..833bab409c0059e8cb0b647d0851cb6f50cf0c24 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/__pycache__/lzma.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/__pycache__/zlib.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/__pycache__/zlib.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aff18a028391efcddb93884c91e31a6203b97121 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/__pycache__/zlib.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/_common/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/_common/__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.14.4-h7c1dbca_0_cp314t/Lib/compression/_common/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/_common/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d76e27c8bdad34ee469229e175e7a07f97763e01 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/_common/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/_common/__pycache__/_streams.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/_common/__pycache__/_streams.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..945e4e6f723ad4fac47a3762fd2f4cf495685552 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/_common/__pycache__/_streams.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/_common/_streams.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/_common/_streams.py new file mode 100644 index 0000000000000000000000000000000000000000..9f367d4e30440f75d9a32c035713b281f3fbb26a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/_common/_streams.py @@ -0,0 +1,162 @@ +"""Internal classes used by compression modules""" + +import io +import sys + +BUFFER_SIZE = io.DEFAULT_BUFFER_SIZE # Compressed data read chunk size + + +class BaseStream(io.BufferedIOBase): + """Mode-checking helper functions.""" + + def _check_not_closed(self): + if self.closed: + raise ValueError("I/O operation on closed file") + + def _check_can_read(self): + if not self.readable(): + raise io.UnsupportedOperation("File not open for reading") + + def _check_can_write(self): + if not self.writable(): + raise io.UnsupportedOperation("File not open for writing") + + def _check_can_seek(self): + if not self.readable(): + raise io.UnsupportedOperation("Seeking is only supported " + "on files open for reading") + if not self.seekable(): + raise io.UnsupportedOperation("The underlying file object " + "does not support seeking") + + +class DecompressReader(io.RawIOBase): + """Adapts the decompressor API to a RawIOBase reader API""" + + def readable(self): + return True + + def __init__(self, fp, decomp_factory, trailing_error=(), **decomp_args): + self._fp = fp + self._eof = False + self._pos = 0 # Current offset in decompressed stream + + # Set to size of decompressed stream once it is known, for SEEK_END + self._size = -1 + + # Save the decompressor factory and arguments. + # If the file contains multiple compressed streams, each + # stream will need a separate decompressor object. A new decompressor + # object is also needed when implementing a backwards seek(). + self._decomp_factory = decomp_factory + self._decomp_args = decomp_args + self._decompressor = self._decomp_factory(**self._decomp_args) + + # Exception class to catch from decompressor signifying invalid + # trailing data to ignore + self._trailing_error = trailing_error + + def close(self): + self._decompressor = None + return super().close() + + def seekable(self): + return self._fp.seekable() + + def readinto(self, b): + with memoryview(b) as view, view.cast("B") as byte_view: + data = self.read(len(byte_view)) + byte_view[:len(data)] = data + return len(data) + + def read(self, size=-1): + if size < 0: + return self.readall() + + if not size or self._eof: + return b"" + data = None # Default if EOF is encountered + # Depending on the input data, our call to the decompressor may not + # return any data. In this case, try again after reading another block. + while True: + if self._decompressor.eof: + rawblock = (self._decompressor.unused_data or + self._fp.read(BUFFER_SIZE)) + if not rawblock: + break + # Continue to next stream. + self._decompressor = self._decomp_factory( + **self._decomp_args) + try: + data = self._decompressor.decompress(rawblock, size) + except self._trailing_error: + # Trailing data isn't a valid compressed stream; ignore it. + break + else: + if self._decompressor.needs_input: + rawblock = self._fp.read(BUFFER_SIZE) + if not rawblock: + raise EOFError("Compressed file ended before the " + "end-of-stream marker was reached") + else: + rawblock = b"" + data = self._decompressor.decompress(rawblock, size) + if data: + break + if not data: + self._eof = True + self._size = self._pos + return b"" + self._pos += len(data) + return data + + def readall(self): + chunks = [] + # sys.maxsize means the max length of output buffer is unlimited, + # so that the whole input buffer can be decompressed within one + # .decompress() call. + while data := self.read(sys.maxsize): + chunks.append(data) + + return b"".join(chunks) + + # Rewind the file to the beginning of the data stream. + def _rewind(self): + self._fp.seek(0) + self._eof = False + self._pos = 0 + self._decompressor = self._decomp_factory(**self._decomp_args) + + def seek(self, offset, whence=io.SEEK_SET): + # Recalculate offset as an absolute file position. + if whence == io.SEEK_SET: + pass + elif whence == io.SEEK_CUR: + offset = self._pos + offset + elif whence == io.SEEK_END: + # Seeking relative to EOF - we need to know the file's size. + if self._size < 0: + while self.read(io.DEFAULT_BUFFER_SIZE): + pass + offset = self._size + offset + else: + raise ValueError("Invalid value for whence: {}".format(whence)) + + # Make it so that offset is the number of bytes to skip forward. + if offset < self._pos: + self._rewind() + else: + offset -= self._pos + + # Read and discard data until we reach the desired position. + while offset > 0: + data = self.read(min(io.DEFAULT_BUFFER_SIZE, offset)) + if not data: + break + offset -= len(data) + + return self._pos + + def tell(self): + """Return the current file position.""" + return self._pos diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/zstd/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/zstd/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..84b25914b0aa93a6c0f0aba6dc02bc8be077ece5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/zstd/__init__.py @@ -0,0 +1,242 @@ +"""Python bindings to the Zstandard (zstd) compression library (RFC-8878).""" + +__all__ = ( + # compression.zstd + 'COMPRESSION_LEVEL_DEFAULT', + 'compress', + 'CompressionParameter', + 'decompress', + 'DecompressionParameter', + 'finalize_dict', + 'get_frame_info', + 'Strategy', + 'train_dict', + + # compression.zstd._zstdfile + 'open', + 'ZstdFile', + + # _zstd + 'get_frame_size', + 'zstd_version', + 'zstd_version_info', + 'ZstdCompressor', + 'ZstdDecompressor', + 'ZstdDict', + 'ZstdError', +) + +import _zstd +import enum +from _zstd import (ZstdCompressor, ZstdDecompressor, ZstdDict, ZstdError, + get_frame_size, zstd_version) +from compression.zstd._zstdfile import ZstdFile, open, _nbytes + +# zstd_version_number is (MAJOR * 100 * 100 + MINOR * 100 + RELEASE) +zstd_version_info = (*divmod(_zstd.zstd_version_number // 100, 100), + _zstd.zstd_version_number % 100) +"""Version number of the runtime zstd library as a tuple of integers.""" + +COMPRESSION_LEVEL_DEFAULT = _zstd.ZSTD_CLEVEL_DEFAULT +"""The default compression level for Zstandard, currently '3'.""" + + +class FrameInfo: + """Information about a Zstandard frame.""" + + __slots__ = 'decompressed_size', 'dictionary_id' + + def __init__(self, decompressed_size, dictionary_id): + super().__setattr__('decompressed_size', decompressed_size) + super().__setattr__('dictionary_id', dictionary_id) + + def __repr__(self): + return (f'FrameInfo(decompressed_size={self.decompressed_size}, ' + f'dictionary_id={self.dictionary_id})') + + def __setattr__(self, name, _): + raise AttributeError(f"can't set attribute {name!r}") + + +def get_frame_info(frame_buffer): + """Get Zstandard frame information from a frame header. + + *frame_buffer* is a bytes-like object. It should start from the beginning + of a frame, and needs to include at least the frame header (6 to 18 bytes). + + The returned FrameInfo object has two attributes. + 'decompressed_size' is the size in bytes of the data in the frame when + decompressed, or None when the decompressed size is unknown. + 'dictionary_id' is an int in the range (0, 2**32). The special value 0 + means that the dictionary ID was not recorded in the frame header, + the frame may or may not need a dictionary to be decoded, + and the ID of such a dictionary is not specified. + """ + return FrameInfo(*_zstd.get_frame_info(frame_buffer)) + + +def train_dict(samples, dict_size): + """Return a ZstdDict representing a trained Zstandard dictionary. + + *samples* is an iterable of samples, where a sample is a bytes-like + object representing a file. + + *dict_size* is the dictionary's maximum size, in bytes. + """ + if not isinstance(dict_size, int): + ds_cls = type(dict_size).__qualname__ + raise TypeError(f'dict_size must be an int object, not {ds_cls!r}.') + + samples = tuple(samples) + chunks = b''.join(samples) + chunk_sizes = tuple(_nbytes(sample) for sample in samples) + if not chunks: + raise ValueError("samples contained no data; can't train dictionary.") + dict_content = _zstd.train_dict(chunks, chunk_sizes, dict_size) + return ZstdDict(dict_content) + + +def finalize_dict(zstd_dict, /, samples, dict_size, level): + """Return a ZstdDict representing a finalized Zstandard dictionary. + + Given a custom content as a basis for dictionary, and a set of samples, + finalize *zstd_dict* by adding headers and statistics according to the + Zstandard dictionary format. + + You may compose an effective dictionary content by hand, which is used as + basis dictionary, and use some samples to finalize a dictionary. The basis + dictionary may be a "raw content" dictionary. See *is_raw* in ZstdDict. + + *samples* is an iterable of samples, where a sample is a bytes-like object + representing a file. + *dict_size* is the dictionary's maximum size, in bytes. + *level* is the expected compression level. The statistics for each + compression level differ, so tuning the dictionary to the compression level + can provide improvements. + """ + + if not isinstance(zstd_dict, ZstdDict): + raise TypeError('zstd_dict argument should be a ZstdDict object.') + if not isinstance(dict_size, int): + raise TypeError('dict_size argument should be an int object.') + if not isinstance(level, int): + raise TypeError('level argument should be an int object.') + + samples = tuple(samples) + chunks = b''.join(samples) + chunk_sizes = tuple(_nbytes(sample) for sample in samples) + if not chunks: + raise ValueError("The samples are empty content, can't finalize the " + "dictionary.") + dict_content = _zstd.finalize_dict(zstd_dict.dict_content, chunks, + chunk_sizes, dict_size, level) + return ZstdDict(dict_content) + + +def compress(data, level=None, options=None, zstd_dict=None): + """Return Zstandard compressed *data* as bytes. + + *level* is an int specifying the compression level to use, defaulting to + COMPRESSION_LEVEL_DEFAULT ('3'). + *options* is a dict object that contains advanced compression + parameters. See CompressionParameter for more on options. + *zstd_dict* is a ZstdDict object, a pre-trained Zstandard dictionary. See + the function train_dict for how to train a ZstdDict on sample data. + + For incremental compression, use a ZstdCompressor instead. + """ + comp = ZstdCompressor(level=level, options=options, zstd_dict=zstd_dict) + return comp.compress(data, mode=ZstdCompressor.FLUSH_FRAME) + + +def decompress(data, zstd_dict=None, options=None): + """Decompress one or more frames of Zstandard compressed *data*. + + *zstd_dict* is a ZstdDict object, a pre-trained Zstandard dictionary. See + the function train_dict for how to train a ZstdDict on sample data. + *options* is a dict object that contains advanced compression + parameters. See DecompressionParameter for more on options. + + For incremental decompression, use a ZstdDecompressor instead. + """ + results = [] + while True: + decomp = ZstdDecompressor(options=options, zstd_dict=zstd_dict) + results.append(decomp.decompress(data)) + if not decomp.eof: + raise ZstdError('Compressed data ended before the ' + 'end-of-stream marker was reached') + data = decomp.unused_data + if not data: + break + return b''.join(results) + + +class CompressionParameter(enum.IntEnum): + """Compression parameters.""" + + compression_level = _zstd.ZSTD_c_compressionLevel + window_log = _zstd.ZSTD_c_windowLog + hash_log = _zstd.ZSTD_c_hashLog + chain_log = _zstd.ZSTD_c_chainLog + search_log = _zstd.ZSTD_c_searchLog + min_match = _zstd.ZSTD_c_minMatch + target_length = _zstd.ZSTD_c_targetLength + strategy = _zstd.ZSTD_c_strategy + + enable_long_distance_matching = _zstd.ZSTD_c_enableLongDistanceMatching + ldm_hash_log = _zstd.ZSTD_c_ldmHashLog + ldm_min_match = _zstd.ZSTD_c_ldmMinMatch + ldm_bucket_size_log = _zstd.ZSTD_c_ldmBucketSizeLog + ldm_hash_rate_log = _zstd.ZSTD_c_ldmHashRateLog + + content_size_flag = _zstd.ZSTD_c_contentSizeFlag + checksum_flag = _zstd.ZSTD_c_checksumFlag + dict_id_flag = _zstd.ZSTD_c_dictIDFlag + + nb_workers = _zstd.ZSTD_c_nbWorkers + job_size = _zstd.ZSTD_c_jobSize + overlap_log = _zstd.ZSTD_c_overlapLog + + def bounds(self): + """Return the (lower, upper) int bounds of a compression parameter. + + Both the lower and upper bounds are inclusive. + """ + return _zstd.get_param_bounds(self.value, is_compress=True) + + +class DecompressionParameter(enum.IntEnum): + """Decompression parameters.""" + + window_log_max = _zstd.ZSTD_d_windowLogMax + + def bounds(self): + """Return the (lower, upper) int bounds of a decompression parameter. + + Both the lower and upper bounds are inclusive. + """ + return _zstd.get_param_bounds(self.value, is_compress=False) + + +class Strategy(enum.IntEnum): + """Compression strategies, listed from fastest to strongest. + + Note that new strategies might be added in the future. + Only the order (from fast to strong) is guaranteed, + the numeric value might change. + """ + + fast = _zstd.ZSTD_fast + dfast = _zstd.ZSTD_dfast + greedy = _zstd.ZSTD_greedy + lazy = _zstd.ZSTD_lazy + lazy2 = _zstd.ZSTD_lazy2 + btlazy2 = _zstd.ZSTD_btlazy2 + btopt = _zstd.ZSTD_btopt + btultra = _zstd.ZSTD_btultra + btultra2 = _zstd.ZSTD_btultra2 + + +# Check validity of the CompressionParameter & DecompressionParameter types +_zstd.set_parameter_types(CompressionParameter, DecompressionParameter) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/zstd/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/zstd/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d8ad6ad0e9b51ecc2514018b1d26740da32505bc Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/zstd/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/zstd/__pycache__/_zstdfile.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/zstd/__pycache__/_zstdfile.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..610f33182c429c1b6fde90d9a7995403aeee4ebf Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/zstd/__pycache__/_zstdfile.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/zstd/_zstdfile.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/zstd/_zstdfile.py new file mode 100644 index 0000000000000000000000000000000000000000..d709f5efc658fa45aaba751081781ceee8a69b3b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/compression/zstd/_zstdfile.py @@ -0,0 +1,345 @@ +import io +from os import PathLike +from _zstd import ZstdCompressor, ZstdDecompressor, ZSTD_DStreamOutSize +from compression._common import _streams + +__all__ = ('ZstdFile', 'open') + +_MODE_CLOSED = 0 +_MODE_READ = 1 +_MODE_WRITE = 2 + + +def _nbytes(dat, /): + if isinstance(dat, (bytes, bytearray)): + return len(dat) + with memoryview(dat) as mv: + return mv.nbytes + + +class ZstdFile(_streams.BaseStream): + """A file-like object providing transparent Zstandard (de)compression. + + A ZstdFile can act as a wrapper for an existing file object, or refer + directly to a named file on disk. + + ZstdFile provides a *binary* file interface. Data is read and returned as + bytes, and may only be written to objects that support the Buffer Protocol. + """ + + FLUSH_BLOCK = ZstdCompressor.FLUSH_BLOCK + FLUSH_FRAME = ZstdCompressor.FLUSH_FRAME + + def __init__(self, file, /, mode='r', *, + level=None, options=None, zstd_dict=None): + """Open a Zstandard compressed file in binary mode. + + *file* can be either an file-like object, or a file name to open. + + *mode* can be 'r' for reading (default), 'w' for (over)writing, 'x' for + creating exclusively, or 'a' for appending. These can equivalently be + given as 'rb', 'wb', 'xb' and 'ab' respectively. + + *level* is an optional int specifying the compression level to use, + or COMPRESSION_LEVEL_DEFAULT if not given. + + *options* is an optional dict for advanced compression parameters. + See CompressionParameter and DecompressionParameter for the possible + options. + + *zstd_dict* is an optional ZstdDict object, a pre-trained Zstandard + dictionary. See train_dict() to train ZstdDict on sample data. + """ + self._fp = None + self._close_fp = False + self._mode = _MODE_CLOSED + self._buffer = None + + if not isinstance(mode, str): + raise ValueError('mode must be a str') + if options is not None and not isinstance(options, dict): + raise TypeError('options must be a dict or None') + mode = mode.removesuffix('b') # handle rb, wb, xb, ab + if mode == 'r': + if level is not None: + raise TypeError('level is illegal in read mode') + self._mode = _MODE_READ + elif mode in {'w', 'a', 'x'}: + if level is not None and not isinstance(level, int): + raise TypeError('level must be int or None') + self._mode = _MODE_WRITE + self._compressor = ZstdCompressor(level=level, options=options, + zstd_dict=zstd_dict) + self._pos = 0 + else: + raise ValueError(f'Invalid mode: {mode!r}') + + if isinstance(file, (str, bytes, PathLike)): + self._fp = io.open(file, f'{mode}b') + self._close_fp = True + elif ((mode == 'r' and hasattr(file, 'read')) + or (mode != 'r' and hasattr(file, 'write'))): + self._fp = file + else: + raise TypeError('file must be a file-like object ' + 'or a str, bytes, or PathLike object') + + if self._mode == _MODE_READ: + raw = _streams.DecompressReader( + self._fp, + ZstdDecompressor, + zstd_dict=zstd_dict, + options=options, + ) + self._buffer = io.BufferedReader(raw) + + def close(self): + """Flush and close the file. + + May be called multiple times. Once the file has been closed, + any other operation on it will raise ValueError. + """ + if self._fp is None: + return + try: + if self._mode == _MODE_READ: + if getattr(self, '_buffer', None): + self._buffer.close() + self._buffer = None + elif self._mode == _MODE_WRITE: + self.flush(self.FLUSH_FRAME) + self._compressor = None + finally: + self._mode = _MODE_CLOSED + try: + if self._close_fp: + self._fp.close() + finally: + self._fp = None + self._close_fp = False + + def write(self, data, /): + """Write a bytes-like object *data* to the file. + + Returns the number of uncompressed bytes written, which is + always the length of data in bytes. Note that due to buffering, + the file on disk may not reflect the data written until .flush() + or .close() is called. + """ + self._check_can_write() + + length = _nbytes(data) + + compressed = self._compressor.compress(data) + self._fp.write(compressed) + self._pos += length + return length + + def flush(self, mode=FLUSH_BLOCK): + """Flush remaining data to the underlying stream. + + The mode argument can be FLUSH_BLOCK or FLUSH_FRAME. Abuse of this + method will reduce compression ratio, use it only when necessary. + + If the program is interrupted afterwards, all data can be recovered. + To ensure saving to disk, also need to use os.fsync(fd). + + This method does nothing in reading mode. + """ + if self._mode == _MODE_READ: + return + self._check_not_closed() + if mode not in {self.FLUSH_BLOCK, self.FLUSH_FRAME}: + raise ValueError('Invalid mode argument, expected either ' + 'ZstdFile.FLUSH_FRAME or ' + 'ZstdFile.FLUSH_BLOCK') + if self._compressor.last_mode == mode: + return + # Flush zstd block/frame, and write. + data = self._compressor.flush(mode) + self._fp.write(data) + if hasattr(self._fp, 'flush'): + self._fp.flush() + + def read(self, size=-1): + """Read up to size uncompressed bytes from the file. + + If size is negative or omitted, read until EOF is reached. + Returns b'' if the file is already at EOF. + """ + if size is None: + size = -1 + self._check_can_read() + return self._buffer.read(size) + + def read1(self, size=-1): + """Read up to size uncompressed bytes, while trying to avoid + making multiple reads from the underlying stream. Reads up to a + buffer's worth of data if size is negative. + + Returns b'' if the file is at EOF. + """ + self._check_can_read() + if size < 0: + # Note this should *not* be io.DEFAULT_BUFFER_SIZE. + # ZSTD_DStreamOutSize is the minimum amount to read guaranteeing + # a full block is read. + size = ZSTD_DStreamOutSize + return self._buffer.read1(size) + + def readinto(self, b): + """Read bytes into b. + + Returns the number of bytes read (0 for EOF). + """ + self._check_can_read() + return self._buffer.readinto(b) + + def readinto1(self, b): + """Read bytes into b, while trying to avoid making multiple reads + from the underlying stream. + + Returns the number of bytes read (0 for EOF). + """ + self._check_can_read() + return self._buffer.readinto1(b) + + def readline(self, size=-1): + """Read a line of uncompressed bytes from the file. + + The terminating newline (if present) is retained. If size is + non-negative, no more than size bytes will be read (in which + case the line may be incomplete). Returns b'' if already at EOF. + """ + self._check_can_read() + return self._buffer.readline(size) + + def seek(self, offset, whence=io.SEEK_SET): + """Change the file position. + + The new position is specified by offset, relative to the + position indicated by whence. Possible values for whence are: + + 0: start of stream (default): offset must not be negative + 1: current stream position + 2: end of stream; offset must not be positive + + Returns the new file position. + + Note that seeking is emulated, so depending on the arguments, + this operation may be extremely slow. + """ + self._check_can_read() + + # BufferedReader.seek() checks seekable + return self._buffer.seek(offset, whence) + + def peek(self, size=-1): + """Return buffered data without advancing the file position. + + Always returns at least one byte of data, unless at EOF. + The exact number of bytes returned is unspecified. + """ + # Relies on the undocumented fact that BufferedReader.peek() always + # returns at least one byte (except at EOF) + self._check_can_read() + return self._buffer.peek(size) + + def __next__(self): + if ret := self._buffer.readline(): + return ret + raise StopIteration + + def tell(self): + """Return the current file position.""" + self._check_not_closed() + if self._mode == _MODE_READ: + return self._buffer.tell() + elif self._mode == _MODE_WRITE: + return self._pos + + def fileno(self): + """Return the file descriptor for the underlying file.""" + self._check_not_closed() + return self._fp.fileno() + + @property + def name(self): + self._check_not_closed() + return self._fp.name + + @property + def mode(self): + return 'wb' if self._mode == _MODE_WRITE else 'rb' + + @property + def closed(self): + """True if this file is closed.""" + return self._mode == _MODE_CLOSED + + def seekable(self): + """Return whether the file supports seeking.""" + return self.readable() and self._buffer.seekable() + + def readable(self): + """Return whether the file was opened for reading.""" + self._check_not_closed() + return self._mode == _MODE_READ + + def writable(self): + """Return whether the file was opened for writing.""" + self._check_not_closed() + return self._mode == _MODE_WRITE + + +def open(file, /, mode='rb', *, level=None, options=None, zstd_dict=None, + encoding=None, errors=None, newline=None): + """Open a Zstandard compressed file in binary or text mode. + + file can be either a file name (given as a str, bytes, or PathLike object), + in which case the named file is opened, or it can be an existing file object + to read from or write to. + + The mode parameter can be 'r', 'rb' (default), 'w', 'wb', 'x', 'xb', 'a', + 'ab' for binary mode, or 'rt', 'wt', 'xt', 'at' for text mode. + + The level, options, and zstd_dict parameters specify the settings the same + as ZstdFile. + + When using read mode (decompression), the options parameter is a dict + representing advanced decompression options. The level parameter is not + supported in this case. When using write mode (compression), only one of + level, an int representing the compression level, or options, a dict + representing advanced compression options, may be passed. In both modes, + zstd_dict is a ZstdDict instance containing a trained Zstandard dictionary. + + For binary mode, this function is equivalent to the ZstdFile constructor: + ZstdFile(filename, mode, ...). In this case, the encoding, errors and + newline parameters must not be provided. + + For text mode, an ZstdFile object is created, and wrapped in an + io.TextIOWrapper instance with the specified encoding, error handling + behavior, and line ending(s). + """ + + text_mode = 't' in mode + mode = mode.replace('t', '') + + if text_mode: + if 'b' in mode: + raise ValueError(f'Invalid mode: {mode!r}') + else: + if encoding is not None: + raise ValueError('Argument "encoding" not supported in binary mode') + if errors is not None: + raise ValueError('Argument "errors" not supported in binary mode') + if newline is not None: + raise ValueError('Argument "newline" not supported in binary mode') + + binary_file = ZstdFile(file, mode, level=level, options=options, + zstd_dict=zstd_dict) + + if text_mode: + return io.TextIOWrapper(binary_file, encoding, errors, newline) + else: + return binary_file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..17ac2ac381e16ae104a822727075cd21f8e15bd8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d6ac4b3e0b675f60cfdaa949ddba883a160298c8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/__init__.py @@ -0,0 +1,65 @@ +# Copyright 2009 Brian Quinlan. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Execute computations asynchronously using threads or processes.""" + +__author__ = 'Brian Quinlan (brian@sweetapp.com)' + +from concurrent.futures._base import (FIRST_COMPLETED, + FIRST_EXCEPTION, + ALL_COMPLETED, + CancelledError, + TimeoutError, + InvalidStateError, + BrokenExecutor, + Future, + Executor, + wait, + as_completed) + +__all__ = [ + 'FIRST_COMPLETED', + 'FIRST_EXCEPTION', + 'ALL_COMPLETED', + 'CancelledError', + 'TimeoutError', + 'InvalidStateError', + 'BrokenExecutor', + 'Future', + 'Executor', + 'wait', + 'as_completed', + 'ProcessPoolExecutor', + 'ThreadPoolExecutor', +] + + +try: + import _interpreters +except ImportError: + _interpreters = None + +if _interpreters: + __all__.append('InterpreterPoolExecutor') + + +def __dir__(): + return __all__ + ['__author__', '__doc__'] + + +def __getattr__(name): + global ProcessPoolExecutor, ThreadPoolExecutor, InterpreterPoolExecutor + + if name == 'ProcessPoolExecutor': + from .process import ProcessPoolExecutor + return ProcessPoolExecutor + + if name == 'ThreadPoolExecutor': + from .thread import ThreadPoolExecutor + return ThreadPoolExecutor + + if _interpreters and name == 'InterpreterPoolExecutor': + from .interpreter import InterpreterPoolExecutor + return InterpreterPoolExecutor + + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..df91c0669e6487ad7e0d4b891ff5b0d8395ea4fb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/__pycache__/_base.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/__pycache__/_base.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cd47a2c93714e2a66640df730bffacaa0c36af7c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/__pycache__/_base.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/__pycache__/interpreter.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/__pycache__/interpreter.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5d807e23cf2920b1edbae895df047609a88e1897 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/__pycache__/interpreter.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/__pycache__/process.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/__pycache__/process.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..27106c8569403d7d02c597cd14e16e57e06b5a08 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/__pycache__/process.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/__pycache__/thread.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/__pycache__/thread.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..61cabcb95344cc9eb8a14961dbf242a3e5a691f1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/__pycache__/thread.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/_base.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/_base.py new file mode 100644 index 0000000000000000000000000000000000000000..d98b1ebdd584b5a331c4925c5d80fbb2e1dc9552 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/_base.py @@ -0,0 +1,674 @@ +# Copyright 2009 Brian Quinlan. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +__author__ = 'Brian Quinlan (brian@sweetapp.com)' + +import collections +import logging +import threading +import time +import types +import weakref +from itertools import islice + +FIRST_COMPLETED = 'FIRST_COMPLETED' +FIRST_EXCEPTION = 'FIRST_EXCEPTION' +ALL_COMPLETED = 'ALL_COMPLETED' +_AS_COMPLETED = '_AS_COMPLETED' + +# Possible future states (for internal use by the futures package). +PENDING = 'PENDING' +RUNNING = 'RUNNING' +# The future was cancelled by the user... +CANCELLED = 'CANCELLED' +# ...and _Waiter.add_cancelled() was called by a worker. +CANCELLED_AND_NOTIFIED = 'CANCELLED_AND_NOTIFIED' +FINISHED = 'FINISHED' + +_STATE_TO_DESCRIPTION_MAP = { + PENDING: "pending", + RUNNING: "running", + CANCELLED: "cancelled", + CANCELLED_AND_NOTIFIED: "cancelled", + FINISHED: "finished" +} + +# Logger for internal use by the futures package. +LOGGER = logging.getLogger("concurrent.futures") + +class Error(Exception): + """Base class for all future-related exceptions.""" + pass + +class CancelledError(Error): + """The Future was cancelled.""" + pass + +TimeoutError = TimeoutError # make local alias for the standard exception + +class InvalidStateError(Error): + """The operation is not allowed in this state.""" + pass + +class _Waiter(object): + """Provides the event that wait() and as_completed() block on.""" + def __init__(self): + self.event = threading.Event() + self.finished_futures = [] + + def add_result(self, future): + self.finished_futures.append(future) + + def add_exception(self, future): + self.finished_futures.append(future) + + def add_cancelled(self, future): + self.finished_futures.append(future) + +class _AsCompletedWaiter(_Waiter): + """Used by as_completed().""" + + def __init__(self): + super(_AsCompletedWaiter, self).__init__() + self.lock = threading.Lock() + + def add_result(self, future): + with self.lock: + super(_AsCompletedWaiter, self).add_result(future) + self.event.set() + + def add_exception(self, future): + with self.lock: + super(_AsCompletedWaiter, self).add_exception(future) + self.event.set() + + def add_cancelled(self, future): + with self.lock: + super(_AsCompletedWaiter, self).add_cancelled(future) + self.event.set() + +class _FirstCompletedWaiter(_Waiter): + """Used by wait(return_when=FIRST_COMPLETED).""" + + def add_result(self, future): + super().add_result(future) + self.event.set() + + def add_exception(self, future): + super().add_exception(future) + self.event.set() + + def add_cancelled(self, future): + super().add_cancelled(future) + self.event.set() + +class _AllCompletedWaiter(_Waiter): + """Used by wait(return_when=FIRST_EXCEPTION and ALL_COMPLETED).""" + + def __init__(self, num_pending_calls, stop_on_exception): + self.num_pending_calls = num_pending_calls + self.stop_on_exception = stop_on_exception + self.lock = threading.Lock() + super().__init__() + + def _decrement_pending_calls(self): + with self.lock: + self.num_pending_calls -= 1 + if not self.num_pending_calls: + self.event.set() + + def add_result(self, future): + super().add_result(future) + self._decrement_pending_calls() + + def add_exception(self, future): + super().add_exception(future) + if self.stop_on_exception: + self.event.set() + else: + self._decrement_pending_calls() + + def add_cancelled(self, future): + super().add_cancelled(future) + self._decrement_pending_calls() + +class _AcquireFutures(object): + """A context manager that does an ordered acquire of Future conditions.""" + + def __init__(self, futures): + self.futures = sorted(futures, key=id) + + def __enter__(self): + for future in self.futures: + future._condition.acquire() + + def __exit__(self, *args): + for future in self.futures: + future._condition.release() + +def _create_and_install_waiters(fs, return_when): + if return_when == _AS_COMPLETED: + waiter = _AsCompletedWaiter() + elif return_when == FIRST_COMPLETED: + waiter = _FirstCompletedWaiter() + else: + pending_count = sum( + f._state not in [CANCELLED_AND_NOTIFIED, FINISHED] for f in fs) + + if return_when == FIRST_EXCEPTION: + waiter = _AllCompletedWaiter(pending_count, stop_on_exception=True) + elif return_when == ALL_COMPLETED: + waiter = _AllCompletedWaiter(pending_count, stop_on_exception=False) + else: + raise ValueError("Invalid return condition: %r" % return_when) + + for f in fs: + f._waiters.append(waiter) + + return waiter + + +def _yield_finished_futures(fs, waiter, ref_collect): + """ + Iterate on the list *fs*, yielding finished futures one by one in + reverse order. + Before yielding a future, *waiter* is removed from its waiters + and the future is removed from each set in the collection of sets + *ref_collect*. + + The aim of this function is to avoid keeping stale references after + the future is yielded and before the iterator resumes. + """ + while fs: + f = fs[-1] + for futures_set in ref_collect: + futures_set.remove(f) + with f._condition: + f._waiters.remove(waiter) + del f + # Careful not to keep a reference to the popped value + yield fs.pop() + + +def as_completed(fs, timeout=None): + """An iterator over the given futures that yields each as it completes. + + Args: + fs: The sequence of Futures (possibly created by different Executors) to + iterate over. + timeout: The maximum number of seconds to wait. If None, then there + is no limit on the wait time. + + Returns: + An iterator that yields the given Futures as they complete (finished or + cancelled). If any given Futures are duplicated, they will be returned + once. + + Raises: + TimeoutError: If the entire result iterator could not be generated + before the given timeout. + """ + if timeout is not None: + end_time = timeout + time.monotonic() + + fs = set(fs) + total_futures = len(fs) + with _AcquireFutures(fs): + finished = set( + f for f in fs + if f._state in [CANCELLED_AND_NOTIFIED, FINISHED]) + pending = fs - finished + waiter = _create_and_install_waiters(fs, _AS_COMPLETED) + finished = list(finished) + try: + yield from _yield_finished_futures(finished, waiter, + ref_collect=(fs,)) + + while pending: + if timeout is None: + wait_timeout = None + else: + wait_timeout = end_time - time.monotonic() + if wait_timeout < 0: + raise TimeoutError( + '%d (of %d) futures unfinished' % ( + len(pending), total_futures)) + + waiter.event.wait(wait_timeout) + + with waiter.lock: + finished = waiter.finished_futures + waiter.finished_futures = [] + waiter.event.clear() + + # reverse to keep finishing order + finished.reverse() + yield from _yield_finished_futures(finished, waiter, + ref_collect=(fs, pending)) + + finally: + # Remove waiter from unfinished futures + for f in fs: + with f._condition: + f._waiters.remove(waiter) + +DoneAndNotDoneFutures = collections.namedtuple( + 'DoneAndNotDoneFutures', 'done not_done') +def wait(fs, timeout=None, return_when=ALL_COMPLETED): + """Wait for the futures in the given sequence to complete. + + Args: + fs: The sequence of Futures (possibly created by different Executors) to + wait upon. + timeout: The maximum number of seconds to wait. If None, then there + is no limit on the wait time. + return_when: Indicates when this function should return. The options + are: + + FIRST_COMPLETED - Return when any future finishes or is + cancelled. + FIRST_EXCEPTION - Return when any future finishes by raising an + exception. If no future raises an exception + then it is equivalent to ALL_COMPLETED. + ALL_COMPLETED - Return when all futures finish or are cancelled. + + Returns: + A named 2-tuple of sets. The first set, named 'done', contains the + futures that completed (is finished or cancelled) before the wait + completed. The second set, named 'not_done', contains uncompleted + futures. Duplicate futures given to *fs* are removed and will be + returned only once. + """ + fs = set(fs) + with _AcquireFutures(fs): + done = {f for f in fs + if f._state in [CANCELLED_AND_NOTIFIED, FINISHED]} + not_done = fs - done + if (return_when == FIRST_COMPLETED) and done: + return DoneAndNotDoneFutures(done, not_done) + elif (return_when == FIRST_EXCEPTION) and done: + if any(f for f in done + if not f.cancelled() and f.exception() is not None): + return DoneAndNotDoneFutures(done, not_done) + + if len(done) == len(fs): + return DoneAndNotDoneFutures(done, not_done) + + waiter = _create_and_install_waiters(fs, return_when) + + waiter.event.wait(timeout) + for f in fs: + with f._condition: + f._waiters.remove(waiter) + + done.update(waiter.finished_futures) + return DoneAndNotDoneFutures(done, fs - done) + + +def _result_or_cancel(fut, timeout=None): + try: + try: + return fut.result(timeout) + finally: + fut.cancel() + finally: + # Break a reference cycle with the exception in self._exception + del fut + + +class Future(object): + """Represents the result of an asynchronous computation.""" + + def __init__(self): + """Initializes the future. Should not be called by clients.""" + self._condition = threading.Condition() + self._state = PENDING + self._result = None + self._exception = None + self._waiters = [] + self._done_callbacks = [] + + def _invoke_callbacks(self): + for callback in self._done_callbacks: + try: + callback(self) + except Exception: + LOGGER.exception('exception calling callback for %r', self) + + def __repr__(self): + with self._condition: + if self._state == FINISHED: + if self._exception: + return '<%s at %#x state=%s raised %s>' % ( + self.__class__.__name__, + id(self), + _STATE_TO_DESCRIPTION_MAP[self._state], + self._exception.__class__.__name__) + else: + return '<%s at %#x state=%s returned %s>' % ( + self.__class__.__name__, + id(self), + _STATE_TO_DESCRIPTION_MAP[self._state], + self._result.__class__.__name__) + return '<%s at %#x state=%s>' % ( + self.__class__.__name__, + id(self), + _STATE_TO_DESCRIPTION_MAP[self._state]) + + def cancel(self): + """Cancel the future if possible. + + Returns True if the future was cancelled, False otherwise. A future + cannot be cancelled if it is running or has already completed. + """ + with self._condition: + if self._state in [RUNNING, FINISHED]: + return False + + if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: + return True + + self._state = CANCELLED + self._condition.notify_all() + + self._invoke_callbacks() + return True + + def cancelled(self): + """Return True if the future was cancelled.""" + with self._condition: + return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED] + + def running(self): + """Return True if the future is currently executing.""" + with self._condition: + return self._state == RUNNING + + def done(self): + """Return True if the future was cancelled or finished executing.""" + with self._condition: + return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED] + + def __get_result(self): + if self._exception is not None: + try: + raise self._exception + finally: + # Break a reference cycle with the exception in self._exception + self = None + else: + return self._result + + def add_done_callback(self, fn): + """Attaches a callable that will be called when the future finishes. + + Args: + fn: A callable that will be called with this future as its only + argument when the future completes or is cancelled. The callable + will always be called by a thread in the same process in which + it was added. If the future has already completed or been + cancelled then the callable will be called immediately. These + callables are called in the order that they were added. + """ + with self._condition: + if self._state not in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED]: + self._done_callbacks.append(fn) + return + try: + fn(self) + except Exception: + LOGGER.exception('exception calling callback for %r', self) + + def result(self, timeout=None): + """Return the result of the call that the future represents. + + Args: + timeout: The number of seconds to wait for the result if the future + isn't done. If None, then there is no limit on the wait time. + + Returns: + The result of the call that the future represents. + + Raises: + CancelledError: If the future was cancelled. + TimeoutError: If the future didn't finish executing before the given + timeout. + Exception: If the call raised then that exception will be raised. + """ + try: + with self._condition: + if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: + raise CancelledError() + elif self._state == FINISHED: + return self.__get_result() + + self._condition.wait(timeout) + + if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: + raise CancelledError() + elif self._state == FINISHED: + return self.__get_result() + else: + raise TimeoutError() + finally: + # Break a reference cycle with the exception in self._exception + self = None + + def exception(self, timeout=None): + """Return the exception raised by the call that the future represents. + + Args: + timeout: The number of seconds to wait for the exception if the + future isn't done. If None, then there is no limit on the wait + time. + + Returns: + The exception raised by the call that the future represents or None + if the call completed without raising. + + Raises: + CancelledError: If the future was cancelled. + TimeoutError: If the future didn't finish executing before the given + timeout. + """ + + with self._condition: + if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: + raise CancelledError() + elif self._state == FINISHED: + return self._exception + + self._condition.wait(timeout) + + if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: + raise CancelledError() + elif self._state == FINISHED: + return self._exception + else: + raise TimeoutError() + + # The following methods should only be used by Executors and in tests. + def set_running_or_notify_cancel(self): + """Mark the future as running or process any cancel notifications. + + Should only be used by Executor implementations and unit tests. + + If the future has been cancelled (cancel() was called and returned + True) then any threads waiting on the future completing (though calls + to as_completed() or wait()) are notified and False is returned. + + If the future was not cancelled then it is put in the running state + (future calls to running() will return True) and True is returned. + + This method should be called by Executor implementations before + executing the work associated with this future. If this method returns + False then the work should not be executed. + + Returns: + False if the Future was cancelled, True otherwise. + + Raises: + RuntimeError: if this method was already called or if set_result() + or set_exception() was called. + """ + with self._condition: + if self._state == CANCELLED: + self._state = CANCELLED_AND_NOTIFIED + for waiter in self._waiters: + waiter.add_cancelled(self) + # self._condition.notify_all() is not necessary because + # self.cancel() triggers a notification. + return False + elif self._state == PENDING: + self._state = RUNNING + return True + else: + LOGGER.critical('Future %s in unexpected state: %s', + id(self), + self._state) + raise RuntimeError('Future in unexpected state') + + def set_result(self, result): + """Sets the return value of work associated with the future. + + Should only be used by Executor implementations and unit tests. + """ + with self._condition: + if self._state in {CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED}: + raise InvalidStateError('{}: {!r}'.format(self._state, self)) + self._result = result + self._state = FINISHED + for waiter in self._waiters: + waiter.add_result(self) + self._condition.notify_all() + self._invoke_callbacks() + + def set_exception(self, exception): + """Sets the result of the future as being the given exception. + + Should only be used by Executor implementations and unit tests. + """ + with self._condition: + if self._state in {CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED}: + raise InvalidStateError('{}: {!r}'.format(self._state, self)) + self._exception = exception + self._state = FINISHED + for waiter in self._waiters: + waiter.add_exception(self) + self._condition.notify_all() + self._invoke_callbacks() + + __class_getitem__ = classmethod(types.GenericAlias) + +class Executor(object): + """This is an abstract base class for concrete asynchronous executors.""" + + def submit(self, fn, /, *args, **kwargs): + """Submits a callable to be executed with the given arguments. + + Schedules the callable to be executed as fn(*args, **kwargs) and returns + a Future instance representing the execution of the callable. + + Returns: + A Future representing the given call. + """ + raise NotImplementedError() + + def map(self, fn, *iterables, timeout=None, chunksize=1, buffersize=None): + """Returns an iterator equivalent to map(fn, iter). + + Args: + fn: A callable that will take as many arguments as there are + passed iterables. + timeout: The maximum number of seconds to wait. If None, then there + is no limit on the wait time. + chunksize: The size of the chunks the iterable will be broken into + before being passed to a child process. This argument is only + used by ProcessPoolExecutor; it is ignored by + ThreadPoolExecutor. + buffersize: The number of submitted tasks whose results have not + yet been yielded. If the buffer is full, iteration over the + iterables pauses until a result is yielded from the buffer. + If None, all input elements are eagerly collected, and a task is + submitted for each. + + Returns: + An iterator equivalent to: map(func, *iterables) but the calls may + be evaluated out-of-order. + + Raises: + TimeoutError: If the entire result iterator could not be generated + before the given timeout. + Exception: If fn(*args) raises for any values. + """ + if buffersize is not None and not isinstance(buffersize, int): + raise TypeError("buffersize must be an integer or None") + if buffersize is not None and buffersize < 1: + raise ValueError("buffersize must be None or > 0") + + if timeout is not None: + end_time = timeout + time.monotonic() + + zipped_iterables = zip(*iterables) + if buffersize: + fs = collections.deque( + self.submit(fn, *args) for args in islice(zipped_iterables, buffersize) + ) + else: + fs = [self.submit(fn, *args) for args in zipped_iterables] + + # Use a weak reference to ensure that the executor can be garbage + # collected independently of the result_iterator closure. + executor_weakref = weakref.ref(self) + + # Yield must be hidden in closure so that the futures are submitted + # before the first iterator value is required. + def result_iterator(): + try: + # reverse to keep finishing order + fs.reverse() + while fs: + if ( + buffersize + and (executor := executor_weakref()) + and (args := next(zipped_iterables, None)) + ): + fs.appendleft(executor.submit(fn, *args)) + # Careful not to keep a reference to the popped future + if timeout is None: + yield _result_or_cancel(fs.pop()) + else: + yield _result_or_cancel(fs.pop(), end_time - time.monotonic()) + finally: + for future in fs: + future.cancel() + return result_iterator() + + def shutdown(self, wait=True, *, cancel_futures=False): + """Clean-up the resources associated with the Executor. + + It is safe to call this method several times. Otherwise, no other + methods can be called after this one. + + Args: + wait: If True then shutdown will not return until all running + futures have finished executing and the resources used by the + executor have been reclaimed. + cancel_futures: If True then shutdown will cancel all pending + futures. Futures that are completed or running will not be + cancelled. + """ + pass + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self.shutdown(wait=True) + return False + + +class BrokenExecutor(RuntimeError): + """ + Raised when a executor has become non-functional after a severe failure. + """ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/interpreter.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/interpreter.py new file mode 100644 index 0000000000000000000000000000000000000000..85c1da2c7228943cc168d7430e2ce06898eb6282 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/interpreter.py @@ -0,0 +1,123 @@ +"""Implements InterpreterPoolExecutor.""" + +from concurrent import interpreters +import sys +from . import thread as _thread +import traceback + + +def do_call(results, func, args, kwargs): + try: + return func(*args, **kwargs) + except BaseException as exc: + # Send the captured exception out on the results queue, + # but still leave it unhandled for the interpreter to handle. + try: + results.put(exc) + except interpreters.NotShareableError: + # The exception is not shareable. + print('exception is not shareable:', file=sys.stderr) + traceback.print_exception(exc) + results.put(None) + raise # re-raise + + +class WorkerContext(_thread.WorkerContext): + + @classmethod + def prepare(cls, initializer, initargs): + def resolve_task(fn, args, kwargs): + if isinstance(fn, str): + # XXX Circle back to this later. + raise TypeError('scripts not supported') + else: + task = (fn, args, kwargs) + return task + + if initializer is not None: + try: + initdata = resolve_task(initializer, initargs, {}) + except ValueError: + if isinstance(initializer, str) and initargs: + raise ValueError(f'an initializer script does not take args, got {initargs!r}') + raise # re-raise + else: + initdata = None + def create_context(): + return cls(initdata) + return create_context, resolve_task + + def __init__(self, initdata): + self.initdata = initdata + self.interp = None + self.results = None + + def __del__(self): + if self.interp is not None: + self.finalize() + + def initialize(self): + assert self.interp is None, self.interp + self.interp = interpreters.create() + try: + maxsize = 0 + self.results = interpreters.create_queue(maxsize) + + if self.initdata: + self.run(self.initdata) + except BaseException: + self.finalize() + raise # re-raise + + def finalize(self): + interp = self.interp + results = self.results + self.results = None + self.interp = None + if results is not None: + del results + if interp is not None: + interp.close() + + def run(self, task): + try: + return self.interp.call(do_call, self.results, *task) + except interpreters.ExecutionFailed as wrapper: + # Wait for the exception data to show up. + exc = self.results.get() + if exc is None: + # The exception must have been not shareable. + raise # re-raise + raise exc from wrapper + + +class BrokenInterpreterPool(_thread.BrokenThreadPool): + """ + Raised when a worker thread in an InterpreterPoolExecutor failed initializing. + """ + + +class InterpreterPoolExecutor(_thread.ThreadPoolExecutor): + + BROKEN = BrokenInterpreterPool + + @classmethod + def prepare_context(cls, initializer, initargs): + return WorkerContext.prepare(initializer, initargs) + + def __init__(self, max_workers=None, thread_name_prefix='', + initializer=None, initargs=()): + """Initializes a new InterpreterPoolExecutor instance. + + Args: + max_workers: The maximum number of interpreters that can be used to + execute the given calls. + thread_name_prefix: An optional name prefix to give our threads. + initializer: A callable or script used to initialize + each worker interpreter. + initargs: A tuple of arguments to pass to the initializer. + """ + thread_name_prefix = (thread_name_prefix or + (f"InterpreterPoolExecutor-{self._counter()}")) + super().__init__(max_workers, thread_name_prefix, + initializer, initargs) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/process.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/process.py new file mode 100644 index 0000000000000000000000000000000000000000..a14650bf5fa47cd65037b078a4e6572ace4480c5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/process.py @@ -0,0 +1,939 @@ +# Copyright 2009 Brian Quinlan. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Implements ProcessPoolExecutor. + +The following diagram and text describe the data-flow through the system: + +|======================= In-process =====================|== Out-of-process ==| + ++----------+ +----------+ +--------+ +-----------+ +---------+ +| | => | Work Ids | | | | Call Q | | Process | +| | +----------+ | | +-----------+ | Pool | +| | | ... | | | | ... | +---------+ +| | | 6 | => | | => | 5, call() | => | | +| | | 7 | | | | ... | | | +| Process | | ... | | Local | +-----------+ | Process | +| Pool | +----------+ | Worker | | #1..n | +| Executor | | Thread | | | +| | +----------- + | | +-----------+ | | +| | <=> | Work Items | <=> | | <= | Result Q | <= | | +| | +------------+ | | +-----------+ | | +| | | 6: call() | | | | ... | | | +| | | future | | | | 4, result | | | +| | | ... | | | | 3, except | | | ++----------+ +------------+ +--------+ +-----------+ +---------+ + +Executor.submit() called: +- creates a uniquely numbered _WorkItem and adds it to the "Work Items" dict +- adds the id of the _WorkItem to the "Work Ids" queue + +Local worker thread: +- reads work ids from the "Work Ids" queue and looks up the corresponding + WorkItem from the "Work Items" dict: if the work item has been cancelled then + it is simply removed from the dict, otherwise it is repackaged as a + _CallItem and put in the "Call Q". New _CallItems are put in the "Call Q" + until "Call Q" is full. NOTE: the size of the "Call Q" is kept small because + calls placed in the "Call Q" can no longer be cancelled with Future.cancel(). +- reads _ResultItems from "Result Q", updates the future stored in the + "Work Items" dict and deletes the dict entry + +Process #1..n: +- reads _CallItems from "Call Q", executes the calls, and puts the resulting + _ResultItems in "Result Q" +""" + +__author__ = 'Brian Quinlan (brian@sweetapp.com)' + +import os +from concurrent.futures import _base +import queue +import multiprocessing as mp +# This import is required to load the multiprocessing.connection submodule +# so that it can be accessed later as `mp.connection` +import multiprocessing.connection +from multiprocessing.queues import Queue +import threading +import weakref +from functools import partial +import itertools +import sys +from traceback import format_exception + + +_threads_wakeups = weakref.WeakKeyDictionary() +_global_shutdown = False + + +class _ThreadWakeup: + def __init__(self): + self._closed = False + self._lock = threading.Lock() + self._reader, self._writer = mp.Pipe(duplex=False) + + def close(self): + # Please note that we do not take the self._lock when + # calling clear() (to avoid deadlocking) so this method can + # only be called safely from the same thread as all calls to + # clear() even if you hold the lock. Otherwise we + # might try to read from the closed pipe. + with self._lock: + if not self._closed: + self._closed = True + self._writer.close() + self._reader.close() + + def wakeup(self): + with self._lock: + if not self._closed: + self._writer.send_bytes(b"") + + def clear(self): + if self._closed: + raise RuntimeError('operation on closed _ThreadWakeup') + while self._reader.poll(): + self._reader.recv_bytes() + + +def _python_exit(): + global _global_shutdown + _global_shutdown = True + items = list(_threads_wakeups.items()) + for _, thread_wakeup in items: + # call not protected by ProcessPoolExecutor._shutdown_lock + thread_wakeup.wakeup() + for t, _ in items: + t.join() + +# Register for `_python_exit()` to be called just before joining all +# non-daemon threads. This is used instead of `atexit.register()` for +# compatibility with subinterpreters, which no longer support daemon threads. +# See bpo-39812 for context. +threading._register_atexit(_python_exit) + +# Controls how many more calls than processes will be queued in the call queue. +# A smaller number will mean that processes spend more time idle waiting for +# work while a larger number will make Future.cancel() succeed less frequently +# (Futures in the call queue cannot be cancelled). +EXTRA_QUEUED_CALLS = 1 + + +# On Windows, WaitForMultipleObjects is used to wait for processes to finish. +# It can wait on, at most, 63 objects. There is an overhead of two objects: +# - the result queue reader +# - the thread wakeup reader +_MAX_WINDOWS_WORKERS = 63 - 2 + +# Hack to embed stringification of remote traceback in local traceback + +class _RemoteTraceback(Exception): + def __init__(self, tb): + self.tb = tb + def __str__(self): + return self.tb + +class _ExceptionWithTraceback: + def __init__(self, exc, tb): + tb = ''.join(format_exception(type(exc), exc, tb)) + self.exc = exc + # Traceback object needs to be garbage-collected as its frames + # contain references to all the objects in the exception scope + self.exc.__traceback__ = None + self.tb = '\n"""\n%s"""' % tb + def __reduce__(self): + return _rebuild_exc, (self.exc, self.tb) + +def _rebuild_exc(exc, tb): + exc.__cause__ = _RemoteTraceback(tb) + return exc + +class _WorkItem(object): + def __init__(self, future, fn, args, kwargs): + self.future = future + self.fn = fn + self.args = args + self.kwargs = kwargs + +class _ResultItem(object): + def __init__(self, work_id, exception=None, result=None, exit_pid=None): + self.work_id = work_id + self.exception = exception + self.result = result + self.exit_pid = exit_pid + +class _CallItem(object): + def __init__(self, work_id, fn, args, kwargs): + self.work_id = work_id + self.fn = fn + self.args = args + self.kwargs = kwargs + + +class _SafeQueue(Queue): + """Safe Queue set exception to the future object linked to a job""" + def __init__(self, max_size=0, *, ctx, pending_work_items, thread_wakeup): + self.pending_work_items = pending_work_items + self.thread_wakeup = thread_wakeup + super().__init__(max_size, ctx=ctx) + + def _on_queue_feeder_error(self, e, obj): + if isinstance(obj, _CallItem): + tb = format_exception(type(e), e, e.__traceback__) + e.__cause__ = _RemoteTraceback('\n"""\n{}"""'.format(''.join(tb))) + work_item = self.pending_work_items.pop(obj.work_id, None) + self.thread_wakeup.wakeup() + # work_item can be None if another process terminated. In this + # case, the executor_manager_thread fails all work_items + # with BrokenProcessPool + if work_item is not None: + work_item.future.set_exception(e) + else: + super()._on_queue_feeder_error(e, obj) + + +def _process_chunk(fn, chunk): + """ Processes a chunk of an iterable passed to map. + + Runs the function passed to map() on a chunk of the + iterable passed to map. + + This function is run in a separate process. + + """ + return [fn(*args) for args in chunk] + + +def _sendback_result(result_queue, work_id, result=None, exception=None, + exit_pid=None): + """Safely send back the given result or exception""" + try: + result_queue.put(_ResultItem(work_id, result=result, + exception=exception, exit_pid=exit_pid)) + except BaseException as e: + exc = _ExceptionWithTraceback(e, e.__traceback__) + result_queue.put(_ResultItem(work_id, exception=exc, + exit_pid=exit_pid)) + + +def _process_worker(call_queue, result_queue, initializer, initargs, max_tasks=None): + """Evaluates calls from call_queue and places the results in result_queue. + + This worker is run in a separate process. + + Args: + call_queue: A ctx.Queue of _CallItems that will be read and + evaluated by the worker. + result_queue: A ctx.Queue of _ResultItems that will written + to by the worker. + initializer: A callable initializer, or None + initargs: A tuple of args for the initializer + """ + if initializer is not None: + try: + initializer(*initargs) + except BaseException: + _base.LOGGER.critical('Exception in initializer:', exc_info=True) + # The parent will notice that the process stopped and + # mark the pool broken + return + num_tasks = 0 + exit_pid = None + while True: + call_item = call_queue.get(block=True) + if call_item is None: + # Wake up queue management thread + result_queue.put(os.getpid()) + return + + if max_tasks is not None: + num_tasks += 1 + if num_tasks >= max_tasks: + exit_pid = os.getpid() + + try: + r = call_item.fn(*call_item.args, **call_item.kwargs) + except BaseException as e: + exc = _ExceptionWithTraceback(e, e.__traceback__) + _sendback_result(result_queue, call_item.work_id, exception=exc, + exit_pid=exit_pid) + else: + _sendback_result(result_queue, call_item.work_id, result=r, + exit_pid=exit_pid) + del r + + # Liberate the resource as soon as possible, to avoid holding onto + # open files or shared memory that is not needed anymore + del call_item + + if exit_pid is not None: + return + + +class _ExecutorManagerThread(threading.Thread): + """Manages the communication between this process and the worker processes. + + The manager is run in a local thread. + + Args: + executor: A reference to the ProcessPoolExecutor that owns + this thread. A weakref will be own by the manager as well as + references to internal objects used to introspect the state of + the executor. + """ + + def __init__(self, executor): + # Store references to necessary internals of the executor. + + # A _ThreadWakeup to allow waking up the queue_manager_thread from the + # main Thread and avoid deadlocks caused by permanently locked queues. + self.thread_wakeup = executor._executor_manager_thread_wakeup + self.shutdown_lock = executor._shutdown_lock + + # A weakref.ref to the ProcessPoolExecutor that owns this thread. Used + # to determine if the ProcessPoolExecutor has been garbage collected + # and that the manager can exit. + # When the executor gets garbage collected, the weakref callback + # will wake up the queue management thread so that it can terminate + # if there is no pending work item. + def weakref_cb(_, + thread_wakeup=self.thread_wakeup, + mp_util_debug=mp.util.debug): + mp_util_debug('Executor collected: triggering callback for' + ' QueueManager wakeup') + thread_wakeup.wakeup() + + self.executor_reference = weakref.ref(executor, weakref_cb) + + # A list of the ctx.Process instances used as workers. + self.processes = executor._processes + + # A ctx.Queue that will be filled with _CallItems derived from + # _WorkItems for processing by the process workers. + self.call_queue = executor._call_queue + + # A ctx.SimpleQueue of _ResultItems generated by the process workers. + self.result_queue = executor._result_queue + + # A queue.Queue of work ids e.g. Queue([5, 6, ...]). + self.work_ids_queue = executor._work_ids + + # Maximum number of tasks a worker process can execute before + # exiting safely + self.max_tasks_per_child = executor._max_tasks_per_child + + # A dict mapping work ids to _WorkItems e.g. + # {5: <_WorkItem...>, 6: <_WorkItem...>, ...} + self.pending_work_items = executor._pending_work_items + + super().__init__() + + def run(self): + # Main loop for the executor manager thread. + + while True: + # gh-109047: During Python finalization, self.call_queue.put() + # creation of a thread can fail with RuntimeError. + try: + self.add_call_item_to_queue() + except BaseException as exc: + cause = format_exception(exc) + self.terminate_broken(cause) + return + + result_item, is_broken, cause = self.wait_result_broken_or_wakeup() + + if is_broken: + self.terminate_broken(cause) + return + if result_item is not None: + self.process_result_item(result_item) + + process_exited = result_item.exit_pid is not None + if process_exited: + p = self.processes.pop(result_item.exit_pid) + p.join() + + # Delete reference to result_item to avoid keeping references + # while waiting on new results. + del result_item + + if executor := self.executor_reference(): + if process_exited: + with self.shutdown_lock: + executor._adjust_process_count() + else: + executor._idle_worker_semaphore.release() + del executor + + if self.is_shutting_down(): + self.flag_executor_shutting_down() + + # When only canceled futures remain in pending_work_items, our + # next call to wait_result_broken_or_wakeup would hang forever. + # This makes sure we have some running futures or none at all. + self.add_call_item_to_queue() + + # Since no new work items can be added, it is safe to shutdown + # this thread if there are no pending work items. + if not self.pending_work_items: + self.join_executor_internals() + return + + def add_call_item_to_queue(self): + # Fills call_queue with _WorkItems from pending_work_items. + # This function never blocks. + while True: + if self.call_queue.full(): + return + try: + work_id = self.work_ids_queue.get(block=False) + except queue.Empty: + return + else: + work_item = self.pending_work_items[work_id] + + if work_item.future.set_running_or_notify_cancel(): + self.call_queue.put(_CallItem(work_id, + work_item.fn, + work_item.args, + work_item.kwargs), + block=True) + else: + del self.pending_work_items[work_id] + continue + + def wait_result_broken_or_wakeup(self): + # Wait for a result to be ready in the result_queue while checking + # that all worker processes are still running, or for a wake up + # signal send. The wake up signals come either from new tasks being + # submitted, from the executor being shutdown/gc-ed, or from the + # shutdown of the python interpreter. + result_reader = self.result_queue._reader + assert not self.thread_wakeup._closed + wakeup_reader = self.thread_wakeup._reader + readers = [result_reader, wakeup_reader] + worker_sentinels = [p.sentinel for p in list(self.processes.values())] + ready = mp.connection.wait(readers + worker_sentinels) + + cause = None + is_broken = True + result_item = None + if result_reader in ready: + try: + result_item = result_reader.recv() + is_broken = False + except BaseException as exc: + cause = format_exception(exc) + + elif wakeup_reader in ready: + is_broken = False + + self.thread_wakeup.clear() + + return result_item, is_broken, cause + + def process_result_item(self, result_item): + # Process the received a result_item. This can be either the PID of a + # worker that exited gracefully or a _ResultItem + + # Received a _ResultItem so mark the future as completed. + work_item = self.pending_work_items.pop(result_item.work_id, None) + # work_item can be None if another process terminated (see above) + if work_item is not None: + if result_item.exception is not None: + work_item.future.set_exception(result_item.exception) + else: + work_item.future.set_result(result_item.result) + + def is_shutting_down(self): + # Check whether we should start shutting down the executor. + executor = self.executor_reference() + # No more work items can be added if: + # - The interpreter is shutting down OR + # - The executor that owns this worker has been collected OR + # - The executor that owns this worker has been shutdown. + return (_global_shutdown or executor is None + or executor._shutdown_thread) + + def _terminate_broken(self, cause): + # Terminate the executor because it is in a broken state. The cause + # argument can be used to display more information on the error that + # lead the executor into becoming broken. + + # Mark the process pool broken so that submits fail right now. + executor = self.executor_reference() + if executor is not None: + executor._broken = ('A child process terminated ' + 'abruptly, the process pool is not ' + 'usable anymore') + executor._shutdown_thread = True + executor = None + + # All pending tasks are to be marked failed with the following + # BrokenProcessPool error + bpe = BrokenProcessPool("A process in the process pool was " + "terminated abruptly while the future was " + "running or pending.") + if cause is not None: + bpe.__cause__ = _RemoteTraceback( + f"\n'''\n{''.join(cause)}'''") + + # Mark pending tasks as failed. + for work_id, work_item in self.pending_work_items.items(): + try: + work_item.future.set_exception(bpe) + except _base.InvalidStateError: + # set_exception() fails if the future is cancelled: ignore it. + # Trying to check if the future is cancelled before calling + # set_exception() would leave a race condition if the future is + # cancelled between the check and set_exception(). + pass + # Delete references to object. See issue16284 + del work_item + self.pending_work_items.clear() + + # Terminate remaining workers forcibly: the queues or their + # locks may be in a dirty state and block forever. + for p in self.processes.values(): + p.terminate() + + self.call_queue._terminate_broken() + + # clean up resources + self._join_executor_internals(broken=True) + + def terminate_broken(self, cause): + with self.shutdown_lock: + self._terminate_broken(cause) + + def flag_executor_shutting_down(self): + # Flag the executor as shutting down and cancel remaining tasks if + # requested as early as possible if it is not gc-ed yet. + executor = self.executor_reference() + if executor is not None: + executor._shutdown_thread = True + # Cancel pending work items if requested. + if executor._cancel_pending_futures: + # Cancel all pending futures and update pending_work_items + # to only have futures that are currently running. + new_pending_work_items = {} + for work_id, work_item in self.pending_work_items.items(): + if not work_item.future.cancel(): + new_pending_work_items[work_id] = work_item + self.pending_work_items = new_pending_work_items + # Drain work_ids_queue since we no longer need to + # add items to the call queue. + while True: + try: + self.work_ids_queue.get_nowait() + except queue.Empty: + break + # Make sure we do this only once to not waste time looping + # on running processes over and over. + executor._cancel_pending_futures = False + + def shutdown_workers(self): + n_children_to_stop = self.get_n_children_alive() + n_sentinels_sent = 0 + # Send the right number of sentinels, to make sure all children are + # properly terminated. + while (n_sentinels_sent < n_children_to_stop + and self.get_n_children_alive() > 0): + for i in range(n_children_to_stop - n_sentinels_sent): + try: + self.call_queue.put_nowait(None) + n_sentinels_sent += 1 + except queue.Full: + break + + def join_executor_internals(self): + with self.shutdown_lock: + self._join_executor_internals() + + def _join_executor_internals(self, broken=False): + # If broken, call_queue was closed and so can no longer be used. + if not broken: + self.shutdown_workers() + + # Release the queue's resources as soon as possible. + self.call_queue.close() + self.call_queue.join_thread() + self.thread_wakeup.close() + + # If .join() is not called on the created processes then + # some ctx.Queue methods may deadlock on Mac OS X. + for p in self.processes.values(): + if broken: + p.terminate() + p.join() + + def get_n_children_alive(self): + # This is an upper bound on the number of children alive. + return sum(p.is_alive() for p in self.processes.values()) + + +_system_limits_checked = False +_system_limited = None + + +def _check_system_limits(): + global _system_limits_checked, _system_limited + if _system_limits_checked: + if _system_limited: + raise NotImplementedError(_system_limited) + _system_limits_checked = True + try: + import multiprocessing.synchronize # noqa: F401 + except ImportError: + _system_limited = ( + "This Python build lacks multiprocessing.synchronize, usually due " + "to named semaphores being unavailable on this platform." + ) + raise NotImplementedError(_system_limited) + try: + nsems_max = os.sysconf("SC_SEM_NSEMS_MAX") + except (AttributeError, ValueError): + # sysconf not available or setting not available + return + if nsems_max == -1: + # indetermined limit, assume that limit is determined + # by available memory only + return + if nsems_max >= 256: + # minimum number of semaphores available + # according to POSIX + return + _system_limited = ("system provides too few semaphores (%d" + " available, 256 necessary)" % nsems_max) + raise NotImplementedError(_system_limited) + + +def _chain_from_iterable_of_lists(iterable): + """ + Specialized implementation of itertools.chain.from_iterable. + Each item in *iterable* should be a list. This function is + careful not to keep references to yielded objects. + """ + for element in iterable: + element.reverse() + while element: + yield element.pop() + + +class BrokenProcessPool(_base.BrokenExecutor): + """ + Raised when a process in a ProcessPoolExecutor terminated abruptly + while a future was in the running state. + """ + +_TERMINATE = "terminate" +_KILL = "kill" + +_SHUTDOWN_CALLBACK_OPERATION = { + _TERMINATE, + _KILL +} + + +class ProcessPoolExecutor(_base.Executor): + def __init__(self, max_workers=None, mp_context=None, + initializer=None, initargs=(), *, max_tasks_per_child=None): + """Initializes a new ProcessPoolExecutor instance. + + Args: + max_workers: The maximum number of processes that can be used to + execute the given calls. If None or not given then as many + worker processes will be created as the machine has processors. + mp_context: A multiprocessing context to launch the workers created + using the multiprocessing.get_context('start method') API. This + object should provide SimpleQueue, Queue and Process. + initializer: A callable used to initialize worker processes. + initargs: A tuple of arguments to pass to the initializer. + max_tasks_per_child: The maximum number of tasks a worker process + can complete before it will exit and be replaced with a fresh + worker process. The default of None means worker process will + live as long as the executor. Requires a non-'fork' mp_context + start method. When given, we default to using 'spawn' if no + mp_context is supplied. + """ + _check_system_limits() + + if max_workers is None: + self._max_workers = os.process_cpu_count() or 1 + if sys.platform == 'win32': + self._max_workers = min(_MAX_WINDOWS_WORKERS, + self._max_workers) + else: + if max_workers <= 0: + raise ValueError("max_workers must be greater than 0") + elif (sys.platform == 'win32' and + max_workers > _MAX_WINDOWS_WORKERS): + raise ValueError( + f"max_workers must be <= {_MAX_WINDOWS_WORKERS}") + + self._max_workers = max_workers + + if mp_context is None: + if max_tasks_per_child is not None: + mp_context = mp.get_context("spawn") + else: + mp_context = mp.get_context() + self._mp_context = mp_context + + # https://github.com/python/cpython/issues/90622 + self._safe_to_dynamically_spawn_children = ( + self._mp_context.get_start_method(allow_none=False) != "fork") + + if initializer is not None and not callable(initializer): + raise TypeError("initializer must be a callable") + self._initializer = initializer + self._initargs = initargs + + if max_tasks_per_child is not None: + if not isinstance(max_tasks_per_child, int): + raise TypeError("max_tasks_per_child must be an integer") + elif max_tasks_per_child <= 0: + raise ValueError("max_tasks_per_child must be >= 1") + if self._mp_context.get_start_method(allow_none=False) == "fork": + # https://github.com/python/cpython/issues/90622 + raise ValueError("max_tasks_per_child is incompatible with" + " the 'fork' multiprocessing start method;" + " supply a different mp_context.") + self._max_tasks_per_child = max_tasks_per_child + + # Management thread + self._executor_manager_thread = None + + # Map of pids to processes + self._processes = {} + + # Shutdown is a two-step process. + self._shutdown_thread = False + self._shutdown_lock = threading.Lock() + self._idle_worker_semaphore = threading.Semaphore(0) + self._broken = False + self._queue_count = 0 + self._pending_work_items = {} + self._cancel_pending_futures = False + + # _ThreadWakeup is a communication channel used to interrupt the wait + # of the main loop of executor_manager_thread from another thread (e.g. + # when calling executor.submit or executor.shutdown). We do not use the + # _result_queue to send wakeup signals to the executor_manager_thread + # as it could result in a deadlock if a worker process dies with the + # _result_queue write lock still acquired. + # + # Care must be taken to only call clear and close from the + # executor_manager_thread, since _ThreadWakeup.clear() is not protected + # by a lock. + self._executor_manager_thread_wakeup = _ThreadWakeup() + + # Create communication channels for the executor + # Make the call queue slightly larger than the number of processes to + # prevent the worker processes from idling. But don't make it too big + # because futures in the call queue cannot be cancelled. + queue_size = self._max_workers + EXTRA_QUEUED_CALLS + self._call_queue = _SafeQueue( + max_size=queue_size, ctx=self._mp_context, + pending_work_items=self._pending_work_items, + thread_wakeup=self._executor_manager_thread_wakeup) + # Killed worker processes can produce spurious "broken pipe" + # tracebacks in the queue's own worker thread. But we detect killed + # processes anyway, so silence the tracebacks. + self._call_queue._ignore_epipe = True + self._result_queue = mp_context.SimpleQueue() + self._work_ids = queue.Queue() + + def _start_executor_manager_thread(self): + if self._executor_manager_thread is None: + # Start the processes so that their sentinels are known. + if not self._safe_to_dynamically_spawn_children: # ie, using fork. + self._launch_processes() + self._executor_manager_thread = _ExecutorManagerThread(self) + self._executor_manager_thread.start() + _threads_wakeups[self._executor_manager_thread] = \ + self._executor_manager_thread_wakeup + + def _adjust_process_count(self): + # gh-132969: avoid error when state is reset and executor is still running, + # which will happen when shutdown(wait=False) is called. + if self._processes is None: + return + + # if there's an idle process, we don't need to spawn a new one. + if self._idle_worker_semaphore.acquire(blocking=False): + return + + process_count = len(self._processes) + if process_count < self._max_workers: + # Assertion disabled as this codepath is also used to replace a + # worker that unexpectedly dies, even when using the 'fork' start + # method. That means there is still a potential deadlock bug. If a + # 'fork' mp_context worker dies, we'll be forking a new one when + # we know a thread is running (self._executor_manager_thread). + #assert self._safe_to_dynamically_spawn_children or not self._executor_manager_thread, 'https://github.com/python/cpython/issues/90622' + self._spawn_process() + + def _launch_processes(self): + # https://github.com/python/cpython/issues/90622 + assert not self._executor_manager_thread, ( + 'Processes cannot be fork()ed after the thread has started, ' + 'deadlock in the child processes could result.') + for _ in range(len(self._processes), self._max_workers): + self._spawn_process() + + def _spawn_process(self): + p = self._mp_context.Process( + target=_process_worker, + args=(self._call_queue, + self._result_queue, + self._initializer, + self._initargs, + self._max_tasks_per_child)) + p.start() + self._processes[p.pid] = p + + def submit(self, fn, /, *args, **kwargs): + with self._shutdown_lock: + if self._broken: + raise BrokenProcessPool(self._broken) + if self._shutdown_thread: + raise RuntimeError('cannot schedule new futures after shutdown') + if _global_shutdown: + raise RuntimeError('cannot schedule new futures after ' + 'interpreter shutdown') + + f = _base.Future() + w = _WorkItem(f, fn, args, kwargs) + + self._pending_work_items[self._queue_count] = w + self._work_ids.put(self._queue_count) + self._queue_count += 1 + # Wake up queue management thread + self._executor_manager_thread_wakeup.wakeup() + + if self._safe_to_dynamically_spawn_children: + self._adjust_process_count() + self._start_executor_manager_thread() + return f + submit.__doc__ = _base.Executor.submit.__doc__ + + def map(self, fn, *iterables, timeout=None, chunksize=1, buffersize=None): + """Returns an iterator equivalent to map(fn, iter). + + Args: + fn: A callable that will take as many arguments as there are + passed iterables. + timeout: The maximum number of seconds to wait. If None, then there + is no limit on the wait time. + chunksize: If greater than one, the iterables will be chopped into + chunks of size chunksize and submitted to the process pool. + If set to one, the items in the list will be sent one at a time. + buffersize: The number of submitted tasks whose results have not + yet been yielded. If the buffer is full, iteration over the + iterables pauses until a result is yielded from the buffer. + If None, all input elements are eagerly collected, and a task is + submitted for each. + + Returns: + An iterator equivalent to: map(func, *iterables) but the calls may + be evaluated out-of-order. + + Raises: + TimeoutError: If the entire result iterator could not be generated + before the given timeout. + Exception: If fn(*args) raises for any values. + """ + if chunksize < 1: + raise ValueError("chunksize must be >= 1.") + + results = super().map(partial(_process_chunk, fn), + itertools.batched(zip(*iterables), chunksize), + timeout=timeout, + buffersize=buffersize) + return _chain_from_iterable_of_lists(results) + + def shutdown(self, wait=True, *, cancel_futures=False): + with self._shutdown_lock: + self._cancel_pending_futures = cancel_futures + self._shutdown_thread = True + if self._executor_manager_thread_wakeup is not None: + # Wake up queue management thread + self._executor_manager_thread_wakeup.wakeup() + + if self._executor_manager_thread is not None and wait: + self._executor_manager_thread.join() + # To reduce the risk of opening too many files, remove references to + # objects that use file descriptors. + self._executor_manager_thread = None + self._call_queue = None + if self._result_queue is not None and wait: + self._result_queue.close() + self._result_queue = None + self._processes = None + self._executor_manager_thread_wakeup = None + + shutdown.__doc__ = _base.Executor.shutdown.__doc__ + + def _force_shutdown(self, operation): + """Attempts to terminate or kill the executor's workers based off the + given operation. Iterates through all of the current processes and + performs the relevant task if the process is still alive. + + After terminating workers, the pool will be in a broken state + and no longer usable (for instance, new tasks should not be + submitted). + """ + if operation not in _SHUTDOWN_CALLBACK_OPERATION: + raise ValueError(f"Unsupported operation: {operation!r}") + + processes = {} + if self._processes: + processes = self._processes.copy() + + # shutdown will invalidate ._processes, so we copy it right before + # calling. If we waited here, we would deadlock if a process decides not + # to exit. + self.shutdown(wait=False, cancel_futures=True) + + if not processes: + return + + for proc in processes.values(): + try: + if not proc.is_alive(): + continue + except ValueError: + # The process is already exited/closed out. + continue + + try: + if operation == _TERMINATE: + proc.terminate() + elif operation == _KILL: + proc.kill() + except ProcessLookupError: + # The process just ended before our signal + continue + + def terminate_workers(self): + """Attempts to terminate the executor's workers. + Iterates through all of the current worker processes and terminates + each one that is still alive. + + After terminating workers, the pool will be in a broken state + and no longer usable (for instance, new tasks should not be + submitted). + """ + return self._force_shutdown(operation=_TERMINATE) + + def kill_workers(self): + """Attempts to kill the executor's workers. + Iterates through all of the current worker processes and kills + each one that is still alive. + + After killing workers, the pool will be in a broken state + and no longer usable (for instance, new tasks should not be + submitted). + """ + return self._force_shutdown(operation=_KILL) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/thread.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/thread.py new file mode 100644 index 0000000000000000000000000000000000000000..909359b648709fe980db610c8834c34f2b2d2e76 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/futures/thread.py @@ -0,0 +1,274 @@ +# Copyright 2009 Brian Quinlan. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Implements ThreadPoolExecutor.""" + +__author__ = 'Brian Quinlan (brian@sweetapp.com)' + +from concurrent.futures import _base +import itertools +import queue +import threading +import types +import weakref +import os + + +_threads_queues = weakref.WeakKeyDictionary() +_shutdown = False +# Lock that ensures that new workers are not created while the interpreter is +# shutting down. Must be held while mutating _threads_queues and _shutdown. +_global_shutdown_lock = threading.Lock() + +def _python_exit(): + global _shutdown + with _global_shutdown_lock: + _shutdown = True + items = list(_threads_queues.items()) + for t, q in items: + q.put(None) + for t, q in items: + t.join() + +# Register for `_python_exit()` to be called just before joining all +# non-daemon threads. This is used instead of `atexit.register()` for +# compatibility with subinterpreters, which no longer support daemon threads. +# See bpo-39812 for context. +threading._register_atexit(_python_exit) + +# At fork, reinitialize the `_global_shutdown_lock` lock in the child process +if hasattr(os, 'register_at_fork'): + os.register_at_fork(before=_global_shutdown_lock.acquire, + after_in_child=_global_shutdown_lock._at_fork_reinit, + after_in_parent=_global_shutdown_lock.release) + os.register_at_fork(after_in_child=_threads_queues.clear) + + +class WorkerContext: + + @classmethod + def prepare(cls, initializer, initargs): + if initializer is not None: + if not callable(initializer): + raise TypeError("initializer must be a callable") + def create_context(): + return cls(initializer, initargs) + def resolve_task(fn, args, kwargs): + return (fn, args, kwargs) + return create_context, resolve_task + + def __init__(self, initializer, initargs): + self.initializer = initializer + self.initargs = initargs + + def initialize(self): + if self.initializer is not None: + self.initializer(*self.initargs) + + def finalize(self): + pass + + def run(self, task): + fn, args, kwargs = task + return fn(*args, **kwargs) + + +class _WorkItem: + def __init__(self, future, task): + self.future = future + self.task = task + + def run(self, ctx): + if not self.future.set_running_or_notify_cancel(): + return + + try: + result = ctx.run(self.task) + except BaseException as exc: + self.future.set_exception(exc) + # Break a reference cycle with the exception 'exc' + self = None + else: + self.future.set_result(result) + + __class_getitem__ = classmethod(types.GenericAlias) + + +def _worker(executor_reference, ctx, work_queue): + try: + ctx.initialize() + except BaseException: + _base.LOGGER.critical('Exception in initializer:', exc_info=True) + executor = executor_reference() + if executor is not None: + executor._initializer_failed() + return + try: + while True: + try: + work_item = work_queue.get_nowait() + except queue.Empty: + # attempt to increment idle count if queue is empty + executor = executor_reference() + if executor is not None: + executor._idle_semaphore.release() + del executor + work_item = work_queue.get(block=True) + + if work_item is not None: + work_item.run(ctx) + # Delete references to object. See GH-60488 + del work_item + continue + + executor = executor_reference() + # Exit if: + # - The interpreter is shutting down OR + # - The executor that owns the worker has been collected OR + # - The executor that owns the worker has been shutdown. + if _shutdown or executor is None or executor._shutdown: + # Flag the executor as shutting down as early as possible if it + # is not gc-ed yet. + if executor is not None: + executor._shutdown = True + # Notice other workers + work_queue.put(None) + return + del executor + except BaseException: + _base.LOGGER.critical('Exception in worker', exc_info=True) + finally: + ctx.finalize() + + +class BrokenThreadPool(_base.BrokenExecutor): + """ + Raised when a worker thread in a ThreadPoolExecutor failed initializing. + """ + + +class ThreadPoolExecutor(_base.Executor): + + BROKEN = BrokenThreadPool + + # Used to assign unique thread names when thread_name_prefix is not supplied. + _counter = itertools.count().__next__ + + @classmethod + def prepare_context(cls, initializer, initargs): + return WorkerContext.prepare(initializer, initargs) + + def __init__(self, max_workers=None, thread_name_prefix='', + initializer=None, initargs=(), **ctxkwargs): + """Initializes a new ThreadPoolExecutor instance. + + Args: + max_workers: The maximum number of threads that can be used to + execute the given calls. + thread_name_prefix: An optional name prefix to give our threads. + initializer: A callable used to initialize worker threads. + initargs: A tuple of arguments to pass to the initializer. + ctxkwargs: Additional arguments to cls.prepare_context(). + """ + if max_workers is None: + # ThreadPoolExecutor is often used to: + # * CPU bound task which releases GIL + # * I/O bound task (which releases GIL, of course) + # + # We use process_cpu_count + 4 for both types of tasks. + # But we limit it to 32 to avoid consuming surprisingly large resource + # on many core machine. + max_workers = min(32, (os.process_cpu_count() or 1) + 4) + if max_workers <= 0: + raise ValueError("max_workers must be greater than 0") + + (self._create_worker_context, + self._resolve_work_item_task, + ) = type(self).prepare_context(initializer, initargs, **ctxkwargs) + + self._max_workers = max_workers + self._work_queue = queue.SimpleQueue() + self._idle_semaphore = threading.Semaphore(0) + self._threads = set() + self._broken = False + self._shutdown = False + self._shutdown_lock = threading.Lock() + self._thread_name_prefix = (thread_name_prefix or + ("ThreadPoolExecutor-%d" % self._counter())) + + def submit(self, fn, /, *args, **kwargs): + with self._shutdown_lock, _global_shutdown_lock: + if self._broken: + raise self.BROKEN(self._broken) + + if self._shutdown: + raise RuntimeError('cannot schedule new futures after shutdown') + if _shutdown: + raise RuntimeError('cannot schedule new futures after ' + 'interpreter shutdown') + + f = _base.Future() + task = self._resolve_work_item_task(fn, args, kwargs) + w = _WorkItem(f, task) + + self._work_queue.put(w) + self._adjust_thread_count() + return f + submit.__doc__ = _base.Executor.submit.__doc__ + + def _adjust_thread_count(self): + # if idle threads are available, don't spin new threads + if self._idle_semaphore.acquire(timeout=0): + return + + # When the executor gets lost, the weakref callback will wake up + # the worker threads. + def weakref_cb(_, q=self._work_queue): + q.put(None) + + num_threads = len(self._threads) + if num_threads < self._max_workers: + thread_name = '%s_%d' % (self._thread_name_prefix or self, + num_threads) + t = threading.Thread(name=thread_name, target=_worker, + args=(weakref.ref(self, weakref_cb), + self._create_worker_context(), + self._work_queue)) + t.start() + self._threads.add(t) + _threads_queues[t] = self._work_queue + + def _initializer_failed(self): + with self._shutdown_lock: + self._broken = ('A thread initializer failed, the thread pool ' + 'is not usable anymore') + # Drain work queue and mark pending futures failed + while True: + try: + work_item = self._work_queue.get_nowait() + except queue.Empty: + break + if work_item is not None: + work_item.future.set_exception(self.BROKEN(self._broken)) + + def shutdown(self, wait=True, *, cancel_futures=False): + with self._shutdown_lock: + self._shutdown = True + if cancel_futures: + # Drain all work items from the queue, and then cancel their + # associated futures. + while True: + try: + work_item = self._work_queue.get_nowait() + except queue.Empty: + break + if work_item is not None: + work_item.future.cancel() + + # Send a wake-up to prevent threads calling + # _work_queue.get(block=True) from permanently blocking. + self._work_queue.put(None) + if wait: + for t in self._threads: + t.join() + shutdown.__doc__ = _base.Executor.shutdown.__doc__ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/interpreters/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/interpreters/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ea4147ee9a25da554cddc06632e04e620008a6d2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/interpreters/__init__.py @@ -0,0 +1,247 @@ +"""Subinterpreters High Level Module.""" + +import threading +import weakref +import _interpreters + +# aliases: +from _interpreters import ( + InterpreterError, InterpreterNotFoundError, NotShareableError, + is_shareable, +) +from ._queues import ( + create as create_queue, + Queue, QueueEmpty, QueueFull, +) + + +__all__ = [ + 'get_current', 'get_main', 'create', 'list_all', 'is_shareable', + 'Interpreter', + 'InterpreterError', 'InterpreterNotFoundError', 'ExecutionFailed', + 'NotShareableError', + 'create_queue', 'Queue', 'QueueEmpty', 'QueueFull', +] + + +_EXEC_FAILURE_STR = """ +{superstr} + +Uncaught in the interpreter: + +{formatted} +""".strip() + +class ExecutionFailed(InterpreterError): + """An unhandled exception happened during execution. + + This is raised from Interpreter.exec() and Interpreter.call(). + """ + + def __init__(self, excinfo): + msg = excinfo.formatted + if not msg: + if excinfo.type and excinfo.msg: + msg = f'{excinfo.type.__name__}: {excinfo.msg}' + else: + msg = excinfo.type.__name__ or excinfo.msg + super().__init__(msg) + self.excinfo = excinfo + + def __str__(self): + try: + formatted = self.excinfo.errdisplay + except Exception: + return super().__str__() + else: + return _EXEC_FAILURE_STR.format( + superstr=super().__str__(), + formatted=formatted, + ) + + +def create(): + """Return a new (idle) Python interpreter.""" + id = _interpreters.create(reqrefs=True) + return Interpreter(id, _ownsref=True) + + +def list_all(): + """Return all existing interpreters.""" + return [Interpreter(id, _whence=whence) + for id, whence in _interpreters.list_all(require_ready=True)] + + +def get_current(): + """Return the currently running interpreter.""" + id, whence = _interpreters.get_current() + return Interpreter(id, _whence=whence) + + +def get_main(): + """Return the main interpreter.""" + id, whence = _interpreters.get_main() + assert whence == _interpreters.WHENCE_RUNTIME, repr(whence) + return Interpreter(id, _whence=whence) + + +_known = weakref.WeakValueDictionary() + +class Interpreter: + """A single Python interpreter. + + Attributes: + + "id" - the unique process-global ID number for the interpreter + "whence" - indicates where the interpreter was created + + If the interpreter wasn't created by this module + then any method that modifies the interpreter will fail, + i.e. .close(), .prepare_main(), .exec(), and .call() + """ + + _WHENCE_TO_STR = { + _interpreters.WHENCE_UNKNOWN: 'unknown', + _interpreters.WHENCE_RUNTIME: 'runtime init', + _interpreters.WHENCE_LEGACY_CAPI: 'legacy C-API', + _interpreters.WHENCE_CAPI: 'C-API', + _interpreters.WHENCE_XI: 'cross-interpreter C-API', + _interpreters.WHENCE_STDLIB: '_interpreters module', + } + + def __new__(cls, id, /, _whence=None, _ownsref=None): + # There is only one instance for any given ID. + if not isinstance(id, int): + raise TypeError(f'id must be an int, got {id!r}') + id = int(id) + if _whence is None: + if _ownsref: + _whence = _interpreters.WHENCE_STDLIB + else: + _whence = _interpreters.whence(id) + assert _whence in cls._WHENCE_TO_STR, repr(_whence) + if _ownsref is None: + _ownsref = (_whence == _interpreters.WHENCE_STDLIB) + try: + self = _known[id] + assert hasattr(self, '_ownsref') + except KeyError: + self = super().__new__(cls) + _known[id] = self + self._id = id + self._whence = _whence + self._ownsref = _ownsref + if _ownsref: + # This may raise InterpreterNotFoundError: + _interpreters.incref(id) + return self + + def __repr__(self): + return f'{type(self).__name__}({self.id})' + + def __hash__(self): + return hash(self._id) + + def __del__(self): + self._decref() + + # for pickling: + def __reduce__(self): + return (type(self), (self._id,)) + + # gh-135729: Globals might be destroyed by the time this is called, so we + # need to keep references ourself + def _decref(self, *, + InterpreterNotFoundError=InterpreterNotFoundError, + _interp_decref=_interpreters.decref, + ): + if not self._ownsref: + return + self._ownsref = False + try: + _interp_decref(self._id) + except InterpreterNotFoundError: + pass + + @property + def id(self): + return self._id + + @property + def whence(self): + return self._WHENCE_TO_STR[self._whence] + + def is_running(self): + """Return whether or not the identified interpreter is running.""" + return _interpreters.is_running(self._id) + + # Everything past here is available only to interpreters created by + # interpreters.create(). + + def close(self): + """Finalize and destroy the interpreter. + + Attempting to destroy the current interpreter results + in an InterpreterError. + """ + return _interpreters.destroy(self._id, restrict=True) + + def prepare_main(self, ns=None, /, **kwargs): + """Bind the given values into the interpreter's __main__. + + The values must be shareable. + """ + ns = dict(ns, **kwargs) if ns is not None else kwargs + _interpreters.set___main___attrs(self._id, ns, restrict=True) + + def exec(self, code, /): + """Run the given source code in the interpreter. + + This is essentially the same as calling the builtin "exec" + with this interpreter, using the __dict__ of its __main__ + module as both globals and locals. + + There is no return value. + + If the code raises an unhandled exception then an ExecutionFailed + exception is raised, which summarizes the unhandled exception. + The actual exception is discarded because objects cannot be + shared between interpreters. + + This blocks the current Python thread until done. During + that time, the previous interpreter is allowed to run + in other threads. + """ + excinfo = _interpreters.exec(self._id, code, restrict=True) + if excinfo is not None: + raise ExecutionFailed(excinfo) + + def _call(self, callable, args, kwargs): + res, excinfo = _interpreters.call(self._id, callable, args, kwargs, restrict=True) + if excinfo is not None: + raise ExecutionFailed(excinfo) + return res + + def call(self, callable, /, *args, **kwargs): + """Call the object in the interpreter with given args/kwargs. + + Nearly all callables, args, kwargs, and return values are + supported. All "shareable" objects are supported, as are + "stateless" functions (meaning non-closures that do not use + any globals). This method will fall back to pickle. + + If the callable raises an exception then the error display + (including full traceback) is sent back between the interpreters + and an ExecutionFailed exception is raised, much like what + happens with Interpreter.exec(). + """ + return self._call(callable, args, kwargs) + + def call_in_thread(self, callable, /, *args, **kwargs): + """Return a new thread that calls the object in the interpreter. + + The return value and any raised exception are discarded. + """ + t = threading.Thread(target=self._call, args=(callable, args, kwargs)) + t.start() + return t diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/interpreters/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/interpreters/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4a671145415c3982fa67b5e164cf9931062ce880 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/interpreters/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/interpreters/__pycache__/_crossinterp.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/interpreters/__pycache__/_crossinterp.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f522d40f4a73834a6884c6f3d584ce3b1f6ac74 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/interpreters/__pycache__/_crossinterp.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/interpreters/__pycache__/_queues.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/interpreters/__pycache__/_queues.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d20a6a2d60a6d1abf74e39e8ae54bd1425156b4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/interpreters/__pycache__/_queues.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/interpreters/_crossinterp.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/interpreters/_crossinterp.py new file mode 100644 index 0000000000000000000000000000000000000000..a5f46b20fbb4c561f2878a6bbdc1792ea3b46e4e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/interpreters/_crossinterp.py @@ -0,0 +1,107 @@ +"""Common code between queues and channels.""" + + +class ItemInterpreterDestroyed(Exception): + """Raised when trying to get an item whose interpreter was destroyed.""" + + +class classonly: + """A non-data descriptor that makes a value only visible on the class. + + This is like the "classmethod" builtin, but does not show up on + instances of the class. It may be used as a decorator. + """ + + def __init__(self, value): + self.value = value + self.getter = classmethod(value).__get__ + self.name = None + + def __set_name__(self, cls, name): + if self.name is not None: + raise TypeError('already used') + self.name = name + + def __get__(self, obj, cls): + if obj is not None: + raise AttributeError(self.name) + # called on the class + return self.getter(None, cls) + + +class UnboundItem: + """Represents a cross-interpreter item no longer bound to an interpreter. + + An item is unbound when the interpreter that added it to the + cross-interpreter container is destroyed. + """ + + __slots__ = () + + @classonly + def singleton(cls, kind, module, name='UNBOUND'): + doc = cls.__doc__ + if doc: + doc = doc.replace( + 'cross-interpreter container', kind, + ).replace( + 'cross-interpreter', kind, + ) + subclass = type( + f'Unbound{kind.capitalize()}Item', + (cls,), + { + "_MODULE": module, + "_NAME": name, + "__doc__": doc, + }, + ) + return object.__new__(subclass) + + _MODULE = __name__ + _NAME = 'UNBOUND' + + def __new__(cls): + raise Exception(f'use {cls._MODULE}.{cls._NAME}') + + def __repr__(self): + return f'{self._MODULE}.{self._NAME}' +# return f'interpreters._queues.UNBOUND' + + +UNBOUND = object.__new__(UnboundItem) +UNBOUND_ERROR = object() +UNBOUND_REMOVE = object() + +_UNBOUND_CONSTANT_TO_FLAG = { + UNBOUND_REMOVE: 1, + UNBOUND_ERROR: 2, + UNBOUND: 3, +} +_UNBOUND_FLAG_TO_CONSTANT = {v: k + for k, v in _UNBOUND_CONSTANT_TO_FLAG.items()} + + +def serialize_unbound(unbound): + op = unbound + try: + flag = _UNBOUND_CONSTANT_TO_FLAG[op] + except KeyError: + raise NotImplementedError(f'unsupported unbound replacement op {op!r}') + return flag, + + +def resolve_unbound(flag, exctype_destroyed): + try: + op = _UNBOUND_FLAG_TO_CONSTANT[flag] + except KeyError: + raise NotImplementedError(f'unsupported unbound replacement op {flag!r}') + if op is UNBOUND_REMOVE: + # "remove" not possible here + raise NotImplementedError + elif op is UNBOUND_ERROR: + raise exctype_destroyed("item's original interpreter destroyed") + elif op is UNBOUND: + return UNBOUND + else: + raise NotImplementedError(repr(op)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/interpreters/_queues.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/interpreters/_queues.py new file mode 100644 index 0000000000000000000000000000000000000000..81ea1098d7f9f317d82db2b29c23d38f010e8a09 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/concurrent/interpreters/_queues.py @@ -0,0 +1,289 @@ +"""Cross-interpreter Queues High Level Module.""" + +import pickle +import queue +import time +import weakref +import _interpqueues as _queues +from . import _crossinterp + +# aliases: +from _interpqueues import ( + QueueError, QueueNotFoundError, +) +from ._crossinterp import ( + UNBOUND_ERROR, UNBOUND_REMOVE, +) + +__all__ = [ + 'UNBOUND', 'UNBOUND_ERROR', 'UNBOUND_REMOVE', + 'create', 'list_all', + 'Queue', + 'QueueError', 'QueueNotFoundError', 'QueueEmpty', 'QueueFull', + 'ItemInterpreterDestroyed', +] + + +class QueueEmpty(QueueError, queue.Empty): + """Raised from get_nowait() when the queue is empty. + + It is also raised from get() if it times out. + """ + + +class QueueFull(QueueError, queue.Full): + """Raised from put_nowait() when the queue is full. + + It is also raised from put() if it times out. + """ + + +class ItemInterpreterDestroyed(QueueError, + _crossinterp.ItemInterpreterDestroyed): + """Raised from get() and get_nowait().""" + + +_SHARED_ONLY = 0 +_PICKLED = 1 + + +UNBOUND = _crossinterp.UnboundItem.singleton('queue', __name__) + + +def _serialize_unbound(unbound): + if unbound is UNBOUND: + unbound = _crossinterp.UNBOUND + return _crossinterp.serialize_unbound(unbound) + + +def _resolve_unbound(flag): + resolved = _crossinterp.resolve_unbound(flag, ItemInterpreterDestroyed) + if resolved is _crossinterp.UNBOUND: + resolved = UNBOUND + return resolved + + +def create(maxsize=0, *, unbounditems=UNBOUND): + """Return a new cross-interpreter queue. + + The queue may be used to pass data safely between interpreters. + + "unbounditems" sets the default for Queue.put(); see that method for + supported values. The default value is UNBOUND, which replaces + the unbound item. + """ + unbound = _serialize_unbound(unbounditems) + unboundop, = unbound + qid = _queues.create(maxsize, unboundop, -1) + self = Queue(qid) + self._set_unbound(unboundop, unbounditems) + return self + + +def list_all(): + """Return a list of all open queues.""" + queues = [] + for qid, unboundop, _ in _queues.list_all(): + self = Queue(qid) + if not hasattr(self, '_unbound'): + self._set_unbound(unboundop) + else: + assert self._unbound[0] == unboundop + queues.append(self) + return queues + + +_known_queues = weakref.WeakValueDictionary() + +class Queue: + """A cross-interpreter queue.""" + + def __new__(cls, id, /): + # There is only one instance for any given ID. + if isinstance(id, int): + id = int(id) + else: + raise TypeError(f'id must be an int, got {id!r}') + try: + self = _known_queues[id] + except KeyError: + self = super().__new__(cls) + self._id = id + _known_queues[id] = self + _queues.bind(id) + return self + + def __del__(self): + try: + _queues.release(self._id) + except QueueNotFoundError: + pass + try: + del _known_queues[self._id] + except KeyError: + pass + + def __repr__(self): + return f'{type(self).__name__}({self.id})' + + def __hash__(self): + return hash(self._id) + + # for pickling: + def __reduce__(self): + return (type(self), (self._id,)) + + def _set_unbound(self, op, items=None): + assert not hasattr(self, '_unbound') + if items is None: + items = _resolve_unbound(op) + unbound = (op, items) + self._unbound = unbound + return unbound + + @property + def id(self): + return self._id + + @property + def unbounditems(self): + try: + _, items = self._unbound + except AttributeError: + op, _ = _queues.get_queue_defaults(self._id) + _, items = self._set_unbound(op) + return items + + @property + def maxsize(self): + try: + return self._maxsize + except AttributeError: + self._maxsize = _queues.get_maxsize(self._id) + return self._maxsize + + def empty(self): + return self.qsize() == 0 + + def full(self): + return _queues.is_full(self._id) + + def qsize(self): + return _queues.get_count(self._id) + + def put(self, obj, block=True, timeout=None, *, + unbounditems=None, + _delay=10 / 1000, # 10 milliseconds + ): + """Add the object to the queue. + + If "block" is true, this blocks while the queue is full. + + For most objects, the object received through Queue.get() will + be a new one, equivalent to the original and not sharing any + actual underlying data. The notable exceptions include + cross-interpreter types (like Queue) and memoryview, where the + underlying data is actually shared. Furthermore, some types + can be sent through a queue more efficiently than others. This + group includes various immutable types like int, str, bytes, and + tuple (if the items are likewise efficiently shareable). See interpreters.is_shareable(). + + "unbounditems" controls the behavior of Queue.get() for the given + object if the current interpreter (calling put()) is later + destroyed. + + If "unbounditems" is None (the default) then it uses the + queue's default, set with create_queue(), + which is usually UNBOUND. + + If "unbounditems" is UNBOUND_ERROR then get() will raise an + ItemInterpreterDestroyed exception if the original interpreter + has been destroyed. This does not otherwise affect the queue; + the next call to put() will work like normal, returning the next + item in the queue. + + If "unbounditems" is UNBOUND_REMOVE then the item will be removed + from the queue as soon as the original interpreter is destroyed. + Be aware that this will introduce an imbalance between put() + and get() calls. + + If "unbounditems" is UNBOUND then it is returned by get() in place + of the unbound item. + """ + if not block: + return self.put_nowait(obj, unbounditems=unbounditems) + if unbounditems is None: + unboundop = -1 + else: + unboundop, = _serialize_unbound(unbounditems) + if timeout is not None: + timeout = int(timeout) + if timeout < 0: + raise ValueError(f'timeout value must be non-negative') + end = time.time() + timeout + while True: + try: + _queues.put(self._id, obj, unboundop) + except QueueFull as exc: + if timeout is not None and time.time() >= end: + raise # re-raise + time.sleep(_delay) + else: + break + + def put_nowait(self, obj, *, unbounditems=None): + if unbounditems is None: + unboundop = -1 + else: + unboundop, = _serialize_unbound(unbounditems) + _queues.put(self._id, obj, unboundop) + + def get(self, block=True, timeout=None, *, + _delay=10 / 1000, # 10 milliseconds + ): + """Return the next object from the queue. + + If "block" is true, this blocks while the queue is empty. + + If the next item's original interpreter has been destroyed + then the "next object" is determined by the value of the + "unbounditems" argument to put(). + """ + if not block: + return self.get_nowait() + if timeout is not None: + timeout = int(timeout) + if timeout < 0: + raise ValueError(f'timeout value must be non-negative') + end = time.time() + timeout + while True: + try: + obj, unboundop = _queues.get(self._id) + except QueueEmpty as exc: + if timeout is not None and time.time() >= end: + raise # re-raise + time.sleep(_delay) + else: + break + if unboundop is not None: + assert obj is None, repr(obj) + return _resolve_unbound(unboundop) + return obj + + def get_nowait(self): + """Return the next object from the channel. + + If the queue is empty then raise QueueEmpty. Otherwise this + is the same as get(). + """ + try: + obj, unboundop = _queues.get(self._id) + except QueueEmpty as exc: + raise # re-raise + if unboundop is not None: + assert obj is None, repr(obj) + return _resolve_unbound(unboundop) + return obj + + +_queues._register_heap_types(Queue, QueueEmpty, QueueFull) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d0c9eb723ec11b141f91acd2448efbd94e032a8e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/__pycache__/_aix.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/__pycache__/_aix.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c3c1681d50285d93332824d5a84eaed03d8660e4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/__pycache__/_aix.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/__pycache__/_endian.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/__pycache__/_endian.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..defd33fa2d16ae544ba7cf301a8e0646fe1f6426 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/__pycache__/_endian.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/__pycache__/_layout.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/__pycache__/_layout.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..edb986334fd9c112c862e15a59bfde1ec30bf30c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/__pycache__/_layout.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/__pycache__/util.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/__pycache__/util.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fbf3bc5f62ff312bde228d4797b10117c5185fe6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/__pycache__/util.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/__pycache__/wintypes.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/__pycache__/wintypes.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..14b11e8190dc9536db45a04bdab9b13b18663dac Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/__pycache__/wintypes.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/README.ctypes b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/README.ctypes new file mode 100644 index 0000000000000000000000000000000000000000..2866e9f349288a4059e7bacee8f0ad9ed886d068 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/README.ctypes @@ -0,0 +1,7 @@ +Files in this directory come from Bob Ippolito's py2app. + +License: Any components of the py2app suite may be distributed under +the MIT or PSF open source licenses. + +This is version 1.0, SVN revision 789, from 2006/01/25. +The main repository is http://svn.red-bean.com/bob/macholib/trunk/macholib/ \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5621defccd61d1c4b0c64b8e136ef4357052dcb3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/__init__.py @@ -0,0 +1,9 @@ +""" +Enough Mach-O to make your head spin. + +See the relevant header files in /usr/include/mach-o + +And also Apple's documentation. +""" + +__version__ = '1.0' diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..76e8079142abd98beee10473c89c04d944c9db5a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/__pycache__/dyld.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/__pycache__/dyld.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2ed9d32f5c408faa5442fcd5ddd992b26098c23d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/__pycache__/dyld.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/__pycache__/dylib.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/__pycache__/dylib.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9a4b931295b9ef16ed7a7c820eb6d68be1a418d8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/__pycache__/dylib.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/__pycache__/framework.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/__pycache__/framework.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4203699c1a7ba516289bc5aa03005e79b8496e28 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/__pycache__/framework.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/dyld.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/dyld.py new file mode 100644 index 0000000000000000000000000000000000000000..ab9b01c87e27d15d7fc02c2b25270f7d17428780 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/dyld.py @@ -0,0 +1,169 @@ +""" +dyld emulation +""" + +import os +from ctypes.macholib.framework import framework_info +from ctypes.macholib.dylib import dylib_info +from itertools import * +try: + from _ctypes import _dyld_shared_cache_contains_path +except ImportError: + def _dyld_shared_cache_contains_path(*args): + raise NotImplementedError + +__all__ = [ + 'dyld_find', 'framework_find', + 'framework_info', 'dylib_info', +] + +# These are the defaults as per man dyld(1) +# +DEFAULT_FRAMEWORK_FALLBACK = [ + os.path.expanduser("~/Library/Frameworks"), + "/Library/Frameworks", + "/Network/Library/Frameworks", + "/System/Library/Frameworks", +] + +DEFAULT_LIBRARY_FALLBACK = [ + os.path.expanduser("~/lib"), + "/usr/local/lib", + "/lib", + "/usr/lib", +] + +def dyld_env(env, var): + if env is None: + env = os.environ + rval = env.get(var) + if rval is None: + return [] + return rval.split(':') + +def dyld_image_suffix(env=None): + if env is None: + env = os.environ + return env.get('DYLD_IMAGE_SUFFIX') + +def dyld_framework_path(env=None): + return dyld_env(env, 'DYLD_FRAMEWORK_PATH') + +def dyld_library_path(env=None): + return dyld_env(env, 'DYLD_LIBRARY_PATH') + +def dyld_fallback_framework_path(env=None): + return dyld_env(env, 'DYLD_FALLBACK_FRAMEWORK_PATH') + +def dyld_fallback_library_path(env=None): + return dyld_env(env, 'DYLD_FALLBACK_LIBRARY_PATH') + +def dyld_image_suffix_search(iterator, env=None): + """For a potential path iterator, add DYLD_IMAGE_SUFFIX semantics""" + suffix = dyld_image_suffix(env) + if suffix is None: + return iterator + def _inject(iterator=iterator, suffix=suffix): + for path in iterator: + if path.endswith('.dylib'): + yield path[:-len('.dylib')] + suffix + '.dylib' + else: + yield path + suffix + yield path + return _inject() + +def dyld_override_search(name, env=None): + # If DYLD_FRAMEWORK_PATH is set and this dylib_name is a + # framework name, use the first file that exists in the framework + # path if any. If there is none go on to search the DYLD_LIBRARY_PATH + # if any. + + framework = framework_info(name) + + if framework is not None: + for path in dyld_framework_path(env): + yield os.path.join(path, framework['name']) + + # If DYLD_LIBRARY_PATH is set then use the first file that exists + # in the path. If none use the original name. + for path in dyld_library_path(env): + yield os.path.join(path, os.path.basename(name)) + +def dyld_executable_path_search(name, executable_path=None): + # If we haven't done any searching and found a library and the + # dylib_name starts with "@executable_path/" then construct the + # library name. + if not executable_path: + import sys + if sys.prefix: + executable_path = os.path.join(sys.prefix, 'bin') + if name.startswith('@executable_path/') and executable_path is not None: + yield os.path.join(executable_path, name[len('@executable_path/'):]) + +def dyld_default_search(name, env=None): + yield name + + framework = framework_info(name) + + if framework is not None: + fallback_framework_path = dyld_fallback_framework_path(env) + for path in fallback_framework_path: + yield os.path.join(path, framework['name']) + + fallback_library_path = dyld_fallback_library_path(env) + for path in fallback_library_path: + yield os.path.join(path, os.path.basename(name)) + + if framework is not None and not fallback_framework_path: + for path in DEFAULT_FRAMEWORK_FALLBACK: + yield os.path.join(path, framework['name']) + + if not fallback_library_path: + for path in DEFAULT_LIBRARY_FALLBACK: + yield os.path.join(path, os.path.basename(name)) + +def dyld_find(name, executable_path=None, env=None): + """ + Find a library or framework using dyld semantics + """ + for path in dyld_image_suffix_search(chain( + dyld_override_search(name, env), + dyld_executable_path_search(name, executable_path), + dyld_default_search(name, env), + ), env): + + if os.path.isfile(path): + return path + try: + if _dyld_shared_cache_contains_path(path): + return path + except NotImplementedError: + pass + + raise ValueError("dylib %s could not be found" % (name,)) + +def framework_find(fn, executable_path=None, env=None): + """ + Find a framework using dyld semantics in a very loose manner. + + Will take input such as: + Python + Python.framework + Python.framework/Versions/Current + """ + error = None + try: + return dyld_find(fn, executable_path=executable_path, env=env) + except ValueError as e: + error = e + fmwk_index = fn.rfind('.framework') + if fmwk_index == -1: + fmwk_index = len(fn) + fn += '.framework' + fn = os.path.join(fn, os.path.basename(fn[:fmwk_index])) + try: + return dyld_find(fn, executable_path=executable_path, env=env) + except ValueError: + raise error + finally: + error = None diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/dylib.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/dylib.py new file mode 100644 index 0000000000000000000000000000000000000000..0ad4cba8da3521756942a18942bd11aaaad95a58 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/dylib.py @@ -0,0 +1,42 @@ +""" +Generic dylib path manipulation +""" + +import re + +__all__ = ['dylib_info'] + +DYLIB_RE = re.compile(r"""(?x) +(?P^.*)(?:^|/) +(?P + (?P\w+?) + (?:\.(?P[^._]+))? + (?:_(?P[^._]+))? + \.dylib$ +) +""") + +def dylib_info(filename): + """ + A dylib name can take one of the following four forms: + Location/Name.SomeVersion_Suffix.dylib + Location/Name.SomeVersion.dylib + Location/Name_Suffix.dylib + Location/Name.dylib + + returns None if not found or a mapping equivalent to: + dict( + location='Location', + name='Name.SomeVersion_Suffix.dylib', + shortname='Name', + version='SomeVersion', + suffix='Suffix', + ) + + Note that SomeVersion and Suffix are optional and may be None + if not present. + """ + is_dylib = DYLIB_RE.match(filename) + if not is_dylib: + return None + return is_dylib.groupdict() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/fetch_macholib b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/fetch_macholib new file mode 100644 index 0000000000000000000000000000000000000000..e6d6a2265956293a8ac5eeb0e0e32309694a4a66 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/fetch_macholib @@ -0,0 +1,2 @@ +#!/bin/sh +svn export --force http://svn.red-bean.com/bob/macholib/trunk/macholib/ . diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/fetch_macholib.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/fetch_macholib.bat new file mode 100644 index 0000000000000000000000000000000000000000..f474d5cd0a26f72be2c53228a4465c8b91a0e649 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/fetch_macholib.bat @@ -0,0 +1 @@ +svn export --force http://svn.red-bean.com/bob/macholib/trunk/macholib/ . diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/framework.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/framework.py new file mode 100644 index 0000000000000000000000000000000000000000..495679fff19d418a8248c492bb5959f52787123c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ctypes/macholib/framework.py @@ -0,0 +1,42 @@ +""" +Generic framework path manipulation +""" + +import re + +__all__ = ['framework_info'] + +STRICT_FRAMEWORK_RE = re.compile(r"""(?x) +(?P^.*)(?:^|/) +(?P + (?P\w+).framework/ + (?:Versions/(?P[^/]+)/)? + (?P=shortname) + (?:_(?P[^_]+))? +)$ +""") + +def framework_info(filename): + """ + A framework name can take one of the following four forms: + Location/Name.framework/Versions/SomeVersion/Name_Suffix + Location/Name.framework/Versions/SomeVersion/Name + Location/Name.framework/Name_Suffix + Location/Name.framework/Name + + returns None if not found, or a mapping equivalent to: + dict( + location='Location', + name='Name.framework/Versions/SomeVersion/Name_Suffix', + shortname='Name', + version='SomeVersion', + suffix='Suffix', + ) + + Note that SomeVersion and Suffix are optional and may be None + if not present + """ + is_framework = STRICT_FRAMEWORK_RE.match(filename) + if not is_framework: + return None + return is_framework.groupdict() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/curses/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/curses/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5fbe764da7f4d34cee3bf81b46fedaec0b60ff98 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/curses/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/curses/__pycache__/ascii.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/curses/__pycache__/ascii.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c6e04af2fc496febd8da7a80b2902e8f3add128b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/curses/__pycache__/ascii.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/curses/__pycache__/has_key.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/curses/__pycache__/has_key.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d848256dee290ee8b46822905b0f50907a95cd62 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/curses/__pycache__/has_key.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/curses/__pycache__/panel.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/curses/__pycache__/panel.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a8b397d28bb6889a52297c839c46f1c64b6eb80c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/curses/__pycache__/panel.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/curses/__pycache__/textpad.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/curses/__pycache__/textpad.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..73ee79eb59a96662351f951347a21b3305aaaec7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/curses/__pycache__/textpad.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/dbm/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/dbm/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..37256a4cbc10cf1d21857d38c86c5227f39e10da Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/dbm/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/dbm/__pycache__/dumb.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/dbm/__pycache__/dumb.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fba53f0b76029ded7b29c80ec31ccebdb23f8b96 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/dbm/__pycache__/dumb.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/dbm/__pycache__/gnu.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/dbm/__pycache__/gnu.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fc570b3210a09e2ae02a2762f9641b096fbff499 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/dbm/__pycache__/gnu.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/dbm/__pycache__/ndbm.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/dbm/__pycache__/ndbm.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..77ff7934f9255720cf6a14aabfcd742ba63ea994 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/dbm/__pycache__/ndbm.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/dbm/__pycache__/sqlite3.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/dbm/__pycache__/sqlite3.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ef6cdb39bf45bc7e1e40996e17220eee3a8822c1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/dbm/__pycache__/sqlite3.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..41d8f5bb24da0ffd722689dc996bd906fc5f578b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/_encoded_words.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/_encoded_words.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8e3a7f58a4c3ce177cc4e7704692f89d4262e10e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/_encoded_words.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/_parseaddr.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/_parseaddr.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..58656379ba020c3ea74d687fccf910dc3b3b5346 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/_parseaddr.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/_policybase.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/_policybase.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..42c2c189a0acce3a6e76e1a874db86122138692c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/_policybase.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/base64mime.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/base64mime.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..10322271441d3b64c459a860ff3513f5adaf3ace Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/base64mime.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/charset.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/charset.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d714dd7cf2d9243fd3ecf3d11cf8c8439bf55d94 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/charset.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/contentmanager.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/contentmanager.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e96d0f79c139d9656db29a76d939e1986ce33c2e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/contentmanager.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/encoders.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/encoders.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..286c16233a50dd1c5584a3bad9fde75700749865 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/encoders.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/errors.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/errors.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5a298d831206022f8c0355bdd794dc7e0477a8dd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/errors.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/feedparser.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/feedparser.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b643d05ce33918de96e061f1256ce7e3a8164c82 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/feedparser.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/generator.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/generator.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..08e0450450a4e69c673b1d1d757ab4e3d2fd9c1e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/generator.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/header.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/header.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3b5e4cb48a10f95347139c53c7bdd0836f873b3b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/header.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/headerregistry.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/headerregistry.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c39c0683fc7e8e8c50bcc591be53d25b08c21935 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/headerregistry.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/iterators.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/iterators.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..35916206093dd77fee7e12b3f22181c557f0a4cf Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/iterators.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/message.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/message.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fdf7d20132a00dacc584f1f4379490b3fae0b4ea Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/message.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/parser.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/parser.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..833ac452ec5a2426d40b8c1fcb7ebdf9eb69ac1c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/parser.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/policy.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/policy.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ff7f5415504a5d92583cc6698637c77e119c3946 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/policy.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/quoprimime.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/quoprimime.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..33835ca8b2aba1b98a672eaada57054eca30678a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/quoprimime.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/utils.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/utils.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0ee27db987abaab820fae3cb1697779899e8bc1b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/utils.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3ee14d4f53c94ce3f247646b651e449af5eb5aa0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/application.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/application.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a30ebb1f9dc5db98712834bd26e49f3dc125d8ef Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/application.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/audio.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/audio.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aa99321ca775700257d5fb632a25a0c925f2a9e6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/audio.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/base.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/base.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9ad0f83daa3b1bd988fb287660d588c395051a96 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/base.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/image.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/image.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9a8bf44ec5434ed2ab95c1ae4623717404f59f10 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/image.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/message.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/message.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d526eb9a173a63a59f5cc160c1e59ccdb4251311 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/message.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/multipart.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/multipart.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..69cd10b9debb08080145c0b4c51358d02a8a009c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/multipart.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/nonmultipart.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/nonmultipart.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8aa6cffd338c7f6f307be5d7c4d38b577a4010f9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/nonmultipart.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/text.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/text.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..70e5bcf7af7f7e096795fcced0fb40728e7266fe Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/__pycache__/text.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/application.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/application.py new file mode 100644 index 0000000000000000000000000000000000000000..9a9d213d2a940d1cdb094dbe9c3f2d2cdde214eb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/application.py @@ -0,0 +1,37 @@ +# Copyright (C) 2001 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.14.4-h7c1dbca_0_cp314t/Lib/email/mime/audio.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/audio.py new file mode 100644 index 0000000000000000000000000000000000000000..85f4a955238c52060e01a688301e276d50fdb3f6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/audio.py @@ -0,0 +1,97 @@ +# Copyright (C) 2001 Python Software Foundation +# Author: Anthony Baxter +# Contact: email-sig@python.org + +"""Class representing audio/* type MIME documents.""" + +__all__ = ['MIMEAudio'] + +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. + for testfn in _rules: + if res := testfn(data): + return res + else: + return None + + +def rule(rulefunc): + _rules.append(rulefunc) + return rulefunc + + +@rule +def _aiff(h): + 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): + if h.startswith(b'.snd'): + return 'basic' + else: + return None + + +@rule +def _wav(h): + # '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.14.4-h7c1dbca_0_cp314t/Lib/email/mime/base.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/base.py new file mode 100644 index 0000000000000000000000000000000000000000..da4c6e591a5cb8545d8eca5892215fce2e63ee6c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/base.py @@ -0,0 +1,29 @@ +# Copyright (C) 2001 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.14.4-h7c1dbca_0_cp314t/Lib/email/mime/image.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/image.py new file mode 100644 index 0000000000000000000000000000000000000000..dab9685848172b34e255c01d947be57372dc13c0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/image.py @@ -0,0 +1,152 @@ +# Copyright (C) 2001 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.14.4-h7c1dbca_0_cp314t/Lib/email/mime/message.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/message.py new file mode 100644 index 0000000000000000000000000000000000000000..13d9ff599f86dbb9383442189f170276cd88154a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/message.py @@ -0,0 +1,33 @@ +# Copyright (C) 2001 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.14.4-h7c1dbca_0_cp314t/Lib/email/mime/multipart.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/multipart.py new file mode 100644 index 0000000000000000000000000000000000000000..1abb84d5fed0bb2f5809b7ba8cf3e054abf97f61 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/multipart.py @@ -0,0 +1,47 @@ +# Copyright (C) 2002 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.14.4-h7c1dbca_0_cp314t/Lib/email/mime/nonmultipart.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/nonmultipart.py new file mode 100644 index 0000000000000000000000000000000000000000..5beab3a441e2bc6f4b88337718c8daa4711188a8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/nonmultipart.py @@ -0,0 +1,21 @@ +# Copyright (C) 2002 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.14.4-h7c1dbca_0_cp314t/Lib/email/mime/text.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/text.py new file mode 100644 index 0000000000000000000000000000000000000000..aa4da7f8217e433186c518604e4ae531d2d78c48 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/mime/text.py @@ -0,0 +1,40 @@ +# Copyright (C) 2001 Python Software Foundation +# Author: Barry Warsaw +# Contact: email-sig@python.org + +"""Class representing text/* type MIME documents.""" + +__all__ = ['MIMEText'] + +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.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9212049f2065746ed6b71dd30ac71ede09359f2b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/_win_cp_codecs.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/_win_cp_codecs.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..998017936e92f8ad600d0eae73725e32e5a5c733 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/_win_cp_codecs.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/aliases.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/aliases.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..43ab10ecb9e046f3436d236a9984c33152bfc73b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/aliases.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/ascii.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/ascii.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9e5f3d4611d4627b9a723862a847554c83d64a17 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/ascii.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/base64_codec.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/base64_codec.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b219fe51b4557fead25571c9724e9f87186ff0b3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/base64_codec.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/big5.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/big5.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..277d9f4d56b28a8c52afdd97edf219ca2ca8b604 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/big5.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/big5hkscs.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/big5hkscs.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cee7859ecfb42b73c9fda245c857adf02dd6433a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/big5hkscs.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/bz2_codec.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/bz2_codec.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..368eea59498d605f6888a2c7e5e68a7f9af7b688 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/bz2_codec.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/charmap.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/charmap.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9c3ff97506de93d9117955db660d83f908dc2365 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/charmap.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp037.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp037.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aeaecaee227869ce26baf77e2d34ef65a41d019c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp037.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1006.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1006.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f5af1012d92d6a90f60469870db8a7dfff82ff5a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1006.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1026.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1026.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d782c7a34a17196a9cc233a5a64d5fb8ff034272 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1026.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1125.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1125.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f21eeaf22a78ccec96d7e7237150d3759e7d9073 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1125.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1140.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1140.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1cb4c30746177991e6655ec6fc133e1ef3f4d923 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1140.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1250.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1250.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..82d6745981206c52e62276e63234ef02a2af4d2f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1250.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1251.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1251.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1bd9d07f29fa63eaeb7168f69108f4d05cfd398c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1251.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1252.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1252.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..00d5aa56abecc084896617f6d4273ef2664b3c9f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1252.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1253.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1253.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0dc842a686d9c90fdbb6dec9db915d89b7466389 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1253.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1254.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1254.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4e60b5d04ec589b5a5b79600a1ff3d722222259f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1254.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1255.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1255.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b06ab2e40acf0b2fcb2b2ddda0260fdd90e0a6d0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1255.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1256.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1256.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e0382577fd016d7b0025ce94d1093d57f12b24e3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1256.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1257.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1257.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..19ea71400bb7ca631c235286616a2dcaf41007de Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1257.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1258.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1258.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..70ff307493983263cde02b34ef3f7a77e2d5309b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp1258.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp273.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp273.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d88a262e9b2b9756e14e01a147c8d47e67d50854 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp273.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp424.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp424.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4dba77aae23fb7b25d5bb314ddab572ce389343f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp424.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp437.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp437.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4313b066fedc8dcb9ee4b8282193c06baacc5f21 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp437.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp500.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp500.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6b3f79afe020b1b9353aba6afbce7312ef2131a1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp500.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp720.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp720.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4290546d491493a357c9c9bccdc3df284882240f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp720.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp737.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp737.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f9624cbdc98fd847ce6cc327d71567f3337ecd41 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp737.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp775.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp775.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d232cd6b8dedeb850a146a23dc4031bf7f2658e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp775.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp850.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp850.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..704ab32c202d08233e2f2998b761d473463e1c01 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp850.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp852.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp852.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8adfa2b088ec8c6d95eaba92fcd618e92fb46689 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp852.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp855.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp855.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2c7272c034f9250e10b023ec838c09201b58e03b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp855.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp856.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp856.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..34a44e829e1f1b88548e7ff1f96d2a9aa9b9cafa Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp856.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp857.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp857.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d67c2447a1206572a4cd584f9a0e75642de7d97 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp857.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp858.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp858.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4aa195965e1d15bb89a7a74dd76eefdcf2656076 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp858.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp860.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp860.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fe5b5ad3a2b5deb01927c4b3a2138aed4f29b497 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp860.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp861.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp861.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e6e02782b2223cbd47dc4b081b9d68cdbfcf467d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp861.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp862.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp862.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4d276e5272d3c45c7cfd94f8f490edc10df59d3e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp862.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp863.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp863.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a112a98fcc0c52e4a50aec56949916730996f9ce Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp863.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp864.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp864.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1c2c81cd975b5b317ac4611d34ff6173be2873f1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp864.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp865.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp865.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9ffe400003e71f677d095454a31bdd65e7c3af58 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp865.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp866.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp866.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5ab589d8cf78cd4cee6ec79ed42edc1cba72d500 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp866.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp869.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp869.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1b49899570bd6137b87a4d6ad193fe6fb5b252cf Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp869.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp874.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp874.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0c2aee8882adca7c402cea2fc8637b8c055fc2c9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp874.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp875.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp875.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0ae8a9f2e22fb4cb5bdba31565f03dcac3018c88 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp875.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp932.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp932.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4050b5d240f3a2a1dcda4f3563a4db8259142962 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp932.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp949.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp949.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..78dd79d7e2d2ebec7a1f6cf97acb572efcd0315e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp949.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp950.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp950.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eedc32a200eac80c3964fd9dbabcdb9a42c63385 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/cp950.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/euc_jis_2004.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/euc_jis_2004.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ce7fca2d2058c26d6e51717cec43a176609647fd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/euc_jis_2004.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/euc_jisx0213.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/euc_jisx0213.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..631060c96b6fc28acf0ecc050e90279ac7a2b58c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/euc_jisx0213.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/euc_jp.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/euc_jp.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aa62bcfae83421b4be3c85501e04da165fd44546 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/euc_jp.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/euc_kr.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/euc_kr.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b54d5c7ae1fc3289404609c5a187f67374fa2ee4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/euc_kr.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/gb18030.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/gb18030.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ae3c1e62955212ad1eaed00c8d89bebe60d8ab66 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/gb18030.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/gb2312.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/gb2312.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b092e213c1c537e2b60b052f1de42e0d03addd92 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/gb2312.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/gbk.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/gbk.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..03dd416c92e09f1599ec8395291562eba486bbc0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/gbk.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/hex_codec.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/hex_codec.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ad1b4be297319cdfed1c534e45868cd413f0fa2c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/hex_codec.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/hp_roman8.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/hp_roman8.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c4c94e1cd93240fc68f49c08c245d23d733e87d9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/hp_roman8.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/hz.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/hz.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b56a32b6597f95eb818f7ee34b7b7d4362a391cb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/hz.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/idna.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/idna.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..568af3108b0b65c035dd5d5b293f3116513b654a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/idna.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_jp.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_jp.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c518fec45a85d6ffa80011ab5479e9c8b822f3ff Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_jp.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_jp_1.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_jp_1.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5b59ec9af3552c4abf88275db61a0831ea6cf9e8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_jp_1.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_jp_2.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_jp_2.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8fc56ac07406373decf67c1a113fdfc501444be4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_jp_2.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_jp_2004.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_jp_2004.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..457ea04fcd5d800f2f2043cde4e713c2abd31ba8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_jp_2004.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_jp_3.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_jp_3.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..079d592c06cd3bb33ef9528ef899f1f718b404aa Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_jp_3.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_jp_ext.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_jp_ext.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1e8da20f3fa604dcf94fa64e934e7f4bcee9e82f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_jp_ext.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_kr.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_kr.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4d851485b6d8dc6b6cd3f02313bd748253070c0d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso2022_kr.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_1.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_1.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5b8ee5fbd7e6341c0c68f08841285d65aba06f5d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_1.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_10.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_10.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..74ec0875b7627bf401f75e5c3fe0e5728285021b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_10.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_11.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_11.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1b201eb9c4e2f451143f7717463edfb5f352db07 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_11.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_13.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_13.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..22fc6f6902a4fdeb5c32f70ccd02a07b44d078a7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_13.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_14.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_14.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..70eb9a10781464fabc0ff2cb9490848b89c88177 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_14.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_15.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_15.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..64323c30548dbabec7e5bf5b80f7b28f4dfd3a84 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_15.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_16.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_16.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7efcc92e96d86b3919feaef427b1140770d29efa Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_16.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_2.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_2.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..459172d73376ae7cb4eaf8a106c2e21f54cbcf8e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_2.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_3.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_3.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b4950f9313ec3408a5d2d5a92c82dfd1a0d12602 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_3.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_4.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_4.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bf3877ebd4e9bec431abb8672b12c6caedd0cd7b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_4.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_5.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_5.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d566ef77dd8da78d864bee83f33296628e9815f2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_5.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_6.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_6.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5ddffb8fe7fb73847c7468f1ebd51f070147da99 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_6.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_7.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_7.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..74d1b635f2e60678ab527d5d3eb1942d0c4c2e7a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_7.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_8.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_8.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..41ce6fb7f2df01fad22e6629c1bfb9b946665bab Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_8.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_9.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_9.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..54bb3a9b172b11ee5c510fd8c81b08c778ea1b50 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/iso8859_9.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/johab.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/johab.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..91c48075f43af4451022bc0930e86db7bfad3416 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/johab.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/koi8_r.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/koi8_r.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8c90adbaa177a95cabe86e3a808110505f8a7b7c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/koi8_r.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/koi8_t.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/koi8_t.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..87f9f0ecae29041053e8375b4dc96f0ec68d9a03 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/koi8_t.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/koi8_u.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/koi8_u.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..78fa293b96a2fbd0843386c01d9f2b97bbc45faf Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/koi8_u.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/kz1048.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/kz1048.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..adbfa50b3482bb1da77c233f30d76d6d3ed2180d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/kz1048.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/latin_1.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/latin_1.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b6b4b417604dba88b25c893a3f85cdf0bf837484 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/latin_1.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_arabic.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_arabic.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..27c41089349f8a15dc7c10616d3f486c712b728f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_arabic.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_croatian.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_croatian.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cbdd0ee3aaa7e9929585dc45234670625638aa0c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_croatian.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_cyrillic.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_cyrillic.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8491c0711d62030feaafbcaf9ebd785bc4e3e947 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_cyrillic.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_farsi.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_farsi.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d63623bebcc413b12e94db758eee94a12e142d8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_farsi.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_greek.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_greek.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..38f6fdc3c42592df4f7ec120058de00281292e6e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_greek.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_iceland.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_iceland.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..06f9aae8dadad63de14b2ef06c78d8b16e44eaa0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_iceland.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_latin2.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_latin2.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6c3da9d45a26ca70bbb748baab1eb4f3e0796072 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_latin2.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_roman.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_roman.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2c59658495ca557beed8c21cb29bdc7ebe910ace Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_roman.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_romanian.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_romanian.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b02d596620d2749e260105b2dcdde74e8597cff7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_romanian.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_turkish.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_turkish.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d23af2641f738fa03081f9d045955bad0e3e93bd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mac_turkish.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mbcs.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mbcs.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..69af06e1e5e85e01c4804a1c1dc29e3db3a2d12b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/mbcs.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/oem.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/oem.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..75264fb3c80b4e0d299f76f839b5c9111270acce Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/oem.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/palmos.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/palmos.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d8f82bfff7bd16bb91d8bfca7705340f8d38eeb8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/palmos.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/ptcp154.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/ptcp154.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5f397faf3db0545e9935b97322b75e2a193b21f8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/ptcp154.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/punycode.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/punycode.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f6a6f9aa2422b13ea9110e6d6e92029155f19c5c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/punycode.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/quopri_codec.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/quopri_codec.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f116a277b07c4fde9418657381d7cbc52f5ecdc9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/quopri_codec.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/raw_unicode_escape.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/raw_unicode_escape.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8aca9a295415876165ba1158029d283fd13a8c72 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/raw_unicode_escape.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/rot_13.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/rot_13.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d5f3e30c360d725d646641ab9c09908b6666b9cc Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/rot_13.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/shift_jis.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/shift_jis.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e366192bd23cc70b49df99ad18719a4c7235d28b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/shift_jis.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/shift_jis_2004.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/shift_jis_2004.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..55f154cb81cf683bdd50ce8d9050e30e01595e45 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/shift_jis_2004.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/shift_jisx0213.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/shift_jisx0213.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c285dfa0a3adeab456d2cffd81acdef306bd968f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/shift_jisx0213.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/tis_620.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/tis_620.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b3b2956199938d48a9bdef7d03dc7ecef482a6ec Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/tis_620.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/undefined.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/undefined.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..63bce2d029ea1d10d28f1121174599f58316f6ee Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/undefined.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/unicode_escape.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/unicode_escape.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..01cc0a54b22b725d495bfaeaa250b4c0b9fc22ab Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/unicode_escape.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_16.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_16.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..73040df9ea66ef5a5e07af9cf763d4c5695b24c3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_16.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_16_be.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_16_be.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..94422145fd14196b0105e326ef40667f634a47c2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_16_be.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_16_le.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_16_le.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e8c7b2287ae19ec3727984ccb4eee0067c510a59 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_16_le.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_32.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_32.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e9e75f9f22ce89c6d51e7557cc0cb45ed411071f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_32.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_32_be.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_32_be.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..957cb6f0a658f7a837f2b493de295c6b7009754c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_32_be.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_32_le.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_32_le.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..28a6a3d3084df09478a815be11e8e009dda49228 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_32_le.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_7.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_7.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8e75bbd95d8026d229f3af3e9210829317f2debc Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_7.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_8.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_8.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..309290161ac02899cfc950deb1c2a4ed53c69622 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_8.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_8_sig.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_8_sig.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..93d881319a3792e798c233adfc0a33bded9fda3d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/utf_8_sig.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/uu_codec.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/uu_codec.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f613835297a99a7de93d5386c0e145e6a61d3f4d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/uu_codec.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/zlib_codec.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/zlib_codec.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d91aee2b53005dc8b46c143bc32573e76ce18139 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/encodings/__pycache__/zlib_codec.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ensurepip/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ensurepip/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b75aaf9dd3b641e36f47ef11fba9f57b39074334 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ensurepip/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ensurepip/__pycache__/__main__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ensurepip/__pycache__/__main__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..390f34adff9b9cb62ec23de837923495cbed1cb2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ensurepip/__pycache__/__main__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ensurepip/__pycache__/_uninstall.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ensurepip/__pycache__/_uninstall.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aba01cb3097b53c83b7f5269074ca472d6a93023 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ensurepip/__pycache__/_uninstall.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/html/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/html/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..291d3546c2feb5158c718c4ba94a08ab08593cce Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/html/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/html/__pycache__/entities.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/html/__pycache__/entities.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1c541ef3043af8a16803e116ebef1ef1ed18a63f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/html/__pycache__/entities.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/html/__pycache__/parser.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/html/__pycache__/parser.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1d2f12b1c62cb73706a9fea7f940d35258c75c6c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/html/__pycache__/parser.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/http/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/http/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..63fe63f8c52e44c52df601d7d5c61e809fe5adde Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/http/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/http/__pycache__/client.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/http/__pycache__/client.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..91c3b3364e3e7dc6f515e9774e10d2630707d708 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/http/__pycache__/client.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/http/__pycache__/cookiejar.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/http/__pycache__/cookiejar.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..17a125fbe5ff8399b5cd8b3c667a008cc1830d00 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/http/__pycache__/cookiejar.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/http/__pycache__/cookies.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/http/__pycache__/cookies.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0aa62e47f26a4ec6ee0b773e8c4d05d960ed50e9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/http/__pycache__/cookies.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/http/__pycache__/server.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/http/__pycache__/server.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d3d881e414b1764f8847d63326cf9b40b77d02c4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/http/__pycache__/server.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/Icons/README.txt b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/Icons/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..e245bc0b26e121eb19df5eb9f8464e12dcf6ebde --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/Icons/README.txt @@ -0,0 +1,51 @@ +IDLE-PYTHON LOGOS + +These are sent to tk on Windows, *NIX, and non-Aqua macOS +in pyshell following "# set application icon". + + +2006?: Andrew Clover made variously sized python icons for win23. +https://www.doxdesk.com/software/py/pyicons.html + +2006: 16, 32, and 48 bit .png versions were copied to CPython +as Python application icons, maybe in PC/icons/py.ico. +https://github.com/python/cpython/issues/43372 + +2014: They were copied (perhaps a bit revised) to idlelib/Icons. +https://github.com/python/cpython/issues/64605 +.gif versions were also added. + +2020: Add Clover's 256-bit image. +https://github.com/python/cpython/issues/82620 +Other fixups were done. + +The idle.ico file used for Windows was created with ImageMagick: + $ convert idle_16.png idle_32.png idle_48.png idle_256.png idle.ico +** This needs redoing whenever files are changed. +?? Do Start, Desktop, and Taskbar use idlelib/Icons files? + +Issue added Windows Store PC/icons/idlex44.png and .../idlex150.png. +https://github.com/python/cpython/pull/22817 +?? Should these be updated with major changes? + +2022: Optimize .png images in CPython repository with external program. +https://github.com/python/cpython/pull/21348 +idle.ico (and idlex##) were not updated. + +The idlexx.gif files are only needed for *nix running tcl/tk 8.5. +As of 2022, this was known true for 1 'major' Linux distribution. +(Same would be true for any non-Aqua macOS with 8.5, but now none?) +Can be deleted when we require 8.6 or it is known always used. + +Future: Derivatives of Python logo should be submitted for approval. +PSF Trademark Working Group / Committee psf-trademarks@python.org +https://www.python.org/community/logos/ # Original files +https://www.python.org/psf/trademarks-faq/ +https://www.python.org/psf/trademarks/ # Usage. + + +OTHER GIFS: These are used by browsers using idlelib.tree. +At least some will not be used when tree is replaced by ttk.Treeview. + + +Edited 2024 August 26 by TJR. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/Icons/idle.ico b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/Icons/idle.ico differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..049d1ff4b3c4ee426e62d0e3c254fad660e9faca Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/__main__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/__main__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..031415789c03f3dd577b8c3e06a7ecd975026ac5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/__main__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/autocomplete.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/autocomplete.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fd674d5690618c61fff7d37fc11bd93ab4df3b51 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/autocomplete.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/autocomplete_w.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/autocomplete_w.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c8c54446c43eaef025b73693ef5a0f7332f1584b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/autocomplete_w.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/autoexpand.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/autoexpand.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9a4c1f33a669e0f313a69170e93210bd1f3bbf75 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/autoexpand.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/browser.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/browser.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..928daa9a72502cbf5e51e81db1c8fb1f7b4274a7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/browser.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/calltip.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/calltip.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2b798b7fc82b6f88e2cb9db5bd884e03a8f0ff14 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/calltip.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/calltip_w.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/calltip_w.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2ad1d0bbed8cf66a64a3975095e65fd597bec99b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/calltip_w.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/codecontext.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/codecontext.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7c79a12d473b31847df788c2eef79e53d1a4a927 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/codecontext.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/colorizer.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/colorizer.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a6ec0bb86ca8f4288d5557dce07eb6f70e8f7b2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/colorizer.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/config.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/config.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b2d58e5388c9c60be354a8f3e6f229ddad2f523f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/config.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/config_key.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/config_key.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..98139d3f4c71aa67a2cb3549cb2aa76058d1ab2c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/config_key.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/debugger.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/debugger.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..837ef40b4c859719b904cf93471128a6e12dc4d7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/debugger.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/debugger_r.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/debugger_r.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d003b23353f8d77832f25f0e1f98edf6feb09dad Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/debugger_r.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/debugobj.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/debugobj.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c0b5b6ce5651197f5f1111932add947b0e974640 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/debugobj.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/debugobj_r.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/debugobj_r.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b38383f1c42449590f8141bb56928ac98f65bdff Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/debugobj_r.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/delegator.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/delegator.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7101052160f73adbeb9c3b2d743fb5cc14f95f1e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/delegator.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/dynoption.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/dynoption.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1caf1b47b8182d94e630eb96b8cebfee07c86287 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/dynoption.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/editor.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/editor.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8e304bf2eb01aa3a536fb87955591f7cfc026712 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/editor.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/filelist.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/filelist.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..409a1dd879e0e6d9d1afa2c87071ae7141f3f5af Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/filelist.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/format.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/format.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b2f3705a33227468a168dd4121f2d097317324aa Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/format.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/grep.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/grep.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..95b9a80c7f52a1eb673a23ace1134ae51821397d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/grep.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/help.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/help.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..efd23c21336e937f1fa16697c85a935c9e81efb0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/help.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/help_about.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/help_about.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8853973eb07fef2534a9c490cc3ca5ddf69681a3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/help_about.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/history.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/history.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4a4d3bbcf41f6fd1ad7a843879e439a5142334eb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/history.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/hyperparser.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/hyperparser.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a082e690e42ebd720db2cd3930e8d5d0122df2c2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/hyperparser.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/idle.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/idle.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3bb20cdbcdc1f311b49f00dd7f7ea3fb8e84b3c0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/idle.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/iomenu.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/iomenu.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c35f5f7ed5940ca609171721d4fb4152df083fe9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/iomenu.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/macosx.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/macosx.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2f4322c3b6be395d868b129997856a870caa77bc Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/macosx.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/mainmenu.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/mainmenu.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2faca2c2d7437172d5ba30b8cec739e6c9580c35 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/mainmenu.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/multicall.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/multicall.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..839bf2abc1bd4cdfd19ccc34bc26d2047e171d53 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/multicall.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/outwin.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/outwin.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..35d6a9916015821eafe5b4a3c6b218c874f07000 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/outwin.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/parenmatch.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/parenmatch.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..94c9c9da5bf9798ebbf679f8eb5e1347886564f5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/parenmatch.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/pathbrowser.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/pathbrowser.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..044a6f17a45262be3977d900f1b5bd1ba25a9dc7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/pathbrowser.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/percolator.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/percolator.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d4ad02ae4388a78efd9396ff3a880b5fbea65b00 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/percolator.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/pyparse.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/pyparse.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..31c4957bb647ea9182b9c2f5dd3b18346a919cd8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/pyparse.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/pyshell.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/pyshell.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..364121772aa292c2a1639cee5dae0aa0a3e0c65b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/pyshell.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/query.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/query.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa592a490274044510bed94f383a46454f8fe2ec Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/query.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/redirector.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/redirector.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..758f7fe0e774909bb548034d2143d6bb4e9e060b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/redirector.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/replace.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/replace.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6666a74e06bd5cb78c89e3f04c46c2a4d1af5ef1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/replace.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/rpc.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/rpc.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2d7a0e52eb364eaa6bdf7580a8ff1f8836479616 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/rpc.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/run.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/run.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..59c7166fd984353219179956e2f5930162ce660c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/run.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/runscript.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/runscript.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..14b85a79c62e9d646b0a81f6a3c4d1a521479684 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/runscript.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/scrolledlist.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/scrolledlist.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..38bf1d4801818cce942e6734d70c33e1a3bdbc02 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/scrolledlist.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/search.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/search.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9de44aeb049ed15337c34c117ea0a22545ab704e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/search.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/searchbase.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/searchbase.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..47edf59562376fc88563e292f6d1f3bdc634bf5e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/searchbase.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/searchengine.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/searchengine.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2d1eeab931aab81ef469fb47f542fa5e862918d2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/searchengine.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/sidebar.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/sidebar.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..53da9f95511e10721b8524feef82dedaaf268a83 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/sidebar.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/squeezer.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/squeezer.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1a620a9332292dead84c474511a05828b6068064 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/squeezer.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/stackviewer.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/stackviewer.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a90fa65ced90627b9abee007bad2053f2740ddf2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/stackviewer.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/statusbar.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/statusbar.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..718c654a18a7486b7c91202978628b33544edf99 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/statusbar.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/textview.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/textview.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..192d108c097a6e6930d282e43f63c15a6717764d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/textview.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/tooltip.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/tooltip.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ebbbfc3f881eeb348080e3be147581d455066744 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/tooltip.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/tree.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/tree.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..174c463a84c0a3eb34d2186dda961cbd4af8eb11 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/tree.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/undo.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/undo.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..59f98f834c86c3de23f06ab807b22d194ddc678d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/undo.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/util.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/util.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..70a0ba5ccf0709f95d09be4e2e071adf07b48219 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/util.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/window.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/window.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9f5dd12f6ff6f857b67c71ffc73de28be0a2b228 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/window.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/zoomheight.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/zoomheight.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a0b22d3742b1264c4bfd4e18878e3131cde6af49 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/zoomheight.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/zzdummy.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/zzdummy.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cabffc4257d6206e0756e204c75701287a07edcd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/zzdummy.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/README.txt b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8eed2699c4121119eec4e38d7b19e6a360404f70 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__init__.py @@ -0,0 +1,23 @@ +"""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) + return standard_tests diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9d6bed4a031a166e56e99c5277f4497948d8e0ad Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/htest.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/htest.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a911917ac532dd5767d8c08f24348a508b9c091b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/htest.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/mock_idle.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/mock_idle.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a2479abadf8b15acb6e01b9150b10e967aea7cfd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/mock_idle.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/mock_tk.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/mock_tk.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..43f9cfeb8f38d501744f13e687a75b09f91279a4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/mock_tk.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/template.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/template.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f042c441c69d166e77b99ce7d31c9376b09b3c6e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/template.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_autocomplete.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_autocomplete.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..29e3920e8f0d614c2b82a1ca2bfee17f1f6d53a6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_autocomplete.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_autocomplete_w.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_autocomplete_w.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ed9fb1279cd4f7b3e801f1c880ea9c2ecd54cb47 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_autocomplete_w.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_autoexpand.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_autoexpand.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..41dbc6e1d3512b4104762ac8957be2e3ff504ff2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_autoexpand.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_browser.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_browser.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..82777871358e4e3715f2e814aba95bc22bd8c7ff Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_browser.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_calltip.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_calltip.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..06cb69399144f6400f0f7d3d9b4705917c1a7bfb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_calltip.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_calltip_w.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_calltip_w.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..98097b81fd43f4a6a1d3016dc848c8a23dc3f67a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_calltip_w.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_codecontext.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_codecontext.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..611080ed78de399c9b5f2a5a9afcc87e0a0bb433 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_codecontext.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_colorizer.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_colorizer.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5bf2279cc4a74cc76e0c01865876819fec402a7d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_colorizer.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_config.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_config.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5f36e6f723c40229e29a2c8fea3fc8ed69ee19f6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_config.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_config_key.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_config_key.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ee2efd4eb070ed7c9d5c307cda998ae8eee5499c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_config_key.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_configdialog.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_configdialog.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e69f52c05d4295a876f2e36196144e39b44a5a36 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_configdialog.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_debugger.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_debugger.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8652a5851c9043c44e66dd16733904c0d9abe24d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_debugger.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_debugger_r.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_debugger_r.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..46b63b9998c42e1a88cef44b7b2c8f5f0456d663 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_debugger_r.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_debugobj.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_debugobj.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..16eb6c56191072bb2469029be232c71ea937b8e4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_debugobj.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_debugobj_r.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_debugobj_r.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c5e7476344591f765adcb416142f4f787069a18c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_debugobj_r.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_delegator.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_delegator.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9474587fe005dcb429073dfcfdd1c4d5931d3fd6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_delegator.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_editmenu.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_editmenu.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..716f8747b6efec6d1524cd69d49716af1b1d45af Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_editmenu.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_editor.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_editor.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f2d870ecda64de28816e03ebe7515cd7f050f1d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_editor.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_filelist.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_filelist.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6c53aa4abcc82b119ad436c0d9e8a2ab9410a77d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_filelist.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_format.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_format.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e1bf6885a6b2d51fb742f67aaf30d0e66b1a0c9d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_format.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_grep.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_grep.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d312a3b1ed8d5176be0f61eb01822602b49e7cdb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_grep.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_help.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_help.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..50f4a0d1960baf28247fd7790e7fba9cc984c529 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_help.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_help_about.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_help_about.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fe1efbe42551b25b15f8412435b00c0e8805c217 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_help_about.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_history.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_history.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c93e05112521e03885f15d373ca6320f5d458edb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_history.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_hyperparser.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_hyperparser.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..da57a75f618fa98a2e429756457269f18b2cfd25 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_hyperparser.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_iomenu.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_iomenu.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fd80e2bcff70b720b7c8729b5b7c935cfb9778bd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_iomenu.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_macosx.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_macosx.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d3ae2a8afdacd93c46ab49f5b7e995c3d3b70349 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_macosx.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_mainmenu.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_mainmenu.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e3450cbba4b46db66a037feac17dca322d3a2bba Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_mainmenu.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_multicall.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_multicall.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aa05e82684184be96f9f4b0d244b852394a7eb74 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_multicall.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_outwin.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_outwin.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bbc8ba330cd51cc2275feb79eb7781a5e55aaff8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_outwin.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_parenmatch.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_parenmatch.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..19066ba7109ef56a23afe1c092b3f2690680ebe6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_parenmatch.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_pathbrowser.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_pathbrowser.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bb4f2848c5ca3446264a4d1ea015dcce74fbacea Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_pathbrowser.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_percolator.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_percolator.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7dc4ca923e4f5ce033567d036ac188baf5812db3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_percolator.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_pyparse.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_pyparse.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d4d3f4c033683e28635c423529a71c2bed465dee Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_pyparse.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_pyshell.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_pyshell.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..72cf1b8957575d1722952ce6419d363d19dab361 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_pyshell.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_query.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_query.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1d70c030a93c51e7d4e510f56a93e5cdb9070664 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_query.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_redirector.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_redirector.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..32bfdc826abba09c086aa5679d88d2f8ffe02d58 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_redirector.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_replace.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_replace.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1f7a9c6240ed79674f08c51c73e172379b27d904 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_replace.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_rpc.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_rpc.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..12dab251288d222832e9835249e0e331d0cb9df9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_rpc.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_run.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_run.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9f9a0901e96eb7319223755bb1f10062a466530f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_run.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_runscript.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_runscript.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b05d98e6750e632b43991d5b1143623bf07727d7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_runscript.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_scrolledlist.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_scrolledlist.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f61291a82363fbb95c850c486a3c815a2f4f7c17 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_scrolledlist.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_search.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_search.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bd6c592470ba2bc0f2aa2b097d5a37e4b886139d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_search.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_searchbase.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_searchbase.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cb9d31fa56c2feeab53c7fd68066c018f054068e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_searchbase.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_searchengine.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_searchengine.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4b6ae0a679d7777785fc2f8eecadc4751970bbcf Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_searchengine.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_sidebar.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_sidebar.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b1001507a618fd32e42d20d84d0a3641fc97829 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_sidebar.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_squeezer.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_squeezer.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d3b70c53e680fa74818d814290add72d16950098 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_squeezer.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_stackviewer.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_stackviewer.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8cbb923b76301dd32baae404cd1a29535f60b165 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_stackviewer.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_statusbar.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_statusbar.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ea52af17aca746b1bc50b4e6a3db10d7fdfbeeb2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_statusbar.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_text.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_text.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3411b0ce9a52a034d7fdbfa6d0d3a57f3f3b1c31 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_text.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_textview.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_textview.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..928ed1c0482cd976b51eedeb359c1086436b6463 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_textview.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_tooltip.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_tooltip.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7b40eb599e9798152eec49ebc7cac41b20e0ac50 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_tooltip.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_tree.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_tree.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1f518c2958bc217aff2ce39c64807f60e6c4def0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_tree.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_undo.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_undo.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..03c37d74b17512fd61d275819a90cb3d180d0117 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_undo.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_util.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_util.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..58cefff2d9a4f353e6af97d5bfc98e0a80f38476 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_util.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_warning.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_warning.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ebc20220ae8682a4ad778f1534e2c6e0bc21dfaa Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_warning.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_window.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_window.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7001cb326b6b81eb4eab95b19faf9a65c29f568d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_window.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_zoomheight.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_zoomheight.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fc5b64c21af9377e7e929739b54ec3b80f0aa6b9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_zoomheight.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_zzdummy.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_zzdummy.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9a923feccbae867b65543734ee23ee31eb69c381 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/test_zzdummy.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/tkinter_testing_utils.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/tkinter_testing_utils.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b03a803e33c7cf35aa1a99476da586c127eec409 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/__pycache__/tkinter_testing_utils.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/example_noext b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/example_stub.pyi b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/example_stub.pyi new file mode 100644 index 0000000000000000000000000000000000000000..abcdbc17529974ca9892cb0b70f30425160bb279 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/example_stub.pyi @@ -0,0 +1,4 @@ +# An example file to test recognition of a .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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/htest.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/htest.py new file mode 100644 index 0000000000000000000000000000000000000000..b63ff9ec2877b96ef225d7f8a4073a19b294cd94 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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 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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/mock_idle.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/mock_tk.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/template.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_autocomplete.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_autocomplete_w.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_autoexpand.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_browser.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_calltip.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_calltip_w.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_codecontext.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_colorizer.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_colorizer.py new file mode 100644 index 0000000000000000000000000000000000000000..40800df97b0bd38e6dfcb1b06d80cacb3ff73916 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_colorizer.py @@ -0,0 +1,623 @@ +"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' + tr'x', Tr'x', tR'x', TR'x', rt'x', rT'x', Rt'x', RT'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',)), + ('20.0', ('KEYWORD',)), + ('21.4', ('KEYWORD',)), ('21.16', ('KEYWORD',)),# ('21.19', ('KEYWORD',)), + #('23.4', ('KEYWORD',)), ('23.10', ('KEYWORD',)), ('23.14', ('KEYWORD',)), ('23.19', ('STRING',)), + #('24.12', ('KEYWORD',)), + ('25.8', ('KEYWORD',)), + ('26.4', ('KEYWORD',)), ('26.9', ('KEYWORD',)), + ('26.11', ('KEYWORD',)), ('26.15', ('STRING',)), + ('26.19', ('KEYWORD',)), ('26.22', ()), + ('26.24', ('KEYWORD',)), ('26.29', ('BUILTIN',)), ('26.37', ('KEYWORD',)), + ('27.4', ('KEYWORD',)), ('27.9', ('KEYWORD',)),# ('27.11', ('KEYWORD',)), ('27.14', (),), + ('28.25', ('STRING',)), ('28.38', ('STRING',)), + ('30.0', ('STRING',)), + ('31.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', '31.0'), ('31.10', '33.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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_config.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_config_key.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_configdialog.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_configdialog.py new file mode 100644 index 0000000000000000000000000000000000000000..2773ed7ce614b55097c2d3811b902c145074da24 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.assertStartsWith(contents, 'When you click') + self.assertEndsWith(contents,'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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_debugger.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_debugger.py new file mode 100644 index 0000000000000000000000000000000000000000..9ca3b332648b31185592128e684183d629c51511 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.assertHasAttr(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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_debugger_r.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_debugobj.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_debugobj_r.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_delegator.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_editmenu.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_editor.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_filelist.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_format.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_grep.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_grep.py new file mode 100644 index 0000000000000000000000000000000000000000..d67dba76911fcfa96bc8826d1cfbf38135a6cce2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.assertStartsWith(lines[4], '(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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_help.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_help.py new file mode 100644 index 0000000000000000000000000000000000000000..ebb02b5c0d8356a89c70acc64de226064ef7e63d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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 — Python editor and shell ') + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_help_about.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_history.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_hyperparser.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_iomenu.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_macosx.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_mainmenu.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_multicall.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_multicall.py new file mode 100644 index 0000000000000000000000000000000000000000..67f28db6b0875cf96328978d512ed940a189e4bc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.assertIsSubclass(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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_outwin.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_outwin.py new file mode 100644 index 0000000000000000000000000000000000000000..0f13363f84f36107283d074ba7ed208f288e5eea --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_outwin.py @@ -0,0 +1,172 @@ +"Test outwin, coverage 76%." + +from idlelib import outwin +import platform +import sys +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) + if sys.platform == 'darwin': # Issue 112938 + cls.text.update = cls.text.update_idletasks + # Without this, test write, writelines, and goto... fail. + # The reasons and why macOS-specific are unclear. + + @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' + ' (%s)' % platform.python_version()) + + 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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_parenmatch.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_pathbrowser.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_percolator.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_pyparse.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_pyshell.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_query.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_query.py new file mode 100644 index 0000000000000000000000000000000000000000..a6ef858a8c954a23f734ad342900e6d15b7f171c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.assertEndsWith(dialog.entry_ok(), '__init__.py') + self.assertEqual(dialog.entry_error['text'], '') + dialog = self.Dummy_ModuleName('idlelib.idle') + self.assertEndsWith(dialog.entry_ok(), '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.assertEndsWith(dialog.result, '__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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_redirector.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_redirector.py new file mode 100644 index 0000000000000000000000000000000000000000..bd486d7da66010815f46a1ad57da8fbe85f0073d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.assertNotHasAttr(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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_replace.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_rpc.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_run.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_run.py new file mode 100644 index 0000000000000000000000000000000000000000..83ecbffa2a197e7460ba98402f197a689bd43a4d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_run.py @@ -0,0 +1,433 @@ +"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 +from test.support import force_not_colorized + +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'? " + "Or did you forget to import 'abc'?\n"), + ('int.reel', AttributeError, + "type object 'int' has no attribute 'reel'. " + "Did you mean: 'real'?\n"), + ) + + @force_not_colorized + 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) + + @force_not_colorized + @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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_runscript.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_scrolledlist.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_search.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_searchbase.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_searchengine.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_sidebar.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_sidebar.py new file mode 100644 index 0000000000000000000000000000000000000000..4157a4b4dcdd2aaf1a0e1936b115421aa339b5ed --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.assertStartsWith(selected_text, '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.assertStartsWith(selected_text, '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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_squeezer.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_stackviewer.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_statusbar.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_text.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_textview.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_tooltip.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_tree.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_undo.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_util.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_warning.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_window.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_zoomheight.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/test_zzdummy.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/idlelib/idle_test/tkinter_testing_utils.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a133ccc8586c6afc0ab7a2165d0d3129a453b250 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/_abc.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/_abc.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1813ca94a1aedd4ab66101680d17ed4613900368 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/_abc.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/_bootstrap.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/_bootstrap.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0918e95763fcf44c4612fa9d8f155725b4339920 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/_bootstrap.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/_bootstrap_external.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/_bootstrap_external.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..129a88189a3362c983bd7fa248bf6b29dca98da3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/_bootstrap_external.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/abc.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/abc.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5fc185c2c12d827c0c5f369738ad35cc5e873a3a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/abc.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/machinery.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/machinery.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c69e002827ee77a82fde147cabcd2cffb31e7476 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/machinery.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/readers.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/readers.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6c6d102803868c55d0d40ac316e4be58fd341c1b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/readers.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/simple.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/simple.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ec4eabd39beb40dd17d2a05b0464b98d9c5afa9e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/simple.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/util.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/util.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..60d8e9ba86370fbc29724f6e289e7c153d5fbfab Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/__pycache__/util.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8ce62dd864fc2735dc4c863909b0622b4f5f4548 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__init__.py @@ -0,0 +1,1093 @@ +from __future__ import annotations + +import os +import re +import abc +import sys +import json +import email +import types +import inspect +import pathlib +import zipfile +import operator +import textwrap +import warnings +import functools +import itertools +import posixpath +import collections + +from . import _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 Any, Iterable, List, Mapping, Match, Optional, Set, cast + +__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) -> str: + return f"No package metadata was found for {self.name}" + + @property + def name(self) -> str: # type: ignore[override] + (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: str): + return line and not line.startswith('#') + + +class EntryPoint: + """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: str, value: str, group: str) -> None: + vars(self).update(name=name, value=value, group=group) + + def load(self) -> Any: + """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 = cast(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) -> str: + match = self.pattern.match(self.value) + assert match is not None + return match.group('module') + + @property + def attr(self) -> str: + match = self.pattern.match(self.value) + assert match is not None + return match.group('attr') + + @property + def extras(self) -> List[str]: + match = self.pattern.match(self.value) + assert match is not None + return re.findall(r'\w+', match.group('extras') or '') + + def _for(self, dist): + vars(self).update(dist=dist) + return 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) -> int: + return hash(self._key()) + + +class EntryPoints(tuple): + """ + An immutable collection of selectable EntryPoint objects. + """ + + __slots__ = () + + def __getitem__(self, name: str) -> EntryPoint: # type: ignore[override] + """ + Get the EntryPoint in self matching name. + """ + try: + return next(iter(self.select(name=name))) + except StopIteration: + raise KeyError(name) + + def __repr__(self): + """ + Repr with classname and tuple constructor to + signal that we deviate from regular tuple behavior. + """ + return '%s(%r)' % (self.__class__.__name__, tuple(self)) + + def select(self, **params) -> EntryPoints: + """ + 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) -> Set[str]: + """ + Return the set of all names of all entry points. + """ + return {ep.name for ep in self} + + @property + def groups(self) -> Set[str]: + """ + Return the set of all groups of all entry points. + """ + 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 PackagePath(pathlib.PurePosixPath): + """A reference to a path in a package""" + + hash: Optional[FileHash] + size: int + dist: Distribution + + def read_text(self, encoding: str = 'utf-8') -> str: # type: ignore[override] + return self.locate().read_text(encoding=encoding) + + def read_binary(self) -> bytes: + return self.locate().read_bytes() + + def locate(self) -> SimplePath: + """Return a path-like object for this path""" + return self.dist.locate_file(self) + + +class FileHash: + def __init__(self, spec: str) -> None: + self.mode, _, self.value = spec.partition('=') + + def __repr__(self) -> str: + return f'' + + +class DeprecatedNonAbstract: + # Required until Python 3.14 + def __new__(cls, *args, **kwargs): + all_names = { + name for subclass in inspect.getmro(cls) for name in vars(subclass) + } + abstract = { + name + for name in all_names + if getattr(getattr(cls, name), '__isabstractmethod__', False) + } + if abstract: + warnings.warn( + f"Unimplemented abstract methods {abstract}", + DeprecationWarning, + stacklevel=2, + ) + return super().__new__(cls) + + +class Distribution(DeprecatedNonAbstract): + """ + An abstract Python distribution package. + + Custom providers may derive from this class and define + the abstract methods to provide a concrete implementation + for their environment. Some providers may opt to override + the default implementation of some properties to bypass + the file-reading mechanism. + """ + + @abc.abstractmethod + def read_text(self, filename) -> Optional[str]: + """Attempt to load metadata file given by the name. + + Python distribution metadata is organized by blobs of text + typically represented as "files" in the metadata directory + (e.g. package-1.0.dist-info). These files include things + like: + + - METADATA: The distribution metadata including fields + like Name and Version and Description. + - entry_points.txt: A series of entry points as defined in + `the entry points spec `_. + - RECORD: A record of files according to + `this recording spec `_. + + A package may provide any set of files, including those + not listed here or none at all. + + :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: str | os.PathLike[str]) -> SimplePath: + """ + Given a path to a file in this distribution, return a SimplePath + to it. + """ + + @classmethod + def from_name(cls, name: str) -> Distribution: + """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(iter(cls.discover(name=name))) + except StopIteration: + raise PackageNotFoundError(name) + + @classmethod + def discover( + cls, *, context: Optional[DistributionFinder.Context] = None, **kwargs + ) -> Iterable[Distribution]: + """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 packages matching + the context. + """ + 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: str | os.PathLike[str]) -> Distribution: + """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 (MetadataPathFinders).""" + 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 per the + `Core metadata specifications `_. + + Custom providers may provide the METADATA file or override this + property. + """ + # deferred for performance (python/cpython#109829) + from . import _adapters + + opt_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('') + ) + text = cast(str, opt_text) + return _adapters.Message(email.message_from_string(text)) + + @property + def name(self) -> str: + """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) -> str: + """Return the 'Version' metadata for the distribution package.""" + return self.metadata['Version'] + + @property + def entry_points(self) -> EntryPoints: + """ + Return EntryPoints for this distribution. + + Custom providers may provide the ``entry_points.txt`` file + or override this property. + """ + return EntryPoints._from_text_for(self.read_text('entry_points.txt'), self) + + @property + def files(self) -> Optional[List[PackagePath]]: + """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 installed-files.txt or + SOURCES.txt for egg-info) is missing. + Result may be empty if the metadata exists but is empty. + + Custom providers are recommended to provide a "RECORD" file (in + ``read_text``) or override this property to allow for callers to be + able to resolve filenames provided by the package. + """ + + 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): + # Delay csv import, since Distribution.files is not as widely used + # as other parts of importlib.metadata + import csv + + return starmap(make_file, csv.reader(lines)) + + @pass_none + def skip_missing_files(package_paths): + return list(filter(lambda path: path.locate().exists(), package_paths)) + + return skip_missing_files( + make_files( + self._read_files_distinfo() + or self._read_files_egginfo_installed() + or self._read_files_egginfo_sources() + ) + ) + + def _read_files_distinfo(self): + """ + Read the lines of RECORD. + """ + text = self.read_text('RECORD') + return text and text.splitlines() + + def _read_files_egginfo_installed(self): + """ + Read installed-files.txt and return lines in a similar + CSV-parsable format as RECORD: each file must be placed + relative to the site-packages directory and must also be + quoted (since file names can contain literal commas). + + This file is written when the package is installed by pip, + but it might not be written for other installation methods. + Assume the file is accurate if it exists. + """ + text = self.read_text('installed-files.txt') + # Prepend the .egg-info/ subdir to the lines in this file. + # But this subdir is only available from PathDistribution's + # self._path. + subdir = getattr(self, '_path', None) + if not text or not subdir: + return + + paths = ( + (subdir / name) + .resolve() + .relative_to(self.locate_file('').resolve(), walk_up=True) + .as_posix() + for name in text.splitlines() + ) + return map('"{}"'.format, paths) + + def _read_files_egginfo_sources(self): + """ + Read SOURCES.txt and return lines in a similar CSV-parsable + format as RECORD: each file name must be quoted (since it + might contain literal commas). + + Note that SOURCES.txt is not a reliable source for what + files are installed by a package. This file is generated + for a source archive, and the files that are present + there (e.g. setup.py) may not correctly reflect the files + that are present after the package has been installed. + """ + text = self.read_text('SOURCES.txt') + return text and map('"{}"'.format, text.splitlines()) + + @property + def requires(self) -> Optional[List[str]]: + """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) + + @property + def origin(self): + return self._load_json('direct_url.json') + + def _load_json(self, filename): + return pass_none(json.loads)( + self.read_text(filename), + object_hook=lambda data: types.SimpleNamespace(**data), + ) + + +class DistributionFinder(MetaPathFinder): + """ + A MetaPathFinder capable of discovering installed distributions. + + Custom providers should implement this interface in order to + supply metadata. + """ + + 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. + + This mechanism gives a custom provider a means to + solicit additional details from the caller beyond + "name" and "path" when searching distributions. + For example, imagine a provider that exposes suites + of packages in either a "public" or "private" ``realm``. + A caller may wish to query only for distributions in + a particular realm and could call + ``distributions(realm="private")`` to signal to the + custom provider to only include distributions from that + realm. + """ + + 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) -> List[str]: + """ + 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()) -> Iterable[Distribution]: + """ + 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 root for children. + + Root is a path on the file system that may contain metadata + directories either as natural directories or within a zip file. + + >>> FastPath('').children() + ['...'] + + FastPath objects are cached and recycled for any given root. + + >>> FastPath('foobar') is FastPath('foobar') + True + """ + + @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: + """ + A micro-optimized class for searching a (fast) path for metadata. + """ + + def __init__(self, path: FastPath): + """ + Calculate all of the children representing metadata. + + From the children in the path, calculate early all of the + children that appear to represent metadata (infos) or legacy + metadata (eggs). + """ + + 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: Prepared): + """ + Yield all infos and eggs matching the Prepared query. + """ + 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 query for metadata on a possibly-named package. + + Pre-calculates the normalization to prevent repeated operations. + + >>> none = Prepared(None) + >>> none.normalized + >>> none.legacy_normalized + >>> bool(none) + False + >>> sample = Prepared('Sample__Pkg-name.foo') + >>> sample.normalized + 'sample_pkg_name_foo' + >>> sample.legacy_normalized + 'sample__pkg_name.foo' + >>> bool(sample) + True + """ + + normalized = None + legacy_normalized = None + + def __init__(self, name: Optional[str]): + 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() + ) -> Iterable[PathDistribution]: + """ + 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) -> None: + FastPath.__new__.cache_clear() + + +class PathDistribution(Distribution): + def __init__(self, path: SimplePath) -> None: + """Construct a distribution. + + :param path: SimplePath indicating the metadata directory. + """ + self._path = path + + def read_text(self, filename: str | os.PathLike[str]) -> Optional[str]: + with suppress( + FileNotFoundError, + IsADirectoryError, + KeyError, + NotADirectoryError, + PermissionError, + ): + return self._path.joinpath(filename).read_text(encoding='utf-8') + + return None + + read_text.__doc__ = Distribution.read_text.__doc__ + + def locate_file(self, path: str | os.PathLike[str]) -> SimplePath: + 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: str) -> Distribution: + """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) -> Iterable[Distribution]: + """Get all ``Distribution`` instances in the current environment. + + :return: An iterable of ``Distribution`` instances. + """ + return Distribution.discover(**kwargs) + + +def metadata(distribution_name: str) -> _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: str) -> str: + """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) -> EntryPoints: + """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()). + + :return: EntryPoints for all installed packages. + """ + eps = itertools.chain.from_iterable( + dist.entry_points for dist in _unique(distributions()) + ) + return EntryPoints(eps).select(**params) + + +def files(distribution_name: str) -> Optional[List[PackagePath]]: + """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: str) -> Optional[List[str]]: + """ + Return a list of requirements for the named package. + + :return: An iterable 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 _topmost(name: PackagePath) -> Optional[str]: + """ + Return the top-most parent as long as there is a parent. + """ + top, *rest = name.parts + return top if rest else None + + +def _get_toplevel_name(name: PackagePath) -> str: + """ + Infer a possibly importable module name from a name presumed on + sys.path. + + >>> _get_toplevel_name(PackagePath('foo.py')) + 'foo' + >>> _get_toplevel_name(PackagePath('foo')) + 'foo' + >>> _get_toplevel_name(PackagePath('foo.pyc')) + 'foo' + >>> _get_toplevel_name(PackagePath('foo/__init__.py')) + 'foo' + >>> _get_toplevel_name(PackagePath('foo.pth')) + 'foo.pth' + >>> _get_toplevel_name(PackagePath('foo.dist-info')) + 'foo.dist-info' + """ + return _topmost(name) or ( + # python/typeshed#10328 + inspect.getmodulename(name) # type: ignore + or str(name) + ) + + +def _top_level_inferred(dist): + opt_names = set(map(_get_toplevel_name, always_iterable(dist.files))) + + def importable_name(name): + return '.' not in name + + return filter(importable_name, opt_names) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0804e425e466305ad59153146bce392860198279 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/_adapters.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/_adapters.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d99f5d8b98639517d10346a78653f64597412ca1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/_adapters.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/_collections.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/_collections.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..866b0e4d6daa351986ddffba889af84f7e7037a4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/_collections.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/_functools.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/_functools.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1f8b9112d31110ecf3db002ab9e7faa9a16b6dfb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/_functools.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/_itertools.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/_itertools.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7422c7e76ab593071c7962226d9303877e7db4be Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/_itertools.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/_meta.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/_meta.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..90384190b818b7a99c2ddf7fe73b5a80db814fa9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/_meta.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/_text.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/_text.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e8b8769352c176c88d64f02430a180a19aa9f034 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/_text.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/diagnose.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/diagnose.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..df08081ed9c4e4f93efa70dfa9b157731f5a3551 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/__pycache__/diagnose.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/_adapters.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/_adapters.py new file mode 100644 index 0000000000000000000000000000000000000000..591168808953ba8ec54b47f14584a3ed7bc073f2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/_adapters.py @@ -0,0 +1,89 @@ +import functools +import warnings +import re +import textwrap +import email.message + +from ._text import FoldedCase + + +# Do not remove prior to 2024-01-01 or Python 3.14 +_warn = functools.partial( + warnings.warn, + "Implicit None on return values is deprecated and will raise KeyErrors.", + DeprecationWarning, + stacklevel=2, +) + + +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 __getitem__(self, item): + """ + Warn users that a ``KeyError`` can be expected when a + missing key is supplied. Ref python/importlib_metadata#371. + """ + res = super().__getitem__(item) + if res is None: + _warn() + return res + + 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.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/_collections.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/_functools.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/_itertools.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/_meta.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/_meta.py new file mode 100644 index 0000000000000000000000000000000000000000..1927d0f624d82f2fa12f81c80cce91279f039e84 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/_meta.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +import os +from typing import Protocol +from typing import Any, Dict, Iterator, List, Optional, TypeVar, Union, overload + + +_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 + + @overload + def get( + self, name: str, failobj: None = None + ) -> Optional[str]: ... # pragma: no cover + + @overload + def get(self, name: str, failobj: _T) -> Union[str, _T]: ... # pragma: no cover + + # overload per python/importlib_metadata#435 + @overload + def get_all( + self, name: str, failobj: None = None + ) -> Optional[List[Any]]: ... # pragma: no cover + + @overload + 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 Distribution. + """ + + def joinpath( + self, other: Union[str, os.PathLike[str]] + ) -> SimplePath: ... # pragma: no cover + + def __truediv__( + self, other: Union[str, os.PathLike[str]] + ) -> SimplePath: ... # pragma: no cover + + @property + def parent(self) -> SimplePath: ... # pragma: no cover + + def read_text(self, encoding=None) -> str: ... # pragma: no cover + + def read_bytes(self) -> bytes: ... # pragma: no cover + + def exists(self) -> bool: ... # pragma: no cover diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/_text.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/diagnose.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/diagnose.py new file mode 100644 index 0000000000000000000000000000000000000000..e405471ac4d94371b1ee9b1622227ff76b337180 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/metadata/diagnose.py @@ -0,0 +1,21 @@ +import sys + +from . import Distribution + + +def inspect(path): + print("Inspecting", path) + dists = list(Distribution.discover(path=[path])) + if not dists: + return + print("Found", len(dists), "packages:", end=' ') + print(', '.join(dist.name for dist in dists)) + + +def run(): + for path in sys.path: + inspect(path) + + +if __name__ == '__main__': + run() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..723c9f9eb33ce1e5f7fb5a70c5c9d62628a93521 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__init__.py @@ -0,0 +1,43 @@ +""" +Read resources contained within a package. + +This codebase is shared between importlib.resources in the stdlib +and importlib_resources in PyPI. See +https://github.com/python/importlib_metadata/wiki/Development-Methodology +for more detail. +""" + +from ._common import ( + as_file, + files, + Package, + Anchor, +) + +from ._functional import ( + contents, + is_resource, + open_binary, + open_text, + path, + read_binary, + read_text, +) + +from .abc import ResourceReader + + +__all__ = [ + 'Package', + 'Anchor', + 'ResourceReader', + 'as_file', + 'files', + 'contents', + '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.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..359c2cb3ab2c7248492a1f3c5e6b68b5cfd0a972 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/_adapters.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/_adapters.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4a618bbc2e77a31922f8b6defe5862227a3b54d3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/_adapters.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/_common.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/_common.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..05856cf698703b7f46dd2e3eba8356a3d28e3e04 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/_common.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/_functional.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/_functional.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cb3b4f8302e675a9133b2740e20f22f2db61d1dd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/_functional.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/_itertools.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/_itertools.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0764a97ec872fd3b90f92516e73665f38e299a9e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/_itertools.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/abc.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/abc.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e5c207a2c3efe20b156b0ea638b8ab661f06e60b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/abc.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/readers.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/readers.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6622fb1c0b654ff1f631f97d344b5bc59cfb7c63 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/readers.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/simple.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/simple.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e715e2826816b616542fe6743530aaf0e81f16a0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/__pycache__/simple.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/_adapters.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/_adapters.py new file mode 100644 index 0000000000000000000000000000000000000000..50688fbb666658c5b0569a363a4ea5b75f2fc00d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/_adapters.py @@ -0,0 +1,168 @@ +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(f"Invalid mode value '{mode}', only 'r' and 'rb' are supported") + + +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.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/_common.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/_common.py new file mode 100644 index 0000000000000000000000000000000000000000..4e9014c45a056e220eaa131839e69c9ba7d3023f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/_common.py @@ -0,0 +1,211 @@ +import os +import pathlib +import tempfile +import functools +import contextlib +import types +import importlib +import inspect +import warnings +import itertools + +from typing import Union, Optional, cast +from .abc import ResourceReader, Traversable + +Package = Union[types.ModuleType, str] +Anchor = Package + + +def package_to_anchor(func): + """ + Replace 'package' parameter as 'anchor' and warn about the change. + + Other errors should fall through. + + >>> files('a', 'b') + Traceback (most recent call last): + TypeError: files() takes from 0 to 1 positional arguments but 2 were given + + Remove this compatibility in Python 3.14. + """ + undefined = object() + + @functools.wraps(func) + def wrapper(anchor=undefined, package=undefined): + if package is not undefined: + if anchor is not undefined: + return func(anchor, package) + warnings.warn( + "First parameter to files is renamed to 'anchor'", + DeprecationWarning, + stacklevel=2, + ) + return func(package) + elif anchor is undefined: + return func() + return func(anchor) + + return wrapper + + +@package_to_anchor +def files(anchor: Optional[Anchor] = None) -> Traversable: + """ + Get a Traversable resource for an anchor. + """ + return from_package(resolve(anchor)) + + +def get_resource_reader(package: 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[union-attr] + if reader is None: + return None + return reader(spec.name) # type: ignore[union-attr] + + +@functools.singledispatch +def resolve(cand: Optional[Anchor]) -> types.ModuleType: + return cast(types.ModuleType, cand) + + +@resolve.register +def _(cand: str) -> types.ModuleType: + return importlib.import_module(cand) + + +@resolve.register +def _(cand: None) -> types.ModuleType: + return resolve(_infer_caller().f_globals['__name__']) + + +def _infer_caller(): + """ + Walk the stack and find the frame of the first caller not in this module. + """ + + def is_this_file(frame_info): + return frame_info.filename == stack[0].filename + + def is_wrapper(frame_info): + return frame_info.function == 'wrapper' + + stack = inspect.stack() + not_this_file = itertools.filterfalse(is_this_file, stack) + # also exclude 'wrapper' due to singledispatch in the call stack + callers = itertools.filterfalse(is_wrapper, not_this_file) + return next(callers).frame + + +def from_package(package: types.ModuleType): + """ + Return a Traversable object for the given package. + + """ + # deferred for performance (python/cpython#109829) + from ._adapters import wrap_spec + + 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 + + +def _temp_file(path): + return _tempfile(path.read_bytes, suffix=path.name) + + +def _is_present_dir(path: Traversable) -> bool: + """ + Some Traversables implement ``is_dir()`` to raise an + exception (i.e. ``FileNotFoundError``) when the + directory doesn't exist. This function wraps that call + to always return a boolean and only return True + if there's a dir and it exists. + """ + with contextlib.suppress(FileNotFoundError): + return path.is_dir() + return False + + +@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 _temp_dir(path) if _is_present_dir(path) else _temp_file(path) + + +@as_file.register(pathlib.Path) +@contextlib.contextmanager +def _(path): + """ + Degenerate behavior for pathlib.Path objects. + """ + yield path + + +@contextlib.contextmanager +def _temp_path(dir: tempfile.TemporaryDirectory): + """ + Wrap tempfile.TemporaryDirectory to return a pathlib object. + """ + with dir as result: + yield pathlib.Path(result) + + +@contextlib.contextmanager +def _temp_dir(path): + """ + Given a traversable dir, recursively replicate the whole tree + to the file system in a context manager. + """ + assert path.is_dir() + with _temp_path(tempfile.TemporaryDirectory()) as temp_dir: + yield _write_contents(temp_dir, path) + + +def _write_contents(target, source): + child = target.joinpath(source.name) + if source.is_dir(): + child.mkdir() + for item in source.iterdir(): + _write_contents(child, item) + else: + child.write_bytes(source.read_bytes()) + return child diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/_functional.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/_functional.py new file mode 100644 index 0000000000000000000000000000000000000000..f59416f2dd627d560b3e393775cc5be14c578370 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/_functional.py @@ -0,0 +1,81 @@ +"""Simplified function-based API for importlib.resources""" + +import warnings + +from ._common import files, as_file + + +_MISSING = object() + + +def open_binary(anchor, *path_names): + """Open for binary reading the *resource* within *package*.""" + return _get_resource(anchor, path_names).open('rb') + + +def open_text(anchor, *path_names, encoding=_MISSING, errors='strict'): + """Open for text reading the *resource* within *package*.""" + encoding = _get_encoding_arg(path_names, encoding) + resource = _get_resource(anchor, path_names) + return resource.open('r', encoding=encoding, errors=errors) + + +def read_binary(anchor, *path_names): + """Read and return contents of *resource* within *package* as bytes.""" + return _get_resource(anchor, path_names).read_bytes() + + +def read_text(anchor, *path_names, encoding=_MISSING, errors='strict'): + """Read and return contents of *resource* within *package* as str.""" + encoding = _get_encoding_arg(path_names, encoding) + resource = _get_resource(anchor, path_names) + return resource.read_text(encoding=encoding, errors=errors) + + +def path(anchor, *path_names): + """Return the path to the *resource* as an actual file system path.""" + return as_file(_get_resource(anchor, path_names)) + + +def is_resource(anchor, *path_names): + """Return ``True`` if there is a resource named *name* in the package, + + Otherwise returns ``False``. + """ + return _get_resource(anchor, path_names).is_file() + + +def contents(anchor, *path_names): + """Return an iterable over the named resources within the package. + + The iterable returns :class:`str` resources (e.g. files). + The iterable does not recurse into subdirectories. + """ + warnings.warn( + "importlib.resources.contents is deprecated. " + "Use files(anchor).iterdir() instead.", + DeprecationWarning, + stacklevel=1, + ) + return (resource.name for resource in _get_resource(anchor, path_names).iterdir()) + + +def _get_encoding_arg(path_names, encoding): + # For compatibility with versions where *encoding* was a positional + # argument, it needs to be given explicitly when there are multiple + # *path_names*. + # This limitation can be removed in Python 3.15. + if encoding is _MISSING: + if len(path_names) > 1: + raise TypeError( + "'encoding' argument required with multiple path names", + ) + else: + return 'utf-8' + return encoding + + +def _get_resource(anchor, path_names): + if anchor is None: + raise TypeError("anchor must be module or string, got None") + return files(anchor).joinpath(*path_names) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/_itertools.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/_itertools.py new file mode 100644 index 0000000000000000000000000000000000000000..7b775ef5ae893f2b8061c5f996dc0a15a4c72adb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/_itertools.py @@ -0,0 +1,38 @@ +# from more_itertools 9.0 +def only(iterable, default=None, too_long=None): + """If *iterable* has only one item, return it. + If it has zero items, return *default*. + If it has more than one item, raise the exception given by *too_long*, + which is ``ValueError`` by default. + >>> only([], default='missing') + 'missing' + >>> only([1]) + 1 + >>> only([1, 2]) # doctest: +IGNORE_EXCEPTION_DETAIL + Traceback (most recent call last): + ... + ValueError: Expected exactly one item in iterable, but got 1, 2, + and perhaps more.' + >>> only([1, 2], too_long=TypeError) # doctest: +IGNORE_EXCEPTION_DETAIL + Traceback (most recent call last): + ... + TypeError + Note that :func:`only` attempts to advance *iterable* twice to ensure there + is only one item. See :func:`spy` or :func:`peekable` to check + iterable contents less destructively. + """ + it = iter(iterable) + first_value = next(it, default) + + try: + second_value = next(it) + except StopIteration: + pass + else: + msg = ( + 'Expected exactly one item in iterable, but got {!r}, {!r}, ' + 'and perhaps more.'.format(first_value, second_value) + ) + raise too_long or ValueError(msg) + + return first_value diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/abc.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/abc.py new file mode 100644 index 0000000000000000000000000000000000000000..6750a7aaf14aa9695fa89d4f8bb43b4be13d9fa5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/abc.py @@ -0,0 +1,173 @@ +import abc +import io +import itertools +import os +import pathlib +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 + + +class TraversalError(Exception): + pass + + +@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 + """ + + 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`` (``/``). + """ + if not descendants: + return self + names = itertools.chain.from_iterable( + path.parts for path in map(pathlib.PurePosixPath, descendants) + ) + target = next(names) + matches = ( + traversable for traversable in self.iterdir() if traversable.name == target + ) + try: + match = next(matches) + except StopIteration: + raise TraversalError( + "Target not found during traversal.", target, list(names) + ) + return match.joinpath(*names) + + 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. + """ + + @property + @abc.abstractmethod + 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.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/readers.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/readers.py new file mode 100644 index 0000000000000000000000000000000000000000..70fc7e2b9c0145b003e4be8d3723b01e31bd52db --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/readers.py @@ -0,0 +1,203 @@ +from __future__ import annotations + +import collections +import contextlib +import itertools +import pathlib +import operator +import re +import warnings +import zipfile +from collections.abc import Iterator + +from . import abc + +from ._itertools import only + + +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): + self.prefix = loader.prefix.replace('\\', '/') + if loader.is_package(module): + _, _, name = module.rpartition('.') + self.prefix += 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(_ensure_traversable, 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): + children = (child for path in self._paths for child in path.iterdir()) + by_name = operator.attrgetter('name') + groups = itertools.groupby(sorted(children, key=by_name), key=by_name) + return map(self._follow, (locs for name, locs in groups)) + + 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, *descendants): + try: + return super().joinpath(*descendants) + except abc.TraversalError: + # One of the paths did not resolve (a directory does not exist). + # Just return something that will not exist. + return self._paths[0].joinpath(*descendants) + + @classmethod + def _follow(cls, children): + """ + Construct a MultiplexedPath if needed. + + If children contains a sole element, return it. + Otherwise, return a MultiplexedPath of the items. + Unless one of the items is not a Directory, then return the first. + """ + subdirs, one_dir, one_file = itertools.tee(children, 3) + + try: + return only(one_dir) + except ValueError: + try: + return cls(*subdirs) + except NotADirectoryError: + return next(one_file) + + 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(*filter(bool, map(self._resolve, namespace_path))) + + @classmethod + def _resolve(cls, path_str) -> abc.Traversable | None: + r""" + Given an item from a namespace path, resolve it to a Traversable. + + path_str might be a directory on the filesystem or a path to a + zipfile plus the path within the zipfile, e.g. ``/foo/bar`` or + ``/foo/baz.zip/inner_dir`` or ``foo\baz.zip\inner_dir\sub``. + + path_str might also be a sentinel used by editable packages to + trigger other behaviors (see python/importlib_resources#311). + In that case, return None. + """ + dirs = (cand for cand in cls._candidate_paths(path_str) if cand.is_dir()) + return next(dirs, None) + + @classmethod + def _candidate_paths(cls, path_str: str) -> Iterator[abc.Traversable]: + yield pathlib.Path(path_str) + yield from cls._resolve_zip_path(path_str) + + @staticmethod + def _resolve_zip_path(path_str: str): + for match in reversed(list(re.finditer(r'[\\/]', path_str))): + with contextlib.suppress( + FileNotFoundError, + IsADirectoryError, + NotADirectoryError, + PermissionError, + ): + inner = path_str[match.end() :].replace('\\', '/') + '/' + yield zipfile.Path(path_str[: match.start()], inner.lstrip('/')) + + 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 + + +def _ensure_traversable(path): + """ + Convert deprecated string arguments to traversables (pathlib.Path). + + Remove with Python 3.15. + """ + if not isinstance(path, str): + return path + + warnings.warn( + "String arguments are deprecated. Pass a Traversable instead.", + DeprecationWarning, + stacklevel=3, + ) + + return pathlib.Path(path) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/simple.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/simple.py new file mode 100644 index 0000000000000000000000000000000000000000..2e75299b13aabf3dd11aea5a23e6723d67854fc9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/importlib/resources/simple.py @@ -0,0 +1,106 @@ +""" +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. + """ + + @property + @abc.abstractmethod + def package(self) -> str: + """ + The name of the package for which this reader loads resources. + """ + + @abc.abstractmethod + def children(self) -> List['SimpleReader']: + """ + Obtain an iterable of SimpleReader for available + child containers (e.g. directories). + """ + + @abc.abstractmethod + def resources(self) -> List[str]: + """ + Obtain available named resources for this virtual package. + """ + + @abc.abstractmethod + def open_binary(self, resource: str) -> BinaryIO: + """ + Obtain a File-like for a named resource. + """ + + @property + def name(self): + return self.package.split('.')[-1] + + +class ResourceContainer(Traversable): + """ + Traversable container for a package's resources via its reader. + """ + + def __init__(self, reader: SimpleReader): + 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() + + +class ResourceHandle(Traversable): + """ + Handle to a named resource in a ResourceReader. + """ + + def __init__(self, parent: ResourceContainer, name: str): + self.parent = parent + self.name = name # type: ignore[misc] + + 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 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.14.4-h7c1dbca_0_cp314t/Lib/json/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/json/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..30922d189c0ea245e9744024969314bac73efcec Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/json/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/json/__pycache__/__main__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/json/__pycache__/__main__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..86f1bf6a3d38c3dd57f9eb17df1a44cddd6d04c8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/json/__pycache__/__main__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/json/__pycache__/decoder.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/json/__pycache__/decoder.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..766c95e6105b3a0ae42ca096945b73000b4ad889 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/json/__pycache__/decoder.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/json/__pycache__/encoder.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/json/__pycache__/encoder.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..31c2852d4a988bc98a0f0156063683c637ca15a4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/json/__pycache__/encoder.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/json/__pycache__/scanner.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/json/__pycache__/scanner.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..35a330e5567bd6fea595a591ac166241bb69d092 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/json/__pycache__/scanner.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/json/__pycache__/tool.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/json/__pycache__/tool.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..37b9c8a9a1d79f0f3063670b3a37f06075d73274 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/json/__pycache__/tool.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/logging/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/logging/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9ed37b8b33c665c74f242cdb3df996ffa6cb4f9f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/logging/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/logging/__pycache__/config.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/logging/__pycache__/config.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9e0ee600919e37858d8803a8d298eb7b17f4322a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/logging/__pycache__/config.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/logging/__pycache__/handlers.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/logging/__pycache__/handlers.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fb7f76d1a3c648ffd1cd2082775c531ef84eb192 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/logging/__pycache__/handlers.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c682554672866628d7765a713a8ca8b6c3e7421a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/connection.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/connection.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..70de5c0b86e1a3199581e9e9dab8a8cc761cb0c0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/connection.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/context.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/context.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2379a3ff0739b29288684a18623b39afc4e81291 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/context.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/forkserver.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/forkserver.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4900655a343f713af9284b3862446afa23028780 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/forkserver.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/heap.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/heap.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b4cac6e13df8b1e8607d59c719c0e702dbfe735e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/heap.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/managers.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/managers.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..af16db359385f1031548142e934604bce57bfd42 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/managers.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/pool.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/pool.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a3edd6961f1ae2c2c085504df238a95471bb51dc Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/pool.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/popen_fork.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/popen_fork.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..760b03d4f58fb92756cad264cd90a1897eb1fc83 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/popen_fork.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/popen_forkserver.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/popen_forkserver.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..31c79b9f1736c4dccd763b0cf9c887a3dbc9fe6d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/popen_forkserver.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/popen_spawn_posix.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/popen_spawn_posix.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0122e519f5addcc6bdecea64fd8879a757354374 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/popen_spawn_posix.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/popen_spawn_win32.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/popen_spawn_win32.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9cc1a31162de48f93c5efade32948da2919600b5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/popen_spawn_win32.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/process.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/process.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bc23ffed8f58e264c5aeeaab974d97e2bd000b9d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/process.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/queues.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/queues.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fcbaefc69ef211f3910810814a83e8d83635b8cf Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/queues.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/reduction.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/reduction.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b40df0819b02a4bf9368a41dd7d0011d21749c6d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/reduction.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/resource_sharer.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/resource_sharer.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ee8181ce7581e96625de8a61e501c0f2e72f8a8d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/resource_sharer.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/resource_tracker.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/resource_tracker.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d944567951af556591ff1303f204c95ee7bd3813 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/resource_tracker.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/shared_memory.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/shared_memory.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..28d79bd359c216ca7f2d277f891cd10f11ccdc2d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/shared_memory.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/sharedctypes.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/sharedctypes.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bf2a6adc8cbeab368fb96a40b43b93e0b9a6ff67 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/sharedctypes.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/spawn.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/spawn.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e61c6072c29fbab887e9a0b28495a213a1da2fbe Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/spawn.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/synchronize.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/synchronize.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4e3b174e7be37817000770445f5356854a2f5aad Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/synchronize.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/util.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/util.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..af22771662a008f546b3e1c275f37c8d37464d70 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/__pycache__/util.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/dummy/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/dummy/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7dc5d1c8dde8484e59728eb6dfa7a36c158dd2ef --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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=None): + 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.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/dummy/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/dummy/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a37f04601075513464575d825b5f5f156c5be0fc Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/dummy/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/dummy/__pycache__/connection.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/dummy/__pycache__/connection.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3f75cad66f41961f66ae0aa0671e3e1a9a08205d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/dummy/__pycache__/connection.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/multiprocessing/dummy/connection.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/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.14.4-h7c1dbca_0_cp314t/Lib/pathlib/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/pathlib/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1ccb83ce971fd8498eb5af1b7b733a5299d08c69 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/pathlib/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/pathlib/__pycache__/_local.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/pathlib/__pycache__/_local.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3e13b9069ec5156a4ece3456e0d48039d1d3a54d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/pathlib/__pycache__/_local.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/pathlib/__pycache__/_os.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/pathlib/__pycache__/_os.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2bbcc920dc4dbe1a5cdcd38dc282f96d0dd9d598 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/pathlib/__pycache__/_os.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/pathlib/__pycache__/types.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/pathlib/__pycache__/types.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bcfdbe0daa6b4ef28fcf48929898a9a016e25343 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/pathlib/__pycache__/types.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/pydoc_data/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/pydoc_data/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..53223a5e36acf73ac8b48b71a4df5ece433f53a1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/pydoc_data/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/pydoc_data/__pycache__/module_docs.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/pydoc_data/__pycache__/module_docs.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..41f5b2c6f5f7b76e422870549194511fbfd341e9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/pydoc_data/__pycache__/module_docs.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/re/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/re/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..57c50a4f2540d8fab3672f672e65432d8f780f3f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/re/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/re/__pycache__/_casefix.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/re/__pycache__/_casefix.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d9e00297aa587d9233c5e3d96d0c54cd84771faf Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/re/__pycache__/_casefix.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/re/__pycache__/_compiler.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/re/__pycache__/_compiler.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fd20bacca825d670121faeeb40ced497f9f9d1f5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/re/__pycache__/_compiler.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/re/__pycache__/_constants.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/re/__pycache__/_constants.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5be161aed9a951d744e98645e54c836227581c95 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/re/__pycache__/_constants.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/re/__pycache__/_parser.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/re/__pycache__/_parser.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6c05bfbfe2f3ca178a90cf4ba0038fc6c2602af1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/re/__pycache__/_parser.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/sqlite3/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/sqlite3/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c58be2dbb68bc90fa648d10b239ad8a67ad93627 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/sqlite3/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/sqlite3/__pycache__/__main__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/sqlite3/__pycache__/__main__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e863febeabcb49f4c90cd00ffaa7ed912e80ccca Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/sqlite3/__pycache__/__main__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/sqlite3/__pycache__/dbapi2.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/sqlite3/__pycache__/dbapi2.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7a29bd1249efe73da41c71f40655ee91edc22733 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/sqlite3/__pycache__/dbapi2.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/sqlite3/__pycache__/dump.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/sqlite3/__pycache__/dump.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1e556a07ecd2bc91174f0b73cc6a10a4d545e8d2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/sqlite3/__pycache__/dump.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/string/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/string/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..943e52282a843b6cd6718cf218d5c0e0fd19d96f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/string/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/string/__pycache__/templatelib.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/string/__pycache__/templatelib.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..33ee72ea2beaab611627b44a5c6150022ce9dcbe Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/string/__pycache__/templatelib.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/sysconfig/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/sysconfig/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..af20be5b06036c8baa252b69a6960530e3bede10 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/sysconfig/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/sysconfig/__pycache__/__main__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/sysconfig/__pycache__/__main__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3e75f27f92302afb15dca42340a66e95cfb4d62e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/sysconfig/__pycache__/__main__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0e7a5b44c2002eecfee5e34df8d254c36fe550da Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6635ec3474e12ec6a2f684a1a93b6ec08df49a37 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__init__.py @@ -0,0 +1,3229 @@ +"""Supporting definitions for the Python regression tests.""" + +if __name__ != 'test.support': + raise ImportError('support must be imported from the test package') + +import annotationlib +import contextlib +import functools +import inspect +import logging +import _opcode +import os +import re +import stat +import sys +import sysconfig +import textwrap +import time +import types +import unittest +import warnings + + +__all__ = [ + # globals + "PIPE_MAX_SIZE", "verbose", "max_memuse", "use_resources", "failfast", + # exceptions + "Error", "TestFailed", "TestDidNotRun", "ResourceDenied", + # io + "record_original_stdout", "get_original_stdout", "captured_stdout", + "captured_stdin", "captured_stderr", "captured_output", + # unittest + "is_resource_enabled", "get_resource_value", "requires", "requires_resource", + "requires_freebsd_version", + "requires_gil_enabled", "requires_linux_version", "requires_mac_ver", + "check_syntax_error", + "requires_gzip", "requires_bz2", "requires_lzma", "requires_zstd", + "bigmemtest", "bigaddrspacetest", "cpython_only", "get_attribute", + "requires_IEEE_754", "requires_zlib", + "has_fork_support", "requires_fork", + "has_subprocess_support", "requires_subprocess", + "has_socket_support", "requires_working_socket", + "anticipate_failure", "load_package_tests", "detect_api_mismatch", + "check__all__", "skip_if_buggy_ucrt_strfptime", + "check_disallow_instantiation", "check_sanitizer", "skip_if_sanitizer", + "requires_limited_api", "requires_specialization", "thread_unsafe", + "skip_if_unlimited_stack_size", + # sys + "MS_WINDOWS", "is_jython", "is_android", "is_emscripten", "is_wasi", + "is_apple_mobile", "check_impl_detail", "unix_shell", "setswitchinterval", + "support_remote_exec_only", + # os + "get_pagesize", + # network + "open_urlresource", + # processes + "reap_children", + # miscellaneous + "run_with_locale", "swap_item", "findfile", "infinite_recursion", + "swap_attr", "Matcher", "set_memlimit", "SuppressCrashReport", "sortdict", + "run_with_tz", "PGO", "missing_compiler_executable", + "ALWAYS_EQ", "NEVER_EQ", "LARGEST", "SMALLEST", + "LOOPBACK_TIMEOUT", "INTERNET_TIMEOUT", "SHORT_TIMEOUT", "LONG_TIMEOUT", + "Py_DEBUG", "exceeds_recursion_limit", "skip_on_s390x", + "requires_jit_enabled", + "requires_jit_disabled", + "force_not_colorized", + "force_not_colorized_test_class", + "make_clean_env", + "BrokenIter", + "in_systemd_nspawn_sync_suppressed", + "run_no_yield_async_fn", "run_yielding_async_fn", "async_yield", + "reset_code", "on_github_actions" + ] + + +# Timeout in seconds for tests using a network server listening on the network +# local loopback interface like 127.0.0.1. +# +# The timeout is long enough to prevent test failure: it takes into account +# that the client and the server can run in different threads or even different +# processes. +# +# The timeout should be long enough for connect(), recv() and send() methods +# of socket.socket. +LOOPBACK_TIMEOUT = 10.0 + +# Timeout in seconds for network requests going to the internet. The timeout is +# short enough to prevent a test to wait for too long if the internet request +# is blocked for whatever reason. +# +# Usually, a timeout using INTERNET_TIMEOUT should not mark a test as failed, +# but skip the test instead: see transient_internet(). +INTERNET_TIMEOUT = 60.0 + +# Timeout in seconds to mark a test as failed if the test takes "too long". +# +# The timeout value depends on the regrtest --timeout command line option. +# +# If a test using SHORT_TIMEOUT starts to fail randomly on slow buildbots, use +# LONG_TIMEOUT instead. +SHORT_TIMEOUT = 30.0 + +# Timeout in seconds to detect when a test hangs. +# +# It is long enough to reduce the risk of test failure on the slowest Python +# buildbots. It should not be used to mark a test as failed if the test takes +# "too long". The timeout value depends on the regrtest --timeout command line +# option. +LONG_TIMEOUT = 5 * 60.0 + +# TEST_HOME_DIR refers to the top level directory of the "test" package +# that contains Python's regression test suite +TEST_SUPPORT_DIR = os.path.dirname(os.path.abspath(__file__)) +TEST_HOME_DIR = os.path.dirname(TEST_SUPPORT_DIR) +STDLIB_DIR = os.path.dirname(TEST_HOME_DIR) +REPO_ROOT = os.path.dirname(STDLIB_DIR) + + +class Error(Exception): + """Base class for regression test exceptions.""" + +class TestFailed(Error): + """Test failed.""" + def __init__(self, msg, *args, stats=None): + self.msg = msg + self.stats = stats + super().__init__(msg, *args) + + def __str__(self): + return self.msg + +class TestFailedWithDetails(TestFailed): + """Test failed.""" + def __init__(self, msg, errors, failures, stats): + self.errors = errors + self.failures = failures + super().__init__(msg, errors, failures, stats=stats) + +class TestDidNotRun(Error): + """Test did not run any subtests.""" + +class ResourceDenied(unittest.SkipTest): + """Test skipped because it requested a disallowed resource. + + This is raised when a test calls requires() for a resource that + has not be enabled. It is used to distinguish between expected + and unexpected skips. + """ + +def anticipate_failure(condition): + """Decorator to mark a test that is known to be broken in some cases + + Any use of this decorator should have a comment identifying the + associated tracker issue. + """ + if condition: + return unittest.expectedFailure + return lambda f: f + +def load_package_tests(pkg_dir, loader, standard_tests, pattern): + """Generic load_tests implementation for simple test packages. + + Most packages can implement load_tests using this function as follows: + + def load_tests(*args): + return load_package_tests(os.path.dirname(__file__), *args) + """ + if pattern is None: + pattern = "test*" + top_dir = STDLIB_DIR + package_tests = loader.discover(start_dir=pkg_dir, + top_level_dir=top_dir, + pattern=pattern) + standard_tests.addTests(package_tests) + return standard_tests + + +def get_attribute(obj, name): + """Get an attribute, raising SkipTest if AttributeError is raised.""" + try: + attribute = getattr(obj, name) + except AttributeError: + raise unittest.SkipTest("object %r has no attribute %r" % (obj, name)) + else: + return attribute + +verbose = 1 # Flag set to 0 by regrtest.py +use_resources = None # Flag set to {} by regrtest.py +max_memuse = 0 # Disable bigmem tests (they will still be run with + # small sizes, to make sure they work.) +real_max_memuse = 0 +junit_xml_list = None # list of testsuite XML elements +failfast = False + +# _original_stdout is meant to hold stdout at the time regrtest began. +# This may be "the real" stdout, or IDLE's emulation of stdout, or whatever. +# The point is to have some flavor of stdout the user can actually see. +_original_stdout = None +def record_original_stdout(stdout): + global _original_stdout + _original_stdout = stdout + +def get_original_stdout(): + return _original_stdout or sys.stdout + + +def _force_run(path, func, *args): + try: + return func(*args) + except FileNotFoundError as err: + # chmod() won't fix a missing file. + if verbose >= 2: + print('%s: %s' % (err.__class__.__name__, err)) + raise + except OSError as err: + if verbose >= 2: + print('%s: %s' % (err.__class__.__name__, err)) + print('re-run %s%r' % (func.__name__, args)) + os.chmod(path, stat.S_IRWXU) + return func(*args) + + +# Check whether a gui is actually available +def _is_gui_available(): + if hasattr(_is_gui_available, 'result'): + return _is_gui_available.result + import platform + reason = None + if sys.platform.startswith('win') and platform.win32_is_iot(): + reason = "gui is not available on Windows IoT Core" + elif sys.platform.startswith('win'): + # if Python is running as a service (such as the buildbot service), + # gui interaction may be disallowed + import ctypes + import ctypes.wintypes + UOI_FLAGS = 1 + WSF_VISIBLE = 0x0001 + class USEROBJECTFLAGS(ctypes.Structure): + _fields_ = [("fInherit", ctypes.wintypes.BOOL), + ("fReserved", ctypes.wintypes.BOOL), + ("dwFlags", ctypes.wintypes.DWORD)] + dll = ctypes.windll.user32 + h = dll.GetProcessWindowStation() + if not h: + raise ctypes.WinError() + uof = USEROBJECTFLAGS() + needed = ctypes.wintypes.DWORD() + res = dll.GetUserObjectInformationW(h, + UOI_FLAGS, + ctypes.byref(uof), + ctypes.sizeof(uof), + ctypes.byref(needed)) + if not res: + raise ctypes.WinError() + if not bool(uof.dwFlags & WSF_VISIBLE): + reason = "gui not available (WSF_VISIBLE flag not set)" + elif sys.platform == 'darwin': + # The Aqua Tk implementations on OS X can abort the process if + # being called in an environment where a window server connection + # cannot be made, for instance when invoked by a buildbot or ssh + # process not running under the same user id as the current console + # user. To avoid that, raise an exception if the window manager + # connection is not available. + import subprocess + try: + rc = subprocess.run(["launchctl", "managername"], + capture_output=True, check=True) + managername = rc.stdout.decode("utf-8").strip() + except subprocess.CalledProcessError: + reason = "unable to detect macOS launchd job manager" + else: + if managername != "Aqua": + reason = f"{managername=} -- can only run in a macOS GUI session" + + # check on every platform whether tkinter can actually do anything + if not reason: + try: + from tkinter import Tk + root = Tk() + root.withdraw() + root.update() + root.destroy() + except Exception as e: + err_string = str(e) + if len(err_string) > 50: + err_string = err_string[:50] + ' [...]' + reason = 'Tk unavailable due to {}: {}'.format(type(e).__name__, + err_string) + + _is_gui_available.reason = reason + _is_gui_available.result = not reason + + return _is_gui_available.result + +def is_resource_enabled(resource): + """Test whether a resource is enabled. + + Known resources are set by regrtest.py. If not running under regrtest.py, + all resources are assumed enabled unless use_resources has been set. + """ + return use_resources is None or resource in use_resources + +def get_resource_value(resource): + """Test whether a resource is enabled. + + Known resources are set by regrtest.py. If not running under regrtest.py, + all resources are assumed enabled unless use_resources has been set. + """ + if use_resources is None: + return None + return use_resources.get(resource) + +def requires(resource, msg=None): + """Raise ResourceDenied if the specified resource is not available.""" + if not is_resource_enabled(resource): + if msg is None: + msg = "Use of the %r resource not enabled" % resource + raise ResourceDenied(msg) + if resource in {"network", "urlfetch"} and not has_socket_support: + raise ResourceDenied("No socket support") + if resource == 'gui' and not _is_gui_available(): + raise ResourceDenied(_is_gui_available.reason) + +def _get_kernel_version(sysname="Linux"): + import platform + if platform.system() != sysname: + return None + version_txt = platform.release().split('-', 1)[0] + try: + return tuple(map(int, version_txt.split('.'))) + except ValueError: + return None + +def _requires_unix_version(sysname, min_version): + """Decorator raising SkipTest if the OS is `sysname` and the version is less + than `min_version`. + + For example, @_requires_unix_version('FreeBSD', (7, 2)) raises SkipTest if + the FreeBSD version is less than 7.2. + """ + import platform + min_version_txt = '.'.join(map(str, min_version)) + version_txt = platform.release().split('-', 1)[0] + if platform.system() == sysname: + try: + version = tuple(map(int, version_txt.split('.'))) + except ValueError: + skip = False + else: + skip = version < min_version + else: + skip = False + + return unittest.skipIf( + skip, + f"{sysname} version {min_version_txt} or higher required, not " + f"{version_txt}" + ) + + +def requires_freebsd_version(*min_version): + """Decorator raising SkipTest if the OS is FreeBSD and the FreeBSD version is + less than `min_version`. + + For example, @requires_freebsd_version(7, 2) raises SkipTest if the FreeBSD + version is less than 7.2. + """ + return _requires_unix_version('FreeBSD', min_version) + +def requires_linux_version(*min_version): + """Decorator raising SkipTest if the OS is Linux and the Linux version is + less than `min_version`. + + For example, @requires_linux_version(2, 6, 32) raises SkipTest if the Linux + version is less than 2.6.32. + """ + return _requires_unix_version('Linux', min_version) + +def requires_mac_ver(*min_version): + """Decorator raising SkipTest if the OS is Mac OS X and the OS X + version if less than min_version. + + For example, @requires_mac_ver(10, 5) raises SkipTest if the OS X version + is lesser than 10.5. + """ + def decorator(func): + @functools.wraps(func) + def wrapper(*args, **kw): + if sys.platform == 'darwin': + import platform + version_txt = platform.mac_ver()[0] + try: + version = tuple(map(int, version_txt.split('.'))) + except ValueError: + pass + else: + if version < min_version: + min_version_txt = '.'.join(map(str, min_version)) + raise unittest.SkipTest( + "Mac OS X %s or higher required, not %s" + % (min_version_txt, version_txt)) + return func(*args, **kw) + wrapper.min_version = min_version + return wrapper + return decorator + + +def thread_unsafe(reason): + """Mark a test as not thread safe. When the test runner is run with + --parallel-threads=N, the test will be run in a single thread.""" + def decorator(test_item): + test_item.__unittest_thread_unsafe__ = True + # the reason is not currently used + test_item.__unittest_thread_unsafe__why__ = reason + return test_item + if isinstance(reason, types.FunctionType): + test_item = reason + reason = '' + return decorator(test_item) + return decorator + + +def skip_if_buildbot(reason=None): + """Decorator raising SkipTest if running on a buildbot.""" + import getpass + if not reason: + reason = 'not suitable for buildbots' + try: + isbuildbot = getpass.getuser().lower() == 'buildbot' + except (KeyError, OSError) as err: + logging.getLogger(__name__).warning('getpass.getuser() failed %s.', err, exc_info=err) + isbuildbot = False + return unittest.skipIf(isbuildbot, reason) + +def check_sanitizer(*, address=False, memory=False, ub=False, thread=False, + function=True): + """Returns True if Python is compiled with sanitizer support""" + if not (address or memory or ub or thread): + raise ValueError('At least one of address, memory, ub or thread must be True') + + + cflags = sysconfig.get_config_var('CFLAGS') or '' + config_args = sysconfig.get_config_var('CONFIG_ARGS') or '' + memory_sanitizer = ( + '-fsanitize=memory' in cflags or + '--with-memory-sanitizer' in config_args + ) + address_sanitizer = ( + '-fsanitize=address' in cflags or + '--with-address-sanitizer' in config_args + ) + ub_sanitizer = ( + '-fsanitize=undefined' in cflags or + '--with-undefined-behavior-sanitizer' in config_args + ) + thread_sanitizer = ( + '-fsanitize=thread' in cflags or + '--with-thread-sanitizer' in config_args + ) + function_sanitizer = ( + '-fsanitize=function' in cflags + ) + return ( + (memory and memory_sanitizer) or + (address and address_sanitizer) or + (ub and ub_sanitizer) or + (thread and thread_sanitizer) or + (function and function_sanitizer) + ) + + +def skip_if_sanitizer(reason=None, *, address=False, memory=False, ub=False, thread=False): + """Decorator raising SkipTest if running with a sanitizer active.""" + if not reason: + reason = 'not working with sanitizers active' + skip = check_sanitizer(address=address, memory=memory, ub=ub, thread=thread) + return unittest.skipIf(skip, reason) + +# gh-89363: True if fork() can hang if Python is built with Address Sanitizer +# (ASAN): libasan race condition, dead lock in pthread_create(). +HAVE_ASAN_FORK_BUG = check_sanitizer(address=True) + + +def set_sanitizer_env_var(env, option): + for name in ('ASAN_OPTIONS', 'MSAN_OPTIONS', 'UBSAN_OPTIONS', 'TSAN_OPTIONS'): + if name in env: + env[name] += f':{option}' + else: + env[name] = option + + +def system_must_validate_cert(f): + """Skip the test on TLS certificate validation failures.""" + @functools.wraps(f) + def dec(*args, **kwargs): + try: + f(*args, **kwargs) + except OSError as e: + if "CERTIFICATE_VERIFY_FAILED" in str(e): + raise unittest.SkipTest("system does not contain " + "necessary certificates") + raise + return dec + +# A constant likely larger than the underlying OS pipe buffer size, to +# make writes blocking. +# Windows limit seems to be around 512 B, and many Unix kernels have a +# 64 KiB pipe buffer size or 16 * PAGE_SIZE: take a few megs to be sure. +# (see issue #17835 for a discussion of this number). +PIPE_MAX_SIZE = 4 * 1024 * 1024 + 1 + +# A constant likely larger than the underlying OS socket buffer size, to make +# writes blocking. +# The socket buffer sizes can usually be tuned system-wide (e.g. through sysctl +# on Linux), or on a per-socket basis (SO_SNDBUF/SO_RCVBUF). See issue #18643 +# for a discussion of this number. +SOCK_MAX_SIZE = 16 * 1024 * 1024 + 1 + +# decorator for skipping tests on non-IEEE 754 platforms +requires_IEEE_754 = unittest.skipUnless( + float.__getformat__("double").startswith("IEEE"), + "test requires IEEE 754 doubles") + +def requires_zlib(reason='requires zlib'): + try: + import zlib + except ImportError: + zlib = None + return unittest.skipUnless(zlib, reason) + +def requires_gzip(reason='requires gzip'): + try: + import gzip + except ImportError: + gzip = None + return unittest.skipUnless(gzip, reason) + +def requires_bz2(reason='requires bz2'): + try: + import bz2 + except ImportError: + bz2 = None + return unittest.skipUnless(bz2, reason) + +def requires_lzma(reason='requires lzma'): + try: + import lzma + except ImportError: + lzma = None + return unittest.skipUnless(lzma, reason) + +def requires_zstd(reason='requires zstd'): + try: + from compression import zstd + except ImportError: + zstd = None + return unittest.skipUnless(zstd, reason) + +def has_no_debug_ranges(): + try: + import _testcapi + except ImportError: + raise unittest.SkipTest("_testinternalcapi required") + return not _testcapi.config_get('code_debug_ranges') + +def requires_debug_ranges(reason='requires co_positions / debug_ranges'): + try: + skip = has_no_debug_ranges() + except unittest.SkipTest as e: + skip = True + reason = e.args[0] if e.args else reason + return unittest.skipIf(skip, reason) + + +MS_WINDOWS = (sys.platform == 'win32') + +# Is not actually used in tests, but is kept for compatibility. +is_jython = sys.platform.startswith('java') + +is_android = sys.platform == "android" + +def skip_android_selinux(name): + return unittest.skipIf( + sys.platform == "android", f"Android blocks {name} with SELinux" + ) + +if sys.platform not in {"win32", "vxworks", "ios", "tvos", "watchos"}: + unix_shell = '/system/bin/sh' if is_android else '/bin/sh' +else: + unix_shell = None + +# wasm32-emscripten and -wasi are POSIX-like but do not +# have subprocess or fork support. +is_emscripten = sys.platform == "emscripten" +is_wasi = sys.platform == "wasi" + +# Use is_wasm32 as a generic check for WebAssembly platforms. +is_wasm32 = is_emscripten or is_wasi + +def skip_emscripten_stack_overflow(): + return unittest.skipIf(is_emscripten, "Exhausts stack on Emscripten") + +def skip_wasi_stack_overflow(): + return unittest.skipIf(is_wasi, "Exhausts stack on WASI") + +is_apple_mobile = sys.platform in {"ios", "tvos", "watchos"} +is_apple = is_apple_mobile or sys.platform == "darwin" + +has_fork_support = hasattr(os, "fork") and not ( + # WASM and Apple mobile platforms do not support subprocesses. + is_emscripten + or is_wasi + or is_apple_mobile + + # Although Android supports fork, it's unsafe to call it from Python because + # all Android apps are multi-threaded. + or is_android +) + +def requires_fork(): + return unittest.skipUnless(has_fork_support, "requires working os.fork()") + +has_subprocess_support = not ( + # WASM and Apple mobile platforms do not support subprocesses. + is_emscripten + or is_wasi + or is_apple_mobile + + # Although Android supports subproceses, they're almost never useful in + # practice (see PEP 738). And most of the tests that use them are calling + # sys.executable, which won't work when Python is embedded in an Android app. + or is_android +) + +def requires_subprocess(): + """Used for subprocess, os.spawn calls, fd inheritance""" + return unittest.skipUnless(has_subprocess_support, "requires subprocess support") + +# Emscripten's socket emulation and WASI sockets have limitations. +has_socket_support = not ( + is_emscripten + or is_wasi +) + +def requires_working_socket(*, module=False): + """Skip tests or modules that require working sockets + + Can be used as a function/class decorator or to skip an entire module. + """ + msg = "requires socket support" + if module: + if not has_socket_support: + raise unittest.SkipTest(msg) + else: + return unittest.skipUnless(has_socket_support, msg) + +# Does strftime() support glibc extension like '%4Y'? +has_strftime_extensions = False +if sys.platform != "win32": + # bpo-47037: Windows debug builds crash with "Debug Assertion Failed" + try: + has_strftime_extensions = time.strftime("%4Y") != "%4Y" + except ValueError: + pass + +# Define the URL of a dedicated HTTP server for the network tests. +# The URL must use clear-text HTTP: no redirection to encrypted HTTPS. +TEST_HTTP_URL = "http://www.pythontest.net" + +# Set by libregrtest/main.py so we can skip tests that are not +# useful for PGO +PGO = False + +# Set by libregrtest/main.py if we are running the extended (time consuming) +# PGO task. If this is True, PGO is also True. +PGO_EXTENDED = False + +# TEST_DATA_DIR is used as a target download location for remote resources +TEST_DATA_DIR = os.path.join(TEST_HOME_DIR, "data") + + +def darwin_malloc_err_warning(test_name): + """Assure user that loud errors generated by macOS libc's malloc are + expected.""" + if sys.platform != 'darwin': + return + + import shutil + msg = ' NOTICE ' + detail = (f'{test_name} may generate "malloc can\'t allocate region"\n' + 'warnings on macOS systems. This behavior is known. Do not\n' + 'report a bug unless tests are also failing.\n' + 'See https://github.com/python/cpython/issues/85100') + + padding, _ = shutil.get_terminal_size() + print(msg.center(padding, '-')) + print(detail) + print('-' * padding) + + +def findfile(filename, subdir=None): + """Try to find a file on sys.path or in the test directory. If it is not + found the argument passed to the function is returned (this does not + necessarily signal failure; could still be the legitimate path). + + Setting *subdir* indicates a relative path to use to find the file + rather than looking directly in the path directories. + """ + if os.path.isabs(filename): + return filename + if subdir is not None: + filename = os.path.join(subdir, filename) + path = [TEST_HOME_DIR] + sys.path + for dn in path: + fn = os.path.join(dn, filename) + if os.path.exists(fn): return fn + return filename + + +def sortdict(dict): + "Like repr(dict), but in sorted order." + items = sorted(dict.items()) + reprpairs = ["%r: %r" % pair for pair in items] + withcommas = ", ".join(reprpairs) + return "{%s}" % withcommas + + +def run_code(code: str, extra_names: dict[str, object] | None = None) -> dict[str, object]: + """Run a piece of code after dedenting it, and return its global namespace.""" + ns = {} + if extra_names: + ns.update(extra_names) + exec(textwrap.dedent(code), ns) + return ns + + +def check_syntax_error(testcase, statement, errtext='', *, lineno=None, offset=None): + with testcase.assertRaisesRegex(SyntaxError, errtext) as cm: + compile(statement, '', 'exec') + err = cm.exception + testcase.assertIsNotNone(err.lineno) + if lineno is not None: + testcase.assertEqual(err.lineno, lineno) + testcase.assertIsNotNone(err.offset) + if offset is not None: + testcase.assertEqual(err.offset, offset) + + +def open_urlresource(url, *args, **kw): + import urllib.request, urllib.parse + from .os_helper import unlink + try: + import gzip + except ImportError: + gzip = None + + check = kw.pop('check', None) + + filename = urllib.parse.urlparse(url)[2].split('/')[-1] # '/': it's URL! + + fn = os.path.join(TEST_DATA_DIR, filename) + + def check_valid_file(fn): + f = open(fn, *args, **kw) + if check is None: + return f + elif check(f): + f.seek(0) + return f + f.close() + + if os.path.exists(fn): + f = check_valid_file(fn) + if f is not None: + return f + unlink(fn) + + # Verify the requirement before downloading the file + requires('urlfetch') + + if verbose: + print('\tfetching %s ...' % url, file=get_original_stdout()) + opener = urllib.request.build_opener() + if gzip: + opener.addheaders.append(('Accept-Encoding', 'gzip')) + f = opener.open(url, timeout=INTERNET_TIMEOUT) + if gzip and f.headers.get('Content-Encoding') == 'gzip': + f = gzip.GzipFile(fileobj=f) + try: + with open(fn, "wb") as out: + s = f.read() + while s: + out.write(s) + s = f.read() + finally: + f.close() + + f = check_valid_file(fn) + if f is not None: + return f + raise TestFailed('invalid resource %r' % fn) + + +@contextlib.contextmanager +def captured_output(stream_name): + """Return a context manager used by captured_stdout/stdin/stderr + that temporarily replaces the sys stream *stream_name* with a StringIO.""" + import io + orig_stdout = getattr(sys, stream_name) + setattr(sys, stream_name, io.StringIO()) + try: + yield getattr(sys, stream_name) + finally: + setattr(sys, stream_name, orig_stdout) + +def captured_stdout(): + """Capture the output of sys.stdout: + + with captured_stdout() as stdout: + print("hello") + self.assertEqual(stdout.getvalue(), "hello\\n") + """ + return captured_output("stdout") + +def captured_stderr(): + """Capture the output of sys.stderr: + + with captured_stderr() as stderr: + print("hello", file=sys.stderr) + self.assertEqual(stderr.getvalue(), "hello\\n") + """ + return captured_output("stderr") + +def captured_stdin(): + """Capture the input to sys.stdin: + + with captured_stdin() as stdin: + stdin.write('hello\\n') + stdin.seek(0) + # call test code that consumes from sys.stdin + captured = input() + self.assertEqual(captured, "hello") + """ + return captured_output("stdin") + + +def gc_collect(): + """Force as many objects as possible to be collected. + + In non-CPython implementations of Python, this is needed because timely + deallocation is not guaranteed by the garbage collector. (Even in CPython + this can be the case in case of reference cycles.) This means that __del__ + methods may be called later than expected and weakrefs may remain alive for + longer than expected. This function tries its best to force all garbage + objects to disappear. + """ + import gc + gc.collect() + gc.collect() + gc.collect() + +@contextlib.contextmanager +def disable_gc(): + import gc + have_gc = gc.isenabled() + gc.disable() + try: + yield + finally: + if have_gc: + gc.enable() + +@contextlib.contextmanager +def gc_threshold(*args): + import gc + old_threshold = gc.get_threshold() + gc.set_threshold(*args) + try: + yield + finally: + gc.set_threshold(*old_threshold) + +def python_is_optimized(): + """Find if Python was built with optimizations.""" + cflags = sysconfig.get_config_var('PY_CFLAGS') or '' + final_opt = "" + for opt in cflags.split(): + if opt.startswith('-O'): + final_opt = opt + if sysconfig.get_config_var("CC") == "gcc": + non_opts = ('', '-O0', '-Og') + else: + non_opts = ('', '-O0') + return final_opt not in non_opts + + +def check_cflags_pgo(): + # Check if Python was built with ./configure --enable-optimizations: + # with Profile Guided Optimization (PGO). + cflags_nodist = sysconfig.get_config_var('PY_CFLAGS_NODIST') or '' + pgo_options = [ + # GCC + '-fprofile-use', + # clang: -fprofile-instr-use=code.profclangd + '-fprofile-instr-use', + # ICC + "-prof-use", + ] + PGO_PROF_USE_FLAG = sysconfig.get_config_var('PGO_PROF_USE_FLAG') + if PGO_PROF_USE_FLAG: + pgo_options.append(PGO_PROF_USE_FLAG) + return any(option in cflags_nodist for option in pgo_options) + + +def check_bolt_optimized(): + # Always return false, if the platform is WASI, + # because BOLT optimization does not support WASM binary. + if is_wasi: + return False + config_args = sysconfig.get_config_var('CONFIG_ARGS') or '' + return '--enable-bolt' in config_args + + +Py_GIL_DISABLED = bool(sysconfig.get_config_var('Py_GIL_DISABLED')) + +def requires_gil_enabled(msg="needs the GIL enabled"): + """Decorator for skipping tests on the free-threaded build.""" + return unittest.skipIf(Py_GIL_DISABLED, msg) + +def expected_failure_if_gil_disabled(): + """Expect test failure if the GIL is disabled.""" + if Py_GIL_DISABLED: + return unittest.expectedFailure + return lambda test_case: test_case + +if Py_GIL_DISABLED: + _header = 'PHBBInP' +else: + _header = 'nP' +_align = '0n' +_vheader = _header + 'n' + +def calcobjsize(fmt): + import struct + return struct.calcsize(_header + fmt + _align) + +def calcvobjsize(fmt): + import struct + return struct.calcsize(_vheader + fmt + _align) + + +_TPFLAGS_STATIC_BUILTIN = 1<<1 +_TPFLAGS_DISALLOW_INSTANTIATION = 1<<7 +_TPFLAGS_IMMUTABLETYPE = 1<<8 +_TPFLAGS_HEAPTYPE = 1<<9 +_TPFLAGS_BASETYPE = 1<<10 +_TPFLAGS_READY = 1<<12 +_TPFLAGS_READYING = 1<<13 +_TPFLAGS_HAVE_GC = 1<<14 +_TPFLAGS_BASE_EXC_SUBCLASS = 1<<30 +_TPFLAGS_TYPE_SUBCLASS = 1<<31 + +def check_sizeof(test, o, size): + try: + import _testinternalcapi + except ImportError: + raise unittest.SkipTest("_testinternalcapi required") + result = sys.getsizeof(o) + # add GC header size + if ((type(o) == type) and (o.__flags__ & _TPFLAGS_HEAPTYPE) or\ + ((type(o) != type) and (type(o).__flags__ & _TPFLAGS_HAVE_GC))): + size += _testinternalcapi.SIZEOF_PYGC_HEAD + msg = 'wrong size for %s: got %d, expected %d' \ + % (type(o), result, size) + test.assertEqual(result, size, msg) + +def subTests(arg_names, arg_values, /, *, _do_cleanups=False): + """Run multiple subtests with different parameters. + """ + single_param = False + if isinstance(arg_names, str): + arg_names = arg_names.replace(',',' ').split() + if len(arg_names) == 1: + single_param = True + arg_values = tuple(arg_values) + def decorator(func): + if isinstance(func, type): + raise TypeError('subTests() can only decorate methods, not classes') + @functools.wraps(func) + def wrapper(self, /, *args, **kwargs): + for values in arg_values: + if single_param: + values = (values,) + subtest_kwargs = dict(zip(arg_names, values)) + with self.subTest(**subtest_kwargs): + func(self, *args, **kwargs, **subtest_kwargs) + if _do_cleanups: + self.doCleanups() + return wrapper + return decorator + +#======================================================================= +# Decorator/context manager for running a code in a different locale, +# correctly resetting it afterwards. + +@contextlib.contextmanager +def run_with_locale(catstr, *locales): + try: + import locale + category = getattr(locale, catstr) + orig_locale = locale.setlocale(category) + except AttributeError: + # if the test author gives us an invalid category string + raise + except Exception: + # cannot retrieve original locale, so do nothing + locale = orig_locale = None + if '' not in locales: + raise unittest.SkipTest('no locales') + else: + for loc in locales: + try: + locale.setlocale(category, loc) + break + except locale.Error: + pass + else: + if '' not in locales: + raise unittest.SkipTest(f'no locales {locales}') + + try: + yield + finally: + if locale and orig_locale: + locale.setlocale(category, orig_locale) + +#======================================================================= +# Decorator for running a function in multiple locales (if they are +# availasble) and resetting the original locale afterwards. + +def run_with_locales(catstr, *locales): + def deco(func): + @functools.wraps(func) + def wrapper(self, /, *args, **kwargs): + dry_run = '' in locales + try: + import locale + category = getattr(locale, catstr) + orig_locale = locale.setlocale(category) + except AttributeError: + # if the test author gives us an invalid category string + raise + except Exception: + # cannot retrieve original locale, so do nothing + pass + else: + try: + for loc in locales: + with self.subTest(locale=loc): + try: + locale.setlocale(category, loc) + except locale.Error: + self.skipTest(f'no locale {loc!r}') + else: + dry_run = False + func(self, *args, **kwargs) + finally: + locale.setlocale(category, orig_locale) + if dry_run: + # no locales available, so just run the test + # with the current locale + with self.subTest(locale=None): + func(self, *args, **kwargs) + return wrapper + return deco + +#======================================================================= +# Decorator for running a function in a specific timezone, correctly +# resetting it afterwards. + +def run_with_tz(tz): + def decorator(func): + def inner(*args, **kwds): + try: + tzset = time.tzset + except AttributeError: + raise unittest.SkipTest("tzset required") + if 'TZ' in os.environ: + orig_tz = os.environ['TZ'] + else: + orig_tz = None + os.environ['TZ'] = tz + tzset() + + # now run the function, resetting the tz on exceptions + try: + return func(*args, **kwds) + finally: + if orig_tz is None: + del os.environ['TZ'] + else: + os.environ['TZ'] = orig_tz + time.tzset() + + inner.__name__ = func.__name__ + inner.__doc__ = func.__doc__ + return inner + return decorator + +#======================================================================= +# Big-memory-test support. Separate from 'resources' because memory use +# should be configurable. + +# Some handy shorthands. Note that these are used for byte-limits as well +# as size-limits, in the various bigmem tests +_1M = 1024*1024 +_1G = 1024 * _1M +_2G = 2 * _1G +_4G = 4 * _1G + +MAX_Py_ssize_t = sys.maxsize + +def _parse_memlimit(limit: str) -> int: + sizes = { + 'k': 1024, + 'm': _1M, + 'g': _1G, + 't': 1024*_1G, + } + m = re.match(r'(\d+(?:\.\d+)?) (K|M|G|T)b?$', limit, + re.IGNORECASE | re.VERBOSE) + if m is None: + raise ValueError(f'Invalid memory limit: {limit!r}') + return int(float(m.group(1)) * sizes[m.group(2).lower()]) + +def set_memlimit(limit: str) -> None: + global max_memuse + global real_max_memuse + memlimit = _parse_memlimit(limit) + if memlimit < _2G - 1: + raise ValueError(f'Memory limit {limit!r} too low to be useful') + + real_max_memuse = memlimit + memlimit = min(memlimit, MAX_Py_ssize_t) + max_memuse = memlimit + + +class _MemoryWatchdog: + """An object which periodically watches the process' memory consumption + and prints it out. + """ + + def __init__(self): + self.procfile = '/proc/{pid}/statm'.format(pid=os.getpid()) + self.started = False + + def start(self): + import warnings + try: + f = open(self.procfile, 'r') + except OSError as e: + logging.getLogger(__name__).warning('/proc not available for stats: %s', e, exc_info=e) + sys.stderr.flush() + return + + import subprocess + with f: + watchdog_script = findfile("memory_watchdog.py") + self.mem_watchdog = subprocess.Popen([sys.executable, watchdog_script], + stdin=f, + stderr=subprocess.DEVNULL) + self.started = True + + def stop(self): + if self.started: + self.mem_watchdog.terminate() + self.mem_watchdog.wait() + + +def bigmemtest(size, memuse, dry_run=True): + """Decorator for bigmem tests. + + 'size' is a requested size for the test (in arbitrary, test-interpreted + units.) 'memuse' is the number of bytes per unit for the test, or a good + estimate of it. For example, a test that needs two byte buffers, of 4 GiB + each, could be decorated with @bigmemtest(size=_4G, memuse=2). + + The 'size' argument is normally passed to the decorated test method as an + extra argument. If 'dry_run' is true, the value passed to the test method + may be less than the requested value. If 'dry_run' is false, it means the + test doesn't support dummy runs when -M is not specified. + """ + def decorator(f): + def wrapper(self): + size = wrapper.size + memuse = wrapper.memuse + if not real_max_memuse: + maxsize = 5147 + else: + maxsize = size + + if ((real_max_memuse or not dry_run) + and real_max_memuse < maxsize * memuse): + raise unittest.SkipTest( + "not enough memory: %.1fG minimum needed" + % (size * memuse / (1024 ** 3))) + + if real_max_memuse and verbose: + print() + print(" ... expected peak memory use: {peak:.1f}G" + .format(peak=size * memuse / (1024 ** 3))) + watchdog = _MemoryWatchdog() + watchdog.start() + else: + watchdog = None + + try: + return f(self, maxsize) + finally: + if watchdog: + watchdog.stop() + + wrapper.size = size + wrapper.memuse = memuse + return wrapper + return decorator + +def bigaddrspacetest(f): + """Decorator for tests that fill the address space.""" + def wrapper(self): + if max_memuse < MAX_Py_ssize_t: + if MAX_Py_ssize_t >= 2**63 - 1 and max_memuse >= 2**31: + raise unittest.SkipTest( + "not enough memory: try a 32-bit build instead") + else: + raise unittest.SkipTest( + "not enough memory: %.1fG minimum needed" + % (MAX_Py_ssize_t / (1024 ** 3))) + else: + return f(self) + return wrapper + +#======================================================================= +# unittest integration. + +def _id(obj): + return obj + +def requires_resource(resource): + if resource == 'gui' and not _is_gui_available(): + return unittest.skip(_is_gui_available.reason) + if is_resource_enabled(resource): + return _id + else: + return unittest.skip("resource {0!r} is not enabled".format(resource)) + +def cpython_only(test): + """ + Decorator for tests only applicable on CPython. + """ + return impl_detail(cpython=True)(test) + +def impl_detail(msg=None, **guards): + if check_impl_detail(**guards): + return _id + if msg is None: + guardnames, default = _parse_guards(guards) + if default: + msg = "implementation detail not available on {0}" + else: + msg = "implementation detail specific to {0}" + guardnames = sorted(guardnames.keys()) + msg = msg.format(' or '.join(guardnames)) + return unittest.skip(msg) + +def _parse_guards(guards): + # Returns a tuple ({platform_name: run_me}, default_value) + if not guards: + return ({'cpython': True}, False) + is_true = list(guards.values())[0] + assert list(guards.values()) == [is_true] * len(guards) # all True or all False + return (guards, not is_true) + +# Use the following check to guard CPython's implementation-specific tests -- +# or to run them only on the implementation(s) guarded by the arguments. +def check_impl_detail(**guards): + """This function returns True or False depending on the host platform. + Examples: + if check_impl_detail(): # only on CPython (default) + if check_impl_detail(jython=True): # only on Jython + if check_impl_detail(cpython=False): # everywhere except on CPython + """ + guards, default = _parse_guards(guards) + return guards.get(sys.implementation.name, default) + + +def no_tracing(func): + """Decorator to temporarily turn off tracing for the duration of a test.""" + trace_wrapper = func + if hasattr(sys, 'gettrace'): + @functools.wraps(func) + def trace_wrapper(*args, **kwargs): + original_trace = sys.gettrace() + try: + sys.settrace(None) + return func(*args, **kwargs) + finally: + sys.settrace(original_trace) + + coverage_wrapper = trace_wrapper + if 'test.cov' in sys.modules: # -Xpresite=test.cov used + cov = sys.monitoring.COVERAGE_ID + @functools.wraps(func) + def coverage_wrapper(*args, **kwargs): + original_events = sys.monitoring.get_events(cov) + try: + sys.monitoring.set_events(cov, 0) + return trace_wrapper(*args, **kwargs) + finally: + sys.monitoring.set_events(cov, original_events) + + return coverage_wrapper + + +def no_rerun(reason): + """Skip rerunning for a particular test. + + WARNING: Use this decorator with care; skipping rerunning makes it + impossible to find reference leaks. Provide a clear reason for skipping the + test using the 'reason' parameter. + """ + def deco(func): + assert not isinstance(func, type), func + _has_run = False + def wrapper(self): + nonlocal _has_run + if _has_run: + self.skipTest(reason) + func(self) + _has_run = True + return wrapper + return deco + + +def refcount_test(test): + """Decorator for tests which involve reference counting. + + To start, the decorator does not run the test if is not run by CPython. + After that, any trace function is unset during the test to prevent + unexpected refcounts caused by the trace function. + + """ + return no_tracing(cpython_only(test)) + + +def requires_limited_api(test): + try: + import _testcapi # noqa: F401 + import _testlimitedcapi # noqa: F401 + except ImportError: + return unittest.skip('needs _testcapi and _testlimitedcapi modules')(test) + return test + + +# Windows build doesn't support --disable-test-modules feature, so there's no +# 'TEST_MODULES' var in config +TEST_MODULES_ENABLED = (sysconfig.get_config_var('TEST_MODULES') or 'yes') == 'yes' + +def requires_specialization(test): + return unittest.skipUnless( + _opcode.ENABLE_SPECIALIZATION, "requires specialization")(test) + + +def requires_specialization_ft(test): + return unittest.skipUnless( + _opcode.ENABLE_SPECIALIZATION_FT, "requires specialization")(test) + + +def reset_code(f: types.FunctionType) -> types.FunctionType: + """Clear all specializations, local instrumentation, and JIT code for the given function.""" + f.__code__ = f.__code__.replace() + return f + +on_github_actions = "GITHUB_ACTIONS" in os.environ + +#======================================================================= +# Check for the presence of docstrings. + +# Rather than trying to enumerate all the cases where docstrings may be +# disabled, we just check for that directly + +def _check_docstrings(): + """Just used to check if docstrings are enabled""" + +MISSING_C_DOCSTRINGS = (check_impl_detail() and + sys.platform != 'win32' and + not sysconfig.get_config_var('WITH_DOC_STRINGS')) + +HAVE_PY_DOCSTRINGS = _check_docstrings.__doc__ is not None +HAVE_DOCSTRINGS = (HAVE_PY_DOCSTRINGS and not MISSING_C_DOCSTRINGS) + +requires_docstrings = unittest.skipUnless(HAVE_DOCSTRINGS, + "test requires docstrings") + + +#======================================================================= +# Support for saving and restoring the imported modules. + +def flush_std_streams(): + if sys.stdout is not None: + sys.stdout.flush() + if sys.stderr is not None: + sys.stderr.flush() + + +def print_warning(msg): + # bpo-45410: Explicitly flush stdout to keep logs in order + flush_std_streams() + stream = print_warning.orig_stderr + for line in msg.splitlines(): + print(f"Warning -- {line}", file=stream) + stream.flush() + +# bpo-39983: Store the original sys.stderr at Python startup to be able to +# log warnings even if sys.stderr is captured temporarily by a test. +print_warning.orig_stderr = sys.stderr + + +# Flag used by saved_test_environment of test.libregrtest.save_env, +# to check if a test modified the environment. The flag should be set to False +# before running a new test. +# +# For example, threading_helper.threading_cleanup() sets the flag is the function fails +# to cleanup threads. +environment_altered = False + +def reap_children(): + """Use this function at the end of test_main() whenever sub-processes + are started. This will help ensure that no extra children (zombies) + stick around to hog resources and create problems when looking + for refleaks. + """ + global environment_altered + + # Need os.waitpid(-1, os.WNOHANG): Windows is not supported + if not (hasattr(os, 'waitpid') and hasattr(os, 'WNOHANG')): + return + elif not has_subprocess_support: + return + + # Reap all our dead child processes so we don't leave zombies around. + # These hog resources and might be causing some of the buildbots to die. + while True: + try: + # Read the exit status of any child process which already completed + pid, status = os.waitpid(-1, os.WNOHANG) + except OSError: + break + + if pid == 0: + break + + print_warning(f"reap_children() reaped child process {pid}") + environment_altered = True + + +@contextlib.contextmanager +def swap_attr(obj, attr, new_val): + """Temporary swap out an attribute with a new object. + + Usage: + with swap_attr(obj, "attr", 5): + ... + + This will set obj.attr to 5 for the duration of the with: block, + restoring the old value at the end of the block. If `attr` doesn't + exist on `obj`, it will be created and then deleted at the end of the + block. + + The old value (or None if it doesn't exist) will be assigned to the + target of the "as" clause, if there is one. + """ + if hasattr(obj, attr): + real_val = getattr(obj, attr) + setattr(obj, attr, new_val) + try: + yield real_val + finally: + setattr(obj, attr, real_val) + else: + setattr(obj, attr, new_val) + try: + yield + finally: + if hasattr(obj, attr): + delattr(obj, attr) + +@contextlib.contextmanager +def swap_item(obj, item, new_val): + """Temporary swap out an item with a new object. + + Usage: + with swap_item(obj, "item", 5): + ... + + This will set obj["item"] to 5 for the duration of the with: block, + restoring the old value at the end of the block. If `item` doesn't + exist on `obj`, it will be created and then deleted at the end of the + block. + + The old value (or None if it doesn't exist) will be assigned to the + target of the "as" clause, if there is one. + """ + if item in obj: + real_val = obj[item] + obj[item] = new_val + try: + yield real_val + finally: + obj[item] = real_val + else: + obj[item] = new_val + try: + yield + finally: + if item in obj: + del obj[item] + +def args_from_interpreter_flags(): + """Return a list of command-line arguments reproducing the current + settings in sys.flags and sys.warnoptions.""" + import subprocess + return subprocess._args_from_interpreter_flags() + +def optim_args_from_interpreter_flags(): + """Return a list of command-line arguments reproducing the current + optimization settings in sys.flags.""" + import subprocess + return subprocess._optim_args_from_interpreter_flags() + + +class Matcher(object): + + _partial_matches = ('msg', 'message') + + def matches(self, d, **kwargs): + """ + Try to match a single dict with the supplied arguments. + + Keys whose values are strings and which are in self._partial_matches + will be checked for partial (i.e. substring) matches. You can extend + this scheme to (for example) do regular expression matching, etc. + """ + result = True + for k in kwargs: + v = kwargs[k] + dv = d.get(k) + if not self.match_value(k, dv, v): + result = False + break + return result + + def match_value(self, k, dv, v): + """ + Try to match a single stored value (dv) with a supplied value (v). + """ + if type(v) != type(dv): + result = False + elif type(dv) is not str or k not in self._partial_matches: + result = (v == dv) + else: + result = dv.find(v) >= 0 + return result + + +_buggy_ucrt = None +def skip_if_buggy_ucrt_strfptime(test): + """ + Skip decorator for tests that use buggy strptime/strftime + + If the UCRT bugs are present time.localtime().tm_zone will be + an empty string, otherwise we assume the UCRT bugs are fixed + + See bpo-37552 [Windows] strptime/strftime return invalid + results with UCRT version 17763.615 + """ + import locale + global _buggy_ucrt + if _buggy_ucrt is None: + if(sys.platform == 'win32' and + locale.getencoding() == 'cp65001' and + time.localtime().tm_zone == ''): + _buggy_ucrt = True + else: + _buggy_ucrt = False + return unittest.skip("buggy MSVC UCRT strptime/strftime")(test) if _buggy_ucrt else test + +class PythonSymlink: + """Creates a symlink for the current Python executable""" + def __init__(self, link=None): + from .os_helper import TESTFN + + self.link = link or os.path.abspath(TESTFN) + self._linked = [] + self.real = os.path.realpath(sys.executable) + self._also_link = [] + + self._env = None + + self._platform_specific() + + if sys.platform == "win32": + def _platform_specific(self): + import glob + import _winapi + + if os.path.lexists(self.real) and not os.path.exists(self.real): + # App symlink appears to not exist, but we want the + # real executable here anyway + self.real = _winapi.GetModuleFileName(0) + + dll = _winapi.GetModuleFileName(sys.dllhandle) + src_dir = os.path.dirname(dll) + dest_dir = os.path.dirname(self.link) + self._also_link.append(( + dll, + os.path.join(dest_dir, os.path.basename(dll)) + )) + for runtime in glob.glob(os.path.join(glob.escape(src_dir), "vcruntime*.dll")): + self._also_link.append(( + runtime, + os.path.join(dest_dir, os.path.basename(runtime)) + )) + + self._env = {k.upper(): os.getenv(k) for k in os.environ} + self._env["PYTHONHOME"] = os.path.dirname(self.real) + if sysconfig.is_python_build(): + self._env["PYTHONPATH"] = STDLIB_DIR + else: + def _platform_specific(self): + pass + + def __enter__(self): + os.symlink(self.real, self.link) + self._linked.append(self.link) + for real, link in self._also_link: + os.symlink(real, link) + self._linked.append(link) + return self + + def __exit__(self, exc_type, exc_value, exc_tb): + for link in self._linked: + try: + os.remove(link) + except IOError as ex: + if verbose: + print("failed to clean up {}: {}".format(link, ex)) + + def _call(self, python, args, env, returncode): + import subprocess + cmd = [python, *args] + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, + stderr=subprocess.PIPE, env=env) + r = p.communicate() + if p.returncode != returncode: + if verbose: + print(repr(r[0])) + print(repr(r[1]), file=sys.stderr) + raise RuntimeError( + 'unexpected return code: {0} (0x{0:08X})'.format(p.returncode)) + return r + + def call_real(self, *args, returncode=0): + return self._call(self.real, args, None, returncode) + + def call_link(self, *args, returncode=0): + return self._call(self.link, args, self._env, returncode) + + +def skip_if_pgo_task(test): + """Skip decorator for tests not run in (non-extended) PGO task""" + ok = not PGO or PGO_EXTENDED + msg = "Not run for (non-extended) PGO task" + return test if ok else unittest.skip(msg)(test) + + +def skip_if_unlimited_stack_size(test): + """Skip decorator for tests not run when an unlimited stack size is configured. + + Tests using support.infinite_recursion([...]) may otherwise run into + an infinite loop, running until the memory on the system is filled and + crashing due to OOM. + + See https://github.com/python/cpython/issues/143460. + """ + if is_emscripten or is_wasi or os.name == "nt": + return test + + import resource + curlim, maxlim = resource.getrlimit(resource.RLIMIT_STACK) + unlimited_stack_size_cond = curlim == maxlim and curlim in (-1, 0xFFFF_FFFF_FFFF_FFFF) + reason = "Not run due to unlimited stack size" + return unittest.skipIf(unlimited_stack_size_cond, reason)(test) + + +def detect_api_mismatch(ref_api, other_api, *, ignore=()): + """Returns the set of items in ref_api not in other_api, except for a + defined list of items to be ignored in this check. + + By default this skips private attributes beginning with '_' but + includes all magic methods, i.e. those starting and ending in '__'. + """ + missing_items = set(dir(ref_api)) - set(dir(other_api)) + if ignore: + missing_items -= set(ignore) + missing_items = set(m for m in missing_items + if not m.startswith('_') or m.endswith('__')) + return missing_items + + +def check__all__(test_case, module, name_of_module=None, extra=(), + not_exported=()): + """Assert that the __all__ variable of 'module' contains all public names. + + The module's public names (its API) are detected automatically based on + whether they match the public name convention and were defined in + 'module'. + + The 'name_of_module' argument can specify (as a string or tuple thereof) + what module(s) an API could be defined in order to be detected as a + public API. One case for this is when 'module' imports part of its public + API from other modules, possibly a C backend (like 'csv' and its '_csv'). + + The 'extra' argument can be a set of names that wouldn't otherwise be + automatically detected as "public", like objects without a proper + '__module__' attribute. If provided, it will be added to the + automatically detected ones. + + The 'not_exported' argument can be a set of names that must not be treated + as part of the public API even though their names indicate otherwise. + + Usage: + import bar + import foo + import unittest + from test import support + + class MiscTestCase(unittest.TestCase): + def test__all__(self): + support.check__all__(self, foo) + + class OtherTestCase(unittest.TestCase): + def test__all__(self): + extra = {'BAR_CONST', 'FOO_CONST'} + not_exported = {'baz'} # Undocumented name. + # bar imports part of its API from _bar. + support.check__all__(self, bar, ('bar', '_bar'), + extra=extra, not_exported=not_exported) + + """ + + if name_of_module is None: + name_of_module = (module.__name__, ) + elif isinstance(name_of_module, str): + name_of_module = (name_of_module, ) + + expected = set(extra) + + for name in dir(module): + if name.startswith('_') or name in not_exported: + continue + obj = getattr(module, name) + if (getattr(obj, '__module__', None) in name_of_module or + (not hasattr(obj, '__module__') and + not isinstance(obj, types.ModuleType))): + expected.add(name) + test_case.assertCountEqual(module.__all__, expected) + + +def suppress_msvcrt_asserts(verbose=False): + try: + import msvcrt + except ImportError: + return + + msvcrt.SetErrorMode(msvcrt.SEM_FAILCRITICALERRORS + | msvcrt.SEM_NOALIGNMENTFAULTEXCEPT + | msvcrt.SEM_NOGPFAULTERRORBOX + | msvcrt.SEM_NOOPENFILEERRORBOX) + + # CrtSetReportMode() is only available in debug build + if hasattr(msvcrt, 'CrtSetReportMode'): + for m in [msvcrt.CRT_WARN, msvcrt.CRT_ERROR, msvcrt.CRT_ASSERT]: + if verbose: + msvcrt.CrtSetReportMode(m, msvcrt.CRTDBG_MODE_FILE) + msvcrt.CrtSetReportFile(m, msvcrt.CRTDBG_FILE_STDERR) + else: + msvcrt.CrtSetReportMode(m, 0) + + +class SuppressCrashReport: + """Try to prevent a crash report from popping up. + + On Windows, don't display the Windows Error Reporting dialog. On UNIX, + disable the creation of coredump file. + """ + old_value = None + old_modes = None + + def __enter__(self): + """On Windows, disable Windows Error Reporting dialogs using + SetErrorMode() and CrtSetReportMode(). + + On UNIX, try to save the previous core file size limit, then set + soft limit to 0. + """ + if sys.platform.startswith('win'): + # see http://msdn.microsoft.com/en-us/library/windows/desktop/ms680621.aspx + try: + import msvcrt + except ImportError: + return + + self.old_value = msvcrt.GetErrorMode() + + msvcrt.SetErrorMode(self.old_value | msvcrt.SEM_NOGPFAULTERRORBOX) + + # bpo-23314: Suppress assert dialogs in debug builds. + # CrtSetReportMode() is only available in debug build. + if hasattr(msvcrt, 'CrtSetReportMode'): + self.old_modes = {} + for report_type in [msvcrt.CRT_WARN, + msvcrt.CRT_ERROR, + msvcrt.CRT_ASSERT]: + old_mode = msvcrt.CrtSetReportMode(report_type, + msvcrt.CRTDBG_MODE_FILE) + old_file = msvcrt.CrtSetReportFile(report_type, + msvcrt.CRTDBG_FILE_STDERR) + self.old_modes[report_type] = old_mode, old_file + + else: + try: + import resource + self.resource = resource + except ImportError: + self.resource = None + if self.resource is not None: + try: + self.old_value = self.resource.getrlimit(self.resource.RLIMIT_CORE) + self.resource.setrlimit(self.resource.RLIMIT_CORE, + (0, self.old_value[1])) + except (ValueError, OSError): + pass + + if sys.platform == 'darwin': + import subprocess + # Check if the 'Crash Reporter' on OSX was configured + # in 'Developer' mode and warn that it will get triggered + # when it is. + # + # This assumes that this context manager is used in tests + # that might trigger the next manager. + cmd = ['/usr/bin/defaults', 'read', + 'com.apple.CrashReporter', 'DialogType'] + proc = subprocess.Popen(cmd, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + with proc: + stdout = proc.communicate()[0] + if stdout.strip() == b'developer': + print("this test triggers the Crash Reporter, " + "that is intentional", end='', flush=True) + + return self + + def __exit__(self, *ignore_exc): + """Restore Windows ErrorMode or core file behavior to initial value.""" + if self.old_value is None: + return + + if sys.platform.startswith('win'): + import msvcrt + msvcrt.SetErrorMode(self.old_value) + + if self.old_modes: + for report_type, (old_mode, old_file) in self.old_modes.items(): + msvcrt.CrtSetReportMode(report_type, old_mode) + msvcrt.CrtSetReportFile(report_type, old_file) + else: + if self.resource is not None: + try: + self.resource.setrlimit(self.resource.RLIMIT_CORE, self.old_value) + except (ValueError, OSError): + pass + + +def patch(test_instance, object_to_patch, attr_name, new_value): + """Override 'object_to_patch'.'attr_name' with 'new_value'. + + Also, add a cleanup procedure to 'test_instance' to restore + 'object_to_patch' value for 'attr_name'. + The 'attr_name' should be a valid attribute for 'object_to_patch'. + + """ + # check that 'attr_name' is a real attribute for 'object_to_patch' + # will raise AttributeError if it does not exist + getattr(object_to_patch, attr_name) + + # keep a copy of the old value + attr_is_local = False + try: + old_value = object_to_patch.__dict__[attr_name] + except (AttributeError, KeyError): + old_value = getattr(object_to_patch, attr_name, None) + else: + attr_is_local = True + + # restore the value when the test is done + def cleanup(): + if attr_is_local: + setattr(object_to_patch, attr_name, old_value) + else: + delattr(object_to_patch, attr_name) + + test_instance.addCleanup(cleanup) + + # actually override the attribute + setattr(object_to_patch, attr_name, new_value) + + +@contextlib.contextmanager +def patch_list(orig): + """Like unittest.mock.patch.dict, but for lists.""" + try: + saved = orig[:] + yield + finally: + orig[:] = saved + + +def run_in_subinterp(code): + """ + Run code in a subinterpreter. Raise unittest.SkipTest if the tracemalloc + module is enabled. + """ + _check_tracemalloc() + try: + import _testcapi + except ImportError: + raise unittest.SkipTest("requires _testcapi") + return _testcapi.run_in_subinterp(code) + + +def run_in_subinterp_with_config(code, *, own_gil=None, **config): + """ + Run code in a subinterpreter. Raise unittest.SkipTest if the tracemalloc + module is enabled. + """ + _check_tracemalloc() + try: + import _testinternalcapi + except ImportError: + raise unittest.SkipTest("requires _testinternalcapi") + if own_gil is not None: + assert 'gil' not in config, (own_gil, config) + config['gil'] = 'own' if own_gil else 'shared' + else: + gil = config['gil'] + if gil == 0: + config['gil'] = 'default' + elif gil == 1: + config['gil'] = 'shared' + elif gil == 2: + config['gil'] = 'own' + elif not isinstance(gil, str): + raise NotImplementedError(gil) + config = types.SimpleNamespace(**config) + return _testinternalcapi.run_in_subinterp_with_config(code, config) + + +def _check_tracemalloc(): + # Issue #10915, #15751: PyGILState_*() functions don't work with + # sub-interpreters, the tracemalloc module uses these functions internally + try: + import tracemalloc + except ImportError: + pass + else: + if tracemalloc.is_tracing(): + raise unittest.SkipTest("run_in_subinterp() cannot be used " + "if tracemalloc module is tracing " + "memory allocations") + + +def check_free_after_iterating(test, iter, cls, args=()): + done = False + def wrapper(): + class A(cls): + def __del__(self): + nonlocal done + done = True + try: + next(it) + except StopIteration: + pass + + it = iter(A(*args)) + # Issue 26494: Shouldn't crash + test.assertRaises(StopIteration, next, it) + + wrapper() + # The sequence should be deallocated just after the end of iterating + gc_collect() + test.assertTrue(done) + + +def missing_compiler_executable(cmd_names=[]): + """Check if the compiler components used to build the interpreter exist. + + Check for the existence of the compiler executables whose names are listed + in 'cmd_names' or all the compiler executables when 'cmd_names' is empty + and return the first missing executable or None when none is found + missing. + + """ + from setuptools._distutils import ccompiler, sysconfig + from setuptools import errors + import shutil + + compiler = ccompiler.new_compiler() + sysconfig.customize_compiler(compiler) + if compiler.compiler_type == "msvc": + # MSVC has no executables, so check whether initialization succeeds + try: + compiler.initialize() + except errors.PlatformError: + return "msvc" + for name in compiler.executables: + if cmd_names and name not in cmd_names: + continue + cmd = getattr(compiler, name) + if cmd_names: + assert cmd is not None, \ + "the '%s' executable is not configured" % name + elif not cmd: + continue + if shutil.which(cmd[0]) is None: + return cmd[0] + + +_old_android_emulator = None +def setswitchinterval(interval): + # Setting a very low gil interval on the Android emulator causes python + # to hang (issue #26939). + minimum_interval = 1e-4 # 100 us + if is_android and interval < minimum_interval: + global _old_android_emulator + if _old_android_emulator is None: + import platform + av = platform.android_ver() + _old_android_emulator = av.is_emulator and av.api_level < 24 + if _old_android_emulator: + interval = minimum_interval + return sys.setswitchinterval(interval) + + +def get_pagesize(): + """Get size of a page in bytes.""" + try: + page_size = os.sysconf('SC_PAGESIZE') + except (ValueError, AttributeError): + try: + page_size = os.sysconf('SC_PAGE_SIZE') + except (ValueError, AttributeError): + page_size = 4096 + return page_size + + +@contextlib.contextmanager +def disable_faulthandler(): + import faulthandler + + # use sys.__stderr__ instead of sys.stderr, since regrtest replaces + # sys.stderr with a StringIO which has no file descriptor when a test + # is run with -W/--verbose3. + fd = sys.__stderr__.fileno() + + is_enabled = faulthandler.is_enabled() + try: + faulthandler.disable() + yield + finally: + if is_enabled: + faulthandler.enable(file=fd, all_threads=True) + + +class SaveSignals: + """ + Save and restore signal handlers. + + This class is only able to save/restore signal handlers registered + by the Python signal module: see bpo-13285 for "external" signal + handlers. + """ + + def __init__(self): + import signal + self.signal = signal + self.signals = signal.valid_signals() + # SIGKILL and SIGSTOP signals cannot be ignored nor caught + for signame in ('SIGKILL', 'SIGSTOP'): + try: + signum = getattr(signal, signame) + except AttributeError: + continue + self.signals.remove(signum) + self.handlers = {} + + def save(self): + for signum in self.signals: + handler = self.signal.getsignal(signum) + if handler is None: + # getsignal() returns None if a signal handler was not + # registered by the Python signal module, + # and the handler is not SIG_DFL nor SIG_IGN. + # + # Ignore the signal: we cannot restore the handler. + continue + self.handlers[signum] = handler + + def restore(self): + for signum, handler in self.handlers.items(): + self.signal.signal(signum, handler) + + +def with_pymalloc(): + try: + import _testcapi + except ImportError: + raise unittest.SkipTest("requires _testcapi") + return _testcapi.WITH_PYMALLOC and not Py_GIL_DISABLED + + +def with_mimalloc(): + try: + import _testcapi + except ImportError: + raise unittest.SkipTest("requires _testcapi") + return _testcapi.WITH_MIMALLOC + + +class _ALWAYS_EQ: + """ + Object that is equal to anything. + """ + def __eq__(self, other): + return True + def __ne__(self, other): + return False + +ALWAYS_EQ = _ALWAYS_EQ() + +class _NEVER_EQ: + """ + Object that is not equal to anything. + """ + def __eq__(self, other): + return False + def __ne__(self, other): + return True + def __hash__(self): + return 1 + +NEVER_EQ = _NEVER_EQ() + +@functools.total_ordering +class _LARGEST: + """ + Object that is greater than anything (except itself). + """ + def __eq__(self, other): + return isinstance(other, _LARGEST) + def __lt__(self, other): + return False + +LARGEST = _LARGEST() + +@functools.total_ordering +class _SMALLEST: + """ + Object that is less than anything (except itself). + """ + def __eq__(self, other): + return isinstance(other, _SMALLEST) + def __gt__(self, other): + return False + +SMALLEST = _SMALLEST() + +def maybe_get_event_loop_policy(): + """Return the global event loop policy if one is set, else return None.""" + import asyncio.events + return asyncio.events._event_loop_policy + +# Helpers for testing hashing. +NHASHBITS = sys.hash_info.width # number of bits in hash() result +assert NHASHBITS in (32, 64) + +# Return mean and sdev of number of collisions when tossing nballs balls +# uniformly at random into nbins bins. By definition, the number of +# collisions is the number of balls minus the number of occupied bins at +# the end. +def collision_stats(nbins, nballs): + n, k = nbins, nballs + # prob a bin empty after k trials = (1 - 1/n)**k + # mean # empty is then n * (1 - 1/n)**k + # so mean # occupied is n - n * (1 - 1/n)**k + # so collisions = k - (n - n*(1 - 1/n)**k) + # + # For the variance: + # n*(n-1)*(1-2/n)**k + meanempty - meanempty**2 = + # n*(n-1)*(1-2/n)**k + meanempty * (1 - meanempty) + # + # Massive cancellation occurs, and, e.g., for a 64-bit hash code + # 1-1/2**64 rounds uselessly to 1.0. Rather than make heroic (and + # error-prone) efforts to rework the naive formulas to avoid those, + # we use the `decimal` module to get plenty of extra precision. + # + # Note: the exact values are straightforward to compute with + # rationals, but in context that's unbearably slow, requiring + # multi-million bit arithmetic. + import decimal + with decimal.localcontext() as ctx: + bits = n.bit_length() * 2 # bits in n**2 + # At least that many bits will likely cancel out. + # Use that many decimal digits instead. + ctx.prec = max(bits, 30) + dn = decimal.Decimal(n) + p1empty = ((dn - 1) / dn) ** k + meanempty = n * p1empty + occupied = n - meanempty + collisions = k - occupied + var = dn*(dn-1)*((dn-2)/dn)**k + meanempty * (1 - meanempty) + return float(collisions), float(var.sqrt()) + + +class catch_unraisable_exception: + """ + Context manager catching unraisable exception using sys.unraisablehook. + + Storing the exception value (cm.unraisable.exc_value) creates a reference + cycle. The reference cycle is broken explicitly when the context manager + exits. + + Storing the object (cm.unraisable.object) can resurrect it if it is set to + an object which is being finalized. Exiting the context manager clears the + stored object. + + Usage: + + with support.catch_unraisable_exception() as cm: + # code creating an "unraisable exception" + ... + + # check the unraisable exception: use cm.unraisable + ... + + # cm.unraisable attribute no longer exists at this point + # (to break a reference cycle) + """ + + def __init__(self): + self.unraisable = None + self._old_hook = None + + def _hook(self, unraisable): + # Storing unraisable.object can resurrect an object which is being + # finalized. Storing unraisable.exc_value creates a reference cycle. + self.unraisable = unraisable + + def __enter__(self): + self._old_hook = sys.unraisablehook + sys.unraisablehook = self._hook + return self + + def __exit__(self, *exc_info): + sys.unraisablehook = self._old_hook + del self.unraisable + + +def wait_process(pid, *, exitcode, timeout=None): + """ + Wait until process pid completes and check that the process exit code is + exitcode. + + Raise an AssertionError if the process exit code is not equal to exitcode. + + If the process runs longer than timeout seconds (LONG_TIMEOUT by default), + kill the process (if signal.SIGKILL is available) and raise an + AssertionError. The timeout feature is not available on Windows. + """ + if os.name != "nt": + import signal + + if timeout is None: + timeout = LONG_TIMEOUT + + start_time = time.monotonic() + for _ in sleeping_retry(timeout, error=False): + pid2, status = os.waitpid(pid, os.WNOHANG) + if pid2 != 0: + break + # rety: the process is still running + else: + try: + os.kill(pid, signal.SIGKILL) + os.waitpid(pid, 0) + except OSError: + # Ignore errors like ChildProcessError or PermissionError + pass + + dt = time.monotonic() - start_time + raise AssertionError(f"process {pid} is still running " + f"after {dt:.1f} seconds") + else: + # Windows implementation: don't support timeout :-( + pid2, status = os.waitpid(pid, 0) + + exitcode2 = os.waitstatus_to_exitcode(status) + if exitcode2 != exitcode: + raise AssertionError(f"process {pid} exited with code {exitcode2}, " + f"but exit code {exitcode} is expected") + + # sanity check: it should not fail in practice + if pid2 != pid: + raise AssertionError(f"pid {pid2} != pid {pid}") + +def skip_if_broken_multiprocessing_synchronize(): + """ + Skip tests if the multiprocessing.synchronize module is missing, if there + is no available semaphore implementation, or if creating a lock raises an + OSError (on Linux only). + """ + from .import_helper import import_module + + # Skip tests if the _multiprocessing extension is missing. + import_module('_multiprocessing') + + # Skip tests if there is no available semaphore implementation: + # multiprocessing.synchronize requires _multiprocessing.SemLock. + synchronize = import_module('multiprocessing.synchronize') + + if sys.platform == "linux": + try: + # bpo-38377: On Linux, creating a semaphore fails with OSError + # if the current user does not have the permission to create + # a file in /dev/shm/ directory. + import multiprocessing + synchronize.Lock(ctx=multiprocessing.get_context('fork')) + # The explicit fork mp context is required in order for + # TestResourceTracker.test_resource_tracker_reused to work. + # synchronize creates a new multiprocessing.resource_tracker + # process at module import time via the above call in that + # scenario. Awkward. This enables gh-84559. No code involved + # should have threads at that point so fork() should be safe. + + except OSError as exc: + raise unittest.SkipTest(f"broken multiprocessing SemLock: {exc!r}") + + +def check_disallow_instantiation(testcase, tp, *args, **kwds): + """ + Check that given type cannot be instantiated using *args and **kwds. + + See bpo-43916: Add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag. + """ + mod = tp.__module__ + name = tp.__name__ + if mod != 'builtins': + qualname = f"{mod}.{name}" + else: + qualname = f"{name}" + msg = f"cannot create '{re.escape(qualname)}' instances" + testcase.assertRaisesRegex(TypeError, msg, tp, *args, **kwds) + testcase.assertRaisesRegex(TypeError, msg, tp.__new__, tp, *args, **kwds) + +def get_recursion_depth(): + """Get the recursion depth of the caller function. + + In the __main__ module, at the module level, it should be 1. + """ + try: + import _testinternalcapi + depth = _testinternalcapi.get_recursion_depth() + except (ImportError, RecursionError) as exc: + # sys._getframe() + frame.f_back implementation. + try: + depth = 0 + frame = sys._getframe() + while frame is not None: + depth += 1 + frame = frame.f_back + finally: + # Break any reference cycles. + frame = None + + # Ignore get_recursion_depth() frame. + return max(depth - 1, 1) + +def get_recursion_available(): + """Get the number of available frames before RecursionError. + + It depends on the current recursion depth of the caller function and + sys.getrecursionlimit(). + """ + limit = sys.getrecursionlimit() + depth = get_recursion_depth() + return limit - depth + +@contextlib.contextmanager +def set_recursion_limit(limit): + """Temporarily change the recursion limit.""" + original_limit = sys.getrecursionlimit() + try: + sys.setrecursionlimit(limit) + yield + finally: + sys.setrecursionlimit(original_limit) + +def infinite_recursion(max_depth=None): + if max_depth is None: + # Pick a number large enough to cause problems + # but not take too long for code that can handle + # very deep recursion. + max_depth = 20_000 + elif max_depth < 3: + raise ValueError(f"max_depth must be at least 3, got {max_depth}") + depth = get_recursion_depth() + depth = max(depth - 1, 1) # Ignore infinite_recursion() frame. + limit = depth + max_depth + return set_recursion_limit(limit) + +def ignore_deprecations_from(module: str, *, like: str) -> object: + token = object() + warnings.filterwarnings( + "ignore", + category=DeprecationWarning, + module=module, + message=like + fr"(?#support{id(token)})", + ) + return token + +def clear_ignored_deprecations(*tokens: object) -> None: + if not tokens: + raise ValueError("Provide token or tokens returned by ignore_deprecations_from") + + new_filters = [] + old_filters = warnings._get_filters() + endswith = tuple(rf"(?#support{id(token)})" for token in tokens) + for action, message, category, module, lineno in old_filters: + if action == "ignore" and category is DeprecationWarning: + if isinstance(message, re.Pattern): + msg = message.pattern + else: + msg = message or "" + if msg.endswith(endswith): + continue + new_filters.append((action, message, category, module, lineno)) + if old_filters != new_filters: + old_filters[:] = new_filters + warnings._filters_mutated() + + +# Skip a test if venv with pip is known to not work. +def requires_venv_with_pip(): + # ensurepip requires zlib to open ZIP archives (.whl binary wheel packages) + try: + import zlib # noqa: F401 + except ImportError: + return unittest.skipIf(True, "venv: ensurepip requires zlib") + + # bpo-26610: pip/pep425tags.py requires ctypes. + # gh-92820: setuptools/windows_support.py uses ctypes (setuptools 58.1). + try: + import ctypes + except ImportError: + ctypes = None + return unittest.skipUnless(ctypes, 'venv: pip requires ctypes') + + +@functools.cache +def _findwheel(pkgname): + """Try to find a wheel with the package specified as pkgname. + + If set, the wheels are searched for in WHEEL_PKG_DIR (see ensurepip). + Otherwise, they are searched for in the test directory. + """ + wheel_dir = sysconfig.get_config_var('WHEEL_PKG_DIR') or os.path.join( + TEST_HOME_DIR, 'wheeldata', + ) + filenames = os.listdir(wheel_dir) + filenames = sorted(filenames, reverse=True) # approximate "newest" first + for filename in filenames: + # filename is like 'setuptools-{version}-py3-none-any.whl' + if not filename.endswith(".whl"): + continue + prefix = pkgname + '-' + if filename.startswith(prefix): + return os.path.join(wheel_dir, filename) + raise FileNotFoundError(f"No wheel for {pkgname} found in {wheel_dir}") + + +# Context manager that creates a virtual environment, install setuptools in it, +# and returns the paths to the venv directory and the python executable +@contextlib.contextmanager +def setup_venv_with_pip_setuptools(venv_dir): + import subprocess + from .os_helper import temp_cwd + + def run_command(cmd): + if verbose: + import shlex + print() + print('Run:', ' '.join(map(shlex.quote, cmd))) + subprocess.run(cmd, check=True) + else: + subprocess.run(cmd, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + check=True) + + with temp_cwd() as temp_dir: + # Create virtual environment to get setuptools + cmd = [sys.executable, '-X', 'dev', '-m', 'venv', venv_dir] + run_command(cmd) + + venv = os.path.join(temp_dir, venv_dir) + + # Get the Python executable of the venv + python_exe = os.path.basename(sys.executable) + if sys.platform == 'win32': + python = os.path.join(venv, 'Scripts', python_exe) + else: + python = os.path.join(venv, 'bin', python_exe) + + cmd = (python, '-X', 'dev', + '-m', 'pip', 'install', + _findwheel('setuptools'), + ) + run_command(cmd) + + yield python + + +# True if Python is built with the Py_DEBUG macro defined: if +# Python is built in debug mode (./configure --with-pydebug). +Py_DEBUG = hasattr(sys, 'gettotalrefcount') + + +def late_deletion(obj): + """ + Keep a Python alive as long as possible. + + Create a reference cycle and store the cycle in an object deleted late in + Python finalization. Try to keep the object alive until the very last + garbage collection. + + The function keeps a strong reference by design. It should be called in a + subprocess to not mark a test as "leaking a reference". + """ + + # Late CPython finalization: + # - finalize_interp_clear() + # - _PyInterpreterState_Clear(): Clear PyInterpreterState members + # (ex: codec_search_path, before_forkers) + # - clear os.register_at_fork() callbacks + # - clear codecs.register() callbacks + + ref_cycle = [obj] + ref_cycle.append(ref_cycle) + + # Store a reference in PyInterpreterState.codec_search_path + import codecs + def search_func(encoding): + return None + search_func.reference = ref_cycle + codecs.register(search_func) + + if hasattr(os, 'register_at_fork'): + # Store a reference in PyInterpreterState.before_forkers + def atfork_func(): + pass + atfork_func.reference = ref_cycle + os.register_at_fork(before=atfork_func) + + +def busy_retry(timeout, err_msg=None, /, *, error=True): + """ + Run the loop body until "break" stops the loop. + + After *timeout* seconds, raise an AssertionError if *error* is true, + or just stop if *error is false. + + Example: + + for _ in support.busy_retry(support.SHORT_TIMEOUT): + if check(): + break + + Example of error=False usage: + + for _ in support.busy_retry(support.SHORT_TIMEOUT, error=False): + if check(): + break + else: + raise RuntimeError('my custom error') + + """ + if timeout <= 0: + raise ValueError("timeout must be greater than zero") + + start_time = time.monotonic() + deadline = start_time + timeout + + while True: + yield + + if time.monotonic() >= deadline: + break + + if error: + dt = time.monotonic() - start_time + msg = f"timeout ({dt:.1f} seconds)" + if err_msg: + msg = f"{msg}: {err_msg}" + raise AssertionError(msg) + + +def sleeping_retry(timeout, err_msg=None, /, + *, init_delay=0.010, max_delay=1.0, error=True): + """ + Wait strategy that applies exponential backoff. + + Run the loop body until "break" stops the loop. Sleep at each loop + iteration, but not at the first iteration. The sleep delay is doubled at + each iteration (up to *max_delay* seconds). + + See busy_retry() documentation for the parameters usage. + + Example raising an exception after SHORT_TIMEOUT seconds: + + for _ in support.sleeping_retry(support.SHORT_TIMEOUT): + if check(): + break + + Example of error=False usage: + + for _ in support.sleeping_retry(support.SHORT_TIMEOUT, error=False): + if check(): + break + else: + raise RuntimeError('my custom error') + """ + + delay = init_delay + for _ in busy_retry(timeout, err_msg, error=error): + yield + + time.sleep(delay) + delay = min(delay * 2, max_delay) + + +class Stopwatch: + """Context manager to roughly time a CPU-bound operation. + + Disables GC. Uses perf_counter, which is a clock with the highest + available resolution. It is chosen even though it does include + time elapsed during sleep and is system-wide, because the + resolution of process_time is too coarse on Windows and + process_time does not exist everywhere (for example, WASM). + + Note: + - This *includes* time spent in other threads/processes. + - Some systems only have a coarse resolution; check + stopwatch.clock_info.resolution when using the results. + + Usage: + + with Stopwatch() as stopwatch: + ... + elapsed = stopwatch.seconds + resolution = stopwatch.clock_info.resolution + """ + def __enter__(self): + get_time = time.perf_counter + clock_info = time.get_clock_info('perf_counter') + self.context = disable_gc() + self.context.__enter__() + self.get_time = get_time + self.clock_info = clock_info + self.start_time = get_time() + return self + + def __exit__(self, *exc): + try: + end_time = self.get_time() + finally: + result = self.context.__exit__(*exc) + self.seconds = end_time - self.start_time + return result + + +@contextlib.contextmanager +def adjust_int_max_str_digits(max_digits): + """Temporarily change the integer string conversion length limit.""" + current = sys.get_int_max_str_digits() + try: + sys.set_int_max_str_digits(max_digits) + yield + finally: + sys.set_int_max_str_digits(current) + + +def exceeds_recursion_limit(): + """For recursion tests, easily exceeds default recursion limit.""" + return 150_000 + + +# Windows doesn't have os.uname() but it doesn't support s390x. +is_s390x = hasattr(os, 'uname') and os.uname().machine == 's390x' +skip_on_s390x = unittest.skipIf(is_s390x, 'skipped on s390x') + +Py_TRACE_REFS = hasattr(sys, 'getobjects') + +_JIT_ENABLED = sys._jit.is_enabled() +requires_jit_enabled = unittest.skipUnless(_JIT_ENABLED, "requires JIT enabled") +requires_jit_disabled = unittest.skipIf(_JIT_ENABLED, "requires JIT disabled") + + +_BASE_COPY_SRC_DIR_IGNORED_NAMES = frozenset({ + # SRC_DIR/.git + '.git', + # ignore all __pycache__/ sub-directories + '__pycache__', +}) + +# Ignore function for shutil.copytree() to copy the Python source code. +def copy_python_src_ignore(path, names): + ignored = _BASE_COPY_SRC_DIR_IGNORED_NAMES + if os.path.basename(path) == 'Doc': + ignored |= { + # SRC_DIR/Doc/build/ + 'build', + # SRC_DIR/Doc/venv/ + 'venv', + } + + # check if we are at the root of the source code + elif 'Modules' in names: + ignored |= { + # SRC_DIR/build/ + 'build', + } + return ignored + + +# XXX Move this to the inspect module? +def walk_class_hierarchy(top, *, topdown=True): + # This is based on the logic in os.walk(). + assert isinstance(top, type), repr(top) + stack = [top] + while stack: + top = stack.pop() + if isinstance(top, tuple): + yield top + continue + + subs = type(top).__subclasses__(top) + if topdown: + # Yield before subclass traversal if going top down. + yield top, subs + # Traverse into subclasses. + for sub in reversed(subs): + stack.append(sub) + else: + # Yield after subclass traversal if going bottom up. + stack.append((top, subs)) + # Traverse into subclasses. + for sub in reversed(subs): + stack.append(sub) + + +def iter_builtin_types(): + # First try the explicit route. + try: + import _testinternalcapi + except ImportError: + _testinternalcapi = None + if _testinternalcapi is not None: + yield from _testinternalcapi.get_static_builtin_types() + return + + # Fall back to making a best-effort guess. + if hasattr(object, '__flags__'): + # Look for any type object with the Py_TPFLAGS_STATIC_BUILTIN flag set. + import datetime + seen = set() + for cls, subs in walk_class_hierarchy(object): + if cls in seen: + continue + seen.add(cls) + if not (cls.__flags__ & _TPFLAGS_STATIC_BUILTIN): + # Do not walk its subclasses. + subs[:] = [] + continue + yield cls + else: + # Fall back to a naive approach. + seen = set() + for obj in __builtins__.values(): + if not isinstance(obj, type): + continue + cls = obj + # XXX? + if cls.__module__ != 'builtins': + continue + if cls == ExceptionGroup: + # It's a heap type. + continue + if cls in seen: + continue + seen.add(cls) + yield cls + + +# XXX Move this to the inspect module? +def iter_name_in_mro(cls, name): + """Yield matching items found in base.__dict__ across the MRO. + + The descriptor protocol is not invoked. + + list(iter_name_in_mro(cls, name))[0] is roughly equivalent to + find_name_in_mro() in Objects/typeobject.c (AKA PyType_Lookup()). + + inspect.getattr_static() is similar. + """ + # This can fail if "cls" is weird. + for base in inspect._static_getmro(cls): + # This can fail if "base" is weird. + ns = inspect._get_dunder_dict_of_class(base) + try: + obj = ns[name] + except KeyError: + continue + yield obj, base + + +# XXX Move this to the inspect module? +def find_name_in_mro(cls, name, default=inspect._sentinel): + for res in iter_name_in_mro(cls, name): + # Return the first one. + return res + if default is not inspect._sentinel: + return default, None + raise AttributeError(name) + + +# XXX The return value should always be exactly the same... +def identify_type_slot_wrappers(): + try: + import _testinternalcapi + except ImportError: + _testinternalcapi = None + if _testinternalcapi is not None: + names = {n: None for n in _testinternalcapi.identify_type_slot_wrappers()} + return list(names) + else: + raise NotImplementedError + + +def iter_slot_wrappers(cls): + def is_slot_wrapper(name, value): + if not isinstance(value, types.WrapperDescriptorType): + assert not repr(value).startswith(' dict[str, str]: + clean_env = os.environ.copy() + for k in clean_env.copy(): + if k.startswith("PYTHON"): + clean_env.pop(k) + clean_env.pop("FORCE_COLOR", None) + clean_env.pop("NO_COLOR", None) + return clean_env + + +WINDOWS_STATUS = { + 0xC0000005: "STATUS_ACCESS_VIOLATION", + 0xC00000FD: "STATUS_STACK_OVERFLOW", + 0xC000013A: "STATUS_CONTROL_C_EXIT", +} + +def get_signal_name(exitcode): + import signal + + if exitcode < 0: + signum = -exitcode + try: + return signal.Signals(signum).name + except ValueError: + pass + + # Shell exit code (ex: WASI build) + if 128 < exitcode < 256: + signum = exitcode - 128 + try: + return signal.Signals(signum).name + except ValueError: + pass + + try: + return WINDOWS_STATUS[exitcode] + except KeyError: + pass + + # Format Windows exit status as hexadecimal + if 0xC0000000 <= exitcode: + return f"0x{exitcode:X}" + + return None + +class BrokenIter: + def __init__(self, init_raises=False, next_raises=False, iter_raises=False): + if init_raises: + 1/0 + self.next_raises = next_raises + self.iter_raises = iter_raises + + def __next__(self): + if self.next_raises: + 1/0 + + def __iter__(self): + if self.iter_raises: + 1/0 + return self + + +def in_systemd_nspawn_sync_suppressed() -> bool: + """ + Test whether the test suite is runing in systemd-nspawn + with ``--suppress-sync=true``. + + This can be used to skip tests that rely on ``fsync()`` calls + and similar not being intercepted. + """ + + if not hasattr(os, "O_SYNC"): + return False + + try: + with open("/run/systemd/container", "rb") as fp: + if fp.read().rstrip() != b"systemd-nspawn": + return False + except FileNotFoundError: + return False + + # If systemd-nspawn is used, O_SYNC flag will immediately + # trigger EINVAL. Otherwise, ENOENT will be given instead. + import errno + try: + fd = os.open(__file__, os.O_RDONLY | os.O_SYNC) + except OSError as err: + if err.errno == errno.EINVAL: + return True + else: + os.close(fd) + + return False + +def run_no_yield_async_fn(async_fn, /, *args, **kwargs): + coro = async_fn(*args, **kwargs) + try: + coro.send(None) + except StopIteration as e: + return e.value + else: + raise AssertionError("coroutine did not complete") + finally: + coro.close() + + +@types.coroutine +def async_yield(v): + return (yield v) + + +def run_yielding_async_fn(async_fn, /, *args, **kwargs): + coro = async_fn(*args, **kwargs) + try: + while True: + try: + coro.send(None) + except StopIteration as e: + return e.value + finally: + coro.close() + + +def is_libssl_fips_mode(): + try: + from _hashlib import get_fips_mode # ask _hashopenssl.c + except ImportError: + return False # more of a maybe, unless we add this to the _ssl module. + return get_fips_mode() != 0 + +def _supports_remote_attaching(): + PROCESS_VM_READV_SUPPORTED = False + + try: + from _remote_debugging import PROCESS_VM_READV_SUPPORTED + except ImportError: + pass + + return PROCESS_VM_READV_SUPPORTED + +def _support_remote_exec_only_impl(): + if not sys.is_remote_debug_enabled(): + return unittest.skip("Remote debugging is not enabled") + if sys.platform not in ("darwin", "linux", "win32"): + return unittest.skip("Test only runs on Linux, Windows and macOS") + if sys.platform == "linux" and not _supports_remote_attaching(): + return unittest.skip("Test only runs on Linux with process_vm_readv support") + return _id + +def support_remote_exec_only(test): + return _support_remote_exec_only_impl()(test) + +class EqualToForwardRef: + """Helper to ease use of annotationlib.ForwardRef in tests. + + This checks only attributes that can be set using the constructor. + + """ + + def __init__( + self, + arg, + *, + module=None, + owner=None, + is_class=False, + ): + self.__forward_arg__ = arg + self.__forward_is_class__ = is_class + self.__forward_module__ = module + self.__owner__ = owner + + def __eq__(self, other): + if not isinstance(other, (EqualToForwardRef, annotationlib.ForwardRef)): + return NotImplemented + return ( + self.__forward_arg__ == other.__forward_arg__ + and self.__forward_module__ == other.__forward_module__ + and self.__forward_is_class__ == other.__forward_is_class__ + and self.__owner__ == other.__owner__ + ) + + def __repr__(self): + extra = [] + if self.__forward_module__ is not None: + extra.append(f", module={self.__forward_module__!r}") + if self.__forward_is_class__: + extra.append(", is_class=True") + if self.__owner__ is not None: + extra.append(f", owner={self.__owner__!r}") + return f"EqualToForwardRef({self.__forward_arg__!r}{''.join(extra)})" + + +_linked_to_musl = None +def linked_to_musl(): + """ + Report if the Python executable is linked to the musl C library. + + Return False if we don't think it is, or a version triple otherwise. + """ + # This is can be a relatively expensive check, so we use a cache. + global _linked_to_musl + if _linked_to_musl is not None: + return _linked_to_musl + + # emscripten (at least as far as we're concerned) and wasi use musl, + # but platform doesn't know how to get the version, so set it to zero. + if is_wasm32: + _linked_to_musl = (0, 0, 0) + return _linked_to_musl + + # On all other non-linux platforms assume no musl. + if sys.platform != 'linux': + _linked_to_musl = False + return _linked_to_musl + + # On linux, we'll depend on the platform module to do the check, so new + # musl platforms should add support in that module if possible. + import platform + lib, version = platform.libc_ver() + if lib != 'musl': + _linked_to_musl = False + return _linked_to_musl + _linked_to_musl = tuple(map(int, version.split('.'))) + return _linked_to_musl + + +def control_characters_c0() -> list[str]: + """Returns a list of C0 control characters as strings. + C0 control characters defined as the byte range 0x00-0x1F, and 0x7F. + """ + return [chr(c) for c in range(0x00, 0x20)] + ["\x7F"] diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/ast_helper.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/ast_helper.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..db47c5694e5e6e92763e872c38205f7e6ee900b5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/ast_helper.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/asynchat.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/asynchat.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..adc204afd10a6237b06159fa326b2102941a63ed Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/asynchat.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/asyncore.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/asyncore.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..132aea77d99c1f083b3eaac8654ed3e02fedb455 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/asyncore.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/bytecode_helper.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/bytecode_helper.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1ac18dcc28c460cdac39dc4e99c09b6037828ae1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/bytecode_helper.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/channels.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/channels.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..14f4cb2fccccbaab8c66d6331092ffd41760aad1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/channels.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/hashlib_helper.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/hashlib_helper.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e13e86a36bc896dd5523328124e0d83c8ca1e470 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/hashlib_helper.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/hypothesis_helper.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/hypothesis_helper.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b3bb80560376ff8008b27bf45f57d17b9da3759 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/hypothesis_helper.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/i18n_helper.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/i18n_helper.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0ddd19c895dafb1d4ba31181d3f63573ac325975 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/i18n_helper.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/import_helper.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/import_helper.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d0f74981203ae726f4c35837dfc7565189bffa1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/import_helper.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/logging_helper.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/logging_helper.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4a6e5e2579b7b4aeca6dbe592a5438d634495029 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/logging_helper.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/numbers.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/numbers.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..28bee0ea0f0ec0f843d787e9b49d4ff9701c0bcb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/numbers.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/os_helper.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/os_helper.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e62254ac5ddcb88c3605da64a839bbf52f3efea3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/os_helper.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/pty_helper.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/pty_helper.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..da0ad0b32de9d5aba1afcab526e790acdec6b968 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/pty_helper.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/refleak_helper.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/refleak_helper.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..18bc506b87d89a375344cf40276612e165bc33c2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/refleak_helper.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/script_helper.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/script_helper.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2c51d6a5dd5aecb7a72b9e18dcb87764edcf73da Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/script_helper.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/smtpd.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/smtpd.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e2f7447e4194003e3f2b25c83690575d97b9a70d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/smtpd.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/socket_helper.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/socket_helper.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..824d551976ec0cf3298b499602a10097236df05c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/socket_helper.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/strace_helper.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/strace_helper.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3b92bcc938c57f1c32b6153a72e46b94cd84ac4f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/strace_helper.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/testcase.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/testcase.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9d0aa50175813afb5f839c9727302375d411763b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/testcase.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/threading_helper.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/threading_helper.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..600ebc9c3855ff02b7f05e9a4932fbee458bf5a9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/threading_helper.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/venv.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/venv.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a1624e5c6f4e3b71ce574cee6d5b901fa8bff8c2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/venv.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/warnings_helper.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/warnings_helper.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..697d5b677752b5c6276e347964037bbaf8f8714c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/warnings_helper.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/_hypothesis_stubs/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/_hypothesis_stubs/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ba5bb814b92f7b427612ad93f0af24326b9240d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/_hypothesis_stubs/__init__.py @@ -0,0 +1,111 @@ +from enum import Enum +import functools +import unittest + +__all__ = [ + "given", + "example", + "assume", + "reject", + "register_random", + "strategies", + "HealthCheck", + "settings", + "Verbosity", +] + +from . import strategies + + +def given(*_args, **_kwargs): + def decorator(f): + if examples := getattr(f, "_examples", []): + + @functools.wraps(f) + def test_function(self): + for example_args, example_kwargs in examples: + with self.subTest(*example_args, **example_kwargs): + f(self, *example_args, **example_kwargs) + + else: + # If we have found no examples, we must skip the test. If @example + # is applied after @given, it will re-wrap the test to remove the + # skip decorator. + test_function = unittest.skip( + "Hypothesis required for property test with no " + + "specified examples" + )(f) + + test_function._given = True + return test_function + + return decorator + + +def example(*args, **kwargs): + if bool(args) == bool(kwargs): + raise ValueError("Must specify exactly one of *args or **kwargs") + + def decorator(f): + base_func = getattr(f, "__wrapped__", f) + if not hasattr(base_func, "_examples"): + base_func._examples = [] + + base_func._examples.append((args, kwargs)) + + if getattr(f, "_given", False): + # If the given decorator is below all the example decorators, + # it would be erroneously skipped, so we need to re-wrap the new + # base function. + f = given()(base_func) + + return f + + return decorator + + +def assume(condition): + if not condition: + raise unittest.SkipTest("Unsatisfied assumption") + return True + + +def reject(): + assume(False) + + +def register_random(*args, **kwargs): + pass # pragma: no cover + + +def settings(*args, **kwargs): + return lambda f: f # pragma: nocover + + +class HealthCheck(Enum): + data_too_large = 1 + filter_too_much = 2 + too_slow = 3 + return_value = 5 + large_base_example = 7 + not_a_test_method = 8 + + @classmethod + def all(cls): + return list(cls) + + +class Verbosity(Enum): + quiet = 0 + normal = 1 + verbose = 2 + debug = 3 + + +class Phase(Enum): + explicit = 0 + reuse = 1 + generate = 2 + target = 3 + shrink = 4 + explain = 5 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/_hypothesis_stubs/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/_hypothesis_stubs/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a9d4bb0ee8b41578d92bdab81c349c7a77ccabf5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/_hypothesis_stubs/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/_hypothesis_stubs/__pycache__/_helpers.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/_hypothesis_stubs/__pycache__/_helpers.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e3b2a55a5a5e344e5e5527239d180faa60f64f51 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/_hypothesis_stubs/__pycache__/_helpers.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/_hypothesis_stubs/__pycache__/strategies.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/_hypothesis_stubs/__pycache__/strategies.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f14661d6cfdef0624d0174c4f4db22ef05bb184 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/_hypothesis_stubs/__pycache__/strategies.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/_hypothesis_stubs/_helpers.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/_hypothesis_stubs/_helpers.py new file mode 100644 index 0000000000000000000000000000000000000000..3f6244e4dbc0b1bc8cc2dad3a19c888e7c4b9fa2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/_hypothesis_stubs/_helpers.py @@ -0,0 +1,43 @@ +# Stub out only the subset of the interface that we actually use in our tests. +class StubClass: + def __init__(self, *args, **kwargs): + self.__stub_args = args + self.__stub_kwargs = kwargs + self.__repr = None + + def _with_repr(self, new_repr): + new_obj = self.__class__(*self.__stub_args, **self.__stub_kwargs) + new_obj.__repr = new_repr + return new_obj + + def __repr__(self): + if self.__repr is not None: + return self.__repr + + argstr = ", ".join(self.__stub_args) + kwargstr = ", ".join(f"{kw}={val}" for kw, val in self.__stub_kwargs.items()) + + in_parens = argstr + if kwargstr: + in_parens += ", " + kwargstr + + return f"{self.__class__.__qualname__}({in_parens})" + + +def stub_factory(klass, name, *, with_repr=None, _seen={}): + if (klass, name) not in _seen: + + class Stub(klass): + def __init__(self, *args, **kwargs): + super().__init__() + self.__stub_args = args + self.__stub_kwargs = kwargs + + Stub.__name__ = name + Stub.__qualname__ = name + if with_repr is not None: + Stub._repr = None + + _seen.setdefault((klass, name, with_repr), Stub) + + return _seen[(klass, name, with_repr)] diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/_hypothesis_stubs/strategies.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/_hypothesis_stubs/strategies.py new file mode 100644 index 0000000000000000000000000000000000000000..d2b885d41e16d0eb3e32bb841509db6e44c7a3c3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/_hypothesis_stubs/strategies.py @@ -0,0 +1,91 @@ +import functools + +from ._helpers import StubClass, stub_factory + + +class StubStrategy(StubClass): + def __make_trailing_repr(self, transformation_name, func): + func_name = func.__name__ or repr(func) + return f"{self!r}.{transformation_name}({func_name})" + + def map(self, pack): + return self._with_repr(self.__make_trailing_repr("map", pack)) + + def flatmap(self, expand): + return self._with_repr(self.__make_trailing_repr("flatmap", expand)) + + def filter(self, condition): + return self._with_repr(self.__make_trailing_repr("filter", condition)) + + def __or__(self, other): + new_repr = f"one_of({self!r}, {other!r})" + return self._with_repr(new_repr) + + +_STRATEGIES = { + "binary", + "booleans", + "builds", + "characters", + "complex_numbers", + "composite", + "data", + "dates", + "datetimes", + "decimals", + "deferred", + "dictionaries", + "emails", + "fixed_dictionaries", + "floats", + "fractions", + "from_regex", + "from_type", + "frozensets", + "functions", + "integers", + "iterables", + "just", + "lists", + "none", + "nothing", + "one_of", + "permutations", + "random_module", + "randoms", + "recursive", + "register_type_strategy", + "runner", + "sampled_from", + "sets", + "shared", + "slices", + "timedeltas", + "times", + "text", + "tuples", + "uuids", +} + +__all__ = sorted(_STRATEGIES) + + +def composite(f): + strategy = stub_factory(StubStrategy, f.__name__) + + @functools.wraps(f) + def inner(*args, **kwargs): + return strategy(*args, **kwargs) + + return inner + + +def __getattr__(name): + if name not in _STRATEGIES: + raise AttributeError(f"Unknown attribute {name}") + + return stub_factory(StubStrategy, f"hypothesis.strategies.{name}") + + +def __dir__(): + return __all__ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/ast_helper.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/ast_helper.py new file mode 100644 index 0000000000000000000000000000000000000000..173d299afee491e96ffea784039fb549e40f681e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/ast_helper.py @@ -0,0 +1,46 @@ +import ast + +class ASTTestMixin: + """Test mixing to have basic assertions for AST nodes.""" + + def assertASTEqual(self, ast1, ast2): + # Ensure the comparisons start at an AST node + self.assertIsInstance(ast1, ast.AST) + self.assertIsInstance(ast2, ast.AST) + + # An AST comparison routine modeled after ast.dump(), but + # instead of string building, it traverses the two trees + # in lock-step. + def traverse_compare(a, b, missing=object()): + if type(a) is not type(b): + self.fail(f"{type(a)!r} is not {type(b)!r}") + if isinstance(a, ast.AST): + for field in a._fields: + if isinstance(a, ast.Constant) and field == "kind": + # Skip the 'kind' field for ast.Constant + continue + value1 = getattr(a, field, missing) + value2 = getattr(b, field, missing) + # Singletons are equal by definition, so further + # testing can be skipped. + if value1 is not value2: + traverse_compare(value1, value2) + elif isinstance(a, list): + try: + for node1, node2 in zip(a, b, strict=True): + traverse_compare(node1, node2) + except ValueError: + # Attempt a "pretty" error ala assertSequenceEqual() + len1 = len(a) + len2 = len(b) + if len1 > len2: + what = "First" + diff = len1 - len2 + else: + what = "Second" + diff = len2 - len1 + msg = f"{what} list contains {diff} additional elements." + raise self.failureException(msg) from None + elif a != b: + self.fail(f"{a!r} != {b!r}") + traverse_compare(ast1, ast2) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/asynchat.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/asynchat.py new file mode 100644 index 0000000000000000000000000000000000000000..a8c6b28a9e1a91fb592215563824adc9ff18b6cb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/asynchat.py @@ -0,0 +1,314 @@ +# TODO: This module was deprecated and removed from CPython 3.12 +# Now it is a test-only helper. Any attempts to rewrite existing tests that +# are using this module and remove it completely are appreciated! +# See: https://github.com/python/cpython/issues/72719 + +# -*- Mode: Python; tab-width: 4 -*- +# Id: asynchat.py,v 2.26 2000/09/07 22:29:26 rushing Exp +# Author: Sam Rushing + +# ====================================================================== +# Copyright 1996 by Sam Rushing +# +# All Rights Reserved +# +# Permission to use, copy, modify, and distribute this software and +# its documentation for any purpose and without fee is hereby +# granted, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name of Sam +# Rushing not be used in advertising or publicity pertaining to +# distribution of the software without specific, written prior +# permission. +# +# SAM RUSHING DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN +# NO EVENT SHALL SAM RUSHING BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +# OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# ====================================================================== + +r"""A class supporting chat-style (command/response) protocols. + +This class adds support for 'chat' style protocols - where one side +sends a 'command', and the other sends a response (examples would be +the common internet protocols - smtp, nntp, ftp, etc..). + +The handle_read() method looks at the input stream for the current +'terminator' (usually '\r\n' for single-line responses, '\r\n.\r\n' +for multi-line output), calling self.found_terminator() on its +receipt. + +for example: +Say you build an async nntp client using this class. At the start +of the connection, you'll have self.terminator set to '\r\n', in +order to process the single-line greeting. Just before issuing a +'LIST' command you'll set it to '\r\n.\r\n'. The output of the LIST +command will be accumulated (using your own 'collect_incoming_data' +method) up to the terminator, and then control will be returned to +you - by calling your self.found_terminator() method. +""" + +from collections import deque + +from test.support import asyncore + + +class async_chat(asyncore.dispatcher): + """This is an abstract class. You must derive from this class, and add + the two methods collect_incoming_data() and found_terminator()""" + + # these are overridable defaults + + ac_in_buffer_size = 65536 + ac_out_buffer_size = 65536 + + # we don't want to enable the use of encoding by default, because that is a + # sign of an application bug that we don't want to pass silently + + use_encoding = 0 + encoding = 'latin-1' + + def __init__(self, sock=None, map=None): + # for string terminator matching + self.ac_in_buffer = b'' + + # we use a list here rather than io.BytesIO for a few reasons... + # del lst[:] is faster than bio.truncate(0) + # lst = [] is faster than bio.truncate(0) + self.incoming = [] + + # we toss the use of the "simple producer" and replace it with + # a pure deque, which the original fifo was a wrapping of + self.producer_fifo = deque() + asyncore.dispatcher.__init__(self, sock, map) + + def collect_incoming_data(self, data): + raise NotImplementedError("must be implemented in subclass") + + def _collect_incoming_data(self, data): + self.incoming.append(data) + + def _get_data(self): + d = b''.join(self.incoming) + del self.incoming[:] + return d + + def found_terminator(self): + raise NotImplementedError("must be implemented in subclass") + + def set_terminator(self, term): + """Set the input delimiter. + + Can be a fixed string of any length, an integer, or None. + """ + if isinstance(term, str) and self.use_encoding: + term = bytes(term, self.encoding) + elif isinstance(term, int) and term < 0: + raise ValueError('the number of received bytes must be positive') + self.terminator = term + + def get_terminator(self): + return self.terminator + + # grab some more data from the socket, + # throw it to the collector method, + # check for the terminator, + # if found, transition to the next state. + + def handle_read(self): + + try: + data = self.recv(self.ac_in_buffer_size) + except BlockingIOError: + return + except OSError: + self.handle_error() + return + + if isinstance(data, str) and self.use_encoding: + data = bytes(str, self.encoding) + self.ac_in_buffer = self.ac_in_buffer + data + + # Continue to search for self.terminator in self.ac_in_buffer, + # while calling self.collect_incoming_data. The while loop + # is necessary because we might read several data+terminator + # combos with a single recv(4096). + + while self.ac_in_buffer: + lb = len(self.ac_in_buffer) + terminator = self.get_terminator() + if not terminator: + # no terminator, collect it all + self.collect_incoming_data(self.ac_in_buffer) + self.ac_in_buffer = b'' + elif isinstance(terminator, int): + # numeric terminator + n = terminator + if lb < n: + self.collect_incoming_data(self.ac_in_buffer) + self.ac_in_buffer = b'' + self.terminator = self.terminator - lb + else: + self.collect_incoming_data(self.ac_in_buffer[:n]) + self.ac_in_buffer = self.ac_in_buffer[n:] + self.terminator = 0 + self.found_terminator() + else: + # 3 cases: + # 1) end of buffer matches terminator exactly: + # collect data, transition + # 2) end of buffer matches some prefix: + # collect data to the prefix + # 3) end of buffer does not match any prefix: + # collect data + terminator_len = len(terminator) + index = self.ac_in_buffer.find(terminator) + if index != -1: + # we found the terminator + if index > 0: + # don't bother reporting the empty string + # (source of subtle bugs) + self.collect_incoming_data(self.ac_in_buffer[:index]) + self.ac_in_buffer = self.ac_in_buffer[index+terminator_len:] + # This does the Right Thing if the terminator + # is changed here. + self.found_terminator() + else: + # check for a prefix of the terminator + index = find_prefix_at_end(self.ac_in_buffer, terminator) + if index: + if index != lb: + # we found a prefix, collect up to the prefix + self.collect_incoming_data(self.ac_in_buffer[:-index]) + self.ac_in_buffer = self.ac_in_buffer[-index:] + break + else: + # no prefix, collect it all + self.collect_incoming_data(self.ac_in_buffer) + self.ac_in_buffer = b'' + + def handle_write(self): + self.initiate_send() + + def handle_close(self): + self.close() + + def push(self, data): + if not isinstance(data, (bytes, bytearray, memoryview)): + raise TypeError('data argument must be byte-ish (%r)', + type(data)) + sabs = self.ac_out_buffer_size + if len(data) > sabs: + for i in range(0, len(data), sabs): + self.producer_fifo.append(data[i:i+sabs]) + else: + self.producer_fifo.append(data) + self.initiate_send() + + def push_with_producer(self, producer): + self.producer_fifo.append(producer) + self.initiate_send() + + def readable(self): + "predicate for inclusion in the readable for select()" + # cannot use the old predicate, it violates the claim of the + # set_terminator method. + + # return (len(self.ac_in_buffer) <= self.ac_in_buffer_size) + return 1 + + def writable(self): + "predicate for inclusion in the writable for select()" + return self.producer_fifo or (not self.connected) + + def close_when_done(self): + "automatically close this channel once the outgoing queue is empty" + self.producer_fifo.append(None) + + def initiate_send(self): + while self.producer_fifo and self.connected: + first = self.producer_fifo[0] + # handle empty string/buffer or None entry + if not first: + del self.producer_fifo[0] + if first is None: + self.handle_close() + return + + # handle classic producer behavior + obs = self.ac_out_buffer_size + try: + data = first[:obs] + except TypeError: + data = first.more() + if data: + self.producer_fifo.appendleft(data) + else: + del self.producer_fifo[0] + continue + + if isinstance(data, str) and self.use_encoding: + data = bytes(data, self.encoding) + + # send the data + try: + num_sent = self.send(data) + except OSError: + self.handle_error() + return + + if num_sent: + if num_sent < len(data) or obs < len(first): + self.producer_fifo[0] = first[num_sent:] + else: + del self.producer_fifo[0] + # we tried to send some actual data + return + + def discard_buffers(self): + # Emergencies only! + self.ac_in_buffer = b'' + del self.incoming[:] + self.producer_fifo.clear() + + +class simple_producer: + + def __init__(self, data, buffer_size=512): + self.data = data + self.buffer_size = buffer_size + + def more(self): + if len(self.data) > self.buffer_size: + result = self.data[:self.buffer_size] + self.data = self.data[self.buffer_size:] + return result + else: + result = self.data + self.data = b'' + return result + + +# Given 'haystack', see if any prefix of 'needle' is at its end. This +# assumes an exact match has already been checked. Return the number of +# characters matched. +# for example: +# f_p_a_e("qwerty\r", "\r\n") => 1 +# f_p_a_e("qwertydkjf", "\r\n") => 0 +# f_p_a_e("qwerty\r\n", "\r\n") => + +# this could maybe be made faster with a computed regex? +# [answer: no; circa Python-2.0, Jan 2001] +# new python: 28961/s +# old python: 18307/s +# re: 12820/s +# regex: 14035/s + +def find_prefix_at_end(haystack, needle): + l = len(needle) - 1 + while l and not haystack.endswith(needle[:l]): + l -= 1 + return l diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/asyncore.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/asyncore.py new file mode 100644 index 0000000000000000000000000000000000000000..870e42837640deba4c85586f1f9879f7ca3e5b81 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/asyncore.py @@ -0,0 +1,649 @@ +# TODO: This module was deprecated and removed from CPython 3.12 +# Now it is a test-only helper. Any attempts to rewrite existing tests that +# are using this module and remove it completely are appreciated! +# See: https://github.com/python/cpython/issues/72719 + +# -*- Mode: Python -*- +# Id: asyncore.py,v 2.51 2000/09/07 22:29:26 rushing Exp +# Author: Sam Rushing + +# ====================================================================== +# Copyright 1996 by Sam Rushing +# +# All Rights Reserved +# +# Permission to use, copy, modify, and distribute this software and +# its documentation for any purpose and without fee is hereby +# granted, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name of Sam +# Rushing not be used in advertising or publicity pertaining to +# distribution of the software without specific, written prior +# permission. +# +# SAM RUSHING DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN +# NO EVENT SHALL SAM RUSHING BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +# OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# ====================================================================== + +"""Basic infrastructure for asynchronous socket service clients and servers. + +There are only two ways to have a program on a single processor do "more +than one thing at a time". Multi-threaded programming is the simplest and +most popular way to do it, but there is another very different technique, +that lets you have nearly all the advantages of multi-threading, without +actually using multiple threads. it's really only practical if your program +is largely I/O bound. If your program is CPU bound, then pre-emptive +scheduled threads are probably what you really need. Network servers are +rarely CPU-bound, however. + +If your operating system supports the select() system call in its I/O +library (and nearly all do), then you can use it to juggle multiple +communication channels at once; doing other work while your I/O is taking +place in the "background." Although this strategy can seem strange and +complex, especially at first, it is in many ways easier to understand and +control than multi-threaded programming. The module documented here solves +many of the difficult problems for you, making the task of building +sophisticated high-performance network servers and clients a snap. +""" + +import select +import socket +import sys +import time +import warnings + +import os +from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL, \ + ENOTCONN, ESHUTDOWN, EISCONN, EBADF, ECONNABORTED, EPIPE, EAGAIN, \ + errorcode + + +_DISCONNECTED = frozenset({ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED, EPIPE, + EBADF}) + +try: + socket_map +except NameError: + socket_map = {} + +def _strerror(err): + try: + return os.strerror(err) + except (ValueError, OverflowError, NameError): + if err in errorcode: + return errorcode[err] + return "Unknown error %s" %err + +class ExitNow(Exception): + pass + +_reraised_exceptions = (ExitNow, KeyboardInterrupt, SystemExit) + +def read(obj): + try: + obj.handle_read_event() + except _reraised_exceptions: + raise + except: + obj.handle_error() + +def write(obj): + try: + obj.handle_write_event() + except _reraised_exceptions: + raise + except: + obj.handle_error() + +def _exception(obj): + try: + obj.handle_expt_event() + except _reraised_exceptions: + raise + except: + obj.handle_error() + +def readwrite(obj, flags): + try: + if flags & select.POLLIN: + obj.handle_read_event() + if flags & select.POLLOUT: + obj.handle_write_event() + if flags & select.POLLPRI: + obj.handle_expt_event() + if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL): + obj.handle_close() + except OSError as e: + if e.errno not in _DISCONNECTED: + obj.handle_error() + else: + obj.handle_close() + except _reraised_exceptions: + raise + except: + obj.handle_error() + +def poll(timeout=0.0, map=None): + if map is None: + map = socket_map + if map: + r = []; w = []; e = [] + for fd, obj in list(map.items()): + is_r = obj.readable() + is_w = obj.writable() + if is_r: + r.append(fd) + # accepting sockets should not be writable + if is_w and not obj.accepting: + w.append(fd) + if is_r or is_w: + e.append(fd) + if [] == r == w == e: + time.sleep(timeout) + return + + r, w, e = select.select(r, w, e, timeout) + + for fd in r: + obj = map.get(fd) + if obj is None: + continue + read(obj) + + for fd in w: + obj = map.get(fd) + if obj is None: + continue + write(obj) + + for fd in e: + obj = map.get(fd) + if obj is None: + continue + _exception(obj) + +def poll2(timeout=0.0, map=None): + # Use the poll() support added to the select module in Python 2.0 + if map is None: + map = socket_map + if timeout is not None: + # timeout is in milliseconds + timeout = int(timeout*1000) + pollster = select.poll() + if map: + for fd, obj in list(map.items()): + flags = 0 + if obj.readable(): + flags |= select.POLLIN | select.POLLPRI + # accepting sockets should not be writable + if obj.writable() and not obj.accepting: + flags |= select.POLLOUT + if flags: + pollster.register(fd, flags) + + r = pollster.poll(timeout) + for fd, flags in r: + obj = map.get(fd) + if obj is None: + continue + readwrite(obj, flags) + +poll3 = poll2 # Alias for backward compatibility + +def loop(timeout=30.0, use_poll=False, map=None, count=None): + if map is None: + map = socket_map + + if use_poll and hasattr(select, 'poll'): + poll_fun = poll2 + else: + poll_fun = poll + + if count is None: + while map: + poll_fun(timeout, map) + + else: + while map and count > 0: + poll_fun(timeout, map) + count = count - 1 + +class dispatcher: + + debug = False + connected = False + accepting = False + connecting = False + closing = False + addr = None + ignore_log_types = frozenset({'warning'}) + + def __init__(self, sock=None, map=None): + if map is None: + self._map = socket_map + else: + self._map = map + + self._fileno = None + + if sock: + # Set to nonblocking just to make sure for cases where we + # get a socket from a blocking source. + sock.setblocking(False) + self.set_socket(sock, map) + self.connected = True + # The constructor no longer requires that the socket + # passed be connected. + try: + self.addr = sock.getpeername() + except OSError as err: + if err.errno in (ENOTCONN, EINVAL): + # To handle the case where we got an unconnected + # socket. + self.connected = False + else: + # The socket is broken in some unknown way, alert + # the user and remove it from the map (to prevent + # polling of broken sockets). + self.del_channel(map) + raise + else: + self.socket = None + + def __repr__(self): + status = [self.__class__.__module__+"."+self.__class__.__qualname__] + if self.accepting and self.addr: + status.append('listening') + elif self.connected: + status.append('connected') + if self.addr is not None: + try: + status.append('%s:%d' % self.addr) + except TypeError: + status.append(repr(self.addr)) + return '<%s at %#x>' % (' '.join(status), id(self)) + + def add_channel(self, map=None): + #self.log_info('adding channel %s' % self) + if map is None: + map = self._map + map[self._fileno] = self + + def del_channel(self, map=None): + fd = self._fileno + if map is None: + map = self._map + if fd in map: + #self.log_info('closing channel %d:%s' % (fd, self)) + del map[fd] + self._fileno = None + + def create_socket(self, family=socket.AF_INET, type=socket.SOCK_STREAM): + self.family_and_type = family, type + sock = socket.socket(family, type) + sock.setblocking(False) + self.set_socket(sock) + + def set_socket(self, sock, map=None): + self.socket = sock + self._fileno = sock.fileno() + self.add_channel(map) + + def set_reuse_addr(self): + # try to re-use a server port if possible + try: + self.socket.setsockopt( + socket.SOL_SOCKET, socket.SO_REUSEADDR, + self.socket.getsockopt(socket.SOL_SOCKET, + socket.SO_REUSEADDR) | 1 + ) + except OSError: + pass + + # ================================================== + # predicates for select() + # these are used as filters for the lists of sockets + # to pass to select(). + # ================================================== + + def readable(self): + return True + + def writable(self): + return True + + # ================================================== + # socket object methods. + # ================================================== + + def listen(self, num): + self.accepting = True + if os.name == 'nt' and num > 5: + num = 5 + return self.socket.listen(num) + + def bind(self, addr): + self.addr = addr + return self.socket.bind(addr) + + def connect(self, address): + self.connected = False + self.connecting = True + err = self.socket.connect_ex(address) + if err in (EINPROGRESS, EALREADY, EWOULDBLOCK) \ + or err == EINVAL and os.name == 'nt': + self.addr = address + return + if err in (0, EISCONN): + self.addr = address + self.handle_connect_event() + else: + raise OSError(err, errorcode[err]) + + def accept(self): + # XXX can return either an address pair or None + try: + conn, addr = self.socket.accept() + except TypeError: + return None + except OSError as why: + if why.errno in (EWOULDBLOCK, ECONNABORTED, EAGAIN): + return None + else: + raise + else: + return conn, addr + + def send(self, data): + try: + result = self.socket.send(data) + return result + except OSError as why: + if why.errno == EWOULDBLOCK: + return 0 + elif why.errno in _DISCONNECTED: + self.handle_close() + return 0 + else: + raise + + def recv(self, buffer_size): + try: + data = self.socket.recv(buffer_size) + if not data: + # a closed connection is indicated by signaling + # a read condition, and having recv() return 0. + self.handle_close() + return b'' + else: + return data + except OSError as why: + # winsock sometimes raises ENOTCONN + if why.errno in _DISCONNECTED: + self.handle_close() + return b'' + else: + raise + + def close(self): + self.connected = False + self.accepting = False + self.connecting = False + self.del_channel() + if self.socket is not None: + try: + self.socket.close() + except OSError as why: + if why.errno not in (ENOTCONN, EBADF): + raise + + # log and log_info may be overridden to provide more sophisticated + # logging and warning methods. In general, log is for 'hit' logging + # and 'log_info' is for informational, warning and error logging. + + def log(self, message): + sys.stderr.write('log: %s\n' % str(message)) + + def log_info(self, message, type='info'): + if type not in self.ignore_log_types: + print('%s: %s' % (type, message)) + + def handle_read_event(self): + if self.accepting: + # accepting sockets are never connected, they "spawn" new + # sockets that are connected + self.handle_accept() + elif not self.connected: + if self.connecting: + self.handle_connect_event() + self.handle_read() + else: + self.handle_read() + + def handle_connect_event(self): + err = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR) + if err != 0: + raise OSError(err, _strerror(err)) + self.handle_connect() + self.connected = True + self.connecting = False + + def handle_write_event(self): + if self.accepting: + # Accepting sockets shouldn't get a write event. + # We will pretend it didn't happen. + return + + if not self.connected: + if self.connecting: + self.handle_connect_event() + self.handle_write() + + def handle_expt_event(self): + # handle_expt_event() is called if there might be an error on the + # socket, or if there is OOB data + # check for the error condition first + err = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR) + if err != 0: + # we can get here when select.select() says that there is an + # exceptional condition on the socket + # since there is an error, we'll go ahead and close the socket + # like we would in a subclassed handle_read() that received no + # data + self.handle_close() + else: + self.handle_expt() + + def handle_error(self): + nil, t, v, tbinfo = compact_traceback() + + # sometimes a user repr method will crash. + try: + self_repr = repr(self) + except: + self_repr = '<__repr__(self) failed for object at %0x>' % id(self) + + self.log_info( + 'uncaptured python exception, closing channel %s (%s:%s %s)' % ( + self_repr, + t, + v, + tbinfo + ), + 'error' + ) + self.handle_close() + + def handle_expt(self): + self.log_info('unhandled incoming priority event', 'warning') + + def handle_read(self): + self.log_info('unhandled read event', 'warning') + + def handle_write(self): + self.log_info('unhandled write event', 'warning') + + def handle_connect(self): + self.log_info('unhandled connect event', 'warning') + + def handle_accept(self): + pair = self.accept() + if pair is not None: + self.handle_accepted(*pair) + + def handle_accepted(self, sock, addr): + sock.close() + self.log_info('unhandled accepted event', 'warning') + + def handle_close(self): + self.log_info('unhandled close event', 'warning') + self.close() + +# --------------------------------------------------------------------------- +# adds simple buffered output capability, useful for simple clients. +# [for more sophisticated usage use asynchat.async_chat] +# --------------------------------------------------------------------------- + +class dispatcher_with_send(dispatcher): + + def __init__(self, sock=None, map=None): + dispatcher.__init__(self, sock, map) + self.out_buffer = b'' + + def initiate_send(self): + num_sent = 0 + num_sent = dispatcher.send(self, self.out_buffer[:65536]) + self.out_buffer = self.out_buffer[num_sent:] + + def handle_write(self): + self.initiate_send() + + def writable(self): + return (not self.connected) or len(self.out_buffer) + + def send(self, data): + if self.debug: + self.log_info('sending %s' % repr(data)) + self.out_buffer = self.out_buffer + data + self.initiate_send() + +# --------------------------------------------------------------------------- +# used for debugging. +# --------------------------------------------------------------------------- + +def compact_traceback(): + exc = sys.exception() + tb = exc.__traceback__ + if not tb: # Must have a traceback + raise AssertionError("traceback does not exist") + tbinfo = [] + while tb: + tbinfo.append(( + tb.tb_frame.f_code.co_filename, + tb.tb_frame.f_code.co_name, + str(tb.tb_lineno) + )) + tb = tb.tb_next + + # just to be safe + del tb + + file, function, line = tbinfo[-1] + info = ' '.join(['[%s|%s|%s]' % x for x in tbinfo]) + return (file, function, line), type(exc), exc, info + +def close_all(map=None, ignore_all=False): + if map is None: + map = socket_map + for x in list(map.values()): + try: + x.close() + except OSError as x: + if x.errno == EBADF: + pass + elif not ignore_all: + raise + except _reraised_exceptions: + raise + except: + if not ignore_all: + raise + map.clear() + +# Asynchronous File I/O: +# +# After a little research (reading man pages on various unixen, and +# digging through the linux kernel), I've determined that select() +# isn't meant for doing asynchronous file i/o. +# Heartening, though - reading linux/mm/filemap.c shows that linux +# supports asynchronous read-ahead. So _MOST_ of the time, the data +# will be sitting in memory for us already when we go to read it. +# +# What other OS's (besides NT) support async file i/o? [VMS?] +# +# Regardless, this is useful for pipes, and stdin/stdout... + +if os.name == 'posix': + class file_wrapper: + # Here we override just enough to make a file + # look like a socket for the purposes of asyncore. + # The passed fd is automatically os.dup()'d + + def __init__(self, fd): + self.fd = os.dup(fd) + + def __del__(self): + if self.fd >= 0: + warnings.warn("unclosed file %r" % self, ResourceWarning, + source=self) + self.close() + + def recv(self, *args): + return os.read(self.fd, *args) + + def send(self, *args): + return os.write(self.fd, *args) + + def getsockopt(self, level, optname, buflen=None): + if (level == socket.SOL_SOCKET and + optname == socket.SO_ERROR and + not buflen): + return 0 + raise NotImplementedError("Only asyncore specific behaviour " + "implemented.") + + read = recv + write = send + + def close(self): + if self.fd < 0: + return + fd = self.fd + self.fd = -1 + os.close(fd) + + def fileno(self): + return self.fd + + class file_dispatcher(dispatcher): + + def __init__(self, fd, map=None): + dispatcher.__init__(self, None, map) + self.connected = True + try: + fd = fd.fileno() + except AttributeError: + pass + self.set_file(fd) + # set it to non-blocking mode + os.set_blocking(fd, False) + + def set_file(self, fd): + self.socket = file_wrapper(fd) + self._fileno = self.socket.fileno() + self.add_channel() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/bytecode_helper.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/bytecode_helper.py new file mode 100644 index 0000000000000000000000000000000000000000..f6426c3e285b2d930fa7f45636aa3346472919f4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/bytecode_helper.py @@ -0,0 +1,158 @@ +"""bytecode_helper - support tools for testing correct bytecode generation""" + +import unittest +import dis +import io +import opcode +try: + import _testinternalcapi +except ImportError: + _testinternalcapi = None + +_UNSPECIFIED = object() + +def instructions_with_positions(instrs, co_positions): + # Return (instr, positions) pairs from the instrs list and co_positions + # iterator. The latter contains items for cache lines and the former + # doesn't, so those need to be skipped. + + co_positions = co_positions or iter(()) + for instr in instrs: + yield instr, next(co_positions, ()) + for _, size, _ in (instr.cache_info or ()): + for i in range(size): + next(co_positions, ()) + +class BytecodeTestCase(unittest.TestCase): + """Custom assertion methods for inspecting bytecode.""" + + def get_disassembly_as_string(self, co): + s = io.StringIO() + dis.dis(co, file=s) + return s.getvalue() + + def assertInBytecode(self, x, opname, argval=_UNSPECIFIED): + """Returns instr if opname is found, otherwise throws AssertionError""" + self.assertIn(opname, dis.opmap) + for instr in dis.get_instructions(x): + if instr.opname == opname: + if argval is _UNSPECIFIED or instr.argval == argval: + return instr + disassembly = self.get_disassembly_as_string(x) + if argval is _UNSPECIFIED: + msg = '%s not found in bytecode:\n%s' % (opname, disassembly) + else: + msg = '(%s,%r) not found in bytecode:\n%s' + msg = msg % (opname, argval, disassembly) + self.fail(msg) + + def assertNotInBytecode(self, x, opname, argval=_UNSPECIFIED): + """Throws AssertionError if opname is found""" + self.assertIn(opname, dis.opmap) + for instr in dis.get_instructions(x): + if instr.opname == opname: + disassembly = self.get_disassembly_as_string(x) + if argval is _UNSPECIFIED: + msg = '%s occurs in bytecode:\n%s' % (opname, disassembly) + self.fail(msg) + elif instr.argval == argval: + msg = '(%s,%r) occurs in bytecode:\n%s' + msg = msg % (opname, argval, disassembly) + self.fail(msg) + +class CompilationStepTestCase(unittest.TestCase): + + HAS_ARG = set(dis.hasarg) + HAS_TARGET = set(dis.hasjrel + dis.hasjabs + dis.hasexc) + HAS_ARG_OR_TARGET = HAS_ARG.union(HAS_TARGET) + + class Label: + pass + + def assertInstructionsMatch(self, actual_seq, expected): + # get an InstructionSequence and an expected list, where each + # entry is a label or an instruction tuple. Construct an expected + # instruction sequence and compare with the one given. + + self.assertIsInstance(expected, list) + actual = actual_seq.get_instructions() + expected = self.seq_from_insts(expected).get_instructions() + self.assertEqual(len(actual), len(expected)) + + # compare instructions + for act, exp in zip(actual, expected): + if isinstance(act, int): + self.assertEqual(exp, act) + continue + self.assertIsInstance(exp, tuple) + self.assertIsInstance(act, tuple) + idx = max([p[0] for p in enumerate(exp) if p[1] != -1]) + self.assertEqual(exp[:idx], act[:idx]) + + def resolveAndRemoveLabels(self, insts): + idx = 0 + res = [] + for item in insts: + assert isinstance(item, (self.Label, tuple)) + if isinstance(item, self.Label): + item.value = idx + else: + idx += 1 + res.append(item) + + return res + + def seq_from_insts(self, insts): + labels = {item for item in insts if isinstance(item, self.Label)} + for i, lbl in enumerate(labels): + lbl.value = i + + seq = _testinternalcapi.new_instruction_sequence() + for item in insts: + if isinstance(item, self.Label): + seq.use_label(item.value) + else: + op = item[0] + if isinstance(op, str): + op = opcode.opmap[op] + arg, *loc = item[1:] + if isinstance(arg, self.Label): + arg = arg.value + loc = loc + [-1] * (4 - len(loc)) + seq.addop(op, arg or 0, *loc) + return seq + + def check_instructions(self, insts): + for inst in insts: + if isinstance(inst, self.Label): + continue + op, arg, *loc = inst + if isinstance(op, str): + op = opcode.opmap[op] + self.assertEqual(op in opcode.hasarg, + arg is not None, + f"{opcode.opname[op]=} {arg=}") + self.assertTrue(all(isinstance(l, int) for l in loc)) + + +@unittest.skipIf(_testinternalcapi is None, "requires _testinternalcapi") +class CodegenTestCase(CompilationStepTestCase): + + def generate_code(self, ast): + insts, _ = _testinternalcapi.compiler_codegen(ast, "my_file.py", 0) + return insts + + +@unittest.skipIf(_testinternalcapi is None, "requires _testinternalcapi") +class CfgOptimizationTestCase(CompilationStepTestCase): + + def get_optimized(self, seq, consts, nlocals=0): + insts = _testinternalcapi.optimize_cfg(seq, consts, nlocals) + return insts, consts + +@unittest.skipIf(_testinternalcapi is None, "requires _testinternalcapi") +class AssemblerTestCase(CompilationStepTestCase): + + def get_code_object(self, filename, insts, metadata): + co = _testinternalcapi.assemble_code_object(filename, insts, metadata) + return co diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/channels.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/channels.py new file mode 100644 index 0000000000000000000000000000000000000000..5352f7d4da3af0f505a718d95dc02753d37c3ea4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/channels.py @@ -0,0 +1,278 @@ +"""Cross-interpreter Channels High Level Module.""" + +import time +import _interpchannels as _channels +from concurrent.interpreters import _crossinterp + +# aliases: +from _interpchannels import ( + ChannelError, ChannelNotFoundError, ChannelClosedError, + ChannelEmptyError, ChannelNotEmptyError, +) +from concurrent.interpreters._crossinterp import ( + UNBOUND_ERROR, UNBOUND_REMOVE, +) + + +__all__ = [ + 'UNBOUND', 'UNBOUND_ERROR', 'UNBOUND_REMOVE', + 'create', 'list_all', + 'SendChannel', 'RecvChannel', + 'ChannelError', 'ChannelNotFoundError', 'ChannelEmptyError', + 'ItemInterpreterDestroyed', +] + + +class ItemInterpreterDestroyed(ChannelError, + _crossinterp.ItemInterpreterDestroyed): + """Raised from get() and get_nowait().""" + + +UNBOUND = _crossinterp.UnboundItem.singleton('queue', __name__) + + +def _serialize_unbound(unbound): + if unbound is UNBOUND: + unbound = _crossinterp.UNBOUND + return _crossinterp.serialize_unbound(unbound) + + +def _resolve_unbound(flag): + resolved = _crossinterp.resolve_unbound(flag, ItemInterpreterDestroyed) + if resolved is _crossinterp.UNBOUND: + resolved = UNBOUND + return resolved + + +def create(*, unbounditems=UNBOUND): + """Return (recv, send) for a new cross-interpreter channel. + + The channel may be used to pass data safely between interpreters. + + "unbounditems" sets the default for the send end of the channel. + See SendChannel.send() for supported values. The default value + is UNBOUND, which replaces the unbound item when received. + """ + unbound = _serialize_unbound(unbounditems) + unboundop, = unbound + cid = _channels.create(unboundop, -1) + recv, send = RecvChannel(cid), SendChannel(cid) + send._set_unbound(unboundop, unbounditems) + return recv, send + + +def list_all(): + """Return a list of (recv, send) for all open channels.""" + channels = [] + for cid, unboundop, _ in _channels.list_all(): + chan = _, send = RecvChannel(cid), SendChannel(cid) + if not hasattr(send, '_unboundop'): + send._set_unbound(unboundop) + else: + assert send._unbound[0] == unboundop + channels.append(chan) + return channels + + +class _ChannelEnd: + """The base class for RecvChannel and SendChannel.""" + + _end = None + + def __new__(cls, cid): + self = super().__new__(cls) + if self._end == 'send': + cid = _channels._channel_id(cid, send=True, force=True) + elif self._end == 'recv': + cid = _channels._channel_id(cid, recv=True, force=True) + else: + raise NotImplementedError(self._end) + self._id = cid + return self + + def __repr__(self): + return f'{type(self).__name__}(id={int(self._id)})' + + def __hash__(self): + return hash(self._id) + + def __eq__(self, other): + if isinstance(self, RecvChannel): + if not isinstance(other, RecvChannel): + return NotImplemented + elif not isinstance(other, SendChannel): + return NotImplemented + return other._id == self._id + + # for pickling: + def __reduce__(self): + return (type(self), (int(self._id),)) + + @property + def id(self): + return self._id + + @property + def _info(self): + return _channels.get_info(self._id) + + @property + def is_closed(self): + return self._info.closed + + +_NOT_SET = object() + + +class RecvChannel(_ChannelEnd): + """The receiving end of a cross-interpreter channel.""" + + _end = 'recv' + + def recv(self, timeout=None, *, + _sentinel=object(), + _delay=10 / 1000, # 10 milliseconds + ): + """Return the next object from the channel. + + This blocks until an object has been sent, if none have been + sent already. + """ + if timeout is not None: + timeout = int(timeout) + if timeout < 0: + raise ValueError(f'timeout value must be non-negative') + end = time.time() + timeout + obj, unboundop = _channels.recv(self._id, _sentinel) + while obj is _sentinel: + time.sleep(_delay) + if timeout is not None and time.time() >= end: + raise TimeoutError + obj, unboundop = _channels.recv(self._id, _sentinel) + if unboundop is not None: + assert obj is None, repr(obj) + return _resolve_unbound(unboundop) + return obj + + def recv_nowait(self, default=_NOT_SET): + """Return the next object from the channel. + + If none have been sent then return the default if one + is provided or fail with ChannelEmptyError. Otherwise this + is the same as recv(). + """ + if default is _NOT_SET: + obj, unboundop = _channels.recv(self._id) + else: + obj, unboundop = _channels.recv(self._id, default) + if unboundop is not None: + assert obj is None, repr(obj) + return _resolve_unbound(unboundop) + return obj + + def close(self): + _channels.close(self._id, recv=True) + + +class SendChannel(_ChannelEnd): + """The sending end of a cross-interpreter channel.""" + + _end = 'send' + +# def __new__(cls, cid, *, _unbound=None): +# if _unbound is None: +# try: +# op = _channels.get_channel_defaults(cid) +# _unbound = (op,) +# except ChannelNotFoundError: +# _unbound = _serialize_unbound(UNBOUND) +# self = super().__new__(cls, cid) +# self._unbound = _unbound +# return self + + def _set_unbound(self, op, items=None): + assert not hasattr(self, '_unbound') + if items is None: + items = _resolve_unbound(op) + unbound = (op, items) + self._unbound = unbound + return unbound + + @property + def unbounditems(self): + try: + _, items = self._unbound + except AttributeError: + op, _ = _channels.get_queue_defaults(self._id) + _, items = self._set_unbound(op) + return items + + @property + def is_closed(self): + info = self._info + return info.closed or info.closing + + def send(self, obj, timeout=None, *, + unbounditems=None, + ): + """Send the object (i.e. its data) to the channel's receiving end. + + This blocks until the object is received. + """ + if unbounditems is None: + unboundop = -1 + else: + unboundop, = _serialize_unbound(unbounditems) + _channels.send(self._id, obj, unboundop, timeout=timeout, blocking=True) + + def send_nowait(self, obj, *, + unbounditems=None, + ): + """Send the object to the channel's receiving end. + + If the object is immediately received then return True + (else False). Otherwise this is the same as send(). + """ + if unbounditems is None: + unboundop = -1 + else: + unboundop, = _serialize_unbound(unbounditems) + # XXX Note that at the moment channel_send() only ever returns + # None. This should be fixed when channel_send_wait() is added. + # See bpo-32604 and gh-19829. + return _channels.send(self._id, obj, unboundop, blocking=False) + + def send_buffer(self, obj, timeout=None, *, + unbounditems=None, + ): + """Send the object's buffer to the channel's receiving end. + + This blocks until the object is received. + """ + if unbounditems is None: + unboundop = -1 + else: + unboundop, = _serialize_unbound(unbounditems) + _channels.send_buffer(self._id, obj, unboundop, + timeout=timeout, blocking=True) + + def send_buffer_nowait(self, obj, *, + unbounditems=None, + ): + """Send the object's buffer to the channel's receiving end. + + If the object is immediately received then return True + (else False). Otherwise this is the same as send(). + """ + if unbounditems is None: + unboundop = -1 + else: + unboundop, = _serialize_unbound(unbounditems) + return _channels.send_buffer(self._id, obj, unboundop, blocking=False) + + def close(self): + _channels.close(self._id, send=True) + + +# XXX This is causing leaks (gh-110318): +_channels._register_end_types(SendChannel, RecvChannel) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/hashlib_helper.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/hashlib_helper.py new file mode 100644 index 0000000000000000000000000000000000000000..7032257b06877a62f48ab1a674a2e7b6fc3d70df --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/hashlib_helper.py @@ -0,0 +1,329 @@ +import functools +import hashlib +import importlib +import unittest +from test.support.import_helper import import_module + +try: + import _hashlib +except ImportError: + _hashlib = None + +try: + import _hmac +except ImportError: + _hmac = None + + +def requires_hashlib(): + return unittest.skipIf(_hashlib is None, "requires _hashlib") + + +def requires_builtin_hmac(): + return unittest.skipIf(_hmac is None, "requires _hmac") + + +def _missing_hash(digestname, implementation=None, *, exc=None): + parts = ["missing", implementation, f"hash algorithm: {digestname!r}"] + msg = " ".join(filter(None, parts)) + raise unittest.SkipTest(msg) from exc + + +def _openssl_availabillity(digestname, *, usedforsecurity): + try: + _hashlib.new(digestname, usedforsecurity=usedforsecurity) + except AttributeError: + assert _hashlib is None + _missing_hash(digestname, "OpenSSL") + except ValueError as exc: + _missing_hash(digestname, "OpenSSL", exc=exc) + + +def _decorate_func_or_class(func_or_class, decorator_func): + if not isinstance(func_or_class, type): + return decorator_func(func_or_class) + + decorated_class = func_or_class + setUpClass = decorated_class.__dict__.get('setUpClass') + if setUpClass is None: + def setUpClass(cls): + super(decorated_class, cls).setUpClass() + setUpClass.__qualname__ = decorated_class.__qualname__ + '.setUpClass' + setUpClass.__module__ = decorated_class.__module__ + else: + setUpClass = setUpClass.__func__ + setUpClass = classmethod(decorator_func(setUpClass)) + decorated_class.setUpClass = setUpClass + return decorated_class + + +def requires_hashdigest(digestname, openssl=None, usedforsecurity=True): + """Decorator raising SkipTest if a hashing algorithm is not available. + + The hashing algorithm may be missing, blocked by a strict crypto policy, + or Python may be configured with `--with-builtin-hashlib-hashes=no`. + + If 'openssl' is True, then the decorator checks that OpenSSL provides + the algorithm. Otherwise the check falls back to (optional) built-in + HACL* implementations. + + The usedforsecurity flag is passed to the constructor but has no effect + on HACL* implementations. + + Examples of exceptions being suppressed: + ValueError: [digital envelope routines: EVP_DigestInit_ex] disabled for FIPS + ValueError: unsupported hash type md4 + """ + if openssl and _hashlib is not None: + def test_availability(): + _hashlib.new(digestname, usedforsecurity=usedforsecurity) + else: + def test_availability(): + hashlib.new(digestname, usedforsecurity=usedforsecurity) + + def decorator_func(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + try: + test_availability() + except ValueError as exc: + _missing_hash(digestname, exc=exc) + return func(*args, **kwargs) + return wrapper + + def decorator(func_or_class): + return _decorate_func_or_class(func_or_class, decorator_func) + return decorator + + +def requires_openssl_hashdigest(digestname, *, usedforsecurity=True): + """Decorator raising SkipTest if an OpenSSL hashing algorithm is missing. + + The hashing algorithm may be missing or blocked by a strict crypto policy. + """ + def decorator_func(func): + @requires_hashlib() # avoid checking at each call + @functools.wraps(func) + def wrapper(*args, **kwargs): + _openssl_availabillity(digestname, usedforsecurity=usedforsecurity) + return func(*args, **kwargs) + return wrapper + + def decorator(func_or_class): + return _decorate_func_or_class(func_or_class, decorator_func) + return decorator + + +def find_openssl_hashdigest_constructor(digestname, *, usedforsecurity=True): + """Find the OpenSSL hash function constructor by its name.""" + assert isinstance(digestname, str), digestname + _openssl_availabillity(digestname, usedforsecurity=usedforsecurity) + # This returns a function of the form _hashlib.openssl_ and + # not a lambda function as it is rejected by _hashlib.hmac_new(). + return getattr(_hashlib, f"openssl_{digestname}") + + +def requires_builtin_hashdigest( + module_name, digestname, *, usedforsecurity=True +): + """Decorator raising SkipTest if a HACL* hashing algorithm is missing. + + - The *module_name* is the C extension module name based on HACL*. + - The *digestname* is one of its member, e.g., 'md5'. + """ + def decorator_func(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + module = import_module(module_name) + try: + getattr(module, digestname) + except AttributeError: + fullname = f'{module_name}.{digestname}' + _missing_hash(fullname, implementation="HACL") + return func(*args, **kwargs) + return wrapper + + def decorator(func_or_class): + return _decorate_func_or_class(func_or_class, decorator_func) + return decorator + + +def find_builtin_hashdigest_constructor( + module_name, digestname, *, usedforsecurity=True +): + """Find the HACL* hash function constructor. + + - The *module_name* is the C extension module name based on HACL*. + - The *digestname* is one of its member, e.g., 'md5'. + """ + module = import_module(module_name) + try: + constructor = getattr(module, digestname) + constructor(b'', usedforsecurity=usedforsecurity) + except (AttributeError, TypeError, ValueError): + _missing_hash(f'{module_name}.{digestname}', implementation="HACL") + return constructor + + +class HashFunctionsTrait: + """Mixin trait class containing hash functions. + + This class is assumed to have all unitest.TestCase methods but should + not directly inherit from it to prevent the test suite being run on it. + + Subclasses should implement the hash functions by returning an object + that can be recognized as a valid digestmod parameter for both hashlib + and HMAC. In particular, it cannot be a lambda function as it will not + be recognized by hashlib (it will still be accepted by the pure Python + implementation of HMAC). + """ + + ALGORITHMS = [ + 'md5', 'sha1', + 'sha224', 'sha256', 'sha384', 'sha512', + 'sha3_224', 'sha3_256', 'sha3_384', 'sha3_512', + ] + + # Default 'usedforsecurity' to use when looking up a hash function. + usedforsecurity = True + + def _find_constructor(self, name): + # By default, a missing algorithm skips the test that uses it. + self.assertIn(name, self.ALGORITHMS) + self.skipTest(f"missing hash function: {name}") + + @property + def md5(self): + return self._find_constructor("md5") + + @property + def sha1(self): + return self._find_constructor("sha1") + + @property + def sha224(self): + return self._find_constructor("sha224") + + @property + def sha256(self): + return self._find_constructor("sha256") + + @property + def sha384(self): + return self._find_constructor("sha384") + + @property + def sha512(self): + return self._find_constructor("sha512") + + @property + def sha3_224(self): + return self._find_constructor("sha3_224") + + @property + def sha3_256(self): + return self._find_constructor("sha3_256") + + @property + def sha3_384(self): + return self._find_constructor("sha3_384") + + @property + def sha3_512(self): + return self._find_constructor("sha3_512") + + +class NamedHashFunctionsTrait(HashFunctionsTrait): + """Trait containing named hash functions. + + Hash functions are available if and only if they are available in hashlib. + """ + + def _find_constructor(self, name): + self.assertIn(name, self.ALGORITHMS) + return name + + +class OpenSSLHashFunctionsTrait(HashFunctionsTrait): + """Trait containing OpenSSL hash functions. + + Hash functions are available if and only if they are available in _hashlib. + """ + + def _find_constructor(self, name): + self.assertIn(name, self.ALGORITHMS) + return find_openssl_hashdigest_constructor( + name, usedforsecurity=self.usedforsecurity + ) + + +class BuiltinHashFunctionsTrait(HashFunctionsTrait): + """Trait containing HACL* hash functions. + + Hash functions are available if and only if they are available in C. + In particular, HACL* HMAC-MD5 may be available even though HACL* md5 + is not since the former is unconditionally built. + """ + + def _find_constructor_in(self, module, name): + self.assertIn(name, self.ALGORITHMS) + return find_builtin_hashdigest_constructor(module, name) + + @property + def md5(self): + return self._find_constructor_in("_md5", "md5") + + @property + def sha1(self): + return self._find_constructor_in("_sha1", "sha1") + + @property + def sha224(self): + return self._find_constructor_in("_sha2", "sha224") + + @property + def sha256(self): + return self._find_constructor_in("_sha2", "sha256") + + @property + def sha384(self): + return self._find_constructor_in("_sha2", "sha384") + + @property + def sha512(self): + return self._find_constructor_in("_sha2", "sha512") + + @property + def sha3_224(self): + return self._find_constructor_in("_sha3", "sha3_224") + + @property + def sha3_256(self): + return self._find_constructor_in("_sha3","sha3_256") + + @property + def sha3_384(self): + return self._find_constructor_in("_sha3","sha3_384") + + @property + def sha3_512(self): + return self._find_constructor_in("_sha3","sha3_512") + + +def find_gil_minsize(modules_names, default=2048): + """Get the largest GIL_MINSIZE value for the given cryptographic modules. + + The valid module names are the following: + + - _hashlib + - _md5, _sha1, _sha2, _sha3, _blake2 + - _hmac + """ + sizes = [] + for module_name in modules_names: + try: + module = importlib.import_module(module_name) + except ImportError: + continue + sizes.append(getattr(module, '_GIL_MINSIZE', default)) + return max(sizes, default=default) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/hypothesis_helper.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/hypothesis_helper.py new file mode 100644 index 0000000000000000000000000000000000000000..a99a4963ffecc94733d008f28353151056029634 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/hypothesis_helper.py @@ -0,0 +1,53 @@ +import os + +try: + import hypothesis +except ImportError: + from . import _hypothesis_stubs as hypothesis +else: + # Regrtest changes to use a tempdir as the working directory, so we have + # to tell Hypothesis to use the original in order to persist the database. + from test.support import has_socket_support + from test.support.os_helper import SAVEDCWD + from hypothesis.configuration import set_hypothesis_home_dir + + set_hypothesis_home_dir(os.path.join(SAVEDCWD, ".hypothesis")) + + # When using the real Hypothesis, we'll configure it to ignore occasional + # slow tests (avoiding flakiness from random VM slowness in CI). + hypothesis.settings.register_profile( + "slow-is-ok", + deadline=None, + suppress_health_check=[ + hypothesis.HealthCheck.too_slow, + hypothesis.HealthCheck.differing_executors, + ], + ) + hypothesis.settings.load_profile("slow-is-ok") + + # For local development, we'll write to the default on-local-disk database + # of failing examples, and also use a pull-through cache to automatically + # replay any failing examples discovered in CI. For details on how this + # works, see https://hypothesis.readthedocs.io/en/latest/database.html + # We only do that if a GITHUB_TOKEN env var is provided, see: + # https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens + # And Python is built with socket support: + if ( + has_socket_support + and "CI" not in os.environ + and "GITHUB_TOKEN" in os.environ + ): + from hypothesis.database import ( + GitHubArtifactDatabase, + MultiplexedDatabase, + ReadOnlyDatabase, + ) + + hypothesis.settings.register_profile( + "cpython-local-dev", + database=MultiplexedDatabase( + hypothesis.settings.default.database, + ReadOnlyDatabase(GitHubArtifactDatabase("python", "cpython")), + ), + ) + hypothesis.settings.load_profile("cpython-local-dev") diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/i18n_helper.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/i18n_helper.py new file mode 100644 index 0000000000000000000000000000000000000000..2e304f29e8ba7fdf07c0725ce762ae3118685fe3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/i18n_helper.py @@ -0,0 +1,63 @@ +import re +import subprocess +import sys +import unittest +from pathlib import Path +from test.support import REPO_ROOT, TEST_HOME_DIR, requires_subprocess +from test.test_tools import skip_if_missing + + +pygettext = Path(REPO_ROOT) / 'Tools' / 'i18n' / 'pygettext.py' + +msgid_pattern = re.compile(r'msgid(.*?)(?:msgid_plural|msgctxt|msgstr)', + re.DOTALL) +msgid_string_pattern = re.compile(r'"((?:\\"|[^"])*)"') + + +def _generate_po_file(path, *, stdout_only=True): + res = subprocess.run([sys.executable, pygettext, + '--no-location', '-o', '-', path], + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + text=True) + if stdout_only: + return res.stdout + return res + + +def _extract_msgids(po): + msgids = [] + for msgid in msgid_pattern.findall(po): + msgid_string = ''.join(msgid_string_pattern.findall(msgid)) + msgid_string = msgid_string.replace(r'\"', '"') + if msgid_string: + msgids.append(msgid_string) + return sorted(msgids) + + +def _get_snapshot_path(module_name): + return Path(TEST_HOME_DIR) / 'translationdata' / module_name / 'msgids.txt' + + +@requires_subprocess() +class TestTranslationsBase(unittest.TestCase): + + def assertMsgidsEqual(self, module): + '''Assert that msgids extracted from a given module match a + snapshot. + + ''' + skip_if_missing('i18n') + res = _generate_po_file(module.__file__, stdout_only=False) + self.assertEqual(res.returncode, 0) + self.assertEqual(res.stderr, '') + msgids = _extract_msgids(res.stdout) + snapshot_path = _get_snapshot_path(module.__name__) + snapshot = snapshot_path.read_text().splitlines() + self.assertListEqual(msgids, snapshot) + + +def update_translation_snapshots(module): + contents = _generate_po_file(module.__file__) + msgids = _extract_msgids(contents) + snapshot_path = _get_snapshot_path(module.__name__) + snapshot_path.write_text('\n'.join(msgids)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/import_helper.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/import_helper.py new file mode 100644 index 0000000000000000000000000000000000000000..4c7eac0b7eb674f508fe40e8ad1e0f2b184fa533 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/import_helper.py @@ -0,0 +1,442 @@ +import contextlib +import _imp +import importlib +import importlib.machinery +import importlib.util +import os +import shutil +import sys +import textwrap +import unittest +import warnings + +from .os_helper import unlink, temp_dir + + +@contextlib.contextmanager +def _ignore_deprecated_imports(ignore=True): + """Context manager to suppress package and module deprecation + warnings when importing them. + + If ignore is False, this context manager has no effect. + """ + if ignore: + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", ".+ (module|package)", + DeprecationWarning) + yield + else: + yield + + +def unload(name): + try: + del sys.modules[name] + except KeyError: + pass + + +def forget(modname): + """'Forget' a module was ever imported. + + This removes the module from sys.modules and deletes any PEP 3147/488 or + legacy .pyc files. + """ + unload(modname) + for dirname in sys.path: + source = os.path.join(dirname, modname + '.py') + # It doesn't matter if they exist or not, unlink all possible + # combinations of PEP 3147/488 and legacy pyc files. + unlink(source + 'c') + for opt in ('', 1, 2): + unlink(importlib.util.cache_from_source(source, optimization=opt)) + + +def make_legacy_pyc(source): + """Move a PEP 3147/488 pyc file to its legacy pyc location. + + :param source: The file system path to the source file. The source file + does not need to exist, however the PEP 3147/488 pyc file must exist. + :return: The file system path to the legacy pyc file. + """ + pyc_file = importlib.util.cache_from_source(source) + assert source.endswith('.py') + legacy_pyc = source + 'c' + shutil.move(pyc_file, legacy_pyc) + return legacy_pyc + + +def import_module(name, deprecated=False, *, required_on=()): + """Import and return the module to be tested, raising SkipTest if + it is not available. + + If deprecated is True, any module or package deprecation messages + will be suppressed. If a module is required on a platform but optional for + others, set required_on to an iterable of platform prefixes which will be + compared against sys.platform. + """ + with _ignore_deprecated_imports(deprecated): + try: + return importlib.import_module(name) + except ImportError as msg: + if sys.platform.startswith(tuple(required_on)): + raise + raise unittest.SkipTest(str(msg)) + + +def _save_and_remove_modules(names): + orig_modules = {} + prefixes = tuple(name + '.' for name in names) + for modname in list(sys.modules): + if modname in names or modname.startswith(prefixes): + orig_modules[modname] = sys.modules.pop(modname) + return orig_modules + + +@contextlib.contextmanager +def frozen_modules(enabled=True): + """Force frozen modules to be used (or not). + + This only applies to modules that haven't been imported yet. + Also, some essential modules will always be imported frozen. + """ + _imp._override_frozen_modules_for_tests(1 if enabled else -1) + try: + yield + finally: + _imp._override_frozen_modules_for_tests(0) + + +@contextlib.contextmanager +def multi_interp_extensions_check(enabled=True): + """Force legacy modules to be allowed in subinterpreters (or not). + + ("legacy" == single-phase init) + + This only applies to modules that haven't been imported yet. + It overrides the PyInterpreterConfig.check_multi_interp_extensions + setting (see support.run_in_subinterp_with_config() and + _interpreters.create()). + + Also see importlib.utils.allowing_all_extensions(). + """ + old = _imp._override_multi_interp_extensions_check(1 if enabled else -1) + try: + yield + finally: + _imp._override_multi_interp_extensions_check(old) + + +def import_fresh_module(name, fresh=(), blocked=(), *, + deprecated=False, + usefrozen=False, + ): + """Import and return a module, deliberately bypassing sys.modules. + + This function imports and returns a fresh copy of the named Python module + by removing the named module from sys.modules before doing the import. + Note that unlike reload, the original module is not affected by + this operation. + + *fresh* is an iterable of additional module names that are also removed + from the sys.modules cache before doing the import. If one of these + modules can't be imported, None is returned. + + *blocked* is an iterable of module names that are replaced with None + in the module cache during the import to ensure that attempts to import + them raise ImportError. + + The named module and any modules named in the *fresh* and *blocked* + parameters are saved before starting the import and then reinserted into + sys.modules when the fresh import is complete. + + Module and package deprecation messages are suppressed during this import + if *deprecated* is True. + + This function will raise ImportError if the named module cannot be + imported. + + If "usefrozen" is False (the default) then the frozen importer is + disabled (except for essential modules like importlib._bootstrap). + """ + # NOTE: test_heapq, test_json and test_warnings include extra sanity checks + # to make sure that this utility function is working as expected + with _ignore_deprecated_imports(deprecated): + # Keep track of modules saved for later restoration as well + # as those which just need a blocking entry removed + fresh = list(fresh) + blocked = list(blocked) + names = {name, *fresh, *blocked} + orig_modules = _save_and_remove_modules(names) + for modname in blocked: + sys.modules[modname] = None + + try: + with frozen_modules(usefrozen): + # Return None when one of the "fresh" modules can not be imported. + try: + for modname in fresh: + __import__(modname) + except ImportError: + return None + return importlib.import_module(name) + finally: + _save_and_remove_modules(names) + sys.modules.update(orig_modules) + + +class CleanImport(object): + """Context manager to force import to return a new module reference. + + This is useful for testing module-level behaviours, such as + the emission of a DeprecationWarning on import. + + Use like this: + + with CleanImport("foo"): + importlib.import_module("foo") # new reference + + If "usefrozen" is False (the default) then the frozen importer is + disabled (except for essential modules like importlib._bootstrap). + """ + + def __init__(self, *module_names, usefrozen=False): + self.original_modules = sys.modules.copy() + for module_name in module_names: + if module_name in sys.modules: + module = sys.modules[module_name] + # It is possible that module_name is just an alias for + # another module (e.g. stub for modules renamed in 3.x). + # In that case, we also need delete the real module to clear + # the import cache. + if module.__name__ != module_name: + del sys.modules[module.__name__] + del sys.modules[module_name] + self._frozen_modules = frozen_modules(usefrozen) + + def __enter__(self): + self._frozen_modules.__enter__() + return self + + def __exit__(self, *ignore_exc): + sys.modules.update(self.original_modules) + self._frozen_modules.__exit__(*ignore_exc) + + +class DirsOnSysPath(object): + """Context manager to temporarily add directories to sys.path. + + This makes a copy of sys.path, appends any directories given + as positional arguments, then reverts sys.path to the copied + settings when the context ends. + + Note that *all* sys.path modifications in the body of the + context manager, including replacement of the object, + will be reverted at the end of the block. + """ + + def __init__(self, *paths): + self.original_value = sys.path[:] + self.original_object = sys.path + sys.path.extend(paths) + + def __enter__(self): + return self + + def __exit__(self, *ignore_exc): + sys.path = self.original_object + sys.path[:] = self.original_value + + +def modules_setup(): + return sys.modules.copy(), + + +def modules_cleanup(oldmodules): + # Encoders/decoders are registered permanently within the internal + # codec cache. If we destroy the corresponding modules their + # globals will be set to None which will trip up the cached functions. + encodings = [(k, v) for k, v in sys.modules.items() + if k.startswith('encodings.')] + sys.modules.clear() + sys.modules.update(encodings) + # XXX: This kind of problem can affect more than just encodings. + # In particular extension modules (such as _ssl) don't cope + # with reloading properly. Really, test modules should be cleaning + # out the test specific modules they know they added (ala test_runpy) + # rather than relying on this function (as test_importhooks and test_pkg + # do currently). Implicitly imported *real* modules should be left alone + # (see issue 10556). + sys.modules.update(oldmodules) + + +@contextlib.contextmanager +def isolated_modules(): + """ + Save modules on entry and cleanup on exit. + """ + (saved,) = modules_setup() + try: + yield + finally: + modules_cleanup(saved) + + +def mock_register_at_fork(func): + # bpo-30599: Mock os.register_at_fork() when importing the random module, + # since this function doesn't allow to unregister callbacks and would leak + # memory. + from unittest import mock + return mock.patch('os.register_at_fork', create=True)(func) + + +@contextlib.contextmanager +def ready_to_import(name=None, source=""): + from test.support import script_helper + + # 1. Sets up a temporary directory and removes it afterwards + # 2. Creates the module file + # 3. Temporarily clears the module from sys.modules (if any) + # 4. Reverts or removes the module when cleaning up + name = name or "spam" + with temp_dir() as tempdir: + path = script_helper.make_script(tempdir, name, source) + old_module = sys.modules.pop(name, None) + try: + sys.path.insert(0, tempdir) + yield name, path + finally: + sys.path.remove(tempdir) + if old_module is not None: + sys.modules[name] = old_module + else: + sys.modules.pop(name, None) + + +def ensure_lazy_imports(imported_module, modules_to_block): + """Test that when imported_module is imported, none of the modules in + modules_to_block are imported as a side effect.""" + modules_to_block = frozenset(modules_to_block) + script = textwrap.dedent( + f""" + import sys + modules_to_block = {modules_to_block} + if unexpected := modules_to_block & sys.modules.keys(): + startup = ", ".join(unexpected) + raise AssertionError(f'unexpectedly imported at startup: {{startup}}') + + import {imported_module} + if unexpected := modules_to_block & sys.modules.keys(): + after = ", ".join(unexpected) + raise AssertionError(f'unexpectedly imported after importing {imported_module}: {{after}}') + """ + ) + from .script_helper import assert_python_ok + assert_python_ok("-S", "-c", script) + + +@contextlib.contextmanager +def module_restored(name): + """A context manager that restores a module to the original state.""" + missing = object() + orig = sys.modules.get(name, missing) + if orig is None: + mod = importlib.import_module(name) + else: + mod = type(sys)(name) + mod.__dict__.update(orig.__dict__) + sys.modules[name] = mod + try: + yield mod + finally: + if orig is missing: + sys.modules.pop(name, None) + else: + sys.modules[name] = orig + + +def create_module(name, loader=None, *, ispkg=False): + """Return a new, empty module.""" + spec = importlib.machinery.ModuleSpec( + name, + loader, + origin='', + is_package=ispkg, + ) + return importlib.util.module_from_spec(spec) + + +def _ensure_module(name, ispkg, addparent, clearnone): + try: + mod = orig = sys.modules[name] + except KeyError: + mod = orig = None + missing = True + else: + missing = False + if mod is not None: + # It was already imported. + return mod, orig, missing + # Otherwise, None means it was explicitly disabled. + + assert name != '__main__' + if not missing: + assert orig is None, (name, sys.modules[name]) + if not clearnone: + raise ModuleNotFoundError(name) + del sys.modules[name] + # Try normal import, then fall back to adding the module. + try: + mod = importlib.import_module(name) + except ModuleNotFoundError: + if addparent and not clearnone: + addparent = None + mod = _add_module(name, ispkg, addparent) + return mod, orig, missing + + +def _add_module(spec, ispkg, addparent): + if isinstance(spec, str): + name = spec + mod = create_module(name, ispkg=ispkg) + spec = mod.__spec__ + else: + name = spec.name + mod = importlib.util.module_from_spec(spec) + sys.modules[name] = mod + if addparent is not False and spec.parent: + _ensure_module(spec.parent, True, addparent, bool(addparent)) + return mod + + +def add_module(spec, *, parents=True): + """Return the module after creating it and adding it to sys.modules. + + If parents is True then also create any missing parents. + """ + return _add_module(spec, False, parents) + + +def add_package(spec, *, parents=True): + """Return the module after creating it and adding it to sys.modules. + + If parents is True then also create any missing parents. + """ + return _add_module(spec, True, parents) + + +def ensure_module_imported(name, *, clearnone=True): + """Return the corresponding module. + + If it was already imported then return that. Otherwise, try + importing it (optionally clear it first if None). If that fails + then create a new empty module. + + It can be helpful to combine this with ready_to_import() and/or + isolated_modules(). + """ + if sys.modules.get(name) is not None: + mod = sys.modules[name] + else: + mod, _, _ = _ensure_module(name, False, True, clearnone) + return mod diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/logging_helper.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/logging_helper.py new file mode 100644 index 0000000000000000000000000000000000000000..12fcca4f0f08d9b445ac84f6a1920c8bcb3badf4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/logging_helper.py @@ -0,0 +1,29 @@ +import logging.handlers + +class TestHandler(logging.handlers.BufferingHandler): + def __init__(self, matcher): + # BufferingHandler takes a "capacity" argument + # so as to know when to flush. As we're overriding + # shouldFlush anyway, we can set a capacity of zero. + # You can call flush() manually to clear out the + # buffer. + logging.handlers.BufferingHandler.__init__(self, 0) + self.matcher = matcher + + def shouldFlush(self): + return False + + def emit(self, record): + self.format(record) + self.buffer.append(record.__dict__) + + def matches(self, **kwargs): + """ + Look for a saved dict whose keys/values match the supplied arguments. + """ + result = False + for d in self.buffer: + if self.matcher.matches(d, **kwargs): + result = True + break + return result diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/numbers.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/numbers.py new file mode 100644 index 0000000000000000000000000000000000000000..d5dbb41acebc38dc08c436d15914ab9bad9ae9ef --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/numbers.py @@ -0,0 +1,80 @@ +# These are shared with test_tokenize and other test modules. +# +# Note: since several test cases filter out floats by looking for "e" and ".", +# don't add hexadecimal literals that contain "e" or "E". +VALID_UNDERSCORE_LITERALS = [ + '0_0_0', + '4_2', + '1_0000_0000', + '0b1001_0100', + '0xffff_ffff', + '0o5_7_7', + '1_00_00.5', + '1_00_00.5e5', + '1_00_00e5_1', + '1e1_0', + '.1_4', + '.1_4e1', + '0b_0', + '0x_f', + '0o_5', + '1_00_00j', + '1_00_00.5j', + '1_00_00e5_1j', + '.1_4j', + '(1_2.5+3_3j)', + '(.5_6j)', +] +INVALID_UNDERSCORE_LITERALS = [ + # Trailing underscores: + '0_', + '42_', + '1.4j_', + '0x_', + '0b1_', + '0xf_', + '0o5_', + '0 if 1_Else 1', + # Underscores in the base selector: + '0_b0', + '0_xf', + '0_o5', + # Old-style octal, still disallowed: + '0_7', + '09_99', + # Multiple consecutive underscores: + '4_______2', + '0.1__4', + '0.1__4j', + '0b1001__0100', + '0xffff__ffff', + '0x___', + '0o5__77', + '1e1__0', + '1e1__0j', + # Underscore right before a dot: + '1_.4', + '1_.4j', + # Underscore right after a dot: + '1._4', + '1._4j', + '._5', + '._5j', + # Underscore right after a sign: + '1.0e+_1', + '1.0e+_1j', + # Underscore right before j: + '1.4_j', + '1.4e5_j', + # Underscore right before e: + '1_e1', + '1.4_e1', + '1.4_e1j', + # Underscore right after e: + '1e_1', + '1.4e_1', + '1.4e_1j', + # Complex cases with parens: + '(1+1.5_j_)', + '(1+1.5_j)', +] diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/os_helper.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/os_helper.py new file mode 100644 index 0000000000000000000000000000000000000000..2c45fe2369ec36b574258e701bfc078114c5499d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/os_helper.py @@ -0,0 +1,832 @@ +import collections.abc +import contextlib +import errno +import logging +import os +import re +import stat +import string +import sys +import time +import unittest +import warnings + +from test import support + + +# Filename used for testing +TESTFN_ASCII = '@test' + +# Disambiguate TESTFN for parallel testing, while letting it remain a valid +# module name. +TESTFN_ASCII = "{}_{}_tmp".format(TESTFN_ASCII, os.getpid()) + +# TESTFN_UNICODE is a non-ascii filename +TESTFN_UNICODE = TESTFN_ASCII + "-\xe0\xf2\u0258\u0141\u011f" +if support.is_apple: + # On Apple's VFS API file names are, by definition, canonically + # decomposed Unicode, encoded using UTF-8. See QA1173: + # http://developer.apple.com/mac/library/qa/qa2001/qa1173.html + import unicodedata + TESTFN_UNICODE = unicodedata.normalize('NFD', TESTFN_UNICODE) + +# TESTFN_UNENCODABLE is a filename (str type) that should *not* be able to be +# encoded by the filesystem encoding (in strict mode). It can be None if we +# cannot generate such filename. +TESTFN_UNENCODABLE = None +if os.name == 'nt': + # skip win32s (0) or Windows 9x/ME (1) + if sys.getwindowsversion().platform >= 2: + # Different kinds of characters from various languages to minimize the + # probability that the whole name is encodable to MBCS (issue #9819) + TESTFN_UNENCODABLE = TESTFN_ASCII + "-\u5171\u0141\u2661\u0363\uDC80" + try: + TESTFN_UNENCODABLE.encode(sys.getfilesystemencoding()) + except UnicodeEncodeError: + pass + else: + print('WARNING: The filename %r CAN be encoded by the filesystem ' + 'encoding (%s). Unicode filename tests may not be effective' + % (TESTFN_UNENCODABLE, sys.getfilesystemencoding())) + TESTFN_UNENCODABLE = None +# Apple and Emscripten deny unencodable filenames (invalid utf-8) +elif not support.is_apple and sys.platform not in {"emscripten", "wasi"}: + try: + # ascii and utf-8 cannot encode the byte 0xff + b'\xff'.decode(sys.getfilesystemencoding()) + except UnicodeDecodeError: + # 0xff will be encoded using the surrogate character u+DCFF + TESTFN_UNENCODABLE = TESTFN_ASCII \ + + b'-\xff'.decode(sys.getfilesystemencoding(), 'surrogateescape') + else: + # File system encoding (eg. ISO-8859-* encodings) can encode + # the byte 0xff. Skip some unicode filename tests. + pass + +# FS_NONASCII: non-ASCII character encodable by os.fsencode(), +# or an empty string if there is no such character. +FS_NONASCII = '' +for character in ( + # First try printable and common characters to have a readable filename. + # For each character, the encoding list are just example of encodings able + # to encode the character (the list is not exhaustive). + + # U+00E6 (Latin Small Letter Ae): cp1252, iso-8859-1 + '\u00E6', + # U+0130 (Latin Capital Letter I With Dot Above): cp1254, iso8859_3 + '\u0130', + # U+0141 (Latin Capital Letter L With Stroke): cp1250, cp1257 + '\u0141', + # U+03C6 (Greek Small Letter Phi): cp1253 + '\u03C6', + # U+041A (Cyrillic Capital Letter Ka): cp1251 + '\u041A', + # U+05D0 (Hebrew Letter Alef): Encodable to cp424 + '\u05D0', + # U+060C (Arabic Comma): cp864, cp1006, iso8859_6, mac_arabic + '\u060C', + # U+062A (Arabic Letter Teh): cp720 + '\u062A', + # U+0E01 (Thai Character Ko Kai): cp874 + '\u0E01', + + # Then try more "special" characters. "special" because they may be + # interpreted or displayed differently depending on the exact locale + # encoding and the font. + + # U+00A0 (No-Break Space) + '\u00A0', + # U+20AC (Euro Sign) + '\u20AC', +): + try: + # If Python is set up to use the legacy 'mbcs' in Windows, + # 'replace' error mode is used, and encode() returns b'?' + # for characters missing in the ANSI codepage + if os.fsdecode(os.fsencode(character)) != character: + raise UnicodeError + except UnicodeError: + pass + else: + FS_NONASCII = character + break + +# Save the initial cwd +SAVEDCWD = os.getcwd() + +# TESTFN_UNDECODABLE is a filename (bytes type) that should *not* be able to be +# decoded from the filesystem encoding (in strict mode). It can be None if we +# cannot generate such filename (ex: the latin1 encoding can decode any byte +# sequence). On UNIX, TESTFN_UNDECODABLE can be decoded by os.fsdecode() thanks +# to the surrogateescape error handler (PEP 383), but not from the filesystem +# encoding in strict mode. +TESTFN_UNDECODABLE = None +for name in ( + # b'\xff' is not decodable by os.fsdecode() with code page 932. Windows + # accepts it to create a file or a directory, or don't accept to enter to + # such directory (when the bytes name is used). So test b'\xe7' first: + # it is not decodable from cp932. + b'\xe7w\xf0', + # undecodable from ASCII, UTF-8 + b'\xff', + # undecodable from iso8859-3, iso8859-6, iso8859-7, cp424, iso8859-8, cp856 + # and cp857 + b'\xae\xd5' + # undecodable from UTF-8 (UNIX and Mac OS X) + b'\xed\xb2\x80', b'\xed\xb4\x80', + # undecodable from shift_jis, cp869, cp874, cp932, cp1250, cp1251, cp1252, + # cp1253, cp1254, cp1255, cp1257, cp1258 + b'\x81\x98', +): + try: + name.decode(sys.getfilesystemencoding()) + except UnicodeDecodeError: + try: + name.decode(sys.getfilesystemencoding(), + sys.getfilesystemencodeerrors()) + except UnicodeDecodeError: + continue + TESTFN_UNDECODABLE = os.fsencode(TESTFN_ASCII) + name + break + +if FS_NONASCII: + TESTFN_NONASCII = TESTFN_ASCII + FS_NONASCII +else: + TESTFN_NONASCII = None +TESTFN = TESTFN_NONASCII or TESTFN_ASCII + + +def make_bad_fd(): + """ + Create an invalid file descriptor by opening and closing a file and return + its fd. + """ + file = open(TESTFN, "wb") + try: + return file.fileno() + finally: + file.close() + unlink(TESTFN) + + +_can_symlink = None + + +def can_symlink(): + global _can_symlink + if _can_symlink is not None: + return _can_symlink + # WASI / wasmtime prevents symlinks with absolute paths, see man + # openat2(2) RESOLVE_BENEATH. Almost all symlink tests use absolute + # paths. Skip symlink tests on WASI for now. + src = os.path.abspath(TESTFN) + symlink_path = src + "can_symlink" + try: + os.symlink(src, symlink_path) + can = True + except (OSError, NotImplementedError, AttributeError): + can = False + else: + os.remove(symlink_path) + _can_symlink = can + return can + + +def skip_unless_symlink(test): + """Skip decorator for tests that require functional symlink""" + ok = can_symlink() + msg = "Requires functional symlink implementation" + return test if ok else unittest.skip(msg)(test) + + +_can_hardlink = None + +def can_hardlink(): + global _can_hardlink + if _can_hardlink is None: + # Android blocks hard links using SELinux + # (https://stackoverflow.com/q/32365690). + _can_hardlink = hasattr(os, "link") and not support.is_android + return _can_hardlink + + +def skip_unless_hardlink(test): + ok = can_hardlink() + msg = "requires hardlink support" + return test if ok else unittest.skip(msg)(test) + + +_can_xattr = None + + +def can_xattr(): + import tempfile + global _can_xattr + if _can_xattr is not None: + return _can_xattr + if not hasattr(os, "setxattr"): + can = False + else: + import platform + tmp_dir = tempfile.mkdtemp() + tmp_fp, tmp_name = tempfile.mkstemp(dir=tmp_dir) + try: + with open(TESTFN, "wb") as fp: + try: + # TESTFN & tempfile may use different file systems with + # different capabilities + os.setxattr(tmp_fp, b"user.test", b"") + os.setxattr(tmp_name, b"trusted.foo", b"42") + os.setxattr(fp.fileno(), b"user.test", b"") + # Kernels < 2.6.39 don't respect setxattr flags. + kernel_version = platform.release() + m = re.match(r"2.6.(\d{1,2})", kernel_version) + can = m is None or int(m.group(1)) >= 39 + except OSError: + can = False + finally: + unlink(TESTFN) + unlink(tmp_name) + rmdir(tmp_dir) + _can_xattr = can + return can + + +def skip_unless_xattr(test): + """Skip decorator for tests that require functional extended attributes""" + ok = can_xattr() + msg = "no non-broken extended attribute support" + return test if ok else unittest.skip(msg)(test) + + +_can_chmod = None + +def can_chmod(): + global _can_chmod + if _can_chmod is not None: + return _can_chmod + if not hasattr(os, "chmod"): + _can_chmod = False + return _can_chmod + try: + with open(TESTFN, "wb") as f: + try: + os.chmod(TESTFN, 0o555) + mode1 = os.stat(TESTFN).st_mode + os.chmod(TESTFN, 0o777) + mode2 = os.stat(TESTFN).st_mode + except OSError as e: + can = False + else: + can = stat.S_IMODE(mode1) != stat.S_IMODE(mode2) + finally: + unlink(TESTFN) + _can_chmod = can + return can + + +def skip_unless_working_chmod(test): + """Skip tests that require working os.chmod() + + WASI SDK 15.0 cannot change file mode bits. + """ + ok = can_chmod() + msg = "requires working os.chmod()" + return test if ok else unittest.skip(msg)(test) + + +@contextlib.contextmanager +def save_mode(path, *, quiet=False): + """Context manager that restores the mode (permissions) of *path* on exit. + + Arguments: + + path: Path of the file to restore the mode of. + + quiet: if False (the default), the context manager raises an exception + on error. Otherwise, it issues only a warning and keeps the current + working directory the same. + + """ + saved_mode = os.stat(path) + try: + yield + finally: + try: + os.chmod(path, saved_mode.st_mode) + except OSError as exc: + if not quiet: + raise + warnings.warn(f'tests may fail, unable to restore the mode of ' + f'{path!r} to {saved_mode.st_mode}: {exc}', + RuntimeWarning, stacklevel=3) + + +# Check whether the current effective user has the capability to override +# DAC (discretionary access control). Typically user root is able to +# bypass file read, write, and execute permission checks. The capability +# is independent of the effective user. See capabilities(7). +_can_dac_override = None + +def can_dac_override(): + global _can_dac_override + + if not can_chmod(): + _can_dac_override = False + if _can_dac_override is not None: + return _can_dac_override + + try: + with open(TESTFN, "wb") as f: + os.chmod(TESTFN, 0o400) + try: + with open(TESTFN, "wb"): + pass + except OSError: + _can_dac_override = False + else: + _can_dac_override = True + finally: + try: + os.chmod(TESTFN, 0o700) + except OSError: + pass + unlink(TESTFN) + + return _can_dac_override + + +def skip_if_dac_override(test): + ok = not can_dac_override() + msg = "incompatible with CAP_DAC_OVERRIDE" + return test if ok else unittest.skip(msg)(test) + + +def skip_unless_dac_override(test): + ok = can_dac_override() + msg = "requires CAP_DAC_OVERRIDE" + return test if ok else unittest.skip(msg)(test) + + +def unlink(filename): + try: + _unlink(filename) + except (FileNotFoundError, NotADirectoryError): + pass + + +if sys.platform.startswith("win"): + def _waitfor(func, pathname, waitall=False): + # Perform the operation + func(pathname) + # Now setup the wait loop + if waitall: + dirname = pathname + else: + dirname, name = os.path.split(pathname) + dirname = dirname or '.' + # Check for `pathname` to be removed from the filesystem. + # The exponential backoff of the timeout amounts to a total + # of ~1 second after which the deletion is probably an error + # anyway. + # Testing on an i7@4.3GHz shows that usually only 1 iteration is + # required when contention occurs. + timeout = 0.001 + while timeout < 1.0: + # Note we are only testing for the existence of the file(s) in + # the contents of the directory regardless of any security or + # access rights. If we have made it this far, we have sufficient + # permissions to do that much using Python's equivalent of the + # Windows API FindFirstFile. + # Other Windows APIs can fail or give incorrect results when + # dealing with files that are pending deletion. + L = os.listdir(dirname) + if not (L if waitall else name in L): + return + # Increase the timeout and try again + time.sleep(timeout) + timeout *= 2 + logging.getLogger(__name__).warning( + 'tests may fail, delete still pending for %s', + pathname, + stack_info=True, + stacklevel=4, + ) + + def _unlink(filename): + _waitfor(os.unlink, filename) + + def _rmdir(dirname): + _waitfor(os.rmdir, dirname) + + def _rmtree(path): + from test.support import _force_run + + def _rmtree_inner(path): + for name in _force_run(path, os.listdir, path): + fullname = os.path.join(path, name) + try: + mode = os.lstat(fullname).st_mode + except OSError as exc: + print("support.rmtree(): os.lstat(%r) failed with %s" + % (fullname, exc), + file=sys.__stderr__) + mode = 0 + if stat.S_ISDIR(mode): + _waitfor(_rmtree_inner, fullname, waitall=True) + _force_run(fullname, os.rmdir, fullname) + else: + _force_run(fullname, os.unlink, fullname) + _waitfor(_rmtree_inner, path, waitall=True) + _waitfor(lambda p: _force_run(p, os.rmdir, p), path) + + def _longpath(path): + try: + import ctypes + except ImportError: + # No ctypes means we can't expands paths. + pass + else: + buffer = ctypes.create_unicode_buffer(len(path) * 2) + length = ctypes.windll.kernel32.GetLongPathNameW(path, buffer, + len(buffer)) + if length: + return buffer[:length] + return path +else: + _unlink = os.unlink + _rmdir = os.rmdir + + def _rmtree(path): + import shutil + try: + shutil.rmtree(path) + return + except OSError: + pass + + def _rmtree_inner(path): + from test.support import _force_run + for name in _force_run(path, os.listdir, path): + fullname = os.path.join(path, name) + try: + mode = os.lstat(fullname).st_mode + except OSError: + mode = 0 + if stat.S_ISDIR(mode): + _rmtree_inner(fullname) + _force_run(path, os.rmdir, fullname) + else: + _force_run(path, os.unlink, fullname) + _rmtree_inner(path) + os.rmdir(path) + + def _longpath(path): + return path + + +def rmdir(dirname): + try: + _rmdir(dirname) + except FileNotFoundError: + pass + + +def rmtree(path): + try: + _rmtree(path) + except FileNotFoundError: + pass + + +@contextlib.contextmanager +def temp_dir(path=None, quiet=False): + """Return a context manager that creates a temporary directory. + + Arguments: + + path: the directory to create temporarily. If omitted or None, + defaults to creating a temporary directory using tempfile.mkdtemp. + + quiet: if False (the default), the context manager raises an exception + on error. Otherwise, if the path is specified and cannot be + created, only a warning is issued. + + """ + import tempfile + dir_created = False + if path is None: + path = tempfile.mkdtemp() + dir_created = True + path = os.path.realpath(path) + else: + try: + os.mkdir(path) + dir_created = True + except OSError as exc: + if not quiet: + raise + logging.getLogger(__name__).warning( + "tests may fail, unable to create temporary directory %r: %s", + path, + exc, + exc_info=exc, + stack_info=True, + stacklevel=3, + ) + if dir_created: + pid = os.getpid() + try: + yield path + finally: + # In case the process forks, let only the parent remove the + # directory. The child has a different process id. (bpo-30028) + if dir_created and pid == os.getpid(): + rmtree(path) + + +@contextlib.contextmanager +def change_cwd(path, quiet=False): + """Return a context manager that changes the current working directory. + + Arguments: + + path: the directory to use as the temporary current working directory. + + quiet: if False (the default), the context manager raises an exception + on error. Otherwise, it issues only a warning and keeps the current + working directory the same. + + """ + saved_dir = os.getcwd() + try: + os.chdir(os.path.realpath(path)) + except OSError as exc: + if not quiet: + raise + logging.getLogger(__name__).warning( + 'tests may fail, unable to change the current working directory ' + 'to %r: %s', + path, + exc, + exc_info=exc, + stack_info=True, + stacklevel=3, + ) + try: + yield os.getcwd() + finally: + os.chdir(saved_dir) + + +@contextlib.contextmanager +def temp_cwd(name='tempcwd', quiet=False): + """ + Context manager that temporarily creates and changes the CWD. + + The function temporarily changes the current working directory + after creating a temporary directory in the current directory with + name *name*. If *name* is None, the temporary directory is + created using tempfile.mkdtemp. + + If *quiet* is False (default) and it is not possible to + create or change the CWD, an error is raised. If *quiet* is True, + only a warning is raised and the original CWD is used. + + """ + with temp_dir(path=name, quiet=quiet) as temp_path: + with change_cwd(temp_path, quiet=quiet) as cwd_dir: + yield cwd_dir + + +def create_empty_file(filename): + """Create an empty file. If the file already exists, truncate it.""" + fd = os.open(filename, os.O_WRONLY | os.O_CREAT | os.O_TRUNC) + os.close(fd) + + +@contextlib.contextmanager +def open_dir_fd(path): + """Open a file descriptor to a directory.""" + assert os.path.isdir(path) + flags = os.O_RDONLY + if hasattr(os, "O_DIRECTORY"): + flags |= os.O_DIRECTORY + dir_fd = os.open(path, flags) + try: + yield dir_fd + finally: + os.close(dir_fd) + + +def fs_is_case_insensitive(directory): + """Detects if the file system for the specified directory + is case-insensitive.""" + import tempfile + with tempfile.NamedTemporaryFile(dir=directory) as base: + base_path = base.name + case_path = base_path.upper() + if case_path == base_path: + case_path = base_path.lower() + try: + return os.path.samefile(base_path, case_path) + except FileNotFoundError: + return False + + +class FakePath: + """Simple implementation of the path protocol. + """ + def __init__(self, path): + self.path = path + + def __repr__(self): + return f'' + + def __fspath__(self): + if (isinstance(self.path, BaseException) or + isinstance(self.path, type) and + issubclass(self.path, BaseException)): + raise self.path + else: + return self.path + + +def fd_count(): + """Count the number of open file descriptors. + """ + if sys.platform.startswith(('linux', 'android', 'freebsd', 'emscripten')): + fd_path = "/proc/self/fd" + elif support.is_apple: + fd_path = "/dev/fd" + else: + fd_path = None + + if fd_path is not None: + try: + names = os.listdir(fd_path) + # Subtract one because listdir() internally opens a file + # descriptor to list the content of the directory. + return len(names) - 1 + except FileNotFoundError: + pass + + MAXFD = 256 + if hasattr(os, 'sysconf'): + try: + MAXFD = os.sysconf("SC_OPEN_MAX") + except OSError: + pass + + old_modes = None + if sys.platform == 'win32': + # bpo-25306, bpo-31009: Call CrtSetReportMode() to not kill the process + # on invalid file descriptor if Python is compiled in debug mode + try: + import msvcrt + msvcrt.CrtSetReportMode + except (AttributeError, ImportError): + # no msvcrt or a release build + pass + else: + old_modes = {} + for report_type in (msvcrt.CRT_WARN, + msvcrt.CRT_ERROR, + msvcrt.CRT_ASSERT): + old_modes[report_type] = msvcrt.CrtSetReportMode(report_type, + 0) + + try: + count = 0 + for fd in range(MAXFD): + try: + # Prefer dup() over fstat(). fstat() can require input/output + # whereas dup() doesn't. + fd2 = os.dup(fd) + except OSError as e: + if e.errno != errno.EBADF: + raise + else: + os.close(fd2) + count += 1 + finally: + if old_modes is not None: + for report_type in (msvcrt.CRT_WARN, + msvcrt.CRT_ERROR, + msvcrt.CRT_ASSERT): + msvcrt.CrtSetReportMode(report_type, old_modes[report_type]) + + return count + + +if hasattr(os, "umask"): + @contextlib.contextmanager + def temp_umask(umask): + """Context manager that temporarily sets the process umask.""" + oldmask = os.umask(umask) + try: + yield + finally: + os.umask(oldmask) +else: + @contextlib.contextmanager + def temp_umask(umask): + """no-op on platforms without umask()""" + yield + + +class EnvironmentVarGuard(collections.abc.MutableMapping): + """Class to help protect the environment variable properly. + + Can be used as a context manager. + """ + + def __init__(self): + self._environ = os.environ + self._changed = {} + + def __getitem__(self, envvar): + return self._environ[envvar] + + def __setitem__(self, envvar, value): + # Remember the initial value on the first access + if envvar not in self._changed: + self._changed[envvar] = self._environ.get(envvar) + self._environ[envvar] = value + + def __delitem__(self, envvar): + # Remember the initial value on the first access + if envvar not in self._changed: + self._changed[envvar] = self._environ.get(envvar) + if envvar in self._environ: + del self._environ[envvar] + + def keys(self): + return self._environ.keys() + + def __iter__(self): + return iter(self._environ) + + def __len__(self): + return len(self._environ) + + def set(self, envvar, value): + self[envvar] = value + + def unset(self, envvar, /, *envvars): + """Unset one or more environment variables.""" + for ev in (envvar, *envvars): + del self[ev] + + def copy(self): + # We do what os.environ.copy() does. + return dict(self) + + def __enter__(self): + return self + + def __exit__(self, *ignore_exc): + for (k, v) in self._changed.items(): + if v is None: + if k in self._environ: + del self._environ[k] + else: + self._environ[k] = v + os.environ = self._environ + + +try: + if support.MS_WINDOWS: + import ctypes + kernel32 = ctypes.WinDLL('kernel32', use_last_error=True) + + ERROR_FILE_NOT_FOUND = 2 + DDD_REMOVE_DEFINITION = 2 + DDD_EXACT_MATCH_ON_REMOVE = 4 + DDD_NO_BROADCAST_SYSTEM = 8 + else: + raise AttributeError +except (ImportError, AttributeError): + def subst_drive(path): + raise unittest.SkipTest('ctypes or kernel32 is not available') +else: + @contextlib.contextmanager + def subst_drive(path): + """Temporarily yield a substitute drive for a given path.""" + for c in reversed(string.ascii_uppercase): + drive = f'{c}:' + if (not kernel32.QueryDosDeviceW(drive, None, 0) and + ctypes.get_last_error() == ERROR_FILE_NOT_FOUND): + break + else: + raise unittest.SkipTest('no available logical drive') + if not kernel32.DefineDosDeviceW( + DDD_NO_BROADCAST_SYSTEM, drive, path): + raise ctypes.WinError(ctypes.get_last_error()) + try: + yield drive + finally: + if not kernel32.DefineDosDeviceW( + DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, + drive, path): + raise ctypes.WinError(ctypes.get_last_error()) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/pty_helper.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/pty_helper.py new file mode 100644 index 0000000000000000000000000000000000000000..dbe7fa429096fc662034b5430ff30b67379157e6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/pty_helper.py @@ -0,0 +1,88 @@ +""" +Helper to run a script in a pseudo-terminal. +""" +import os +import selectors +import subprocess +import sys +from contextlib import ExitStack +from errno import EIO + +from test.support.import_helper import import_module + +def run_pty(script, input=b"dummy input\r", env=None): + pty = import_module('pty') + output = bytearray() + [master, slave] = pty.openpty() + args = (sys.executable, '-c', script) + + # Isolate readline from personal init files by setting INPUTRC + # to an empty file. See also GH-142353. + if env is None: + env = {**os.environ.copy(), "INPUTRC": os.devnull} + else: + env.setdefault("INPUTRC", os.devnull) + + proc = subprocess.Popen(args, stdin=slave, stdout=slave, stderr=slave, env=env) + os.close(slave) + with ExitStack() as cleanup: + cleanup.enter_context(proc) + def terminate(proc): + try: + proc.terminate() + except ProcessLookupError: + # Workaround for Open/Net BSD bug (Issue 16762) + pass + cleanup.callback(terminate, proc) + cleanup.callback(os.close, master) + # Avoid using DefaultSelector and PollSelector. Kqueue() does not + # work with pseudo-terminals on OS X < 10.9 (Issue 20365) and Open + # BSD (Issue 20667). Poll() does not work with OS X 10.6 or 10.4 + # either (Issue 20472). Hopefully the file descriptor is low enough + # to use with select(). + sel = cleanup.enter_context(selectors.SelectSelector()) + sel.register(master, selectors.EVENT_READ | selectors.EVENT_WRITE) + os.set_blocking(master, False) + while True: + for [_, events] in sel.select(): + if events & selectors.EVENT_READ: + try: + chunk = os.read(master, 0x10000) + except OSError as err: + # Linux raises EIO when slave is closed (Issue 5380) + if err.errno != EIO: + raise + chunk = b"" + if not chunk: + return output + output.extend(chunk) + if events & selectors.EVENT_WRITE: + try: + input = input[os.write(master, input):] + except OSError as err: + # Apparently EIO means the slave was closed + if err.errno != EIO: + raise + input = b"" # Stop writing + if not input: + sel.modify(master, selectors.EVENT_READ) + + +###################################################################### +## Fake stdin (for testing interactive debugging) +###################################################################### + +class FakeInput: + """ + A fake input stream for pdb's interactive debugger. Whenever a + line is read, print it (to simulate the user typing it), and then + return it. The set of lines to return is specified in the + constructor; they should not have trailing newlines. + """ + def __init__(self, lines): + self.lines = lines + + def readline(self): + line = self.lines.pop(0) + print(line) + return line + '\n' diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/refleak_helper.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/refleak_helper.py new file mode 100644 index 0000000000000000000000000000000000000000..2f86c93a1e2e5884093ec4129ab811fbb9e108f6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/refleak_helper.py @@ -0,0 +1,8 @@ +""" +Utilities for changing test behaviour while hunting +for refleaks +""" + +_hunting_for_refleaks = False +def hunting_for_refleaks(): + return _hunting_for_refleaks diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/script_helper.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/script_helper.py new file mode 100644 index 0000000000000000000000000000000000000000..46ce950433ddf64726630e2e6ef679d8eefab116 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/script_helper.py @@ -0,0 +1,324 @@ +# Common utility functions used by various script execution tests +# e.g. test_cmd_line, test_cmd_line_script and test_runpy + +import collections +import importlib +import sys +import os +import os.path +import subprocess +import py_compile + +from importlib.util import source_from_cache +from test import support +from test.support.import_helper import make_legacy_pyc + + +# Cached result of the expensive test performed in the function below. +__cached_interp_requires_environment = None + + +def interpreter_requires_environment(): + """ + Returns True if our sys.executable interpreter requires environment + variables in order to be able to run at all. + + This is designed to be used with @unittest.skipIf() to annotate tests + that need to use an assert_python*() function to launch an isolated + mode (-I) or no environment mode (-E) sub-interpreter process. + + A normal build & test does not run into this situation but it can happen + when trying to run the standard library test suite from an interpreter that + doesn't have an obvious home with Python's current home finding logic. + + Setting PYTHONHOME is one way to get most of the testsuite to run in that + situation. PYTHONPATH or PYTHONUSERSITE are other common environment + variables that might impact whether or not the interpreter can start. + """ + global __cached_interp_requires_environment + if __cached_interp_requires_environment is None: + # If PYTHONHOME is set, assume that we need it + if 'PYTHONHOME' in os.environ: + __cached_interp_requires_environment = True + return True + # cannot run subprocess, assume we don't need it + if not support.has_subprocess_support: + __cached_interp_requires_environment = False + return False + + # Try running an interpreter with -E to see if it works or not. + try: + subprocess.check_call([sys.executable, '-E', + '-c', 'import sys; sys.exit(0)']) + except subprocess.CalledProcessError: + __cached_interp_requires_environment = True + else: + __cached_interp_requires_environment = False + + return __cached_interp_requires_environment + + +class _PythonRunResult(collections.namedtuple("_PythonRunResult", + ("rc", "out", "err"))): + """Helper for reporting Python subprocess run results""" + def fail(self, cmd_line): + """Provide helpful details about failed subcommand runs""" + # Limit to 300 lines of ASCII characters + maxlen = 300 * 100 + out, err = self.out, self.err + if len(out) > maxlen: + out = b'(... truncated stdout ...)' + out[-maxlen:] + if len(err) > maxlen: + err = b'(... truncated stderr ...)' + err[-maxlen:] + out = out.decode('utf8', 'replace').rstrip() + err = err.decode('utf8', 'replace').rstrip() + + exitcode = self.rc + signame = support.get_signal_name(exitcode) + if signame: + exitcode = f"{exitcode} ({signame})" + raise AssertionError(f"Process return code is {exitcode}\n" + f"command line: {cmd_line!r}\n" + f"\n" + f"stdout:\n" + f"---\n" + f"{out}\n" + f"---\n" + f"\n" + f"stderr:\n" + f"---\n" + f"{err}\n" + f"---") + + +# Executing the interpreter in a subprocess +@support.requires_subprocess() +def run_python_until_end(*args, **env_vars): + """Used to implement assert_python_*. + + *args are the command line flags to pass to the python interpreter. + **env_vars keyword arguments are environment variables to set on the process. + + If __run_using_command= is supplied, it must be a list of + command line arguments to prepend to the command line used. + Useful when you want to run another command that should launch the + python interpreter via its own arguments. ["/bin/echo", "--"] for + example could print the unquoted python command line instead of + run it. + """ + env_required = interpreter_requires_environment() + run_using_command = env_vars.pop('__run_using_command', None) + cwd = env_vars.pop('__cwd', None) + if '__isolated' in env_vars: + isolated = env_vars.pop('__isolated') + else: + isolated = not env_vars and not env_required + cmd_line = [sys.executable, '-X', 'faulthandler'] + if run_using_command: + cmd_line = run_using_command + cmd_line + if isolated: + # isolated mode: ignore Python environment variables, ignore user + # site-packages, and don't add the current directory to sys.path + cmd_line.append('-I') + elif not env_vars and not env_required: + # ignore Python environment variables + cmd_line.append('-E') + + # But a special flag that can be set to override -- in this case, the + # caller is responsible to pass the full environment. + if env_vars.pop('__cleanenv', None): + env = {} + if sys.platform == 'win32': + # Windows requires at least the SYSTEMROOT environment variable to + # start Python. + env['SYSTEMROOT'] = os.environ['SYSTEMROOT'] + + # Other interesting environment variables, not copied currently: + # COMSPEC, HOME, PATH, TEMP, TMPDIR, TMP. + else: + # Need to preserve the original environment, for in-place testing of + # shared library builds. + env = os.environ.copy() + + # set TERM='' unless the TERM environment variable is passed explicitly + # see issues #11390 and #18300 + if 'TERM' not in env_vars: + env['TERM'] = '' + + env.update(env_vars) + cmd_line.extend(args) + proc = subprocess.Popen(cmd_line, stdin=subprocess.PIPE, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + env=env, cwd=cwd) + with proc: + try: + out, err = proc.communicate() + finally: + proc.kill() + subprocess._cleanup() + rc = proc.returncode + return _PythonRunResult(rc, out, err), cmd_line + + +@support.requires_subprocess() +def _assert_python(expected_success, /, *args, **env_vars): + res, cmd_line = run_python_until_end(*args, **env_vars) + if (res.rc and expected_success) or (not res.rc and not expected_success): + res.fail(cmd_line) + return res + + +def assert_python_ok(*args, **env_vars): + """ + Assert that running the interpreter with `args` and optional environment + variables `env_vars` succeeds (rc == 0) and return a (return code, stdout, + stderr) tuple. + + If the __cleanenv keyword is set, env_vars is used as a fresh environment. + + Python is started in isolated mode (command line option -I), + except if the __isolated keyword is set to False. + """ + return _assert_python(True, *args, **env_vars) + + +def assert_python_failure(*args, **env_vars): + """ + Assert that running the interpreter with `args` and optional environment + variables `env_vars` fails (rc != 0) and return a (return code, stdout, + stderr) tuple. + + See assert_python_ok() for more options. + """ + return _assert_python(False, *args, **env_vars) + + +@support.requires_subprocess() +def spawn_python(*args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kw): + """Run a Python subprocess with the given arguments. + + kw is extra keyword args to pass to subprocess.Popen. Returns a Popen + object. + """ + cmd_line = [sys.executable] + if not interpreter_requires_environment(): + cmd_line.append('-E') + cmd_line.extend(args) + # Under Fedora (?), GNU readline can output junk on stderr when initialized, + # depending on the TERM setting. Setting TERM=vt100 is supposed to disable + # that. References: + # - http://reinout.vanrees.org/weblog/2009/08/14/readline-invisible-character-hack.html + # - http://stackoverflow.com/questions/15760712/python-readline-module-prints-escape-character-during-import + # - http://lists.gnu.org/archive/html/bug-readline/2007-08/msg00004.html + env = kw.setdefault('env', dict(os.environ)) + env['TERM'] = 'vt100' + return subprocess.Popen(cmd_line, stdin=subprocess.PIPE, + stdout=stdout, stderr=stderr, + **kw) + + +def kill_python(p): + """Run the given Popen process until completion and return stdout.""" + p.stdin.close() + data = p.stdout.read() + p.stdout.close() + # try to cleanup the child so we don't appear to leak when running + # with regrtest -R. + p.wait() + subprocess._cleanup() + return data + + +def make_script(script_dir, script_basename, source, omit_suffix=False): + script_filename = script_basename + if not omit_suffix: + script_filename += os.extsep + 'py' + script_name = os.path.join(script_dir, script_filename) + if isinstance(source, str): + # The script should be encoded to UTF-8, the default string encoding + with open(script_name, 'w', encoding='utf-8') as script_file: + script_file.write(source) + else: + with open(script_name, 'wb') as script_file: + script_file.write(source) + importlib.invalidate_caches() + return script_name + + +def make_zip_script(zip_dir, zip_basename, script_name, name_in_zip=None): + import zipfile + zip_filename = zip_basename+os.extsep+'zip' + zip_name = os.path.join(zip_dir, zip_filename) + with zipfile.ZipFile(zip_name, 'w') as zip_file: + if name_in_zip is None: + parts = script_name.split(os.sep) + if len(parts) >= 2 and parts[-2] == '__pycache__': + legacy_pyc = make_legacy_pyc(source_from_cache(script_name)) + name_in_zip = os.path.basename(legacy_pyc) + script_name = legacy_pyc + else: + name_in_zip = os.path.basename(script_name) + zip_file.write(script_name, name_in_zip) + #if test.support.verbose: + # with zipfile.ZipFile(zip_name, 'r') as zip_file: + # print 'Contents of %r:' % zip_name + # zip_file.printdir() + return zip_name, os.path.join(zip_name, name_in_zip) + + +def make_pkg(pkg_dir, init_source=''): + os.mkdir(pkg_dir) + make_script(pkg_dir, '__init__', init_source) + + +def make_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename, + source, depth=1, compiled=False): + import zipfile + unlink = [] + init_name = make_script(zip_dir, '__init__', '') + unlink.append(init_name) + init_basename = os.path.basename(init_name) + script_name = make_script(zip_dir, script_basename, source) + unlink.append(script_name) + if compiled: + init_name = py_compile.compile(init_name, doraise=True) + script_name = py_compile.compile(script_name, doraise=True) + unlink.extend((init_name, script_name)) + pkg_names = [os.sep.join([pkg_name]*i) for i in range(1, depth+1)] + script_name_in_zip = os.path.join(pkg_names[-1], os.path.basename(script_name)) + zip_filename = zip_basename+os.extsep+'zip' + zip_name = os.path.join(zip_dir, zip_filename) + with zipfile.ZipFile(zip_name, 'w') as zip_file: + for name in pkg_names: + init_name_in_zip = os.path.join(name, init_basename) + zip_file.write(init_name, init_name_in_zip) + zip_file.write(script_name, script_name_in_zip) + for name in unlink: + os.unlink(name) + #if test.support.verbose: + # with zipfile.ZipFile(zip_name, 'r') as zip_file: + # print 'Contents of %r:' % zip_name + # zip_file.printdir() + return zip_name, os.path.join(zip_name, script_name_in_zip) + + +@support.requires_subprocess() +def run_test_script(script): + # use -u to try to get the full output if the test hangs or crash + if support.verbose: + def title(text): + return f"===== {text} ======" + + name = f"script {os.path.basename(script)}" + print() + print(title(name), flush=True) + # In verbose mode, the child process inherit stdout and stdout, + # to see output in realtime and reduce the risk of losing output. + args = [sys.executable, "-E", "-X", "faulthandler", "-u", script, "-v"] + proc = subprocess.run(args) + print(title(f"{name} completed: exit code {proc.returncode}"), + flush=True) + if proc.returncode: + raise AssertionError(f"{name} failed") + else: + assert_python_ok("-u", script, "-v") diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/smtpd.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/smtpd.py new file mode 100644 index 0000000000000000000000000000000000000000..6537679db9ad24f22c5071d8139b1efca354ffd4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/smtpd.py @@ -0,0 +1,874 @@ +#! /usr/bin/env python3 +"""An RFC 5321 smtp proxy with optional RFC 1870 and RFC 6531 extensions. + +Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]] + +Options: + + --nosetuid + -n + This program generally tries to setuid 'nobody', unless this flag is + set. The setuid call will fail if this program is not run as root (in + which case, use this flag). + + --version + -V + Print the version number and exit. + + --class classname + -c classname + Use 'classname' as the concrete SMTP proxy class. Uses 'PureProxy' by + default. + + --size limit + -s limit + Restrict the total size of the incoming message to "limit" number of + bytes via the RFC 1870 SIZE extension. Defaults to 33554432 bytes. + + --smtputf8 + -u + Enable the SMTPUTF8 extension and behave as an RFC 6531 smtp proxy. + + --debug + -d + Turn on debugging prints. + + --help + -h + Print this message and exit. + +Version: %(__version__)s + +If localhost is not given then 'localhost' is used, and if localport is not +given then 8025 is used. If remotehost is not given then 'localhost' is used, +and if remoteport is not given, then 25 is used. +""" + +# Overview: +# +# This file implements the minimal SMTP protocol as defined in RFC 5321. It +# has a hierarchy of classes which implement the backend functionality for the +# smtpd. A number of classes are provided: +# +# SMTPServer - the base class for the backend. Raises NotImplementedError +# if you try to use it. +# +# DebuggingServer - simply prints each message it receives on stdout. +# +# PureProxy - Proxies all messages to a real smtpd which does final +# delivery. One known problem with this class is that it doesn't handle +# SMTP errors from the backend server at all. This should be fixed +# (contributions are welcome!). +# +# +# Author: Barry Warsaw +# +# TODO: +# +# - support mailbox delivery +# - alias files +# - Handle more ESMTP extensions +# - handle error codes from the backend smtpd + +import sys +import os +import errno +import getopt +import time +import socket +import collections +from test.support import asyncore, asynchat +from warnings import warn +from email._header_value_parser import get_addr_spec, get_angle_addr + +__all__ = [ + "SMTPChannel", "SMTPServer", "DebuggingServer", "PureProxy", +] + +program = sys.argv[0] +__version__ = 'Python SMTP proxy version 0.3' + + +class Devnull: + def write(self, msg): pass + def flush(self): pass + + +DEBUGSTREAM = Devnull() +NEWLINE = '\n' +COMMASPACE = ', ' +DATA_SIZE_DEFAULT = 33554432 + + +def usage(code, msg=''): + print(__doc__ % globals(), file=sys.stderr) + if msg: + print(msg, file=sys.stderr) + sys.exit(code) + + +class SMTPChannel(asynchat.async_chat): + COMMAND = 0 + DATA = 1 + + command_size_limit = 512 + command_size_limits = collections.defaultdict(lambda x=command_size_limit: x) + + @property + def max_command_size_limit(self): + try: + return max(self.command_size_limits.values()) + except ValueError: + return self.command_size_limit + + def __init__(self, server, conn, addr, data_size_limit=DATA_SIZE_DEFAULT, + map=None, enable_SMTPUTF8=False, decode_data=False): + asynchat.async_chat.__init__(self, conn, map=map) + self.smtp_server = server + self.conn = conn + self.addr = addr + self.data_size_limit = data_size_limit + self.enable_SMTPUTF8 = enable_SMTPUTF8 + self._decode_data = decode_data + if enable_SMTPUTF8 and decode_data: + raise ValueError("decode_data and enable_SMTPUTF8 cannot" + " be set to True at the same time") + if decode_data: + self._emptystring = '' + self._linesep = '\r\n' + self._dotsep = '.' + self._newline = NEWLINE + else: + self._emptystring = b'' + self._linesep = b'\r\n' + self._dotsep = ord(b'.') + self._newline = b'\n' + self._set_rset_state() + self.seen_greeting = '' + self.extended_smtp = False + self.command_size_limits.clear() + self.fqdn = socket.getfqdn() + try: + self.peer = conn.getpeername() + except OSError as err: + # a race condition may occur if the other end is closing + # before we can get the peername + self.close() + if err.errno != errno.ENOTCONN: + raise + return + print('Peer:', repr(self.peer), file=DEBUGSTREAM) + self.push('220 %s %s' % (self.fqdn, __version__)) + + def _set_post_data_state(self): + """Reset state variables to their post-DATA state.""" + self.smtp_state = self.COMMAND + self.mailfrom = None + self.rcpttos = [] + self.require_SMTPUTF8 = False + self.num_bytes = 0 + self.set_terminator(b'\r\n') + + def _set_rset_state(self): + """Reset all state variables except the greeting.""" + self._set_post_data_state() + self.received_data = '' + self.received_lines = [] + + + # properties for backwards-compatibility + @property + def __server(self): + warn("Access to __server attribute on SMTPChannel is deprecated, " + "use 'smtp_server' instead", DeprecationWarning, 2) + return self.smtp_server + @__server.setter + def __server(self, value): + warn("Setting __server attribute on SMTPChannel is deprecated, " + "set 'smtp_server' instead", DeprecationWarning, 2) + self.smtp_server = value + + @property + def __line(self): + warn("Access to __line attribute on SMTPChannel is deprecated, " + "use 'received_lines' instead", DeprecationWarning, 2) + return self.received_lines + @__line.setter + def __line(self, value): + warn("Setting __line attribute on SMTPChannel is deprecated, " + "set 'received_lines' instead", DeprecationWarning, 2) + self.received_lines = value + + @property + def __state(self): + warn("Access to __state attribute on SMTPChannel is deprecated, " + "use 'smtp_state' instead", DeprecationWarning, 2) + return self.smtp_state + @__state.setter + def __state(self, value): + warn("Setting __state attribute on SMTPChannel is deprecated, " + "set 'smtp_state' instead", DeprecationWarning, 2) + self.smtp_state = value + + @property + def __greeting(self): + warn("Access to __greeting attribute on SMTPChannel is deprecated, " + "use 'seen_greeting' instead", DeprecationWarning, 2) + return self.seen_greeting + @__greeting.setter + def __greeting(self, value): + warn("Setting __greeting attribute on SMTPChannel is deprecated, " + "set 'seen_greeting' instead", DeprecationWarning, 2) + self.seen_greeting = value + + @property + def __mailfrom(self): + warn("Access to __mailfrom attribute on SMTPChannel is deprecated, " + "use 'mailfrom' instead", DeprecationWarning, 2) + return self.mailfrom + @__mailfrom.setter + def __mailfrom(self, value): + warn("Setting __mailfrom attribute on SMTPChannel is deprecated, " + "set 'mailfrom' instead", DeprecationWarning, 2) + self.mailfrom = value + + @property + def __rcpttos(self): + warn("Access to __rcpttos attribute on SMTPChannel is deprecated, " + "use 'rcpttos' instead", DeprecationWarning, 2) + return self.rcpttos + @__rcpttos.setter + def __rcpttos(self, value): + warn("Setting __rcpttos attribute on SMTPChannel is deprecated, " + "set 'rcpttos' instead", DeprecationWarning, 2) + self.rcpttos = value + + @property + def __data(self): + warn("Access to __data attribute on SMTPChannel is deprecated, " + "use 'received_data' instead", DeprecationWarning, 2) + return self.received_data + @__data.setter + def __data(self, value): + warn("Setting __data attribute on SMTPChannel is deprecated, " + "set 'received_data' instead", DeprecationWarning, 2) + self.received_data = value + + @property + def __fqdn(self): + warn("Access to __fqdn attribute on SMTPChannel is deprecated, " + "use 'fqdn' instead", DeprecationWarning, 2) + return self.fqdn + @__fqdn.setter + def __fqdn(self, value): + warn("Setting __fqdn attribute on SMTPChannel is deprecated, " + "set 'fqdn' instead", DeprecationWarning, 2) + self.fqdn = value + + @property + def __peer(self): + warn("Access to __peer attribute on SMTPChannel is deprecated, " + "use 'peer' instead", DeprecationWarning, 2) + return self.peer + @__peer.setter + def __peer(self, value): + warn("Setting __peer attribute on SMTPChannel is deprecated, " + "set 'peer' instead", DeprecationWarning, 2) + self.peer = value + + @property + def __conn(self): + warn("Access to __conn attribute on SMTPChannel is deprecated, " + "use 'conn' instead", DeprecationWarning, 2) + return self.conn + @__conn.setter + def __conn(self, value): + warn("Setting __conn attribute on SMTPChannel is deprecated, " + "set 'conn' instead", DeprecationWarning, 2) + self.conn = value + + @property + def __addr(self): + warn("Access to __addr attribute on SMTPChannel is deprecated, " + "use 'addr' instead", DeprecationWarning, 2) + return self.addr + @__addr.setter + def __addr(self, value): + warn("Setting __addr attribute on SMTPChannel is deprecated, " + "set 'addr' instead", DeprecationWarning, 2) + self.addr = value + + # Overrides base class for convenience. + def push(self, msg): + asynchat.async_chat.push(self, bytes( + msg + '\r\n', 'utf-8' if self.require_SMTPUTF8 else 'ascii')) + + # Implementation of base class abstract method + def collect_incoming_data(self, data): + limit = None + if self.smtp_state == self.COMMAND: + limit = self.max_command_size_limit + elif self.smtp_state == self.DATA: + limit = self.data_size_limit + if limit and self.num_bytes > limit: + return + elif limit: + self.num_bytes += len(data) + if self._decode_data: + self.received_lines.append(str(data, 'utf-8')) + else: + self.received_lines.append(data) + + # Implementation of base class abstract method + def found_terminator(self): + line = self._emptystring.join(self.received_lines) + print('Data:', repr(line), file=DEBUGSTREAM) + self.received_lines = [] + if self.smtp_state == self.COMMAND: + sz, self.num_bytes = self.num_bytes, 0 + if not line: + self.push('500 Error: bad syntax') + return + if not self._decode_data: + line = str(line, 'utf-8') + i = line.find(' ') + if i < 0: + command = line.upper() + arg = None + else: + command = line[:i].upper() + arg = line[i+1:].strip() + max_sz = (self.command_size_limits[command] + if self.extended_smtp else self.command_size_limit) + if sz > max_sz: + self.push('500 Error: line too long') + return + method = getattr(self, 'smtp_' + command, None) + if not method: + self.push('500 Error: command "%s" not recognized' % command) + return + method(arg) + return + else: + if self.smtp_state != self.DATA: + self.push('451 Internal confusion') + self.num_bytes = 0 + return + if self.data_size_limit and self.num_bytes > self.data_size_limit: + self.push('552 Error: Too much mail data') + self.num_bytes = 0 + return + # Remove extraneous carriage returns and de-transparency according + # to RFC 5321, Section 4.5.2. + data = [] + for text in line.split(self._linesep): + if text and text[0] == self._dotsep: + data.append(text[1:]) + else: + data.append(text) + self.received_data = self._newline.join(data) + args = (self.peer, self.mailfrom, self.rcpttos, self.received_data) + kwargs = {} + if not self._decode_data: + kwargs = { + 'mail_options': self.mail_options, + 'rcpt_options': self.rcpt_options, + } + status = self.smtp_server.process_message(*args, **kwargs) + self._set_post_data_state() + if not status: + self.push('250 OK') + else: + self.push(status) + + # SMTP and ESMTP commands + def smtp_HELO(self, arg): + if not arg: + self.push('501 Syntax: HELO hostname') + return + # See issue #21783 for a discussion of this behavior. + if self.seen_greeting: + self.push('503 Duplicate HELO/EHLO') + return + self._set_rset_state() + self.seen_greeting = arg + self.push('250 %s' % self.fqdn) + + def smtp_EHLO(self, arg): + if not arg: + self.push('501 Syntax: EHLO hostname') + return + # See issue #21783 for a discussion of this behavior. + if self.seen_greeting: + self.push('503 Duplicate HELO/EHLO') + return + self._set_rset_state() + self.seen_greeting = arg + self.extended_smtp = True + self.push('250-%s' % self.fqdn) + if self.data_size_limit: + self.push('250-SIZE %s' % self.data_size_limit) + self.command_size_limits['MAIL'] += 26 + if not self._decode_data: + self.push('250-8BITMIME') + if self.enable_SMTPUTF8: + self.push('250-SMTPUTF8') + self.command_size_limits['MAIL'] += 10 + self.push('250 HELP') + + def smtp_NOOP(self, arg): + if arg: + self.push('501 Syntax: NOOP') + else: + self.push('250 OK') + + def smtp_QUIT(self, arg): + # args is ignored + self.push('221 Bye') + self.close_when_done() + + def _strip_command_keyword(self, keyword, arg): + keylen = len(keyword) + if arg[:keylen].upper() == keyword: + return arg[keylen:].strip() + return '' + + def _getaddr(self, arg): + if not arg: + return '', '' + if arg.lstrip().startswith('<'): + address, rest = get_angle_addr(arg) + else: + address, rest = get_addr_spec(arg) + if not address: + return address, rest + return address.addr_spec, rest + + def _getparams(self, params): + # Return params as dictionary. Return None if not all parameters + # appear to be syntactically valid according to RFC 1869. + result = {} + for param in params: + param, eq, value = param.partition('=') + if not param.isalnum() or eq and not value: + return None + result[param] = value if eq else True + return result + + def smtp_HELP(self, arg): + if arg: + extended = ' [SP ]' + lc_arg = arg.upper() + if lc_arg == 'EHLO': + self.push('250 Syntax: EHLO hostname') + elif lc_arg == 'HELO': + self.push('250 Syntax: HELO hostname') + elif lc_arg == 'MAIL': + msg = '250 Syntax: MAIL FROM:
' + if self.extended_smtp: + msg += extended + self.push(msg) + elif lc_arg == 'RCPT': + msg = '250 Syntax: RCPT TO:
' + if self.extended_smtp: + msg += extended + self.push(msg) + elif lc_arg == 'DATA': + self.push('250 Syntax: DATA') + elif lc_arg == 'RSET': + self.push('250 Syntax: RSET') + elif lc_arg == 'NOOP': + self.push('250 Syntax: NOOP') + elif lc_arg == 'QUIT': + self.push('250 Syntax: QUIT') + elif lc_arg == 'VRFY': + self.push('250 Syntax: VRFY
') + else: + self.push('501 Supported commands: EHLO HELO MAIL RCPT ' + 'DATA RSET NOOP QUIT VRFY') + else: + self.push('250 Supported commands: EHLO HELO MAIL RCPT DATA ' + 'RSET NOOP QUIT VRFY') + + def smtp_VRFY(self, arg): + if arg: + address, params = self._getaddr(arg) + if address: + self.push('252 Cannot VRFY user, but will accept message ' + 'and attempt delivery') + else: + self.push('502 Could not VRFY %s' % arg) + else: + self.push('501 Syntax: VRFY
') + + def smtp_MAIL(self, arg): + if not self.seen_greeting: + self.push('503 Error: send HELO first') + return + print('===> MAIL', arg, file=DEBUGSTREAM) + syntaxerr = '501 Syntax: MAIL FROM:
' + if self.extended_smtp: + syntaxerr += ' [SP ]' + if arg is None: + self.push(syntaxerr) + return + arg = self._strip_command_keyword('FROM:', arg) + address, params = self._getaddr(arg) + if not address: + self.push(syntaxerr) + return + if not self.extended_smtp and params: + self.push(syntaxerr) + return + if self.mailfrom: + self.push('503 Error: nested MAIL command') + return + self.mail_options = params.upper().split() + params = self._getparams(self.mail_options) + if params is None: + self.push(syntaxerr) + return + if not self._decode_data: + body = params.pop('BODY', '7BIT') + if body not in ['7BIT', '8BITMIME']: + self.push('501 Error: BODY can only be one of 7BIT, 8BITMIME') + return + if self.enable_SMTPUTF8: + smtputf8 = params.pop('SMTPUTF8', False) + if smtputf8 is True: + self.require_SMTPUTF8 = True + elif smtputf8 is not False: + self.push('501 Error: SMTPUTF8 takes no arguments') + return + size = params.pop('SIZE', None) + if size: + if not size.isdigit(): + self.push(syntaxerr) + return + elif self.data_size_limit and int(size) > self.data_size_limit: + self.push('552 Error: message size exceeds fixed maximum message size') + return + if len(params.keys()) > 0: + self.push('555 MAIL FROM parameters not recognized or not implemented') + return + self.mailfrom = address + print('sender:', self.mailfrom, file=DEBUGSTREAM) + self.push('250 OK') + + def smtp_RCPT(self, arg): + if not self.seen_greeting: + self.push('503 Error: send HELO first'); + return + print('===> RCPT', arg, file=DEBUGSTREAM) + if not self.mailfrom: + self.push('503 Error: need MAIL command') + return + syntaxerr = '501 Syntax: RCPT TO:
' + if self.extended_smtp: + syntaxerr += ' [SP ]' + if arg is None: + self.push(syntaxerr) + return + arg = self._strip_command_keyword('TO:', arg) + address, params = self._getaddr(arg) + if not address: + self.push(syntaxerr) + return + if not self.extended_smtp and params: + self.push(syntaxerr) + return + self.rcpt_options = params.upper().split() + params = self._getparams(self.rcpt_options) + if params is None: + self.push(syntaxerr) + return + # XXX currently there are no options we recognize. + if len(params.keys()) > 0: + self.push('555 RCPT TO parameters not recognized or not implemented') + return + self.rcpttos.append(address) + print('recips:', self.rcpttos, file=DEBUGSTREAM) + self.push('250 OK') + + def smtp_RSET(self, arg): + if arg: + self.push('501 Syntax: RSET') + return + self._set_rset_state() + self.push('250 OK') + + def smtp_DATA(self, arg): + if not self.seen_greeting: + self.push('503 Error: send HELO first'); + return + if not self.rcpttos: + self.push('503 Error: need RCPT command') + return + if arg: + self.push('501 Syntax: DATA') + return + self.smtp_state = self.DATA + self.set_terminator(b'\r\n.\r\n') + self.push('354 End data with .') + + # Commands that have not been implemented + def smtp_EXPN(self, arg): + self.push('502 EXPN not implemented') + + +class SMTPServer(asyncore.dispatcher): + # SMTPChannel class to use for managing client connections + channel_class = SMTPChannel + + def __init__(self, localaddr, remoteaddr, + data_size_limit=DATA_SIZE_DEFAULT, map=None, + enable_SMTPUTF8=False, decode_data=False): + self._localaddr = localaddr + self._remoteaddr = remoteaddr + self.data_size_limit = data_size_limit + self.enable_SMTPUTF8 = enable_SMTPUTF8 + self._decode_data = decode_data + if enable_SMTPUTF8 and decode_data: + raise ValueError("decode_data and enable_SMTPUTF8 cannot" + " be set to True at the same time") + asyncore.dispatcher.__init__(self, map=map) + try: + family = 0 if socket.has_ipv6 else socket.AF_INET + gai_results = socket.getaddrinfo(*localaddr, family=family, + type=socket.SOCK_STREAM) + self.create_socket(gai_results[0][0], gai_results[0][1]) + # try to re-use a server port if possible + self.set_reuse_addr() + self.bind(localaddr) + self.listen(5) + except: + self.close() + raise + else: + print('%s started at %s\n\tLocal addr: %s\n\tRemote addr:%s' % ( + self.__class__.__name__, time.ctime(time.time()), + localaddr, remoteaddr), file=DEBUGSTREAM) + + def handle_accepted(self, conn, addr): + print('Incoming connection from %s' % repr(addr), file=DEBUGSTREAM) + channel = self.channel_class(self, + conn, + addr, + self.data_size_limit, + self._map, + self.enable_SMTPUTF8, + self._decode_data) + + # API for "doing something useful with the message" + def process_message(self, peer, mailfrom, rcpttos, data, **kwargs): + """Override this abstract method to handle messages from the client. + + peer is a tuple containing (ipaddr, port) of the client that made the + socket connection to our smtp port. + + mailfrom is the raw address the client claims the message is coming + from. + + rcpttos is a list of raw addresses the client wishes to deliver the + message to. + + data is a string containing the entire full text of the message, + headers (if supplied) and all. It has been 'de-transparencied' + according to RFC 821, Section 4.5.2. In other words, a line + containing a '.' followed by other text has had the leading dot + removed. + + kwargs is a dictionary containing additional information. It is + empty if decode_data=True was given as init parameter, otherwise + it will contain the following keys: + 'mail_options': list of parameters to the mail command. All + elements are uppercase strings. Example: + ['BODY=8BITMIME', 'SMTPUTF8']. + 'rcpt_options': same, for the rcpt command. + + This function should return None for a normal '250 Ok' response; + otherwise, it should return the desired response string in RFC 821 + format. + + """ + raise NotImplementedError + + +class DebuggingServer(SMTPServer): + + def _print_message_content(self, peer, data): + inheaders = 1 + lines = data.splitlines() + for line in lines: + # headers first + if inheaders and not line: + peerheader = 'X-Peer: ' + peer[0] + if not isinstance(data, str): + # decoded_data=false; make header match other binary output + peerheader = repr(peerheader.encode('utf-8')) + print(peerheader) + inheaders = 0 + if not isinstance(data, str): + # Avoid spurious 'str on bytes instance' warning. + line = repr(line) + print(line) + + def process_message(self, peer, mailfrom, rcpttos, data, **kwargs): + print('---------- MESSAGE FOLLOWS ----------') + if kwargs: + if kwargs.get('mail_options'): + print('mail options: %s' % kwargs['mail_options']) + if kwargs.get('rcpt_options'): + print('rcpt options: %s\n' % kwargs['rcpt_options']) + self._print_message_content(peer, data) + print('------------ END MESSAGE ------------') + + +class PureProxy(SMTPServer): + def __init__(self, *args, **kwargs): + if 'enable_SMTPUTF8' in kwargs and kwargs['enable_SMTPUTF8']: + raise ValueError("PureProxy does not support SMTPUTF8.") + super(PureProxy, self).__init__(*args, **kwargs) + + def process_message(self, peer, mailfrom, rcpttos, data): + lines = data.split('\n') + # Look for the last header + i = 0 + for line in lines: + if not line: + break + i += 1 + lines.insert(i, 'X-Peer: %s' % peer[0]) + data = NEWLINE.join(lines) + refused = self._deliver(mailfrom, rcpttos, data) + # TBD: what to do with refused addresses? + print('we got some refusals:', refused, file=DEBUGSTREAM) + + def _deliver(self, mailfrom, rcpttos, data): + import smtplib + refused = {} + try: + s = smtplib.SMTP() + s.connect(self._remoteaddr[0], self._remoteaddr[1]) + try: + refused = s.sendmail(mailfrom, rcpttos, data) + finally: + s.quit() + except smtplib.SMTPRecipientsRefused as e: + print('got SMTPRecipientsRefused', file=DEBUGSTREAM) + refused = e.recipients + except (OSError, smtplib.SMTPException) as e: + print('got', e.__class__, file=DEBUGSTREAM) + # All recipients were refused. If the exception had an associated + # error code, use it. Otherwise,fake it with a non-triggering + # exception code. + errcode = getattr(e, 'smtp_code', -1) + errmsg = getattr(e, 'smtp_error', 'ignore') + for r in rcpttos: + refused[r] = (errcode, errmsg) + return refused + + +class Options: + setuid = True + classname = 'PureProxy' + size_limit = None + enable_SMTPUTF8 = False + + +def parseargs(): + global DEBUGSTREAM + try: + opts, args = getopt.getopt( + sys.argv[1:], 'nVhc:s:du', + ['class=', 'nosetuid', 'version', 'help', 'size=', 'debug', + 'smtputf8']) + except getopt.error as e: + usage(1, e) + + options = Options() + for opt, arg in opts: + if opt in ('-h', '--help'): + usage(0) + elif opt in ('-V', '--version'): + print(__version__) + sys.exit(0) + elif opt in ('-n', '--nosetuid'): + options.setuid = False + elif opt in ('-c', '--class'): + options.classname = arg + elif opt in ('-d', '--debug'): + DEBUGSTREAM = sys.stderr + elif opt in ('-u', '--smtputf8'): + options.enable_SMTPUTF8 = True + elif opt in ('-s', '--size'): + try: + int_size = int(arg) + options.size_limit = int_size + except: + print('Invalid size: ' + arg, file=sys.stderr) + sys.exit(1) + + # parse the rest of the arguments + if len(args) < 1: + localspec = 'localhost:8025' + remotespec = 'localhost:25' + elif len(args) < 2: + localspec = args[0] + remotespec = 'localhost:25' + elif len(args) < 3: + localspec = args[0] + remotespec = args[1] + else: + usage(1, 'Invalid arguments: %s' % COMMASPACE.join(args)) + + # split into host/port pairs + i = localspec.find(':') + if i < 0: + usage(1, 'Bad local spec: %s' % localspec) + options.localhost = localspec[:i] + try: + options.localport = int(localspec[i+1:]) + except ValueError: + usage(1, 'Bad local port: %s' % localspec) + i = remotespec.find(':') + if i < 0: + usage(1, 'Bad remote spec: %s' % remotespec) + options.remotehost = remotespec[:i] + try: + options.remoteport = int(remotespec[i+1:]) + except ValueError: + usage(1, 'Bad remote port: %s' % remotespec) + return options + + +if __name__ == '__main__': + options = parseargs() + # Become nobody + classname = options.classname + if "." in classname: + lastdot = classname.rfind(".") + mod = __import__(classname[:lastdot], globals(), locals(), [""]) + classname = classname[lastdot+1:] + else: + import __main__ as mod + class_ = getattr(mod, classname) + proxy = class_((options.localhost, options.localport), + (options.remotehost, options.remoteport), + options.size_limit, enable_SMTPUTF8=options.enable_SMTPUTF8) + if options.setuid: + try: + import pwd + except ImportError: + print('Cannot import module "pwd"; try running with -n option.', file=sys.stderr) + sys.exit(1) + nobody = pwd.getpwnam('nobody')[2] + try: + os.setuid(nobody) + except PermissionError: + print('Cannot setuid "nobody"; try running with -n option.', file=sys.stderr) + sys.exit(1) + try: + asyncore.loop() + except KeyboardInterrupt: + pass diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/socket_helper.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/socket_helper.py new file mode 100644 index 0000000000000000000000000000000000000000..a41e487f3e4bc52012425e30eab9b430a3b3a7ab --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/socket_helper.py @@ -0,0 +1,343 @@ +import contextlib +import errno +import os.path +import socket +import sys +import subprocess +import tempfile +import unittest + +from .. import support + +HOST = "localhost" +HOSTv4 = "127.0.0.1" +HOSTv6 = "::1" + +# WASI SDK 15.0 does not provide gethostname, stub raises OSError ENOTSUP. +has_gethostname = not support.is_wasi + + +def find_unused_port(family=socket.AF_INET, socktype=socket.SOCK_STREAM): + """Returns an unused port that should be suitable for binding. This is + achieved by creating a temporary socket with the same family and type as + the 'sock' parameter (default is AF_INET, SOCK_STREAM), and binding it to + the specified host address (defaults to 0.0.0.0) with the port set to 0, + eliciting an unused ephemeral port from the OS. The temporary socket is + then closed and deleted, and the ephemeral port is returned. + + Either this method or bind_port() should be used for any tests where a + server socket needs to be bound to a particular port for the duration of + the test. Which one to use depends on whether the calling code is creating + a python socket, or if an unused port needs to be provided in a constructor + or passed to an external program (i.e. the -accept argument to openssl's + s_server mode). Always prefer bind_port() over find_unused_port() where + possible. Hard coded ports should *NEVER* be used. As soon as a server + socket is bound to a hard coded port, the ability to run multiple instances + of the test simultaneously on the same host is compromised, which makes the + test a ticking time bomb in a buildbot environment. On Unix buildbots, this + may simply manifest as a failed test, which can be recovered from without + intervention in most cases, but on Windows, the entire python process can + completely and utterly wedge, requiring someone to log in to the buildbot + and manually kill the affected process. + + (This is easy to reproduce on Windows, unfortunately, and can be traced to + the SO_REUSEADDR socket option having different semantics on Windows versus + Unix/Linux. On Unix, you can't have two AF_INET SOCK_STREAM sockets bind, + listen and then accept connections on identical host/ports. An EADDRINUSE + OSError will be raised at some point (depending on the platform and + the order bind and listen were called on each socket). + + However, on Windows, if SO_REUSEADDR is set on the sockets, no EADDRINUSE + will ever be raised when attempting to bind two identical host/ports. When + accept() is called on each socket, the second caller's process will steal + the port from the first caller, leaving them both in an awkwardly wedged + state where they'll no longer respond to any signals or graceful kills, and + must be forcibly killed via OpenProcess()/TerminateProcess(). + + The solution on Windows is to use the SO_EXCLUSIVEADDRUSE socket option + instead of SO_REUSEADDR, which effectively affords the same semantics as + SO_REUSEADDR on Unix. Given the propensity of Unix developers in the Open + Source world compared to Windows ones, this is a common mistake. A quick + look over OpenSSL's 0.9.8g source shows that they use SO_REUSEADDR when + openssl.exe is called with the 's_server' option, for example. See + http://bugs.python.org/issue2550 for more info. The following site also + has a very thorough description about the implications of both REUSEADDR + and EXCLUSIVEADDRUSE on Windows: + https://learn.microsoft.com/windows/win32/winsock/using-so-reuseaddr-and-so-exclusiveaddruse + + XXX: although this approach is a vast improvement on previous attempts to + elicit unused ports, it rests heavily on the assumption that the ephemeral + port returned to us by the OS won't immediately be dished back out to some + other process when we close and delete our temporary socket but before our + calling code has a chance to bind the returned port. We can deal with this + issue if/when we come across it. + """ + + with socket.socket(family, socktype) as tempsock: + port = bind_port(tempsock) + del tempsock + return port + +def bind_port(sock, host=HOST): + """Bind the socket to a free port and return the port number. Relies on + ephemeral ports in order to ensure we are using an unbound port. This is + important as many tests may be running simultaneously, especially in a + buildbot environment. This method raises an exception if the sock.family + is AF_INET and sock.type is SOCK_STREAM, *and* the socket has SO_REUSEADDR + or SO_REUSEPORT set on it. Tests should *never* set these socket options + for TCP/IP sockets. The only case for setting these options is testing + multicasting via multiple UDP sockets. + + Additionally, if the SO_EXCLUSIVEADDRUSE socket option is available (i.e. + on Windows), it will be set on the socket. This will prevent anyone else + from bind()'ing to our host/port for the duration of the test. + """ + + if sock.family == socket.AF_INET and sock.type == socket.SOCK_STREAM: + if hasattr(socket, 'SO_REUSEADDR'): + if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) == 1: + raise support.TestFailed("tests should never set the " + "SO_REUSEADDR socket option on " + "TCP/IP sockets!") + if hasattr(socket, 'SO_REUSEPORT'): + try: + if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1: + raise support.TestFailed("tests should never set the " + "SO_REUSEPORT socket option on " + "TCP/IP sockets!") + except OSError: + # Python's socket module was compiled using modern headers + # thus defining SO_REUSEPORT but this process is running + # under an older kernel that does not support SO_REUSEPORT. + pass + if hasattr(socket, 'SO_EXCLUSIVEADDRUSE'): + sock.setsockopt(socket.SOL_SOCKET, socket.SO_EXCLUSIVEADDRUSE, 1) + + sock.bind((host, 0)) + port = sock.getsockname()[1] + return port + +def bind_unix_socket(sock, addr): + """Bind a unix socket, raising SkipTest if PermissionError is raised.""" + assert sock.family == socket.AF_UNIX + try: + sock.bind(addr) + except PermissionError: + sock.close() + raise unittest.SkipTest('cannot bind AF_UNIX sockets') + +def _is_ipv6_enabled(): + """Check whether IPv6 is enabled on this host.""" + if socket.has_ipv6: + sock = None + try: + sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) + sock.bind((HOSTv6, 0)) + return True + except OSError: + pass + finally: + if sock: + sock.close() + return False + +IPV6_ENABLED = _is_ipv6_enabled() + + +_bind_nix_socket_error = None +def skip_unless_bind_unix_socket(test): + """Decorator for tests requiring a functional bind() for unix sockets.""" + if not hasattr(socket, 'AF_UNIX'): + return unittest.skip('No UNIX Sockets')(test) + global _bind_nix_socket_error + if _bind_nix_socket_error is None: + from .os_helper import TESTFN, unlink + path = TESTFN + "can_bind_unix_socket" + with socket.socket(socket.AF_UNIX) as sock: + try: + sock.bind(path) + _bind_nix_socket_error = False + except OSError as e: + _bind_nix_socket_error = e + finally: + unlink(path) + if _bind_nix_socket_error: + msg = 'Requires a functional unix bind(): %s' % _bind_nix_socket_error + return unittest.skip(msg)(test) + else: + return test + + +def get_socket_conn_refused_errs(): + """ + Get the different socket error numbers ('errno') which can be received + when a connection is refused. + """ + errors = [errno.ECONNREFUSED] + if hasattr(errno, 'ENETUNREACH'): + # On Solaris, ENETUNREACH is returned sometimes instead of ECONNREFUSED + errors.append(errno.ENETUNREACH) + if hasattr(errno, 'EADDRNOTAVAIL'): + # bpo-31910: socket.create_connection() fails randomly + # with EADDRNOTAVAIL on Travis CI + errors.append(errno.EADDRNOTAVAIL) + if hasattr(errno, 'EHOSTUNREACH'): + # bpo-37583: The destination host cannot be reached + errors.append(errno.EHOSTUNREACH) + if not IPV6_ENABLED: + errors.append(errno.EAFNOSUPPORT) + return errors + + +_NOT_SET = object() + +@contextlib.contextmanager +def transient_internet(resource_name, *, timeout=_NOT_SET, errnos=()): + """Return a context manager that raises ResourceDenied when various issues + with the internet connection manifest themselves as exceptions.""" + import urllib.error + if timeout is _NOT_SET: + timeout = support.INTERNET_TIMEOUT + + default_errnos = [ + ('ECONNREFUSED', 111), + ('ECONNRESET', 104), + ('EHOSTUNREACH', 113), + ('ENETUNREACH', 101), + ('ETIMEDOUT', 110), + # socket.create_connection() fails randomly with + # EADDRNOTAVAIL on Travis CI. + ('EADDRNOTAVAIL', 99), + ] + default_gai_errnos = [ + ('EAI_AGAIN', -3), + ('EAI_FAIL', -4), + ('EAI_NONAME', -2), + ('EAI_NODATA', -5), + # Encountered when trying to resolve IPv6-only hostnames + ('WSANO_DATA', 11004), + ] + + denied = support.ResourceDenied("Resource %r is not available" % resource_name) + captured_errnos = errnos + gai_errnos = [] + if not captured_errnos: + captured_errnos = [getattr(errno, name, num) + for (name, num) in default_errnos] + gai_errnos = [getattr(socket, name, num) + for (name, num) in default_gai_errnos] + + def filter_error(err): + n = getattr(err, 'errno', None) + if (isinstance(err, TimeoutError) or + (isinstance(err, socket.gaierror) and n in gai_errnos) or + (isinstance(err, urllib.error.HTTPError) and + 500 <= err.code <= 599) or + (isinstance(err, urllib.error.URLError) and + (("ConnectionRefusedError" in err.reason) or + ("TimeoutError" in err.reason) or + ("EOFError" in err.reason))) or + n in captured_errnos): + if not support.verbose: + sys.stderr.write(denied.args[0] + "\n") + raise denied from err + + old_timeout = socket.getdefaulttimeout() + try: + if timeout is not None: + socket.setdefaulttimeout(timeout) + yield + except OSError as err: + # urllib can wrap original socket errors multiple times (!), we must + # unwrap to get at the original error. + while True: + a = err.args + if len(a) >= 1 and isinstance(a[0], OSError): + err = a[0] + # The error can also be wrapped as args[1]: + # except socket.error as msg: + # raise OSError('socket error', msg) from msg + elif len(a) >= 2 and isinstance(a[1], OSError): + err = a[1] + # The error can also be wrapped as __cause__: + # raise URLError(f"ftp error: {exp}") from exp + elif isinstance(err, urllib.error.URLError) and err.__cause__: + err = err.__cause__ + else: + break + filter_error(err) + raise + # XXX should we catch generic exceptions and look for their + # __cause__ or __context__? + finally: + socket.setdefaulttimeout(old_timeout) + + +def create_unix_domain_name(): + """ + Create a UNIX domain name: socket.bind() argument of a AF_UNIX socket. + + Return a path relative to the current directory to get a short path + (around 27 ASCII characters). + """ + return tempfile.mktemp(prefix="test_python_", suffix='.sock', + dir=os.path.curdir) + + +# consider that sysctl values should not change while tests are running +_sysctl_cache = {} + +def _get_sysctl(name): + """Get a sysctl value as an integer.""" + try: + return _sysctl_cache[name] + except KeyError: + pass + + # At least Linux and FreeBSD support the "-n" option + cmd = ['sysctl', '-n', name] + proc = subprocess.run(cmd, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + text=True) + if proc.returncode: + support.print_warning(f'{' '.join(cmd)!r} command failed with ' + f'exit code {proc.returncode}') + # cache the error to only log the warning once + _sysctl_cache[name] = None + return None + output = proc.stdout + + # Parse '0\n' to get '0' + try: + value = int(output.strip()) + except Exception as exc: + support.print_warning(f'Failed to parse {' '.join(cmd)!r} ' + f'command output {output!r}: {exc!r}') + # cache the error to only log the warning once + _sysctl_cache[name] = None + return None + + _sysctl_cache[name] = value + return value + + +def tcp_blackhole(): + if not sys.platform.startswith('freebsd'): + return False + + # gh-109015: test if FreeBSD TCP blackhole is enabled + value = _get_sysctl('net.inet.tcp.blackhole') + if value is None: + # don't skip if we fail to get the sysctl value + return False + return (value != 0) + + +def skip_if_tcp_blackhole(test): + """Decorator skipping test if TCP blackhole is enabled.""" + skip_if = unittest.skipIf( + tcp_blackhole(), + "TCP blackhole is enabled (sysctl net.inet.tcp.blackhole)" + ) + return skip_if(test) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/strace_helper.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/strace_helper.py new file mode 100644 index 0000000000000000000000000000000000000000..cf95f7bdc7d2cadfcaf75b00495b1db0315adcee --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/strace_helper.py @@ -0,0 +1,209 @@ +import re +import sys +import textwrap +import os +import unittest +from dataclasses import dataclass +from functools import cache +from test import support +from test.support.script_helper import run_python_until_end + +_strace_binary = "/usr/bin/strace" +_syscall_regex = re.compile( + r"(?P[^(]*)\((?P[^)]*)\)\s*[=]\s*(?P.+)") +_returncode_regex = re.compile( + br"\+\+\+ exited with (?P\d+) \+\+\+") + + +@dataclass +class StraceEvent: + syscall: str + args: list[str] + returncode: str + + +@dataclass +class StraceResult: + strace_returncode: int + python_returncode: int + + """The event messages generated by strace. This is very similar to the + stderr strace produces with returncode marker section removed.""" + event_bytes: bytes + stdout: bytes + stderr: bytes + + def events(self): + """Parse event_bytes data into system calls for easier processing. + + This assumes the program under inspection doesn't print any non-utf8 + strings which would mix into the strace output.""" + decoded_events = self.event_bytes.decode('utf-8', 'surrogateescape') + matches = [ + _syscall_regex.match(event) + for event in decoded_events.splitlines() + ] + return [ + StraceEvent(match["syscall"], + [arg.strip() for arg in (match["args"].split(","))], + match["returncode"]) for match in matches if match + ] + + def sections(self): + """Find all "MARK " writes and use them to make groups of events. + + This is useful to avoid variable / overhead events, like those at + interpreter startup or when opening a file so a test can verify just + the small case under study.""" + current_section = "__startup" + sections = {current_section: []} + for event in self.events(): + if event.syscall == 'write' and len( + event.args) > 2 and event.args[1].startswith("\"MARK "): + # Found a new section, don't include the write in the section + # but all events until next mark should be in that section + current_section = event.args[1].split( + " ", 1)[1].removesuffix('\\n"') + if current_section not in sections: + sections[current_section] = list() + else: + sections[current_section].append(event) + + return sections + +def _filter_memory_call(call): + # mmap can operate on a fd or "MAP_ANONYMOUS" which gives a block of memory. + # Ignore "MAP_ANONYMOUS + the "MAP_ANON" alias. + if call.syscall == "mmap" and "MAP_ANON" in call.args[3]: + return True + + if call.syscall in ("munmap", "mprotect"): + return True + + return False + + +def filter_memory(syscalls): + """Filter out memory allocation calls from File I/O calls. + + Some calls (mmap, munmap, etc) can be used on files or to just get a block + of memory. Use this function to filter out the memory related calls from + other calls.""" + + return [call for call in syscalls if not _filter_memory_call(call)] + + +@support.requires_subprocess() +def strace_python(code, strace_flags, check=True): + """Run strace and return the trace. + + Sets strace_returncode and python_returncode to `-1` on error.""" + res = None + + def _make_error(reason, details): + return StraceResult( + strace_returncode=-1, + python_returncode=-1, + event_bytes= f"error({reason},details={details!r}) = -1".encode('utf-8'), + stdout=res.out if res else b"", + stderr=res.err if res else b"") + + # Run strace, and get out the raw text + try: + res, cmd_line = run_python_until_end( + "-c", + textwrap.dedent(code), + __run_using_command=[_strace_binary] + strace_flags, + ) + except OSError as err: + return _make_error("Caught OSError", err) + + if check and res.rc: + res.fail(cmd_line) + + # Get out program returncode + stripped = res.err.strip() + output = stripped.rsplit(b"\n", 1) + if len(output) != 2: + return _make_error("Expected strace events and exit code line", + stripped[-50:]) + + returncode_match = _returncode_regex.match(output[1]) + if not returncode_match: + return _make_error("Expected to find returncode in last line.", + output[1][:50]) + + python_returncode = int(returncode_match["returncode"]) + if check and python_returncode: + res.fail(cmd_line) + + return StraceResult(strace_returncode=res.rc, + python_returncode=python_returncode, + event_bytes=output[0], + stdout=res.out, + stderr=res.err) + + +def get_events(code, strace_flags, prelude, cleanup): + # NOTE: The flush is currently required to prevent the prints from getting + # buffered and done all at once at exit + prelude = textwrap.dedent(prelude) + code = textwrap.dedent(code) + cleanup = textwrap.dedent(cleanup) + to_run = f""" +print("MARK prelude", flush=True) +{prelude} +print("MARK code", flush=True) +{code} +print("MARK cleanup", flush=True) +{cleanup} +print("MARK __shutdown", flush=True) + """ + trace = strace_python(to_run, strace_flags) + all_sections = trace.sections() + return all_sections['code'] + + +def get_syscalls(code, strace_flags, prelude="", cleanup="", + ignore_memory=True): + """Get the syscalls which a given chunk of python code generates""" + events = get_events(code, strace_flags, prelude=prelude, cleanup=cleanup) + + if ignore_memory: + events = filter_memory(events) + + return [ev.syscall for ev in events] + + +# Moderately expensive (spawns a subprocess), so share results when possible. +@cache +def _can_strace(): + res = strace_python("import sys; sys.exit(0)", + # --trace option needs strace 5.5 (gh-133741) + ["--trace=%process"], + check=False) + if res.strace_returncode == 0 and res.python_returncode == 0: + assert res.events(), "Should have parsed multiple calls" + return True + return False + + +def requires_strace(): + if sys.platform != "linux": + return unittest.skip("Linux only, requires strace.") + + if "LD_PRELOAD" in os.environ: + # Distribution packaging (ex. Debian `fakeroot` and Gentoo `sandbox`) + # use LD_PRELOAD to intercept system calls, which changes the overall + # set of system calls which breaks tests expecting a specific set of + # system calls). + return unittest.skip("Not supported when LD_PRELOAD is intercepting system calls.") + + if support.check_sanitizer(address=True, memory=True): + return unittest.skip("LeakSanitizer does not work under ptrace (strace, gdb, etc)") + + return unittest.skipUnless(_can_strace(), "Requires working strace") + + +__all__ = ["filter_memory", "get_events", "get_syscalls", "requires_strace", + "strace_python", "StraceEvent", "StraceResult"] diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/testcase.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/testcase.py new file mode 100644 index 0000000000000000000000000000000000000000..fad1e4cb3499c07ba7ca7fc8bdc36be5cfcaaa58 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/testcase.py @@ -0,0 +1,65 @@ +from math import copysign, isnan + + +class ExceptionIsLikeMixin: + def assertExceptionIsLike(self, exc, template): + """ + Passes when the provided `exc` matches the structure of `template`. + Individual exceptions don't have to be the same objects or even pass + an equality test: they only need to be the same type and contain equal + `exc_obj.args`. + """ + if exc is None and template is None: + return + + if template is None: + self.fail(f"unexpected exception: {exc}") + + if exc is None: + self.fail(f"expected an exception like {template!r}, got None") + + if not isinstance(exc, ExceptionGroup): + self.assertEqual(exc.__class__, template.__class__) + self.assertEqual(exc.args[0], template.args[0]) + else: + self.assertEqual(exc.message, template.message) + self.assertEqual(len(exc.exceptions), len(template.exceptions)) + for e, t in zip(exc.exceptions, template.exceptions): + self.assertExceptionIsLike(e, t) + + +class FloatsAreIdenticalMixin: + def assertFloatsAreIdentical(self, x, y): + """Fail unless floats x and y are identical, in the sense that: + (1) both x and y are nans, or + (2) both x and y are infinities, with the same sign, or + (3) both x and y are zeros, with the same sign, or + (4) x and y are both finite and nonzero, and x == y + + """ + msg = 'floats {!r} and {!r} are not identical' + + if isnan(x) or isnan(y): + if isnan(x) and isnan(y): + return + elif x == y: + if x != 0.0: + return + # both zero; check that signs match + elif copysign(1.0, x) == copysign(1.0, y): + return + else: + msg += ': zeros have different signs' + self.fail(msg.format(x, y)) + + +class ComplexesAreIdenticalMixin(FloatsAreIdenticalMixin): + def assertComplexesAreIdentical(self, x, y): + """Fail unless complex numbers x and y have equal values and signs. + + In particular, if x and y both have real (or imaginary) part + zero, but the zeros have different signs, this test will fail. + + """ + self.assertFloatsAreIdentical(x.real, y.real) + self.assertFloatsAreIdentical(x.imag, y.imag) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/threading_helper.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/threading_helper.py new file mode 100644 index 0000000000000000000000000000000000000000..cf87233f0e2e938a9f2e7d7906844ca009416432 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/threading_helper.py @@ -0,0 +1,285 @@ +import _thread +import contextlib +import functools +import sys +import threading +import time +import unittest + +from test import support + + +#======================================================================= +# Threading support to prevent reporting refleaks when running regrtest.py -R + +# NOTE: we use thread._count() rather than threading.enumerate() (or the +# moral equivalent thereof) because a threading.Thread object is still alive +# until its __bootstrap() method has returned, even after it has been +# unregistered from the threading module. +# thread._count(), on the other hand, only gets decremented *after* the +# __bootstrap() method has returned, which gives us reliable reference counts +# at the end of a test run. + + +def threading_setup(): + return _thread._count(), len(threading._dangling) + + +def threading_cleanup(*original_values): + orig_count, orig_ndangling = original_values + + timeout = 1.0 + for _ in support.sleeping_retry(timeout, error=False): + # Copy the thread list to get a consistent output. threading._dangling + # is a WeakSet, its value changes when it's read. + dangling_threads = list(threading._dangling) + count = _thread._count() + + if count <= orig_count: + return + + # Timeout! + support.environment_altered = True + support.print_warning( + f"threading_cleanup() failed to clean up threads " + f"in {timeout:.1f} seconds\n" + f" before: thread count={orig_count}, dangling={orig_ndangling}\n" + f" after: thread count={count}, dangling={len(dangling_threads)}") + for thread in dangling_threads: + support.print_warning(f"Dangling thread: {thread!r}") + + # The warning happens when a test spawns threads and some of these threads + # are still running after the test completes. To fix this warning, join + # threads explicitly to wait until they complete. + # + # To make the warning more likely, reduce the timeout. + + +def reap_threads(func): + """Use this function when threads are being used. This will + ensure that the threads are cleaned up even when the test fails. + """ + @functools.wraps(func) + def decorator(*args): + key = threading_setup() + try: + return func(*args) + finally: + threading_cleanup(*key) + return decorator + + +@contextlib.contextmanager +def wait_threads_exit(timeout=None): + """ + bpo-31234: Context manager to wait until all threads created in the with + statement exit. + + Use _thread.count() to check if threads exited. Indirectly, wait until + threads exit the internal t_bootstrap() C function of the _thread module. + + threading_setup() and threading_cleanup() are designed to emit a warning + if a test leaves running threads in the background. This context manager + is designed to cleanup threads started by the _thread.start_new_thread() + which doesn't allow to wait for thread exit, whereas thread.Thread has a + join() method. + """ + if timeout is None: + timeout = support.SHORT_TIMEOUT + old_count = _thread._count() + try: + yield + finally: + start_time = time.monotonic() + for _ in support.sleeping_retry(timeout, error=False): + support.gc_collect() + count = _thread._count() + if count <= old_count: + break + else: + dt = time.monotonic() - start_time + msg = (f"wait_threads() failed to cleanup {count - old_count} " + f"threads after {dt:.1f} seconds " + f"(count: {count}, old count: {old_count})") + raise AssertionError(msg) + + +def join_thread(thread, timeout=None): + """Join a thread. Raise an AssertionError if the thread is still alive + after timeout seconds. + """ + if timeout is None: + timeout = support.SHORT_TIMEOUT + thread.join(timeout) + if thread.is_alive(): + msg = f"failed to join the thread in {timeout:.1f} seconds" + raise AssertionError(msg) + + +@contextlib.contextmanager +def start_threads(threads, unlock=None): + try: + import faulthandler + except ImportError: + # It isn't supported on subinterpreters yet. + faulthandler = None + threads = list(threads) + started = [] + try: + try: + for t in threads: + t.start() + started.append(t) + except: + if support.verbose: + print("Can't start %d threads, only %d threads started" % + (len(threads), len(started))) + raise + yield + finally: + try: + if unlock: + unlock() + endtime = time.monotonic() + for timeout in range(1, 16): + endtime += 60 + for t in started: + t.join(max(endtime - time.monotonic(), 0.01)) + started = [t for t in started if t.is_alive()] + if not started: + break + if support.verbose: + print('Unable to join %d threads during a period of ' + '%d minutes' % (len(started), timeout)) + finally: + started = [t for t in started if t.is_alive()] + if started: + if faulthandler is not None: + faulthandler.dump_traceback(sys.stdout) + raise AssertionError('Unable to join %d threads' % len(started)) + + +class catch_threading_exception: + """ + Context manager catching threading.Thread exception using + threading.excepthook. + + Attributes set when an exception is caught: + + * exc_type + * exc_value + * exc_traceback + * thread + + See threading.excepthook() documentation for these attributes. + + These attributes are deleted at the context manager exit. + + Usage: + + with threading_helper.catch_threading_exception() as cm: + # code spawning a thread which raises an exception + ... + + # check the thread exception, use cm attributes: + # exc_type, exc_value, exc_traceback, thread + ... + + # exc_type, exc_value, exc_traceback, thread attributes of cm no longer + # exists at this point + # (to avoid reference cycles) + """ + + def __init__(self): + self.exc_type = None + self.exc_value = None + self.exc_traceback = None + self.thread = None + self._old_hook = None + + def _hook(self, args): + self.exc_type = args.exc_type + self.exc_value = args.exc_value + self.exc_traceback = args.exc_traceback + self.thread = args.thread + + def __enter__(self): + self._old_hook = threading.excepthook + threading.excepthook = self._hook + return self + + def __exit__(self, *exc_info): + threading.excepthook = self._old_hook + del self.exc_type + del self.exc_value + del self.exc_traceback + del self.thread + + +def _can_start_thread() -> bool: + """Detect whether Python can start new threads. + + Some WebAssembly platforms do not provide a working pthread + implementation. Thread support is stubbed and any attempt + to create a new thread fails. + + - wasm32-wasi does not have threading. + - wasm32-emscripten can be compiled with or without pthread + support (-s USE_PTHREADS / __EMSCRIPTEN_PTHREADS__). + """ + if sys.platform == "emscripten": + return sys._emscripten_info.pthreads + elif sys.platform == "wasi": + return False + else: + # assume all other platforms have working thread support. + return True + +can_start_thread = _can_start_thread() + +def requires_working_threading(*, module=False): + """Skip tests or modules that require working threading. + + Can be used as a function/class decorator or to skip an entire module. + """ + msg = "requires threading support" + if module: + if not can_start_thread: + raise unittest.SkipTest(msg) + else: + return unittest.skipUnless(can_start_thread, msg) + + +def run_concurrently(worker_func, nthreads=None, args=(), kwargs={}): + """ + Run the worker function(s) concurrently in multiple threads. + + If `worker_func` is a single callable, it is used for all threads. + If it is a list of callables, each callable is used for one thread. + """ + from collections.abc import Iterable + + if nthreads is None: + nthreads = len(worker_func) + if not isinstance(worker_func, Iterable): + worker_func = [worker_func] * nthreads + assert len(worker_func) == nthreads + + barrier = threading.Barrier(nthreads) + + def wrapper_func(func, *args, **kwargs): + # Wait for all threads to reach this point before proceeding. + barrier.wait() + func(*args, **kwargs) + + with catch_threading_exception() as cm: + workers = [ + threading.Thread(target=wrapper_func, args=(func, *args), kwargs=kwargs) + for func in worker_func + ] + with start_threads(workers): + pass + + # If a worker thread raises an exception, re-raise it. + if cm.exc_value is not None: + raise cm.exc_value diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/venv.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/venv.py new file mode 100644 index 0000000000000000000000000000000000000000..757392b51c81179ffcb80e05b3ab45947a4f55ff --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/venv.py @@ -0,0 +1,81 @@ +import contextlib +import logging +import os +import subprocess +import shlex +import sys +import sysconfig +import tempfile +import venv + + +class VirtualEnvironment: + def __init__(self, prefix, **venv_create_args): + self._logger = logging.getLogger(self.__class__.__name__) + venv.create(prefix, **venv_create_args) + self._prefix = prefix + self._paths = sysconfig.get_paths( + scheme='venv', + vars={'base': self.prefix}, + expand=True, + ) + + @classmethod + @contextlib.contextmanager + def from_tmpdir(cls, *, prefix=None, dir=None, **venv_create_args): + delete = not bool(os.environ.get('PYTHON_TESTS_KEEP_VENV')) + with tempfile.TemporaryDirectory(prefix=prefix, dir=dir, delete=delete) as tmpdir: + yield cls(tmpdir, **venv_create_args) + + @property + def prefix(self): + return self._prefix + + @property + def paths(self): + return self._paths + + @property + def interpreter(self): + return os.path.join(self.paths['scripts'], os.path.basename(sys.executable)) + + def _format_output(self, name, data, indent='\t'): + if not data: + return indent + f'{name}: (none)' + if len(data.splitlines()) == 1: + return indent + f'{name}: {data}' + else: + prefixed_lines = '\n'.join(indent + '> ' + line for line in data.splitlines()) + return indent + f'{name}:\n' + prefixed_lines + + def run(self, *args, **subprocess_args): + if subprocess_args.get('shell'): + raise ValueError('Running the subprocess in shell mode is not supported.') + default_args = { + 'capture_output': True, + 'check': True, + } + try: + result = subprocess.run([self.interpreter, *args], **default_args | subprocess_args) + except subprocess.CalledProcessError as e: + if e.returncode != 0: + self._logger.error( + f'Interpreter returned non-zero exit status {e.returncode}.\n' + + self._format_output('COMMAND', shlex.join(e.cmd)) + '\n' + + self._format_output('STDOUT', e.stdout.decode()) + '\n' + + self._format_output('STDERR', e.stderr.decode()) + '\n' + ) + raise + else: + return result + + +class VirtualEnvironmentMixin: + def venv(self, name=None, **venv_create_args): + venv_name = self.id() + if name: + venv_name += f'-{name}' + return VirtualEnvironment.from_tmpdir( + prefix=f'{venv_name}-venv-', + **venv_create_args, + ) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/warnings_helper.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/warnings_helper.py new file mode 100644 index 0000000000000000000000000000000000000000..5f6f14afd74a6ee9e9c415a4a83b93724fd12957 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/warnings_helper.py @@ -0,0 +1,207 @@ +import contextlib +import functools +import importlib +import re +import sys +import warnings + + +def import_deprecated(name): + """Import *name* while suppressing DeprecationWarning.""" + with warnings.catch_warnings(): + warnings.simplefilter('ignore', category=DeprecationWarning) + return importlib.import_module(name) + + +def check_syntax_warning(testcase, statement, errtext='', + *, lineno=1, offset=None): + # Test also that a warning is emitted only once. + from test.support import check_syntax_error + with warnings.catch_warnings(record=True) as warns: + warnings.simplefilter('always', SyntaxWarning) + compile(statement, '', 'exec') + testcase.assertEqual(len(warns), 1, warns) + + warn, = warns + testcase.assertIsSubclass(warn.category, SyntaxWarning) + if errtext: + testcase.assertRegex(str(warn.message), errtext) + testcase.assertEqual(warn.filename, '') + testcase.assertIsNotNone(warn.lineno) + if lineno is not None: + testcase.assertEqual(warn.lineno, lineno) + + # SyntaxWarning should be converted to SyntaxError when raised, + # since the latter contains more information and provides better + # error report. + with warnings.catch_warnings(record=True) as warns: + warnings.simplefilter('error', SyntaxWarning) + check_syntax_error(testcase, statement, errtext, + lineno=lineno, offset=offset) + # No warnings are leaked when a SyntaxError is raised. + testcase.assertEqual(warns, []) + + +def ignore_warnings(*, category): + """Decorator to suppress warnings. + + Use of context managers to hide warnings make diffs + more noisy and tools like 'git blame' less useful. + """ + def decorator(test): + @functools.wraps(test) + def wrapper(self, *args, **kwargs): + with warnings.catch_warnings(): + warnings.simplefilter('ignore', category=category) + return test(self, *args, **kwargs) + return wrapper + return decorator + + +class WarningsRecorder(object): + """Convenience wrapper for the warnings list returned on + entry to the warnings.catch_warnings() context manager. + """ + def __init__(self, warnings_list): + self._warnings = warnings_list + self._last = 0 + + def __getattr__(self, attr): + if len(self._warnings) > self._last: + return getattr(self._warnings[-1], attr) + elif attr in warnings.WarningMessage._WARNING_DETAILS: + return None + raise AttributeError("%r has no attribute %r" % (self, attr)) + + @property + def warnings(self): + return self._warnings[self._last:] + + def reset(self): + self._last = len(self._warnings) + + +@contextlib.contextmanager +def check_warnings(*filters, **kwargs): + """Context manager to silence warnings. + + Accept 2-tuples as positional arguments: + ("message regexp", WarningCategory) + + Optional argument: + - if 'quiet' is True, it does not fail if a filter catches nothing + (default True without argument, + default False if some filters are defined) + + Without argument, it defaults to: + check_warnings(("", Warning), quiet=True) + """ + quiet = kwargs.get('quiet') + if not filters: + filters = (("", Warning),) + # Preserve backward compatibility + if quiet is None: + quiet = True + return _filterwarnings(filters, quiet) + + +@contextlib.contextmanager +def check_no_warnings(testcase, message='', category=Warning, force_gc=False): + """Context manager to check that no warnings are emitted. + + This context manager enables a given warning within its scope + and checks that no warnings are emitted even with that warning + enabled. + + If force_gc is True, a garbage collection is attempted before checking + for warnings. This may help to catch warnings emitted when objects + are deleted, such as ResourceWarning. + + Other keyword arguments are passed to warnings.filterwarnings(). + """ + from test.support import gc_collect + with warnings.catch_warnings(record=True) as warns: + warnings.filterwarnings('always', + message=message, + category=category) + yield + if force_gc: + gc_collect() + testcase.assertEqual(warns, []) + + +@contextlib.contextmanager +def check_no_resource_warning(testcase): + """Context manager to check that no ResourceWarning is emitted. + + Usage: + + with check_no_resource_warning(self): + f = open(...) + ... + del f + + You must remove the object which may emit ResourceWarning before + the end of the context manager. + """ + with check_no_warnings(testcase, category=ResourceWarning, force_gc=True): + yield + + +def _filterwarnings(filters, quiet=False): + """Catch the warnings, then check if all the expected + warnings have been raised and re-raise unexpected warnings. + If 'quiet' is True, only re-raise the unexpected warnings. + """ + # Clear the warning registry of the calling module + # in order to re-raise the warnings. + frame = sys._getframe(2) + registry = frame.f_globals.get('__warningregistry__') + if registry: + registry.clear() + # Because test_warnings swap the module, we need to look up in the + # sys.modules dictionary. + wmod = sys.modules['warnings'] + with wmod.catch_warnings(record=True) as w: + # Set filter "always" to record all warnings. + wmod.simplefilter("always") + yield WarningsRecorder(w) + # Filter the recorded warnings + reraise = list(w) + missing = [] + for msg, cat in filters: + seen = False + for w in reraise[:]: + warning = w.message + # Filter out the matching messages + if (re.match(msg, str(warning), re.I) and + issubclass(warning.__class__, cat)): + seen = True + reraise.remove(w) + if not seen and not quiet: + # This filter caught nothing + missing.append((msg, cat.__name__)) + if reraise: + raise AssertionError("unhandled warning %s" % reraise[0]) + if missing: + raise AssertionError("filter (%r, %s) did not catch any warning" % + missing[0]) + + +@contextlib.contextmanager +def save_restore_warnings_filters(): + old_filters = warnings.filters[:] + try: + yield + finally: + warnings.filters[:] = old_filters + + +def _warn_about_deprecation(): + warnings.warn( + "This is used in test_support test to ensure" + " support.ignore_deprecations_from() works as expected." + " You should not be seeing this.", + DeprecationWarning, + stacklevel=0, + ) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/__main__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/__main__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..db474edbb59877ac986525f2b40dc399aef859a7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/__main__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/colorchooser.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/colorchooser.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5eeede3199944e150192835c637f51c1e00bb0d6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/colorchooser.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/commondialog.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/commondialog.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a845b43b7fdf001850996e0de773d5a1fad9be74 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/commondialog.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/constants.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/constants.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e18aabe266789c2b173b929e5f218a32ecda3858 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/constants.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/dialog.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/dialog.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a44e6dc3546c02d3bfc380df366bfa9514948e6b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/dialog.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/dnd.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/dnd.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e92f57b30ca1c2e74265a082d7eab4fcc1334b20 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/dnd.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/filedialog.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/filedialog.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3b210e0e1e9ca53e9fa27e2b483910e995febaad Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/filedialog.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/font.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/font.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7ae1d9e10a2cf26296d435ebded265c872434816 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/font.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/messagebox.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/messagebox.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..52a535d92054abecc8971ef6a9412325cb790a1a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/messagebox.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/scrolledtext.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/scrolledtext.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..43d9210bccb1e6fbe84f0d3d6f2885814f484154 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/scrolledtext.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/simpledialog.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/simpledialog.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d9856b3f5e4dbede71c598ca2a1627f59d83eece Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/simpledialog.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/ttk.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/ttk.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a424b037ddc933f89f945ddb8549b39e90692c7e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/ttk.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tomllib/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tomllib/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..33672260a0d4d9032cd73ee5c919e30a7651bcfa Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tomllib/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tomllib/__pycache__/_parser.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tomllib/__pycache__/_parser.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..10c29cc74218b7dc56d845ed065630a016eb60d2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tomllib/__pycache__/_parser.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tomllib/__pycache__/_re.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tomllib/__pycache__/_re.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..08136b69e6ca0487d935a62a270d88ce59e96499 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tomllib/__pycache__/_re.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tomllib/__pycache__/_types.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tomllib/__pycache__/_types.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2cb58225860416595a2d34422b17ce828cab11bd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tomllib/__pycache__/_types.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e2376c6c8b7a0b86ecdf5b9abec8f7a622821d9b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/__main__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/__main__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..76a002f195fc748d2c673830ec4eb0102d1e8027 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/__main__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/bytedesign.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/bytedesign.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4d6b6574428445bcf755324728849dd1de6c274a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/bytedesign.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/chaos.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/chaos.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0c128dff828f7e7929158cd99a51cf5785d9ee09 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/chaos.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/clock.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/clock.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..988095303ad561b35191c1cce6a01ee8751e8eac Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/clock.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/colormixer.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/colormixer.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..806c09c3e7562fb5cf732c24bd95b84dbb2cc138 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/colormixer.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/forest.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/forest.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..553bc1d7e9ddc21e1be51b4dff03f422c5235ff7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/forest.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/fractalcurves.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/fractalcurves.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f0405c65f103ef5402048e79008cdd0907200c24 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/fractalcurves.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/lindenmayer.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/lindenmayer.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..18f3a02515b0052c7d3d34f8957bbfd102449763 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/lindenmayer.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/minimal_hanoi.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/minimal_hanoi.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..697f6472a9e683f607da2b4b85a7c40357c0d505 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/minimal_hanoi.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/nim.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/nim.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..471a78311f969d75256bb12e29b3085919873b2f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/nim.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/paint.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/paint.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b82ead82a3bf9d90aeb2afc1259b7143f5662b37 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/paint.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/peace.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/peace.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2cbfb32fd6fc5067da9f09234d2476ee8cb737a8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/peace.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/penrose.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/penrose.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e2773edc4ec33b842efc7e4f947ffd8dc8c94a3e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/penrose.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/planet_and_moon.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/planet_and_moon.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..83cd88de2ed17d068654117b0310008405719bad Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/planet_and_moon.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/rosette.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/rosette.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6745b38882ca99a6cb8a41d5f1f5929e5f0d7a7a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/rosette.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/round_dance.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/round_dance.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7607bc48b32fbb55ee5ffba3f1375a05d308506c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/round_dance.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/sorting_animate.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/sorting_animate.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9a56e6a039ce5fe8441ee64de6be224418bf481c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/sorting_animate.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/tree.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/tree.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f563b6853fda034330c07134325d613b2a4b0186 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/tree.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/two_canvases.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/two_canvases.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2574242eb1d6acd204309e9e4df72e635f8127ca Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/two_canvases.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/yinyang.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/yinyang.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4faaa46362182c2c94dbe26798144822aaa2150a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/turtledemo/__pycache__/yinyang.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f53d65e827c93a7a63196b801f42493b4de3af56 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/__main__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/__main__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ab844c154ebd6df36b480c66f210d1bd3ca037b3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/__main__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/_log.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/_log.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..076fa11efb13d7f110297febed3dc917ff3189b3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/_log.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/async_case.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/async_case.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..022cf43b386da232ac69c6477fe9e468660b3364 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/async_case.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/case.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/case.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f681d3ea565c81b8f9d4e08cc7dcfe5c21a3857c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/case.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/loader.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/loader.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..82caeb03568a615a392a0ad111eb9b1fb89c02b3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/loader.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/main.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/main.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fb937b382a5ecd7e7eccf06d9e994405f4a6eccb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/main.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/result.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/result.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6759a737223f502f0650e4e247d143a7f51b26a4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/result.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/runner.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/runner.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4606c2c0b3ae9945d1e0d17d1896ded016d6b676 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/runner.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/signals.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/signals.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..be8f6e74f282b812342cfb2930e8e8ef2a7d3ff9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/signals.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/suite.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/suite.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e7f0b4f2586eaa2ff754fd262960d3c119877f1a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/suite.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/util.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/util.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6667baa43430c44ba215cc1a4580851703e669bd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/util.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/urllib/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/urllib/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..75d39090d048ec2719ecd3b0732c72442178690d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/urllib/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/urllib/__pycache__/error.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/urllib/__pycache__/error.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1bdda3d114142f63fd7de5fd8da3c456ad1ca6ed Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/urllib/__pycache__/error.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/urllib/__pycache__/parse.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/urllib/__pycache__/parse.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a7194d5e5cbc17287479bb95b6c3306a3e19760a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/urllib/__pycache__/parse.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/urllib/__pycache__/request.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/urllib/__pycache__/request.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4c32e5acc4b75cc1383af8dad539091d0893d764 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/urllib/__pycache__/request.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/urllib/__pycache__/response.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/urllib/__pycache__/response.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..959ce2a1b43dc538c70a9ed479b3e4a8674f38af Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/urllib/__pycache__/response.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/urllib/__pycache__/robotparser.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/urllib/__pycache__/robotparser.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..61478e5d91092a119a392fec6a68eb0c94f41392 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/urllib/__pycache__/robotparser.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e5710d3fc5cbfa590bdcf3f4a4661f26cca2c188 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/__pycache__/__main__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/__pycache__/__main__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8365331885932fe8a40b1c5ff5d70bcdbe2233f3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/__pycache__/__main__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/common/Activate.ps1 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/common/Activate.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..16ba5290faef35e77277fddb1afd0c48573bc54d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/common/Activate.ps1 @@ -0,0 +1,248 @@ +<# +.Synopsis +Activate a Python virtual environment for the current PowerShell session. + +.Description +Pushes the python executable for a virtual environment to the front of the +$Env:PATH environment variable and sets the prompt to signify that you are +in a Python virtual environment. Makes use of the command line switches as +well as the `pyvenv.cfg` file values present in the virtual environment. + +.Parameter VenvDir +Path to the directory that contains the virtual environment to activate. The +default value for this is the parent of the directory that the Activate.ps1 +script is located within. + +.Parameter Prompt +The prompt prefix to display when this virtual environment is activated. By +default, this prompt is the name of the virtual environment folder (VenvDir) +surrounded by parentheses and followed by a single space (ie. '(.venv) '). + +.Example +Activate.ps1 +Activates the Python virtual environment that contains the Activate.ps1 script. + +.Example +Activate.ps1 -Verbose +Activates the Python virtual environment that contains the Activate.ps1 script, +and shows extra information about the activation as it executes. + +.Example +Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv +Activates the Python virtual environment located in the specified location. + +.Example +Activate.ps1 -Prompt "MyPython" +Activates the Python virtual environment that contains the Activate.ps1 script, +and prefixes the current prompt with the specified string (surrounded in +parentheses) while the virtual environment is active. + +.Notes +On Windows, it may be required to enable this Activate.ps1 script by setting the +execution policy for the user. You can do this by issuing the following PowerShell +command: + +PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + +For more information on Execution Policies: +https://go.microsoft.com/fwlink/?LinkID=135170 + +#> +Param( + [Parameter(Mandatory = $false)] + [String] + $VenvDir, + [Parameter(Mandatory = $false)] + [String] + $Prompt +) + +<# Function declarations --------------------------------------------------- #> + +<# +.Synopsis +Remove all shell session elements added by the Activate script, including the +addition of the virtual environment's Python executable from the beginning of +the PATH variable. + +.Parameter NonDestructive +If present, do not remove this function from the global namespace for the +session. + +#> +function global:deactivate ([switch]$NonDestructive) { + # Revert to original values + + # The prior prompt: + if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) { + Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt + Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT + } + + # The prior PYTHONHOME: + if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) { + Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME + Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME + } + + # The prior PATH: + if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) { + Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH + Remove-Item -Path Env:_OLD_VIRTUAL_PATH + } + + # Just remove the VIRTUAL_ENV altogether: + if (Test-Path -Path Env:VIRTUAL_ENV) { + Remove-Item -Path env:VIRTUAL_ENV + } + + # Just remove VIRTUAL_ENV_PROMPT altogether. + if (Test-Path -Path Env:VIRTUAL_ENV_PROMPT) { + Remove-Item -Path env:VIRTUAL_ENV_PROMPT + } + + # Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether: + if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) { + Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force + } + + # Leave deactivate function in the global namespace if requested: + if (-not $NonDestructive) { + Remove-Item -Path function:deactivate + } +} + +<# +.Description +Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the +given folder, and returns them in a map. + +For each line in the pyvenv.cfg file, if that line can be parsed into exactly +two strings separated by `=` (with any amount of whitespace surrounding the =) +then it is considered a `key = value` line. The left hand string is the key, +the right hand is the value. + +If the value starts with a `'` or a `"` then the first and last character is +stripped from the value before being captured. + +.Parameter ConfigDir +Path to the directory that contains the `pyvenv.cfg` file. +#> +function Get-PyVenvConfig( + [String] + $ConfigDir +) { + Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg" + + # Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue). + $pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue + + # An empty map will be returned if no config file is found. + $pyvenvConfig = @{ } + + if ($pyvenvConfigPath) { + + Write-Verbose "File exists, parse `key = value` lines" + $pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath + + $pyvenvConfigContent | ForEach-Object { + $keyval = $PSItem -split "\s*=\s*", 2 + if ($keyval[0] -and $keyval[1]) { + $val = $keyval[1] + + # Remove extraneous quotations around a string value. + if ("'""".Contains($val.Substring(0, 1))) { + $val = $val.Substring(1, $val.Length - 2) + } + + $pyvenvConfig[$keyval[0]] = $val + Write-Verbose "Adding Key: '$($keyval[0])'='$val'" + } + } + } + return $pyvenvConfig +} + + +<# Begin Activate script --------------------------------------------------- #> + +# Determine the containing directory of this script +$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition +$VenvExecDir = Get-Item -Path $VenvExecPath + +Write-Verbose "Activation script is located in path: '$VenvExecPath'" +Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)" +Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)" + +# Set values required in priority: CmdLine, ConfigFile, Default +# First, get the location of the virtual environment, it might not be +# VenvExecDir if specified on the command line. +if ($VenvDir) { + Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values" +} +else { + Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir." + $VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/") + Write-Verbose "VenvDir=$VenvDir" +} + +# Next, read the `pyvenv.cfg` file to determine any required value such +# as `prompt`. +$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir + +# Next, set the prompt from the command line, or the config file, or +# just use the name of the virtual environment folder. +if ($Prompt) { + Write-Verbose "Prompt specified as argument, using '$Prompt'" +} +else { + Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value" + if ($pyvenvCfg -and $pyvenvCfg['prompt']) { + Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'" + $Prompt = $pyvenvCfg['prompt']; + } + else { + Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virtual environment)" + Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'" + $Prompt = Split-Path -Path $venvDir -Leaf + } +} + +Write-Verbose "Prompt = '$Prompt'" +Write-Verbose "VenvDir='$VenvDir'" + +# Deactivate any currently active virtual environment, but leave the +# deactivate function in place. +deactivate -nondestructive + +# Now set the environment variable VIRTUAL_ENV, used by many tools to determine +# that there is an activated venv. +$env:VIRTUAL_ENV = $VenvDir + +$env:VIRTUAL_ENV_PROMPT = $Prompt + +if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) { + + Write-Verbose "Setting prompt to '$Prompt'" + + # Set the prompt to include the env name + # Make sure _OLD_VIRTUAL_PROMPT is global + function global:_OLD_VIRTUAL_PROMPT { "" } + Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT + New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt + + function global:prompt { + Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) " + _OLD_VIRTUAL_PROMPT + } +} + +# Clear PYTHONHOME +if (Test-Path -Path Env:PYTHONHOME) { + Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME + Remove-Item -Path Env:PYTHONHOME +} + +# Add the venv to the PATH +Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH +$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH" diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/common/activate b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/common/activate new file mode 100644 index 0000000000000000000000000000000000000000..70673a265d41f803982f920b038693bc088aa0fc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/common/activate @@ -0,0 +1,76 @@ +# This file must be used with "source bin/activate" *from bash* +# You cannot run it directly + +deactivate () { + # reset old environment variables + if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then + PATH="${_OLD_VIRTUAL_PATH:-}" + export PATH + unset _OLD_VIRTUAL_PATH + fi + if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then + PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}" + export PYTHONHOME + unset _OLD_VIRTUAL_PYTHONHOME + fi + + # Call hash to forget past locations. Without forgetting + # past locations the $PATH changes we made may not be respected. + # See "man bash" for more details. hash is usually a builtin of your shell + hash -r 2> /dev/null + + if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then + PS1="${_OLD_VIRTUAL_PS1:-}" + export PS1 + unset _OLD_VIRTUAL_PS1 + fi + + unset VIRTUAL_ENV + unset VIRTUAL_ENV_PROMPT + if [ ! "${1:-}" = "nondestructive" ] ; then + # Self destruct! + unset -f deactivate + fi +} + +# unset irrelevant variables +deactivate nondestructive + +# on Windows, a path can contain colons and backslashes and has to be converted: +case "$(uname)" in + CYGWIN*|MSYS*|MINGW*) + # transform D:\path\to\venv to /d/path/to/venv on MSYS and MINGW + # and to /cygdrive/d/path/to/venv on Cygwin + VIRTUAL_ENV=$(cygpath __VENV_DIR__) + export VIRTUAL_ENV + ;; + *) + # use the path as-is + export VIRTUAL_ENV=__VENV_DIR__ + ;; +esac + +_OLD_VIRTUAL_PATH="$PATH" +PATH="$VIRTUAL_ENV/"__VENV_BIN_NAME__":$PATH" +export PATH + +VIRTUAL_ENV_PROMPT=__VENV_PROMPT__ +export VIRTUAL_ENV_PROMPT + +# unset PYTHONHOME if set +# this will fail if PYTHONHOME is set to the empty string (which is bad anyway) +# could use `if (set -u; : $PYTHONHOME) ;` in bash +if [ -n "${PYTHONHOME:-}" ] ; then + _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}" + unset PYTHONHOME +fi + +if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then + _OLD_VIRTUAL_PS1="${PS1:-}" + PS1="("__VENV_PROMPT__") ${PS1:-}" + export PS1 +fi + +# Call hash to forget past commands. Without forgetting +# past commands the $PATH changes we made may not be respected +hash -r 2> /dev/null diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/common/activate.fish b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/common/activate.fish new file mode 100644 index 0000000000000000000000000000000000000000..284a7469c99b5769215de855d7dc80d63a1ba874 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/common/activate.fish @@ -0,0 +1,69 @@ +# This file must be used with "source /bin/activate.fish" *from fish* +# (https://fishshell.com/). You cannot run it directly. + +function deactivate -d "Exit virtual environment and return to normal shell environment" + # reset old environment variables + if test -n "$_OLD_VIRTUAL_PATH" + set -gx PATH $_OLD_VIRTUAL_PATH + set -e _OLD_VIRTUAL_PATH + end + if test -n "$_OLD_VIRTUAL_PYTHONHOME" + set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME + set -e _OLD_VIRTUAL_PYTHONHOME + end + + if test -n "$_OLD_FISH_PROMPT_OVERRIDE" + set -e _OLD_FISH_PROMPT_OVERRIDE + # prevents error when using nested fish instances (Issue #93858) + if functions -q _old_fish_prompt + functions -e fish_prompt + functions -c _old_fish_prompt fish_prompt + functions -e _old_fish_prompt + end + end + + set -e VIRTUAL_ENV + set -e VIRTUAL_ENV_PROMPT + if test "$argv[1]" != "nondestructive" + # Self-destruct! + functions -e deactivate + end +end + +# Unset irrelevant variables. +deactivate nondestructive + +set -gx VIRTUAL_ENV __VENV_DIR__ + +set -gx _OLD_VIRTUAL_PATH $PATH +set -gx PATH "$VIRTUAL_ENV/"__VENV_BIN_NAME__ $PATH +set -gx VIRTUAL_ENV_PROMPT __VENV_PROMPT__ + +# Unset PYTHONHOME if set. +if set -q PYTHONHOME + set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME + set -e PYTHONHOME +end + +if test -z "$VIRTUAL_ENV_DISABLE_PROMPT" + # fish uses a function instead of an env var to generate the prompt. + + # Save the current fish_prompt function as the function _old_fish_prompt. + functions -c fish_prompt _old_fish_prompt + + # With the original prompt function renamed, we can override with our own. + function fish_prompt + # Save the return status of the last command. + set -l old_status $status + + # Output the venv prompt; color taken from the blue of the Python logo. + printf "%s(%s)%s " (set_color 4B8BBE) __VENV_PROMPT__ (set_color normal) + + # Restore the return status of the previous command. + echo "exit $old_status" | . + # Output the original/"old" prompt. + _old_fish_prompt + end + + set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV" +end diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/nt/activate.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/nt/activate.bat new file mode 100644 index 0000000000000000000000000000000000000000..9ac5c20b477838f15e47cf542d371cac9c89eea1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/nt/activate.bat @@ -0,0 +1,34 @@ +@echo off + +rem This file is UTF-8 encoded, so we need to update the current code page while executing it +for /f "tokens=2 delims=:." %%a in ('"%SystemRoot%\System32\chcp.com"') do ( + set _OLD_CODEPAGE=%%a +) +if defined _OLD_CODEPAGE ( + "%SystemRoot%\System32\chcp.com" 65001 > nul +) + +set "VIRTUAL_ENV=__VENV_DIR__" + +if not defined PROMPT set PROMPT=$P$G + +if defined _OLD_VIRTUAL_PROMPT set PROMPT=%_OLD_VIRTUAL_PROMPT% +if defined _OLD_VIRTUAL_PYTHONHOME set PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME% + +set "_OLD_VIRTUAL_PROMPT=%PROMPT%" +set "PROMPT=(__VENV_PROMPT__) %PROMPT%" + +if defined PYTHONHOME set _OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME% +set PYTHONHOME= + +if defined _OLD_VIRTUAL_PATH set PATH=%_OLD_VIRTUAL_PATH% +if not defined _OLD_VIRTUAL_PATH set _OLD_VIRTUAL_PATH=%PATH% + +set "PATH=%VIRTUAL_ENV%\__VENV_BIN_NAME__;%PATH%" +set "VIRTUAL_ENV_PROMPT=__VENV_PROMPT__" + +:END +if defined _OLD_CODEPAGE ( + "%SystemRoot%\System32\chcp.com" %_OLD_CODEPAGE% > nul + set _OLD_CODEPAGE= +) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/nt/deactivate.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/nt/deactivate.bat new file mode 100644 index 0000000000000000000000000000000000000000..44dae49537073789b536689bb940456e65929b99 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/nt/deactivate.bat @@ -0,0 +1,22 @@ +@echo off + +if defined _OLD_VIRTUAL_PROMPT ( + set "PROMPT=%_OLD_VIRTUAL_PROMPT%" +) +set _OLD_VIRTUAL_PROMPT= + +if defined _OLD_VIRTUAL_PYTHONHOME ( + set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%" + set _OLD_VIRTUAL_PYTHONHOME= +) + +if defined _OLD_VIRTUAL_PATH ( + set "PATH=%_OLD_VIRTUAL_PATH%" +) + +set _OLD_VIRTUAL_PATH= + +set VIRTUAL_ENV= +set VIRTUAL_ENV_PROMPT= + +:END diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/posix/activate.csh b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/posix/activate.csh new file mode 100644 index 0000000000000000000000000000000000000000..2a3fa835476ab9b44551831ab8b7ad43e86df64b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/posix/activate.csh @@ -0,0 +1,27 @@ +# This file must be used with "source bin/activate.csh" *from csh*. +# You cannot run it directly. + +# Created by Davide Di Blasi . +# Ported to Python 3.3 venv by Andrew Svetlov + +alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; unsetenv VIRTUAL_ENV_PROMPT; test "\!:*" != "nondestructive" && unalias deactivate' + +# Unset irrelevant variables. +deactivate nondestructive + +setenv VIRTUAL_ENV __VENV_DIR__ + +set _OLD_VIRTUAL_PATH="$PATH" +setenv PATH "$VIRTUAL_ENV/"__VENV_BIN_NAME__":$PATH" +setenv VIRTUAL_ENV_PROMPT __VENV_PROMPT__ + + +set _OLD_VIRTUAL_PROMPT="$prompt" + +if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then + set prompt = "("__VENV_PROMPT__") $prompt:q" +endif + +alias pydoc python -m pydoc + +rehash diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..21478913e21a89404a37131105218eb96e57c86b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/handlers.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/handlers.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0d90c1b709db9c2c39586cc3277af84188b4b4fc Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/handlers.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/headers.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/headers.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1929850b6742bf14feea92235147f215ad2f8b44 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/headers.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/simple_server.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/simple_server.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7ea4b9fa524db22190d0f3690f71a9d32a17bedb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/simple_server.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/types.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/types.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..341fcf1e82e306cbe867436bf8a48b3ada8399b1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/types.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/util.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/util.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f9712e446294a6babe1899f2b590086ddc44e8ef Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/util.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/validate.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/validate.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1849f1705f64ea381d034151031ee4d54173874a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/wsgiref/__pycache__/validate.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d14614f7df91260f57672b164ebcacd74d9a2dd0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/NodeFilter.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/NodeFilter.py new file mode 100644 index 0000000000000000000000000000000000000000..640e0bfd246ca5f9b61fd7ca79ad7b3e560a2a2d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/NodeFilter.py @@ -0,0 +1,27 @@ +# This is the Python mapping for interface NodeFilter from +# DOM2-Traversal-Range. It contains only constants. + +class NodeFilter: + """ + This is the DOM2 NodeFilter interface. It contains only constants. + """ + FILTER_ACCEPT = 1 + FILTER_REJECT = 2 + FILTER_SKIP = 3 + + SHOW_ALL = 0xFFFFFFFF + SHOW_ELEMENT = 0x00000001 + SHOW_ATTRIBUTE = 0x00000002 + SHOW_TEXT = 0x00000004 + SHOW_CDATA_SECTION = 0x00000008 + SHOW_ENTITY_REFERENCE = 0x00000010 + SHOW_ENTITY = 0x00000020 + SHOW_PROCESSING_INSTRUCTION = 0x00000040 + SHOW_COMMENT = 0x00000080 + SHOW_DOCUMENT = 0x00000100 + SHOW_DOCUMENT_TYPE = 0x00000200 + SHOW_DOCUMENT_FRAGMENT = 0x00000400 + SHOW_NOTATION = 0x00000800 + + def acceptNode(self, node): + raise NotImplementedError diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..dd7fb996afd616cfc811ea56a8d50345bf3ea7b6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__init__.py @@ -0,0 +1,140 @@ +"""W3C Document Object Model implementation for Python. + +The Python mapping of the Document Object Model is documented in the +Python Library Reference in the section on the xml.dom package. + +This package contains the following modules: + +minidom -- A simple implementation of the Level 1 DOM with namespace + support added (based on the Level 2 specification) and other + minor Level 2 functionality. + +pulldom -- DOM builder supporting on-demand tree-building for selected + subtrees of the document. + +""" + + +class Node: + """Class giving the NodeType constants.""" + __slots__ = () + + # DOM implementations may use this as a base class for their own + # Node implementations. If they don't, the constants defined here + # should still be used as the canonical definitions as they match + # the values given in the W3C recommendation. Client code can + # safely refer to these values in all tests of Node.nodeType + # values. + + ELEMENT_NODE = 1 + ATTRIBUTE_NODE = 2 + TEXT_NODE = 3 + CDATA_SECTION_NODE = 4 + ENTITY_REFERENCE_NODE = 5 + ENTITY_NODE = 6 + PROCESSING_INSTRUCTION_NODE = 7 + COMMENT_NODE = 8 + DOCUMENT_NODE = 9 + DOCUMENT_TYPE_NODE = 10 + DOCUMENT_FRAGMENT_NODE = 11 + NOTATION_NODE = 12 + + +#ExceptionCode +INDEX_SIZE_ERR = 1 +DOMSTRING_SIZE_ERR = 2 +HIERARCHY_REQUEST_ERR = 3 +WRONG_DOCUMENT_ERR = 4 +INVALID_CHARACTER_ERR = 5 +NO_DATA_ALLOWED_ERR = 6 +NO_MODIFICATION_ALLOWED_ERR = 7 +NOT_FOUND_ERR = 8 +NOT_SUPPORTED_ERR = 9 +INUSE_ATTRIBUTE_ERR = 10 +INVALID_STATE_ERR = 11 +SYNTAX_ERR = 12 +INVALID_MODIFICATION_ERR = 13 +NAMESPACE_ERR = 14 +INVALID_ACCESS_ERR = 15 +VALIDATION_ERR = 16 + + +class DOMException(Exception): + """Abstract base class for DOM exceptions. + Exceptions with specific codes are specializations of this class.""" + + def __init__(self, *args, **kw): + if self.__class__ is DOMException: + raise RuntimeError( + "DOMException should not be instantiated directly") + Exception.__init__(self, *args, **kw) + + def _get_code(self): + return self.code + + +class IndexSizeErr(DOMException): + code = INDEX_SIZE_ERR + +class DomstringSizeErr(DOMException): + code = DOMSTRING_SIZE_ERR + +class HierarchyRequestErr(DOMException): + code = HIERARCHY_REQUEST_ERR + +class WrongDocumentErr(DOMException): + code = WRONG_DOCUMENT_ERR + +class InvalidCharacterErr(DOMException): + code = INVALID_CHARACTER_ERR + +class NoDataAllowedErr(DOMException): + code = NO_DATA_ALLOWED_ERR + +class NoModificationAllowedErr(DOMException): + code = NO_MODIFICATION_ALLOWED_ERR + +class NotFoundErr(DOMException): + code = NOT_FOUND_ERR + +class NotSupportedErr(DOMException): + code = NOT_SUPPORTED_ERR + +class InuseAttributeErr(DOMException): + code = INUSE_ATTRIBUTE_ERR + +class InvalidStateErr(DOMException): + code = INVALID_STATE_ERR + +class SyntaxErr(DOMException): + code = SYNTAX_ERR + +class InvalidModificationErr(DOMException): + code = INVALID_MODIFICATION_ERR + +class NamespaceErr(DOMException): + code = NAMESPACE_ERR + +class InvalidAccessErr(DOMException): + code = INVALID_ACCESS_ERR + +class ValidationErr(DOMException): + code = VALIDATION_ERR + +class UserDataHandler: + """Class giving the operation constants for UserDataHandler.handle().""" + + # Based on DOM Level 3 (WD 9 April 2002) + + NODE_CLONED = 1 + NODE_IMPORTED = 2 + NODE_DELETED = 3 + NODE_RENAMED = 4 + +XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace" +XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/" +XHTML_NAMESPACE = "http://www.w3.org/1999/xhtml" +EMPTY_NAMESPACE = None +EMPTY_PREFIX = None + +from .domreg import getDOMImplementation, registerDOMImplementation # noqa: F401 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/NodeFilter.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/NodeFilter.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aa5f9f5efffeabdb9dda42fa807907b7c0787c1f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/NodeFilter.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..812a703999b2fbed3a251963ebdc3dcd66a32669 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/domreg.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/domreg.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1798e2dc9b9c26212f8131c8b09e1d6f318dab66 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/domreg.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/expatbuilder.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/expatbuilder.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..11b99c4d49678bca0634e9cfd0df07e742140cc6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/expatbuilder.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/minicompat.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/minicompat.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3da7a47ae0f1eda9b3b5bb5705ec7ff793be0dbd Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/minicompat.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/minidom.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/minidom.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7752e479d713f1aac2bc4ade78e44bae23dea0d7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/minidom.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/pulldom.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/pulldom.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..61e6d7206fa0c6700d78ab6c8a7b2b09f61e7707 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/pulldom.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/xmlbuilder.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/xmlbuilder.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b8c0fe1394623842bff6c1d74808caf85354bec6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/__pycache__/xmlbuilder.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/domreg.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/domreg.py new file mode 100644 index 0000000000000000000000000000000000000000..69c17eebb265daad3243e62018409d72942a93af --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/domreg.py @@ -0,0 +1,99 @@ +"""Registration facilities for DOM. This module should not be used +directly. Instead, the functions getDOMImplementation and +registerDOMImplementation should be imported from xml.dom.""" + +# This is a list of well-known implementations. Well-known names +# should be published by posting to xml-sig@python.org, and are +# subsequently recorded in this file. + +import sys + +well_known_implementations = { + 'minidom':'xml.dom.minidom', + '4DOM': 'xml.dom.DOMImplementation', + } + +# DOM implementations not officially registered should register +# themselves with their + +registered = {} + +def registerDOMImplementation(name, factory): + """registerDOMImplementation(name, factory) + + Register the factory function with the name. The factory function + should return an object which implements the DOMImplementation + interface. The factory function can either return the same object, + or a new one (e.g. if that implementation supports some + customization).""" + + registered[name] = factory + +def _good_enough(dom, features): + "_good_enough(dom, features) -> Return 1 if the dom offers the features" + for f,v in features: + if not dom.hasFeature(f,v): + return 0 + return 1 + +def getDOMImplementation(name=None, features=()): + """getDOMImplementation(name = None, features = ()) -> DOM implementation. + + Return a suitable DOM implementation. The name is either + well-known, the module name of a DOM implementation, or None. If + it is not None, imports the corresponding module and returns + DOMImplementation object if the import succeeds. + + If name is not given, consider the available implementations to + find one with the required feature set. If no implementation can + be found, raise an ImportError. The features list must be a sequence + of (feature, version) pairs which are passed to hasFeature.""" + + import os + creator = None + mod = well_known_implementations.get(name) + if mod: + mod = __import__(mod, {}, {}, ['getDOMImplementation']) + return mod.getDOMImplementation() + elif name: + return registered[name]() + elif not sys.flags.ignore_environment and "PYTHON_DOM" in os.environ: + return getDOMImplementation(name = os.environ["PYTHON_DOM"]) + + # User did not specify a name, try implementations in arbitrary + # order, returning the one that has the required features + if isinstance(features, str): + features = _parse_feature_string(features) + for creator in registered.values(): + dom = creator() + if _good_enough(dom, features): + return dom + + for creator in well_known_implementations.keys(): + try: + dom = getDOMImplementation(name = creator) + except Exception: # typically ImportError, or AttributeError + continue + if _good_enough(dom, features): + return dom + + raise ImportError("no suitable DOM implementation found") + +def _parse_feature_string(s): + features = [] + parts = s.split() + i = 0 + length = len(parts) + while i < length: + feature = parts[i] + if feature[0] in "0123456789": + raise ValueError("bad feature name: %r" % (feature,)) + i = i + 1 + version = None + if i < length: + v = parts[i] + if v[0] in "0123456789": + i = i + 1 + version = v + features.append((feature, version)) + return tuple(features) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/expatbuilder.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/expatbuilder.py new file mode 100644 index 0000000000000000000000000000000000000000..7dd667bf3fbe042d8d14ff1d07541cf52dc8f333 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/expatbuilder.py @@ -0,0 +1,962 @@ +"""Facility to use the Expat parser to load a minidom instance +from a string or file. + +This avoids all the overhead of SAX and pulldom to gain performance. +""" + +# Warning! +# +# This module is tightly bound to the implementation details of the +# minidom DOM and can't be used with other DOM implementations. This +# is due, in part, to a lack of appropriate methods in the DOM (there is +# no way to create Entity and Notation nodes via the DOM Level 2 +# interface), and for performance. The latter is the cause of some fairly +# cryptic code. +# +# Performance hacks: +# +# - .character_data_handler() has an extra case in which continuing +# data is appended to an existing Text node; this can be a +# speedup since pyexpat can break up character data into multiple +# callbacks even though we set the buffer_text attribute on the +# parser. This also gives us the advantage that we don't need a +# separate normalization pass. +# +# - Determining that a node exists is done using an identity comparison +# with None rather than a truth test; this avoids searching for and +# calling any methods on the node object if it exists. (A rather +# nice speedup is achieved this way as well!) + +from xml.dom import xmlbuilder, minidom, Node +from xml.dom import EMPTY_NAMESPACE, EMPTY_PREFIX, XMLNS_NAMESPACE +from xml.parsers import expat +from xml.dom.minidom import _append_child, _set_attribute_node +from xml.dom.NodeFilter import NodeFilter + +TEXT_NODE = Node.TEXT_NODE +CDATA_SECTION_NODE = Node.CDATA_SECTION_NODE +DOCUMENT_NODE = Node.DOCUMENT_NODE + +FILTER_ACCEPT = xmlbuilder.DOMBuilderFilter.FILTER_ACCEPT +FILTER_REJECT = xmlbuilder.DOMBuilderFilter.FILTER_REJECT +FILTER_SKIP = xmlbuilder.DOMBuilderFilter.FILTER_SKIP +FILTER_INTERRUPT = xmlbuilder.DOMBuilderFilter.FILTER_INTERRUPT + +theDOMImplementation = minidom.getDOMImplementation() + +# Expat typename -> TypeInfo +_typeinfo_map = { + "CDATA": minidom.TypeInfo(None, "cdata"), + "ENUM": minidom.TypeInfo(None, "enumeration"), + "ENTITY": minidom.TypeInfo(None, "entity"), + "ENTITIES": minidom.TypeInfo(None, "entities"), + "ID": minidom.TypeInfo(None, "id"), + "IDREF": minidom.TypeInfo(None, "idref"), + "IDREFS": minidom.TypeInfo(None, "idrefs"), + "NMTOKEN": minidom.TypeInfo(None, "nmtoken"), + "NMTOKENS": minidom.TypeInfo(None, "nmtokens"), + } + +class ElementInfo(object): + __slots__ = '_attr_info', '_model', 'tagName' + + def __init__(self, tagName, model=None): + self.tagName = tagName + self._attr_info = [] + self._model = model + + def __getstate__(self): + return self._attr_info, self._model, self.tagName + + def __setstate__(self, state): + self._attr_info, self._model, self.tagName = state + + def getAttributeType(self, aname): + for info in self._attr_info: + if info[1] == aname: + t = info[-2] + if t[0] == "(": + return _typeinfo_map["ENUM"] + else: + return _typeinfo_map[info[-2]] + return minidom._no_type + + def getAttributeTypeNS(self, namespaceURI, localName): + return minidom._no_type + + def isElementContent(self): + if self._model: + type = self._model[0] + return type not in (expat.model.XML_CTYPE_ANY, + expat.model.XML_CTYPE_MIXED) + else: + return False + + def isEmpty(self): + if self._model: + return self._model[0] == expat.model.XML_CTYPE_EMPTY + else: + return False + + def isId(self, aname): + for info in self._attr_info: + if info[1] == aname: + return info[-2] == "ID" + return False + + def isIdNS(self, euri, ename, auri, aname): + # not sure this is meaningful + return self.isId((auri, aname)) + +def _intern(builder, s): + return builder._intern_setdefault(s, s) + +def _parse_ns_name(builder, name): + assert ' ' in name + parts = name.split(' ') + intern = builder._intern_setdefault + if len(parts) == 3: + uri, localname, prefix = parts + prefix = intern(prefix, prefix) + qname = "%s:%s" % (prefix, localname) + qname = intern(qname, qname) + localname = intern(localname, localname) + elif len(parts) == 2: + uri, localname = parts + prefix = EMPTY_PREFIX + qname = localname = intern(localname, localname) + else: + raise ValueError("Unsupported syntax: spaces in URIs not supported: %r" % name) + return intern(uri, uri), localname, prefix, qname + + +class ExpatBuilder: + """Document builder that uses Expat to build a ParsedXML.DOM document + instance.""" + + def __init__(self, options=None): + if options is None: + options = xmlbuilder.Options() + self._options = options + if self._options.filter is not None: + self._filter = FilterVisibilityController(self._options.filter) + else: + self._filter = None + # This *really* doesn't do anything in this case, so + # override it with something fast & minimal. + self._finish_start_element = id + self._parser = None + self.reset() + + def createParser(self): + """Create a new parser object.""" + return expat.ParserCreate() + + def getParser(self): + """Return the parser object, creating a new one if needed.""" + if not self._parser: + self._parser = self.createParser() + self._intern_setdefault = self._parser.intern.setdefault + self._parser.buffer_text = True + self._parser.ordered_attributes = True + self._parser.specified_attributes = True + self.install(self._parser) + return self._parser + + def reset(self): + """Free all data structures used during DOM construction.""" + self.document = theDOMImplementation.createDocument( + EMPTY_NAMESPACE, None, None) + self.curNode = self.document + self._elem_info = self.document._elem_info + self._cdata = False + + def install(self, parser): + """Install the callbacks needed to build the DOM into the parser.""" + # This creates circular references! + parser.StartDoctypeDeclHandler = self.start_doctype_decl_handler + parser.StartElementHandler = self.first_element_handler + parser.EndElementHandler = self.end_element_handler + parser.ProcessingInstructionHandler = self.pi_handler + if self._options.entities: + parser.EntityDeclHandler = self.entity_decl_handler + parser.NotationDeclHandler = self.notation_decl_handler + if self._options.comments: + parser.CommentHandler = self.comment_handler + if self._options.cdata_sections: + parser.StartCdataSectionHandler = self.start_cdata_section_handler + parser.EndCdataSectionHandler = self.end_cdata_section_handler + parser.CharacterDataHandler = self.character_data_handler_cdata + else: + parser.CharacterDataHandler = self.character_data_handler + parser.ExternalEntityRefHandler = self.external_entity_ref_handler + parser.XmlDeclHandler = self.xml_decl_handler + parser.ElementDeclHandler = self.element_decl_handler + parser.AttlistDeclHandler = self.attlist_decl_handler + + def parseFile(self, file): + """Parse a document from a file object, returning the document + node.""" + parser = self.getParser() + first_buffer = True + try: + while buffer := file.read(16*1024): + parser.Parse(buffer, False) + if first_buffer and self.document.documentElement: + self._setup_subset(buffer) + first_buffer = False + parser.Parse(b"", True) + except ParseEscape: + pass + doc = self.document + self.reset() + self._parser = None + return doc + + def parseString(self, string): + """Parse a document from a string, returning the document node.""" + parser = self.getParser() + try: + parser.Parse(string, True) + self._setup_subset(string) + except ParseEscape: + pass + doc = self.document + self.reset() + self._parser = None + return doc + + def _setup_subset(self, buffer): + """Load the internal subset if there might be one.""" + if self.document.doctype: + extractor = InternalSubsetExtractor() + extractor.parseString(buffer) + subset = extractor.getSubset() + self.document.doctype.internalSubset = subset + + def start_doctype_decl_handler(self, doctypeName, systemId, publicId, + has_internal_subset): + doctype = self.document.implementation.createDocumentType( + doctypeName, publicId, systemId) + doctype.ownerDocument = self.document + _append_child(self.document, doctype) + self.document.doctype = doctype + if self._filter and self._filter.acceptNode(doctype) == FILTER_REJECT: + self.document.doctype = None + del self.document.childNodes[-1] + doctype = None + self._parser.EntityDeclHandler = None + self._parser.NotationDeclHandler = None + if has_internal_subset: + if doctype is not None: + doctype.entities._seq = [] + doctype.notations._seq = [] + self._parser.CommentHandler = None + self._parser.ProcessingInstructionHandler = None + self._parser.EndDoctypeDeclHandler = self.end_doctype_decl_handler + + def end_doctype_decl_handler(self): + if self._options.comments: + self._parser.CommentHandler = self.comment_handler + self._parser.ProcessingInstructionHandler = self.pi_handler + if not (self._elem_info or self._filter): + self._finish_end_element = id + + def pi_handler(self, target, data): + node = self.document.createProcessingInstruction(target, data) + _append_child(self.curNode, node) + if self._filter and self._filter.acceptNode(node) == FILTER_REJECT: + self.curNode.removeChild(node) + + def character_data_handler_cdata(self, data): + childNodes = self.curNode.childNodes + if self._cdata: + if ( self._cdata_continue + and childNodes[-1].nodeType == CDATA_SECTION_NODE): + childNodes[-1].appendData(data) + return + node = self.document.createCDATASection(data) + self._cdata_continue = True + elif childNodes and childNodes[-1].nodeType == TEXT_NODE: + node = childNodes[-1] + value = node.data + data + node.data = value + return + else: + node = minidom.Text() + node.data = data + node.ownerDocument = self.document + _append_child(self.curNode, node) + + def character_data_handler(self, data): + childNodes = self.curNode.childNodes + if childNodes and childNodes[-1].nodeType == TEXT_NODE: + node = childNodes[-1] + node.data = node.data + data + return + node = minidom.Text() + node.data = node.data + data + node.ownerDocument = self.document + _append_child(self.curNode, node) + + def entity_decl_handler(self, entityName, is_parameter_entity, value, + base, systemId, publicId, notationName): + if is_parameter_entity: + # we don't care about parameter entities for the DOM + return + if not self._options.entities: + return + node = self.document._create_entity(entityName, publicId, + systemId, notationName) + if value is not None: + # internal entity + # node *should* be readonly, but we'll cheat + child = self.document.createTextNode(value) + node.childNodes.append(child) + self.document.doctype.entities._seq.append(node) + if self._filter and self._filter.acceptNode(node) == FILTER_REJECT: + del self.document.doctype.entities._seq[-1] + + def notation_decl_handler(self, notationName, base, systemId, publicId): + node = self.document._create_notation(notationName, publicId, systemId) + self.document.doctype.notations._seq.append(node) + if self._filter and self._filter.acceptNode(node) == FILTER_ACCEPT: + del self.document.doctype.notations._seq[-1] + + def comment_handler(self, data): + node = self.document.createComment(data) + _append_child(self.curNode, node) + if self._filter and self._filter.acceptNode(node) == FILTER_REJECT: + self.curNode.removeChild(node) + + def start_cdata_section_handler(self): + self._cdata = True + self._cdata_continue = False + + def end_cdata_section_handler(self): + self._cdata = False + self._cdata_continue = False + + def external_entity_ref_handler(self, context, base, systemId, publicId): + return 1 + + def first_element_handler(self, name, attributes): + if self._filter is None and not self._elem_info: + self._finish_end_element = id + self.getParser().StartElementHandler = self.start_element_handler + self.start_element_handler(name, attributes) + + def start_element_handler(self, name, attributes): + node = self.document.createElement(name) + _append_child(self.curNode, node) + self.curNode = node + + if attributes: + for i in range(0, len(attributes), 2): + a = minidom.Attr(attributes[i], EMPTY_NAMESPACE, + None, EMPTY_PREFIX) + value = attributes[i+1] + a.value = value + a.ownerDocument = self.document + _set_attribute_node(node, a) + + if node is not self.document.documentElement: + self._finish_start_element(node) + + def _finish_start_element(self, node): + if self._filter: + # To be general, we'd have to call isSameNode(), but this + # is sufficient for minidom: + if node is self.document.documentElement: + return + filt = self._filter.startContainer(node) + if filt == FILTER_REJECT: + # ignore this node & all descendents + Rejecter(self) + elif filt == FILTER_SKIP: + # ignore this node, but make it's children become + # children of the parent node + Skipper(self) + else: + return + self.curNode = node.parentNode + node.parentNode.removeChild(node) + node.unlink() + + # If this ever changes, Namespaces.end_element_handler() needs to + # be changed to match. + # + def end_element_handler(self, name): + curNode = self.curNode + self.curNode = curNode.parentNode + self._finish_end_element(curNode) + + def _finish_end_element(self, curNode): + info = self._elem_info.get(curNode.tagName) + if info: + self._handle_white_text_nodes(curNode, info) + if self._filter: + if curNode is self.document.documentElement: + return + if self._filter.acceptNode(curNode) == FILTER_REJECT: + self.curNode.removeChild(curNode) + curNode.unlink() + + def _handle_white_text_nodes(self, node, info): + if (self._options.whitespace_in_element_content + or not info.isElementContent()): + return + + # We have element type information and should remove ignorable + # whitespace; identify for text nodes which contain only + # whitespace. + L = [] + for child in node.childNodes: + if child.nodeType == TEXT_NODE and not child.data.strip(): + L.append(child) + + # Remove ignorable whitespace from the tree. + for child in L: + node.removeChild(child) + + def element_decl_handler(self, name, model): + info = self._elem_info.get(name) + if info is None: + self._elem_info[name] = ElementInfo(name, model) + else: + assert info._model is None + info._model = model + + def attlist_decl_handler(self, elem, name, type, default, required): + info = self._elem_info.get(elem) + if info is None: + info = ElementInfo(elem) + self._elem_info[elem] = info + info._attr_info.append( + [None, name, None, None, default, 0, type, required]) + + def xml_decl_handler(self, version, encoding, standalone): + self.document.version = version + self.document.encoding = encoding + # This is still a little ugly, thanks to the pyexpat API. ;-( + if standalone >= 0: + if standalone: + self.document.standalone = True + else: + self.document.standalone = False + + +# Don't include FILTER_INTERRUPT, since that's checked separately +# where allowed. +_ALLOWED_FILTER_RETURNS = (FILTER_ACCEPT, FILTER_REJECT, FILTER_SKIP) + +class FilterVisibilityController(object): + """Wrapper around a DOMBuilderFilter which implements the checks + to make the whatToShow filter attribute work.""" + + __slots__ = 'filter', + + def __init__(self, filter): + self.filter = filter + + def startContainer(self, node): + mask = self._nodetype_mask[node.nodeType] + if self.filter.whatToShow & mask: + val = self.filter.startContainer(node) + if val == FILTER_INTERRUPT: + raise ParseEscape + if val not in _ALLOWED_FILTER_RETURNS: + raise ValueError( + "startContainer() returned illegal value: " + repr(val)) + return val + else: + return FILTER_ACCEPT + + def acceptNode(self, node): + mask = self._nodetype_mask[node.nodeType] + if self.filter.whatToShow & mask: + val = self.filter.acceptNode(node) + if val == FILTER_INTERRUPT: + raise ParseEscape + if val == FILTER_SKIP: + # move all child nodes to the parent, and remove this node + parent = node.parentNode + for child in node.childNodes[:]: + parent.appendChild(child) + # node is handled by the caller + return FILTER_REJECT + if val not in _ALLOWED_FILTER_RETURNS: + raise ValueError( + "acceptNode() returned illegal value: " + repr(val)) + return val + else: + return FILTER_ACCEPT + + _nodetype_mask = { + Node.ELEMENT_NODE: NodeFilter.SHOW_ELEMENT, + Node.ATTRIBUTE_NODE: NodeFilter.SHOW_ATTRIBUTE, + Node.TEXT_NODE: NodeFilter.SHOW_TEXT, + Node.CDATA_SECTION_NODE: NodeFilter.SHOW_CDATA_SECTION, + Node.ENTITY_REFERENCE_NODE: NodeFilter.SHOW_ENTITY_REFERENCE, + Node.ENTITY_NODE: NodeFilter.SHOW_ENTITY, + Node.PROCESSING_INSTRUCTION_NODE: NodeFilter.SHOW_PROCESSING_INSTRUCTION, + Node.COMMENT_NODE: NodeFilter.SHOW_COMMENT, + Node.DOCUMENT_NODE: NodeFilter.SHOW_DOCUMENT, + Node.DOCUMENT_TYPE_NODE: NodeFilter.SHOW_DOCUMENT_TYPE, + Node.DOCUMENT_FRAGMENT_NODE: NodeFilter.SHOW_DOCUMENT_FRAGMENT, + Node.NOTATION_NODE: NodeFilter.SHOW_NOTATION, + } + + +class FilterCrutch(object): + __slots__ = '_builder', '_level', '_old_start', '_old_end' + + def __init__(self, builder): + self._level = 0 + self._builder = builder + parser = builder._parser + self._old_start = parser.StartElementHandler + self._old_end = parser.EndElementHandler + parser.StartElementHandler = self.start_element_handler + parser.EndElementHandler = self.end_element_handler + +class Rejecter(FilterCrutch): + __slots__ = () + + def __init__(self, builder): + FilterCrutch.__init__(self, builder) + parser = builder._parser + for name in ("ProcessingInstructionHandler", + "CommentHandler", + "CharacterDataHandler", + "StartCdataSectionHandler", + "EndCdataSectionHandler", + "ExternalEntityRefHandler", + ): + setattr(parser, name, None) + + def start_element_handler(self, *args): + self._level = self._level + 1 + + def end_element_handler(self, *args): + if self._level == 0: + # restore the old handlers + parser = self._builder._parser + self._builder.install(parser) + parser.StartElementHandler = self._old_start + parser.EndElementHandler = self._old_end + else: + self._level = self._level - 1 + +class Skipper(FilterCrutch): + __slots__ = () + + def start_element_handler(self, *args): + node = self._builder.curNode + self._old_start(*args) + if self._builder.curNode is not node: + self._level = self._level + 1 + + def end_element_handler(self, *args): + if self._level == 0: + # We're popping back out of the node we're skipping, so we + # shouldn't need to do anything but reset the handlers. + self._builder._parser.StartElementHandler = self._old_start + self._builder._parser.EndElementHandler = self._old_end + self._builder = None + else: + self._level = self._level - 1 + self._old_end(*args) + + +# framework document used by the fragment builder. +# Takes a string for the doctype, subset string, and namespace attrs string. + +_FRAGMENT_BUILDER_INTERNAL_SYSTEM_ID = \ + "http://xml.python.org/entities/fragment-builder/internal" + +_FRAGMENT_BUILDER_TEMPLATE = ( + '''\ + +%%s +]> +&fragment-builder-internal;''' + % _FRAGMENT_BUILDER_INTERNAL_SYSTEM_ID) + + +class FragmentBuilder(ExpatBuilder): + """Builder which constructs document fragments given XML source + text and a context node. + + The context node is expected to provide information about the + namespace declarations which are in scope at the start of the + fragment. + """ + + def __init__(self, context, options=None): + if context.nodeType == DOCUMENT_NODE: + self.originalDocument = context + self.context = context + else: + self.originalDocument = context.ownerDocument + self.context = context + ExpatBuilder.__init__(self, options) + + def reset(self): + ExpatBuilder.reset(self) + self.fragment = None + + def parseFile(self, file): + """Parse a document fragment from a file object, returning the + fragment node.""" + return self.parseString(file.read()) + + def parseString(self, string): + """Parse a document fragment from a string, returning the + fragment node.""" + self._source = string + parser = self.getParser() + doctype = self.originalDocument.doctype + ident = "" + if doctype: + subset = doctype.internalSubset or self._getDeclarations() + if doctype.publicId: + ident = ('PUBLIC "%s" "%s"' + % (doctype.publicId, doctype.systemId)) + elif doctype.systemId: + ident = 'SYSTEM "%s"' % doctype.systemId + else: + subset = "" + nsattrs = self._getNSattrs() # get ns decls from node's ancestors + document = _FRAGMENT_BUILDER_TEMPLATE % (ident, subset, nsattrs) + try: + parser.Parse(document, True) + except: + self.reset() + raise + fragment = self.fragment + self.reset() +## self._parser = None + return fragment + + def _getDeclarations(self): + """Re-create the internal subset from the DocumentType node. + + This is only needed if we don't already have the + internalSubset as a string. + """ + doctype = self.context.ownerDocument.doctype + s = "" + if doctype: + for i in range(doctype.notations.length): + notation = doctype.notations.item(i) + if s: + s = s + "\n " + s = "%s' \ + % (s, notation.publicId, notation.systemId) + else: + s = '%s SYSTEM "%s">' % (s, notation.systemId) + for i in range(doctype.entities.length): + entity = doctype.entities.item(i) + if s: + s = s + "\n " + s = "%s" + return s + + def _getNSattrs(self): + return "" + + def external_entity_ref_handler(self, context, base, systemId, publicId): + if systemId == _FRAGMENT_BUILDER_INTERNAL_SYSTEM_ID: + # this entref is the one that we made to put the subtree + # in; all of our given input is parsed in here. + old_document = self.document + old_cur_node = self.curNode + parser = self._parser.ExternalEntityParserCreate(context) + # put the real document back, parse into the fragment to return + self.document = self.originalDocument + self.fragment = self.document.createDocumentFragment() + self.curNode = self.fragment + try: + parser.Parse(self._source, True) + finally: + self.curNode = old_cur_node + self.document = old_document + self._source = None + return -1 + else: + return ExpatBuilder.external_entity_ref_handler( + self, context, base, systemId, publicId) + + +class Namespaces: + """Mix-in class for builders; adds support for namespaces.""" + + def _initNamespaces(self): + # list of (prefix, uri) ns declarations. Namespace attrs are + # constructed from this and added to the element's attrs. + self._ns_ordered_prefixes = [] + + def createParser(self): + """Create a new namespace-handling parser.""" + parser = expat.ParserCreate(namespace_separator=" ") + parser.namespace_prefixes = True + return parser + + def install(self, parser): + """Insert the namespace-handlers onto the parser.""" + ExpatBuilder.install(self, parser) + if self._options.namespace_declarations: + parser.StartNamespaceDeclHandler = ( + self.start_namespace_decl_handler) + + def start_namespace_decl_handler(self, prefix, uri): + """Push this namespace declaration on our storage.""" + self._ns_ordered_prefixes.append((prefix, uri)) + + def start_element_handler(self, name, attributes): + if ' ' in name: + uri, localname, prefix, qname = _parse_ns_name(self, name) + else: + uri = EMPTY_NAMESPACE + qname = name + localname = None + prefix = EMPTY_PREFIX + node = minidom.Element(qname, uri, prefix, localname) + node.ownerDocument = self.document + _append_child(self.curNode, node) + self.curNode = node + + if self._ns_ordered_prefixes: + for prefix, uri in self._ns_ordered_prefixes: + if prefix: + a = minidom.Attr(_intern(self, 'xmlns:' + prefix), + XMLNS_NAMESPACE, prefix, "xmlns") + else: + a = minidom.Attr("xmlns", XMLNS_NAMESPACE, + "xmlns", EMPTY_PREFIX) + a.value = uri + a.ownerDocument = self.document + _set_attribute_node(node, a) + del self._ns_ordered_prefixes[:] + + if attributes: + node._ensure_attributes() + _attrs = node._attrs + _attrsNS = node._attrsNS + for i in range(0, len(attributes), 2): + aname = attributes[i] + value = attributes[i+1] + if ' ' in aname: + uri, localname, prefix, qname = _parse_ns_name(self, aname) + a = minidom.Attr(qname, uri, localname, prefix) + _attrs[qname] = a + _attrsNS[(uri, localname)] = a + else: + a = minidom.Attr(aname, EMPTY_NAMESPACE, + aname, EMPTY_PREFIX) + _attrs[aname] = a + _attrsNS[(EMPTY_NAMESPACE, aname)] = a + a.ownerDocument = self.document + a.value = value + a.ownerElement = node + + if __debug__: + # This only adds some asserts to the original + # end_element_handler(), so we only define this when -O is not + # used. If changing one, be sure to check the other to see if + # it needs to be changed as well. + # + def end_element_handler(self, name): + curNode = self.curNode + if ' ' in name: + uri, localname, prefix, qname = _parse_ns_name(self, name) + assert (curNode.namespaceURI == uri + and curNode.localName == localname + and curNode.prefix == prefix), \ + "element stack messed up! (namespace)" + else: + assert curNode.nodeName == name, \ + "element stack messed up - bad nodeName" + assert curNode.namespaceURI == EMPTY_NAMESPACE, \ + "element stack messed up - bad namespaceURI" + self.curNode = curNode.parentNode + self._finish_end_element(curNode) + + +class ExpatBuilderNS(Namespaces, ExpatBuilder): + """Document builder that supports namespaces.""" + + def reset(self): + ExpatBuilder.reset(self) + self._initNamespaces() + + +class FragmentBuilderNS(Namespaces, FragmentBuilder): + """Fragment builder that supports namespaces.""" + + def reset(self): + FragmentBuilder.reset(self) + self._initNamespaces() + + def _getNSattrs(self): + """Return string of namespace attributes from this element and + ancestors.""" + # XXX This needs to be re-written to walk the ancestors of the + # context to build up the namespace information from + # declarations, elements, and attributes found in context. + # Otherwise we have to store a bunch more data on the DOM + # (though that *might* be more reliable -- not clear). + attrs = "" + context = self.context + L = [] + while context: + if hasattr(context, '_ns_prefix_uri'): + for prefix, uri in context._ns_prefix_uri.items(): + # add every new NS decl from context to L and attrs string + if prefix in L: + continue + L.append(prefix) + if prefix: + declname = "xmlns:" + prefix + else: + declname = "xmlns" + if attrs: + attrs = "%s\n %s='%s'" % (attrs, declname, uri) + else: + attrs = " %s='%s'" % (declname, uri) + context = context.parentNode + return attrs + + +class ParseEscape(Exception): + """Exception raised to short-circuit parsing in InternalSubsetExtractor.""" + pass + +class InternalSubsetExtractor(ExpatBuilder): + """XML processor which can rip out the internal document type subset.""" + + subset = None + + def getSubset(self): + """Return the internal subset as a string.""" + return self.subset + + def parseFile(self, file): + try: + ExpatBuilder.parseFile(self, file) + except ParseEscape: + pass + + def parseString(self, string): + try: + ExpatBuilder.parseString(self, string) + except ParseEscape: + pass + + def install(self, parser): + parser.StartDoctypeDeclHandler = self.start_doctype_decl_handler + parser.StartElementHandler = self.start_element_handler + + def start_doctype_decl_handler(self, name, publicId, systemId, + has_internal_subset): + if has_internal_subset: + parser = self.getParser() + self.subset = [] + parser.DefaultHandler = self.subset.append + parser.EndDoctypeDeclHandler = self.end_doctype_decl_handler + else: + raise ParseEscape() + + def end_doctype_decl_handler(self): + s = ''.join(self.subset).replace('\r\n', '\n').replace('\r', '\n') + self.subset = s + raise ParseEscape() + + def start_element_handler(self, name, attrs): + raise ParseEscape() + + +def parse(file, namespaces=True): + """Parse a document, returning the resulting Document node. + + 'file' may be either a file name or an open file object. + """ + if namespaces: + builder = ExpatBuilderNS() + else: + builder = ExpatBuilder() + + if isinstance(file, str): + with open(file, 'rb') as fp: + result = builder.parseFile(fp) + else: + result = builder.parseFile(file) + return result + + +def parseString(string, namespaces=True): + """Parse a document from a string, returning the resulting + Document node. + """ + if namespaces: + builder = ExpatBuilderNS() + else: + builder = ExpatBuilder() + return builder.parseString(string) + + +def parseFragment(file, context, namespaces=True): + """Parse a fragment of a document, given the context from which it + was originally extracted. context should be the parent of the + node(s) which are in the fragment. + + 'file' may be either a file name or an open file object. + """ + if namespaces: + builder = FragmentBuilderNS(context) + else: + builder = FragmentBuilder(context) + + if isinstance(file, str): + with open(file, 'rb') as fp: + result = builder.parseFile(fp) + else: + result = builder.parseFile(file) + return result + + +def parseFragmentString(string, context, namespaces=True): + """Parse a fragment of a document from a string, given the context + from which it was originally extracted. context should be the + parent of the node(s) which are in the fragment. + """ + if namespaces: + builder = FragmentBuilderNS(context) + else: + builder = FragmentBuilder(context) + return builder.parseString(string) + + +def makeBuilder(options): + """Create a builder based on an Options object.""" + if options.namespaces: + return ExpatBuilderNS(options) + else: + return ExpatBuilder(options) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/minicompat.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/minicompat.py new file mode 100644 index 0000000000000000000000000000000000000000..5d6fae9a2575bf502999b3c59aeecb7b93a37385 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/minicompat.py @@ -0,0 +1,109 @@ +"""Python version compatibility support for minidom. + +This module contains internal implementation details and +should not be imported; use xml.dom.minidom instead. +""" + +# This module should only be imported using "import *". +# +# The following names are defined: +# +# NodeList -- lightest possible NodeList implementation +# +# EmptyNodeList -- lightest possible NodeList that is guaranteed to +# remain empty (immutable) +# +# StringTypes -- tuple of defined string types +# +# defproperty -- function used in conjunction with GetattrMagic; +# using these together is needed to make them work +# as efficiently as possible in both Python 2.2+ +# and older versions. For example: +# +# class MyClass(GetattrMagic): +# def _get_myattr(self): +# return something +# +# defproperty(MyClass, "myattr", +# "return some value") +# +# For Python 2.2 and newer, this will construct a +# property object on the class, which avoids +# needing to override __getattr__(). It will only +# work for read-only attributes. +# +# For older versions of Python, inheriting from +# GetattrMagic will use the traditional +# __getattr__() hackery to achieve the same effect, +# but less efficiently. +# +# defproperty() should be used for each version of +# the relevant _get_() function. + +__all__ = ["NodeList", "EmptyNodeList", "StringTypes", "defproperty"] + +import xml.dom + +StringTypes = (str,) + + +class NodeList(list): + __slots__ = () + + def item(self, index): + if 0 <= index < len(self): + return self[index] + + def _get_length(self): + return len(self) + + def _set_length(self, value): + raise xml.dom.NoModificationAllowedErr( + "attempt to modify read-only attribute 'length'") + + length = property(_get_length, _set_length, + doc="The number of nodes in the NodeList.") + + # For backward compatibility + def __setstate__(self, state): + if state is None: + state = [] + self[:] = state + + +class EmptyNodeList(tuple): + __slots__ = () + + def __add__(self, other): + NL = NodeList() + NL.extend(other) + return NL + + def __radd__(self, other): + NL = NodeList() + NL.extend(other) + return NL + + def item(self, index): + return None + + def _get_length(self): + return 0 + + def _set_length(self, value): + raise xml.dom.NoModificationAllowedErr( + "attempt to modify read-only attribute 'length'") + + length = property(_get_length, _set_length, + doc="The number of nodes in the NodeList.") + + +def defproperty(klass, name, doc): + get = getattr(klass, ("_get_" + name)) + def set(self, value, name=name): + raise xml.dom.NoModificationAllowedErr( + "attempt to modify read-only attribute " + repr(name)) + assert not hasattr(klass, "_set_" + name), \ + "expected not to find _set_" + name + prop = property(get, set, doc=doc) + setattr(klass, name, prop) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/minidom.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/minidom.py new file mode 100644 index 0000000000000000000000000000000000000000..16b33b90184dc59d08805ebfd07c4d660606e66e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/minidom.py @@ -0,0 +1,2024 @@ +"""Simple implementation of the Level 1 DOM. + +Namespaces and other minor Level 2 features are also supported. + +parse("foo.xml") + +parseString("") + +Todo: +===== + * convenience methods for getting elements and text. + * more testing + * bring some of the writer and linearizer code into conformance with this + interface + * SAX 2 namespaces +""" + +import io +import xml.dom + +from xml.dom import EMPTY_NAMESPACE, EMPTY_PREFIX, XMLNS_NAMESPACE, domreg +from xml.dom.minicompat import * +from xml.dom.xmlbuilder import DOMImplementationLS, DocumentLS + +# This is used by the ID-cache invalidation checks; the list isn't +# actually complete, since the nodes being checked will never be the +# DOCUMENT_NODE or DOCUMENT_FRAGMENT_NODE. (The node being checked is +# the node being added or removed, not the node being modified.) +# +_nodeTypes_with_children = (xml.dom.Node.ELEMENT_NODE, + xml.dom.Node.ENTITY_REFERENCE_NODE) + + +class Node(xml.dom.Node): + namespaceURI = None # this is non-null only for elements and attributes + parentNode = None + ownerDocument = None + nextSibling = None + previousSibling = None + + prefix = EMPTY_PREFIX # non-null only for NS elements and attributes + + def __bool__(self): + return True + + def toxml(self, encoding=None, standalone=None): + return self.toprettyxml("", "", encoding, standalone) + + def toprettyxml(self, indent="\t", newl="\n", encoding=None, + standalone=None): + if encoding is None: + writer = io.StringIO() + else: + writer = io.TextIOWrapper(io.BytesIO(), + encoding=encoding, + errors="xmlcharrefreplace", + newline='\n') + if self.nodeType == Node.DOCUMENT_NODE: + # Can pass encoding only to document, to put it into XML header + self.writexml(writer, "", indent, newl, encoding, standalone) + else: + self.writexml(writer, "", indent, newl) + if encoding is None: + return writer.getvalue() + else: + return writer.detach().getvalue() + + def hasChildNodes(self): + return bool(self.childNodes) + + def _get_childNodes(self): + return self.childNodes + + def _get_firstChild(self): + if self.childNodes: + return self.childNodes[0] + + def _get_lastChild(self): + if self.childNodes: + return self.childNodes[-1] + + def insertBefore(self, newChild, refChild): + if newChild.nodeType == self.DOCUMENT_FRAGMENT_NODE: + for c in tuple(newChild.childNodes): + self.insertBefore(c, refChild) + ### The DOM does not clearly specify what to return in this case + return newChild + if newChild.nodeType not in self._child_node_types: + raise xml.dom.HierarchyRequestErr( + "%s cannot be child of %s" % (repr(newChild), repr(self))) + if newChild.parentNode is not None: + newChild.parentNode.removeChild(newChild) + if refChild is None: + self.appendChild(newChild) + else: + try: + index = self.childNodes.index(refChild) + except ValueError: + raise xml.dom.NotFoundErr() + if newChild.nodeType in _nodeTypes_with_children: + _clear_id_cache(self) + self.childNodes.insert(index, newChild) + newChild.nextSibling = refChild + refChild.previousSibling = newChild + if index: + node = self.childNodes[index-1] + node.nextSibling = newChild + newChild.previousSibling = node + else: + newChild.previousSibling = None + newChild.parentNode = self + return newChild + + def appendChild(self, node): + if node.nodeType == self.DOCUMENT_FRAGMENT_NODE: + for c in tuple(node.childNodes): + self.appendChild(c) + ### The DOM does not clearly specify what to return in this case + return node + if node.nodeType not in self._child_node_types: + raise xml.dom.HierarchyRequestErr( + "%s cannot be child of %s" % (repr(node), repr(self))) + elif node.nodeType in _nodeTypes_with_children: + _clear_id_cache(self) + if node.parentNode is not None: + node.parentNode.removeChild(node) + _append_child(self, node) + node.nextSibling = None + return node + + def replaceChild(self, newChild, oldChild): + if newChild.nodeType == self.DOCUMENT_FRAGMENT_NODE: + refChild = oldChild.nextSibling + self.removeChild(oldChild) + return self.insertBefore(newChild, refChild) + if newChild.nodeType not in self._child_node_types: + raise xml.dom.HierarchyRequestErr( + "%s cannot be child of %s" % (repr(newChild), repr(self))) + if newChild is oldChild: + return + if newChild.parentNode is not None: + newChild.parentNode.removeChild(newChild) + try: + index = self.childNodes.index(oldChild) + except ValueError: + raise xml.dom.NotFoundErr() + self.childNodes[index] = newChild + newChild.parentNode = self + oldChild.parentNode = None + if (newChild.nodeType in _nodeTypes_with_children + or oldChild.nodeType in _nodeTypes_with_children): + _clear_id_cache(self) + newChild.nextSibling = oldChild.nextSibling + newChild.previousSibling = oldChild.previousSibling + oldChild.nextSibling = None + oldChild.previousSibling = None + if newChild.previousSibling: + newChild.previousSibling.nextSibling = newChild + if newChild.nextSibling: + newChild.nextSibling.previousSibling = newChild + return oldChild + + def removeChild(self, oldChild): + try: + self.childNodes.remove(oldChild) + except ValueError: + raise xml.dom.NotFoundErr() + if oldChild.nextSibling is not None: + oldChild.nextSibling.previousSibling = oldChild.previousSibling + if oldChild.previousSibling is not None: + oldChild.previousSibling.nextSibling = oldChild.nextSibling + oldChild.nextSibling = oldChild.previousSibling = None + if oldChild.nodeType in _nodeTypes_with_children: + _clear_id_cache(self) + + oldChild.parentNode = None + return oldChild + + def normalize(self): + L = [] + for child in self.childNodes: + if child.nodeType == Node.TEXT_NODE: + if not child.data: + # empty text node; discard + if L: + L[-1].nextSibling = child.nextSibling + if child.nextSibling: + child.nextSibling.previousSibling = child.previousSibling + child.unlink() + elif L and L[-1].nodeType == child.nodeType: + # collapse text node + node = L[-1] + node.data = node.data + child.data + node.nextSibling = child.nextSibling + if child.nextSibling: + child.nextSibling.previousSibling = node + child.unlink() + else: + L.append(child) + else: + L.append(child) + if child.nodeType == Node.ELEMENT_NODE: + child.normalize() + self.childNodes[:] = L + + def cloneNode(self, deep): + return _clone_node(self, deep, self.ownerDocument or self) + + def isSupported(self, feature, version): + return self.ownerDocument.implementation.hasFeature(feature, version) + + def _get_localName(self): + # Overridden in Element and Attr where localName can be Non-Null + return None + + # Node interfaces from Level 3 (WD 9 April 2002) + + def isSameNode(self, other): + return self is other + + def getInterface(self, feature): + if self.isSupported(feature, None): + return self + else: + return None + + # The "user data" functions use a dictionary that is only present + # if some user data has been set, so be careful not to assume it + # exists. + + def getUserData(self, key): + try: + return self._user_data[key][0] + except (AttributeError, KeyError): + return None + + def setUserData(self, key, data, handler): + old = None + try: + d = self._user_data + except AttributeError: + d = {} + self._user_data = d + if key in d: + old = d[key][0] + if data is None: + # ignore handlers passed for None + handler = None + if old is not None: + del d[key] + else: + d[key] = (data, handler) + return old + + def _call_user_data_handler(self, operation, src, dst): + if hasattr(self, "_user_data"): + for key, (data, handler) in list(self._user_data.items()): + if handler is not None: + handler.handle(operation, key, data, src, dst) + + # minidom-specific API: + + def unlink(self): + self.parentNode = self.ownerDocument = None + if self.childNodes: + for child in self.childNodes: + child.unlink() + self.childNodes = NodeList() + self.previousSibling = None + self.nextSibling = None + + # A Node is its own context manager, to ensure that an unlink() call occurs. + # This is similar to how a file object works. + def __enter__(self): + return self + + def __exit__(self, et, ev, tb): + self.unlink() + +defproperty(Node, "firstChild", doc="First child node, or None.") +defproperty(Node, "lastChild", doc="Last child node, or None.") +defproperty(Node, "localName", doc="Namespace-local name of this node.") + + +def _append_child(self, node): + # fast path with less checks; usable by DOM builders if careful + childNodes = self.childNodes + if childNodes: + last = childNodes[-1] + node.previousSibling = last + last.nextSibling = node + childNodes.append(node) + node.parentNode = self + + +def _write_data(writer, text, attr): + "Writes datachars to writer." + if not text: + return + # See the comments in ElementTree.py for behavior and + # implementation details. + if "&" in text: + text = text.replace("&", "&") + if "<" in text: + text = text.replace("<", "<") + if ">" in text: + text = text.replace(">", ">") + if attr: + if '"' in text: + text = text.replace('"', """) + if "\r" in text: + text = text.replace("\r", " ") + if "\n" in text: + text = text.replace("\n", " ") + if "\t" in text: + text = text.replace("\t", " ") + writer.write(text) + +def _get_elements_by_tagName_helper(parent, name, rc): + for node in parent.childNodes: + if node.nodeType == Node.ELEMENT_NODE and \ + (name == "*" or node.tagName == name): + rc.append(node) + _get_elements_by_tagName_helper(node, name, rc) + return rc + +def _get_elements_by_tagName_ns_helper(parent, nsURI, localName, rc): + for node in parent.childNodes: + if node.nodeType == Node.ELEMENT_NODE: + if ((localName == "*" or node.localName == localName) and + (nsURI == "*" or node.namespaceURI == nsURI)): + rc.append(node) + _get_elements_by_tagName_ns_helper(node, nsURI, localName, rc) + return rc + +class DocumentFragment(Node): + nodeType = Node.DOCUMENT_FRAGMENT_NODE + nodeName = "#document-fragment" + nodeValue = None + attributes = None + parentNode = None + _child_node_types = (Node.ELEMENT_NODE, + Node.TEXT_NODE, + Node.CDATA_SECTION_NODE, + Node.ENTITY_REFERENCE_NODE, + Node.PROCESSING_INSTRUCTION_NODE, + Node.COMMENT_NODE, + Node.NOTATION_NODE) + + def __init__(self): + self.childNodes = NodeList() + + +class Attr(Node): + __slots__=('_name', '_value', 'namespaceURI', + '_prefix', 'childNodes', '_localName', 'ownerDocument', 'ownerElement') + nodeType = Node.ATTRIBUTE_NODE + attributes = None + specified = False + _is_id = False + + _child_node_types = (Node.TEXT_NODE, Node.ENTITY_REFERENCE_NODE) + + def __init__(self, qName, namespaceURI=EMPTY_NAMESPACE, localName=None, + prefix=None): + self.ownerElement = None + self.ownerDocument = None + self._name = qName + self.namespaceURI = namespaceURI + self._prefix = prefix + if localName is not None: + self._localName = localName + self.childNodes = NodeList() + + # Add the single child node that represents the value of the attr + self.childNodes.append(Text()) + + # nodeValue and value are set elsewhere + + def _get_localName(self): + try: + return self._localName + except AttributeError: + return self.nodeName.split(":", 1)[-1] + + def _get_specified(self): + return self.specified + + def _get_name(self): + return self._name + + def _set_name(self, value): + self._name = value + if self.ownerElement is not None: + _clear_id_cache(self.ownerElement) + + nodeName = name = property(_get_name, _set_name) + + def _get_value(self): + return self._value + + def _set_value(self, value): + self._value = value + self.childNodes[0].data = value + if self.ownerElement is not None: + _clear_id_cache(self.ownerElement) + self.childNodes[0].data = value + + nodeValue = value = property(_get_value, _set_value) + + def _get_prefix(self): + return self._prefix + + def _set_prefix(self, prefix): + nsuri = self.namespaceURI + if prefix == "xmlns": + if nsuri and nsuri != XMLNS_NAMESPACE: + raise xml.dom.NamespaceErr( + "illegal use of 'xmlns' prefix for the wrong namespace") + self._prefix = prefix + if prefix is None: + newName = self.localName + else: + newName = "%s:%s" % (prefix, self.localName) + if self.ownerElement: + _clear_id_cache(self.ownerElement) + self.name = newName + + prefix = property(_get_prefix, _set_prefix) + + def unlink(self): + # This implementation does not call the base implementation + # since most of that is not needed, and the expense of the + # method call is not warranted. We duplicate the removal of + # children, but that's all we needed from the base class. + elem = self.ownerElement + if elem is not None: + del elem._attrs[self.nodeName] + del elem._attrsNS[(self.namespaceURI, self.localName)] + if self._is_id: + self._is_id = False + elem._magic_id_nodes -= 1 + self.ownerDocument._magic_id_count -= 1 + for child in self.childNodes: + child.unlink() + del self.childNodes[:] + + def _get_isId(self): + if self._is_id: + return True + doc = self.ownerDocument + elem = self.ownerElement + if doc is None or elem is None: + return False + + info = doc._get_elem_info(elem) + if info is None: + return False + if self.namespaceURI: + return info.isIdNS(self.namespaceURI, self.localName) + else: + return info.isId(self.nodeName) + + def _get_schemaType(self): + doc = self.ownerDocument + elem = self.ownerElement + if doc is None or elem is None: + return _no_type + + info = doc._get_elem_info(elem) + if info is None: + return _no_type + if self.namespaceURI: + return info.getAttributeTypeNS(self.namespaceURI, self.localName) + else: + return info.getAttributeType(self.nodeName) + +defproperty(Attr, "isId", doc="True if this attribute is an ID.") +defproperty(Attr, "localName", doc="Namespace-local name of this attribute.") +defproperty(Attr, "schemaType", doc="Schema type for this attribute.") + + +class NamedNodeMap(object): + """The attribute list is a transient interface to the underlying + dictionaries. Mutations here will change the underlying element's + dictionary. + + Ordering is imposed artificially and does not reflect the order of + attributes as found in an input document. + """ + + __slots__ = ('_attrs', '_attrsNS', '_ownerElement') + + def __init__(self, attrs, attrsNS, ownerElement): + self._attrs = attrs + self._attrsNS = attrsNS + self._ownerElement = ownerElement + + def _get_length(self): + return len(self._attrs) + + def item(self, index): + try: + return self[list(self._attrs.keys())[index]] + except IndexError: + return None + + def items(self): + L = [] + for node in self._attrs.values(): + L.append((node.nodeName, node.value)) + return L + + def itemsNS(self): + L = [] + for node in self._attrs.values(): + L.append(((node.namespaceURI, node.localName), node.value)) + return L + + def __contains__(self, key): + if isinstance(key, str): + return key in self._attrs + else: + return key in self._attrsNS + + def keys(self): + return self._attrs.keys() + + def keysNS(self): + return self._attrsNS.keys() + + def values(self): + return self._attrs.values() + + def get(self, name, value=None): + return self._attrs.get(name, value) + + __len__ = _get_length + + def _cmp(self, other): + if self._attrs is getattr(other, "_attrs", None): + return 0 + else: + return (id(self) > id(other)) - (id(self) < id(other)) + + def __eq__(self, other): + return self._cmp(other) == 0 + + def __ge__(self, other): + return self._cmp(other) >= 0 + + def __gt__(self, other): + return self._cmp(other) > 0 + + def __le__(self, other): + return self._cmp(other) <= 0 + + def __lt__(self, other): + return self._cmp(other) < 0 + + def __getitem__(self, attname_or_tuple): + if isinstance(attname_or_tuple, tuple): + return self._attrsNS[attname_or_tuple] + else: + return self._attrs[attname_or_tuple] + + # same as set + def __setitem__(self, attname, value): + if isinstance(value, str): + try: + node = self._attrs[attname] + except KeyError: + node = Attr(attname) + node.ownerDocument = self._ownerElement.ownerDocument + self.setNamedItem(node) + node.value = value + else: + if not isinstance(value, Attr): + raise TypeError("value must be a string or Attr object") + node = value + self.setNamedItem(node) + + def getNamedItem(self, name): + try: + return self._attrs[name] + except KeyError: + return None + + def getNamedItemNS(self, namespaceURI, localName): + try: + return self._attrsNS[(namespaceURI, localName)] + except KeyError: + return None + + def removeNamedItem(self, name): + n = self.getNamedItem(name) + if n is not None: + _clear_id_cache(self._ownerElement) + del self._attrs[n.nodeName] + del self._attrsNS[(n.namespaceURI, n.localName)] + if hasattr(n, 'ownerElement'): + n.ownerElement = None + return n + else: + raise xml.dom.NotFoundErr() + + def removeNamedItemNS(self, namespaceURI, localName): + n = self.getNamedItemNS(namespaceURI, localName) + if n is not None: + _clear_id_cache(self._ownerElement) + del self._attrsNS[(n.namespaceURI, n.localName)] + del self._attrs[n.nodeName] + if hasattr(n, 'ownerElement'): + n.ownerElement = None + return n + else: + raise xml.dom.NotFoundErr() + + def setNamedItem(self, node): + if not isinstance(node, Attr): + raise xml.dom.HierarchyRequestErr( + "%s cannot be child of %s" % (repr(node), repr(self))) + old = self._attrs.get(node.name) + if old: + old.unlink() + self._attrs[node.name] = node + self._attrsNS[(node.namespaceURI, node.localName)] = node + node.ownerElement = self._ownerElement + _clear_id_cache(node.ownerElement) + return old + + def setNamedItemNS(self, node): + return self.setNamedItem(node) + + def __delitem__(self, attname_or_tuple): + node = self[attname_or_tuple] + _clear_id_cache(node.ownerElement) + node.unlink() + + def __getstate__(self): + return self._attrs, self._attrsNS, self._ownerElement + + def __setstate__(self, state): + self._attrs, self._attrsNS, self._ownerElement = state + +defproperty(NamedNodeMap, "length", + doc="Number of nodes in the NamedNodeMap.") + +AttributeList = NamedNodeMap + + +class TypeInfo(object): + __slots__ = 'namespace', 'name' + + def __init__(self, namespace, name): + self.namespace = namespace + self.name = name + + def __repr__(self): + if self.namespace: + return "<%s %r (from %r)>" % (self.__class__.__name__, self.name, + self.namespace) + else: + return "<%s %r>" % (self.__class__.__name__, self.name) + + def _get_name(self): + return self.name + + def _get_namespace(self): + return self.namespace + +_no_type = TypeInfo(None, None) + +class Element(Node): + __slots__=('ownerDocument', 'parentNode', 'tagName', 'nodeName', 'prefix', + 'namespaceURI', '_localName', 'childNodes', '_attrs', '_attrsNS', + 'nextSibling', 'previousSibling') + nodeType = Node.ELEMENT_NODE + nodeValue = None + schemaType = _no_type + + _magic_id_nodes = 0 + + _child_node_types = (Node.ELEMENT_NODE, + Node.PROCESSING_INSTRUCTION_NODE, + Node.COMMENT_NODE, + Node.TEXT_NODE, + Node.CDATA_SECTION_NODE, + Node.ENTITY_REFERENCE_NODE) + + def __init__(self, tagName, namespaceURI=EMPTY_NAMESPACE, prefix=None, + localName=None): + self.ownerDocument = None + self.parentNode = None + self.tagName = self.nodeName = tagName + self.prefix = prefix + self.namespaceURI = namespaceURI + self.childNodes = NodeList() + self.nextSibling = self.previousSibling = None + + # Attribute dictionaries are lazily created + # attributes are double-indexed: + # tagName -> Attribute + # URI,localName -> Attribute + # in the future: consider lazy generation + # of attribute objects this is too tricky + # for now because of headaches with + # namespaces. + self._attrs = None + self._attrsNS = None + + def _ensure_attributes(self): + if self._attrs is None: + self._attrs = {} + self._attrsNS = {} + + def _get_localName(self): + try: + return self._localName + except AttributeError: + return self.tagName.split(":", 1)[-1] + + def _get_tagName(self): + return self.tagName + + def unlink(self): + if self._attrs is not None: + for attr in list(self._attrs.values()): + attr.unlink() + self._attrs = None + self._attrsNS = None + Node.unlink(self) + + def getAttribute(self, attname): + """Returns the value of the specified attribute. + + Returns the value of the element's attribute named attname as + a string. An empty string is returned if the element does not + have such an attribute. Note that an empty string may also be + returned as an explicitly given attribute value, use the + hasAttribute method to distinguish these two cases. + """ + if self._attrs is None: + return "" + try: + return self._attrs[attname].value + except KeyError: + return "" + + def getAttributeNS(self, namespaceURI, localName): + if self._attrsNS is None: + return "" + try: + return self._attrsNS[(namespaceURI, localName)].value + except KeyError: + return "" + + def setAttribute(self, attname, value): + attr = self.getAttributeNode(attname) + if attr is None: + attr = Attr(attname) + attr.value = value # also sets nodeValue + attr.ownerDocument = self.ownerDocument + self.setAttributeNode(attr) + elif value != attr.value: + attr.value = value + if attr.isId: + _clear_id_cache(self) + + def setAttributeNS(self, namespaceURI, qualifiedName, value): + prefix, localname = _nssplit(qualifiedName) + attr = self.getAttributeNodeNS(namespaceURI, localname) + if attr is None: + attr = Attr(qualifiedName, namespaceURI, localname, prefix) + attr.value = value + attr.ownerDocument = self.ownerDocument + self.setAttributeNode(attr) + else: + if value != attr.value: + attr.value = value + if attr.isId: + _clear_id_cache(self) + if attr.prefix != prefix: + attr.prefix = prefix + attr.nodeName = qualifiedName + + def getAttributeNode(self, attrname): + if self._attrs is None: + return None + return self._attrs.get(attrname) + + def getAttributeNodeNS(self, namespaceURI, localName): + if self._attrsNS is None: + return None + return self._attrsNS.get((namespaceURI, localName)) + + def setAttributeNode(self, attr): + if attr.ownerElement not in (None, self): + raise xml.dom.InuseAttributeErr("attribute node already owned") + self._ensure_attributes() + old1 = self._attrs.get(attr.name, None) + if old1 is not None: + self.removeAttributeNode(old1) + old2 = self._attrsNS.get((attr.namespaceURI, attr.localName), None) + if old2 is not None and old2 is not old1: + self.removeAttributeNode(old2) + _set_attribute_node(self, attr) + + if old1 is not attr: + # It might have already been part of this node, in which case + # it doesn't represent a change, and should not be returned. + return old1 + if old2 is not attr: + return old2 + + setAttributeNodeNS = setAttributeNode + + def removeAttribute(self, name): + if self._attrsNS is None: + raise xml.dom.NotFoundErr() + try: + attr = self._attrs[name] + except KeyError: + raise xml.dom.NotFoundErr() + self.removeAttributeNode(attr) + + def removeAttributeNS(self, namespaceURI, localName): + if self._attrsNS is None: + raise xml.dom.NotFoundErr() + try: + attr = self._attrsNS[(namespaceURI, localName)] + except KeyError: + raise xml.dom.NotFoundErr() + self.removeAttributeNode(attr) + + def removeAttributeNode(self, node): + if node is None: + raise xml.dom.NotFoundErr() + try: + self._attrs[node.name] + except KeyError: + raise xml.dom.NotFoundErr() + _clear_id_cache(self) + node.unlink() + # Restore this since the node is still useful and otherwise + # unlinked + node.ownerDocument = self.ownerDocument + return node + + removeAttributeNodeNS = removeAttributeNode + + def hasAttribute(self, name): + """Checks whether the element has an attribute with the specified name. + + Returns True if the element has an attribute with the specified name. + Otherwise, returns False. + """ + if self._attrs is None: + return False + return name in self._attrs + + def hasAttributeNS(self, namespaceURI, localName): + if self._attrsNS is None: + return False + return (namespaceURI, localName) in self._attrsNS + + def getElementsByTagName(self, name): + """Returns all descendant elements with the given tag name. + + Returns the list of all descendant elements (not direct children + only) with the specified tag name. + """ + return _get_elements_by_tagName_helper(self, name, NodeList()) + + def getElementsByTagNameNS(self, namespaceURI, localName): + return _get_elements_by_tagName_ns_helper( + self, namespaceURI, localName, NodeList()) + + def __repr__(self): + return "" % (self.tagName, id(self)) + + def writexml(self, writer, indent="", addindent="", newl=""): + """Write an XML element to a file-like object + + Write the element to the writer object that must provide + a write method (e.g. a file or StringIO object). + """ + # indent = current indentation + # addindent = indentation to add to higher levels + # newl = newline string + writer.write(indent+"<" + self.tagName) + + attrs = self._get_attributes() + + for a_name in attrs.keys(): + writer.write(" %s=\"" % a_name) + _write_data(writer, attrs[a_name].value, True) + writer.write("\"") + if self.childNodes: + writer.write(">") + if (len(self.childNodes) == 1 and + self.childNodes[0].nodeType in ( + Node.TEXT_NODE, Node.CDATA_SECTION_NODE)): + self.childNodes[0].writexml(writer, '', '', '') + else: + writer.write(newl) + for node in self.childNodes: + node.writexml(writer, indent+addindent, addindent, newl) + writer.write(indent) + writer.write("%s" % (self.tagName, newl)) + else: + writer.write("/>%s"%(newl)) + + def _get_attributes(self): + self._ensure_attributes() + return NamedNodeMap(self._attrs, self._attrsNS, self) + + def hasAttributes(self): + if self._attrs: + return True + else: + return False + + # DOM Level 3 attributes, based on the 22 Oct 2002 draft + + def setIdAttribute(self, name): + idAttr = self.getAttributeNode(name) + self.setIdAttributeNode(idAttr) + + def setIdAttributeNS(self, namespaceURI, localName): + idAttr = self.getAttributeNodeNS(namespaceURI, localName) + self.setIdAttributeNode(idAttr) + + def setIdAttributeNode(self, idAttr): + if idAttr is None or not self.isSameNode(idAttr.ownerElement): + raise xml.dom.NotFoundErr() + if _get_containing_entref(self) is not None: + raise xml.dom.NoModificationAllowedErr() + if not idAttr._is_id: + idAttr._is_id = True + self._magic_id_nodes += 1 + self.ownerDocument._magic_id_count += 1 + _clear_id_cache(self) + +defproperty(Element, "attributes", + doc="NamedNodeMap of attributes on the element.") +defproperty(Element, "localName", + doc="Namespace-local name of this element.") + + +def _set_attribute_node(element, attr): + _clear_id_cache(element) + element._ensure_attributes() + element._attrs[attr.name] = attr + element._attrsNS[(attr.namespaceURI, attr.localName)] = attr + + # This creates a circular reference, but Element.unlink() + # breaks the cycle since the references to the attribute + # dictionaries are tossed. + attr.ownerElement = element + +class Childless: + """Mixin that makes childless-ness easy to implement and avoids + the complexity of the Node methods that deal with children. + """ + __slots__ = () + + attributes = None + childNodes = EmptyNodeList() + firstChild = None + lastChild = None + + def _get_firstChild(self): + return None + + def _get_lastChild(self): + return None + + def appendChild(self, node): + raise xml.dom.HierarchyRequestErr( + self.nodeName + " nodes cannot have children") + + def hasChildNodes(self): + return False + + def insertBefore(self, newChild, refChild): + raise xml.dom.HierarchyRequestErr( + self.nodeName + " nodes do not have children") + + def removeChild(self, oldChild): + raise xml.dom.NotFoundErr( + self.nodeName + " nodes do not have children") + + def normalize(self): + # For childless nodes, normalize() has nothing to do. + pass + + def replaceChild(self, newChild, oldChild): + raise xml.dom.HierarchyRequestErr( + self.nodeName + " nodes do not have children") + + +class ProcessingInstruction(Childless, Node): + nodeType = Node.PROCESSING_INSTRUCTION_NODE + __slots__ = ('target', 'data') + + def __init__(self, target, data): + self.target = target + self.data = data + + # nodeValue is an alias for data + def _get_nodeValue(self): + return self.data + def _set_nodeValue(self, value): + self.data = value + nodeValue = property(_get_nodeValue, _set_nodeValue) + + # nodeName is an alias for target + def _get_nodeName(self): + return self.target + def _set_nodeName(self, value): + self.target = value + nodeName = property(_get_nodeName, _set_nodeName) + + def writexml(self, writer, indent="", addindent="", newl=""): + writer.write("%s%s" % (indent,self.target, self.data, newl)) + + +class CharacterData(Childless, Node): + __slots__=('_data', 'ownerDocument','parentNode', 'previousSibling', 'nextSibling') + + def __init__(self): + self.ownerDocument = self.parentNode = None + self.previousSibling = self.nextSibling = None + self._data = '' + Node.__init__(self) + + def _get_length(self): + return len(self.data) + __len__ = _get_length + + def _get_data(self): + return self._data + def _set_data(self, data): + self._data = data + + data = nodeValue = property(_get_data, _set_data) + + def __repr__(self): + data = self.data + if len(data) > 10: + dotdotdot = "..." + else: + dotdotdot = "" + return '' % ( + self.__class__.__name__, data[0:10], dotdotdot) + + def substringData(self, offset, count): + if offset < 0: + raise xml.dom.IndexSizeErr("offset cannot be negative") + if offset >= len(self.data): + raise xml.dom.IndexSizeErr("offset cannot be beyond end of data") + if count < 0: + raise xml.dom.IndexSizeErr("count cannot be negative") + return self.data[offset:offset+count] + + def appendData(self, arg): + self.data = self.data + arg + + def insertData(self, offset, arg): + if offset < 0: + raise xml.dom.IndexSizeErr("offset cannot be negative") + if offset >= len(self.data): + raise xml.dom.IndexSizeErr("offset cannot be beyond end of data") + if arg: + self.data = "%s%s%s" % ( + self.data[:offset], arg, self.data[offset:]) + + def deleteData(self, offset, count): + if offset < 0: + raise xml.dom.IndexSizeErr("offset cannot be negative") + if offset >= len(self.data): + raise xml.dom.IndexSizeErr("offset cannot be beyond end of data") + if count < 0: + raise xml.dom.IndexSizeErr("count cannot be negative") + if count: + self.data = self.data[:offset] + self.data[offset+count:] + + def replaceData(self, offset, count, arg): + if offset < 0: + raise xml.dom.IndexSizeErr("offset cannot be negative") + if offset >= len(self.data): + raise xml.dom.IndexSizeErr("offset cannot be beyond end of data") + if count < 0: + raise xml.dom.IndexSizeErr("count cannot be negative") + if count: + self.data = "%s%s%s" % ( + self.data[:offset], arg, self.data[offset+count:]) + +defproperty(CharacterData, "length", doc="Length of the string data.") + + +class Text(CharacterData): + __slots__ = () + + nodeType = Node.TEXT_NODE + nodeName = "#text" + attributes = None + + def splitText(self, offset): + if offset < 0 or offset > len(self.data): + raise xml.dom.IndexSizeErr("illegal offset value") + newText = self.__class__() + newText.data = self.data[offset:] + newText.ownerDocument = self.ownerDocument + next = self.nextSibling + if self.parentNode and self in self.parentNode.childNodes: + if next is None: + self.parentNode.appendChild(newText) + else: + self.parentNode.insertBefore(newText, next) + self.data = self.data[:offset] + return newText + + def writexml(self, writer, indent="", addindent="", newl=""): + _write_data(writer, "%s%s%s" % (indent, self.data, newl), False) + + # DOM Level 3 (WD 9 April 2002) + + def _get_wholeText(self): + L = [self.data] + n = self.previousSibling + while n is not None: + if n.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE): + L.insert(0, n.data) + n = n.previousSibling + else: + break + n = self.nextSibling + while n is not None: + if n.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE): + L.append(n.data) + n = n.nextSibling + else: + break + return ''.join(L) + + def replaceWholeText(self, content): + # XXX This needs to be seriously changed if minidom ever + # supports EntityReference nodes. + parent = self.parentNode + n = self.previousSibling + while n is not None: + if n.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE): + next = n.previousSibling + parent.removeChild(n) + n = next + else: + break + n = self.nextSibling + if not content: + parent.removeChild(self) + while n is not None: + if n.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE): + next = n.nextSibling + parent.removeChild(n) + n = next + else: + break + if content: + self.data = content + return self + else: + return None + + def _get_isWhitespaceInElementContent(self): + if self.data.strip(): + return False + elem = _get_containing_element(self) + if elem is None: + return False + info = self.ownerDocument._get_elem_info(elem) + if info is None: + return False + else: + return info.isElementContent() + +defproperty(Text, "isWhitespaceInElementContent", + doc="True iff this text node contains only whitespace" + " and is in element content.") +defproperty(Text, "wholeText", + doc="The text of all logically-adjacent text nodes.") + + +def _get_containing_element(node): + c = node.parentNode + while c is not None: + if c.nodeType == Node.ELEMENT_NODE: + return c + c = c.parentNode + return None + +def _get_containing_entref(node): + c = node.parentNode + while c is not None: + if c.nodeType == Node.ENTITY_REFERENCE_NODE: + return c + c = c.parentNode + return None + + +class Comment(CharacterData): + nodeType = Node.COMMENT_NODE + nodeName = "#comment" + + def __init__(self, data): + CharacterData.__init__(self) + self._data = data + + def writexml(self, writer, indent="", addindent="", newl=""): + if "--" in self.data: + raise ValueError("'--' is not allowed in a comment node") + writer.write("%s%s" % (indent, self.data, newl)) + + +class CDATASection(Text): + __slots__ = () + + nodeType = Node.CDATA_SECTION_NODE + nodeName = "#cdata-section" + + def writexml(self, writer, indent="", addindent="", newl=""): + if self.data.find("]]>") >= 0: + raise ValueError("']]>' not allowed in a CDATA section") + writer.write("" % self.data) + + +class ReadOnlySequentialNamedNodeMap(object): + __slots__ = '_seq', + + def __init__(self, seq=()): + # seq should be a list or tuple + self._seq = seq + + def __len__(self): + return len(self._seq) + + def _get_length(self): + return len(self._seq) + + def getNamedItem(self, name): + for n in self._seq: + if n.nodeName == name: + return n + + def getNamedItemNS(self, namespaceURI, localName): + for n in self._seq: + if n.namespaceURI == namespaceURI and n.localName == localName: + return n + + def __getitem__(self, name_or_tuple): + if isinstance(name_or_tuple, tuple): + node = self.getNamedItemNS(*name_or_tuple) + else: + node = self.getNamedItem(name_or_tuple) + if node is None: + raise KeyError(name_or_tuple) + return node + + def item(self, index): + if index < 0: + return None + try: + return self._seq[index] + except IndexError: + return None + + def removeNamedItem(self, name): + raise xml.dom.NoModificationAllowedErr( + "NamedNodeMap instance is read-only") + + def removeNamedItemNS(self, namespaceURI, localName): + raise xml.dom.NoModificationAllowedErr( + "NamedNodeMap instance is read-only") + + def setNamedItem(self, node): + raise xml.dom.NoModificationAllowedErr( + "NamedNodeMap instance is read-only") + + def setNamedItemNS(self, node): + raise xml.dom.NoModificationAllowedErr( + "NamedNodeMap instance is read-only") + + def __getstate__(self): + return [self._seq] + + def __setstate__(self, state): + self._seq = state[0] + +defproperty(ReadOnlySequentialNamedNodeMap, "length", + doc="Number of entries in the NamedNodeMap.") + + +class Identified: + """Mix-in class that supports the publicId and systemId attributes.""" + + __slots__ = 'publicId', 'systemId' + + def _identified_mixin_init(self, publicId, systemId): + self.publicId = publicId + self.systemId = systemId + + def _get_publicId(self): + return self.publicId + + def _get_systemId(self): + return self.systemId + +class DocumentType(Identified, Childless, Node): + nodeType = Node.DOCUMENT_TYPE_NODE + nodeValue = None + name = None + publicId = None + systemId = None + internalSubset = None + + def __init__(self, qualifiedName): + self.entities = ReadOnlySequentialNamedNodeMap() + self.notations = ReadOnlySequentialNamedNodeMap() + if qualifiedName: + prefix, localname = _nssplit(qualifiedName) + self.name = localname + self.nodeName = self.name + + def _get_internalSubset(self): + return self.internalSubset + + def cloneNode(self, deep): + if self.ownerDocument is None: + # it's ok + clone = DocumentType(None) + clone.name = self.name + clone.nodeName = self.name + operation = xml.dom.UserDataHandler.NODE_CLONED + if deep: + clone.entities._seq = [] + clone.notations._seq = [] + for n in self.notations._seq: + notation = Notation(n.nodeName, n.publicId, n.systemId) + clone.notations._seq.append(notation) + n._call_user_data_handler(operation, n, notation) + for e in self.entities._seq: + entity = Entity(e.nodeName, e.publicId, e.systemId, + e.notationName) + entity.actualEncoding = e.actualEncoding + entity.encoding = e.encoding + entity.version = e.version + clone.entities._seq.append(entity) + e._call_user_data_handler(operation, e, entity) + self._call_user_data_handler(operation, self, clone) + return clone + else: + return None + + def writexml(self, writer, indent="", addindent="", newl=""): + writer.write(""+newl) + +class Entity(Identified, Node): + attributes = None + nodeType = Node.ENTITY_NODE + nodeValue = None + + actualEncoding = None + encoding = None + version = None + + def __init__(self, name, publicId, systemId, notation): + self.nodeName = name + self.notationName = notation + self.childNodes = NodeList() + self._identified_mixin_init(publicId, systemId) + + def _get_actualEncoding(self): + return self.actualEncoding + + def _get_encoding(self): + return self.encoding + + def _get_version(self): + return self.version + + def appendChild(self, newChild): + raise xml.dom.HierarchyRequestErr( + "cannot append children to an entity node") + + def insertBefore(self, newChild, refChild): + raise xml.dom.HierarchyRequestErr( + "cannot insert children below an entity node") + + def removeChild(self, oldChild): + raise xml.dom.HierarchyRequestErr( + "cannot remove children from an entity node") + + def replaceChild(self, newChild, oldChild): + raise xml.dom.HierarchyRequestErr( + "cannot replace children of an entity node") + +class Notation(Identified, Childless, Node): + nodeType = Node.NOTATION_NODE + nodeValue = None + + def __init__(self, name, publicId, systemId): + self.nodeName = name + self._identified_mixin_init(publicId, systemId) + + +class DOMImplementation(DOMImplementationLS): + _features = [("core", "1.0"), + ("core", "2.0"), + ("core", None), + ("xml", "1.0"), + ("xml", "2.0"), + ("xml", None), + ("ls-load", "3.0"), + ("ls-load", None), + ] + + def hasFeature(self, feature, version): + if version == "": + version = None + return (feature.lower(), version) in self._features + + def createDocument(self, namespaceURI, qualifiedName, doctype): + if doctype and doctype.parentNode is not None: + raise xml.dom.WrongDocumentErr( + "doctype object owned by another DOM tree") + doc = self._create_document() + + add_root_element = not (namespaceURI is None + and qualifiedName is None + and doctype is None) + + if not qualifiedName and add_root_element: + # The spec is unclear what to raise here; SyntaxErr + # would be the other obvious candidate. Since Xerces raises + # InvalidCharacterErr, and since SyntaxErr is not listed + # for createDocument, that seems to be the better choice. + # XXX: need to check for illegal characters here and in + # createElement. + + # DOM Level III clears this up when talking about the return value + # of this function. If namespaceURI, qName and DocType are + # Null the document is returned without a document element + # Otherwise if doctype or namespaceURI are not None + # Then we go back to the above problem + raise xml.dom.InvalidCharacterErr("Element with no name") + + if add_root_element: + prefix, localname = _nssplit(qualifiedName) + if prefix == "xml" \ + and namespaceURI != "http://www.w3.org/XML/1998/namespace": + raise xml.dom.NamespaceErr("illegal use of 'xml' prefix") + if prefix and not namespaceURI: + raise xml.dom.NamespaceErr( + "illegal use of prefix without namespaces") + element = doc.createElementNS(namespaceURI, qualifiedName) + if doctype: + doc.appendChild(doctype) + doc.appendChild(element) + + if doctype: + doctype.parentNode = doctype.ownerDocument = doc + + doc.doctype = doctype + doc.implementation = self + return doc + + def createDocumentType(self, qualifiedName, publicId, systemId): + doctype = DocumentType(qualifiedName) + doctype.publicId = publicId + doctype.systemId = systemId + return doctype + + # DOM Level 3 (WD 9 April 2002) + + def getInterface(self, feature): + if self.hasFeature(feature, None): + return self + else: + return None + + # internal + def _create_document(self): + return Document() + +class ElementInfo(object): + """Object that represents content-model information for an element. + + This implementation is not expected to be used in practice; DOM + builders should provide implementations which do the right thing + using information available to it. + + """ + + __slots__ = 'tagName', + + def __init__(self, name): + self.tagName = name + + def getAttributeType(self, aname): + return _no_type + + def getAttributeTypeNS(self, namespaceURI, localName): + return _no_type + + def isElementContent(self): + return False + + def isEmpty(self): + """Returns true iff this element is declared to have an EMPTY + content model.""" + return False + + def isId(self, aname): + """Returns true iff the named attribute is a DTD-style ID.""" + return False + + def isIdNS(self, namespaceURI, localName): + """Returns true iff the identified attribute is a DTD-style ID.""" + return False + + def __getstate__(self): + return self.tagName + + def __setstate__(self, state): + self.tagName = state + +def _clear_id_cache(node): + if node.nodeType == Node.DOCUMENT_NODE: + node._id_cache.clear() + node._id_search_stack = None + elif node.ownerDocument: + node.ownerDocument._id_cache.clear() + node.ownerDocument._id_search_stack= None + +class Document(Node, DocumentLS): + __slots__ = ('_elem_info', 'doctype', + '_id_search_stack', 'childNodes', '_id_cache') + _child_node_types = (Node.ELEMENT_NODE, Node.PROCESSING_INSTRUCTION_NODE, + Node.COMMENT_NODE, Node.DOCUMENT_TYPE_NODE) + + implementation = DOMImplementation() + nodeType = Node.DOCUMENT_NODE + nodeName = "#document" + nodeValue = None + attributes = None + parentNode = None + previousSibling = nextSibling = None + + + # Document attributes from Level 3 (WD 9 April 2002) + + actualEncoding = None + encoding = None + standalone = None + version = None + strictErrorChecking = False + errorHandler = None + documentURI = None + + _magic_id_count = 0 + + def __init__(self): + self.doctype = None + self.childNodes = NodeList() + # mapping of (namespaceURI, localName) -> ElementInfo + # and tagName -> ElementInfo + self._elem_info = {} + self._id_cache = {} + self._id_search_stack = None + + def _get_elem_info(self, element): + if element.namespaceURI: + key = element.namespaceURI, element.localName + else: + key = element.tagName + return self._elem_info.get(key) + + def _get_actualEncoding(self): + return self.actualEncoding + + def _get_doctype(self): + return self.doctype + + def _get_documentURI(self): + return self.documentURI + + def _get_encoding(self): + return self.encoding + + def _get_errorHandler(self): + return self.errorHandler + + def _get_standalone(self): + return self.standalone + + def _get_strictErrorChecking(self): + return self.strictErrorChecking + + def _get_version(self): + return self.version + + def appendChild(self, node): + if node.nodeType not in self._child_node_types: + raise xml.dom.HierarchyRequestErr( + "%s cannot be child of %s" % (repr(node), repr(self))) + if node.parentNode is not None: + # This needs to be done before the next test since this + # may *be* the document element, in which case it should + # end up re-ordered to the end. + node.parentNode.removeChild(node) + + if node.nodeType == Node.ELEMENT_NODE \ + and self._get_documentElement(): + raise xml.dom.HierarchyRequestErr( + "two document elements disallowed") + return Node.appendChild(self, node) + + def removeChild(self, oldChild): + try: + self.childNodes.remove(oldChild) + except ValueError: + raise xml.dom.NotFoundErr() + oldChild.nextSibling = oldChild.previousSibling = None + oldChild.parentNode = None + if self.documentElement is oldChild: + self.documentElement = None + + return oldChild + + def _get_documentElement(self): + for node in self.childNodes: + if node.nodeType == Node.ELEMENT_NODE: + return node + + def unlink(self): + if self.doctype is not None: + self.doctype.unlink() + self.doctype = None + Node.unlink(self) + + def cloneNode(self, deep): + if not deep: + return None + clone = self.implementation.createDocument(None, None, None) + clone.encoding = self.encoding + clone.standalone = self.standalone + clone.version = self.version + for n in self.childNodes: + childclone = _clone_node(n, deep, clone) + assert childclone.ownerDocument.isSameNode(clone) + clone.childNodes.append(childclone) + if childclone.nodeType == Node.DOCUMENT_NODE: + assert clone.documentElement is None + elif childclone.nodeType == Node.DOCUMENT_TYPE_NODE: + assert clone.doctype is None + clone.doctype = childclone + childclone.parentNode = clone + self._call_user_data_handler(xml.dom.UserDataHandler.NODE_CLONED, + self, clone) + return clone + + def createDocumentFragment(self): + d = DocumentFragment() + d.ownerDocument = self + return d + + def createElement(self, tagName): + e = Element(tagName) + e.ownerDocument = self + return e + + def createTextNode(self, data): + if not isinstance(data, str): + raise TypeError("node contents must be a string") + t = Text() + t.data = data + t.ownerDocument = self + return t + + def createCDATASection(self, data): + if not isinstance(data, str): + raise TypeError("node contents must be a string") + c = CDATASection() + c.data = data + c.ownerDocument = self + return c + + def createComment(self, data): + c = Comment(data) + c.ownerDocument = self + return c + + def createProcessingInstruction(self, target, data): + p = ProcessingInstruction(target, data) + p.ownerDocument = self + return p + + def createAttribute(self, qName): + a = Attr(qName) + a.ownerDocument = self + a.value = "" + return a + + def createElementNS(self, namespaceURI, qualifiedName): + prefix, localName = _nssplit(qualifiedName) + e = Element(qualifiedName, namespaceURI, prefix) + e.ownerDocument = self + return e + + def createAttributeNS(self, namespaceURI, qualifiedName): + prefix, localName = _nssplit(qualifiedName) + a = Attr(qualifiedName, namespaceURI, localName, prefix) + a.ownerDocument = self + a.value = "" + return a + + # A couple of implementation-specific helpers to create node types + # not supported by the W3C DOM specs: + + def _create_entity(self, name, publicId, systemId, notationName): + e = Entity(name, publicId, systemId, notationName) + e.ownerDocument = self + return e + + def _create_notation(self, name, publicId, systemId): + n = Notation(name, publicId, systemId) + n.ownerDocument = self + return n + + def getElementById(self, id): + if id in self._id_cache: + return self._id_cache[id] + if not (self._elem_info or self._magic_id_count): + return None + + stack = self._id_search_stack + if stack is None: + # we never searched before, or the cache has been cleared + stack = [self.documentElement] + self._id_search_stack = stack + elif not stack: + # Previous search was completed and cache is still valid; + # no matching node. + return None + + result = None + while stack: + node = stack.pop() + # add child elements to stack for continued searching + stack.extend([child for child in node.childNodes + if child.nodeType in _nodeTypes_with_children]) + # check this node + info = self._get_elem_info(node) + if info: + # We have to process all ID attributes before + # returning in order to get all the attributes set to + # be IDs using Element.setIdAttribute*(). + for attr in node.attributes.values(): + if attr.namespaceURI: + if info.isIdNS(attr.namespaceURI, attr.localName): + self._id_cache[attr.value] = node + if attr.value == id: + result = node + elif not node._magic_id_nodes: + break + elif info.isId(attr.name): + self._id_cache[attr.value] = node + if attr.value == id: + result = node + elif not node._magic_id_nodes: + break + elif attr._is_id: + self._id_cache[attr.value] = node + if attr.value == id: + result = node + elif node._magic_id_nodes == 1: + break + elif node._magic_id_nodes: + for attr in node.attributes.values(): + if attr._is_id: + self._id_cache[attr.value] = node + if attr.value == id: + result = node + if result is not None: + break + return result + + def getElementsByTagName(self, name): + return _get_elements_by_tagName_helper(self, name, NodeList()) + + def getElementsByTagNameNS(self, namespaceURI, localName): + return _get_elements_by_tagName_ns_helper( + self, namespaceURI, localName, NodeList()) + + def isSupported(self, feature, version): + return self.implementation.hasFeature(feature, version) + + def importNode(self, node, deep): + if node.nodeType == Node.DOCUMENT_NODE: + raise xml.dom.NotSupportedErr("cannot import document nodes") + elif node.nodeType == Node.DOCUMENT_TYPE_NODE: + raise xml.dom.NotSupportedErr("cannot import document type nodes") + return _clone_node(node, deep, self) + + def writexml(self, writer, indent="", addindent="", newl="", encoding=None, + standalone=None): + declarations = [] + + if encoding: + declarations.append(f'encoding="{encoding}"') + if standalone is not None: + declarations.append(f'standalone="{"yes" if standalone else "no"}"') + + writer.write(f'{newl}') + + for node in self.childNodes: + node.writexml(writer, indent, addindent, newl) + + # DOM Level 3 (WD 9 April 2002) + + def renameNode(self, n, namespaceURI, name): + if n.ownerDocument is not self: + raise xml.dom.WrongDocumentErr( + "cannot rename nodes from other documents;\n" + "expected %s,\nfound %s" % (self, n.ownerDocument)) + if n.nodeType not in (Node.ELEMENT_NODE, Node.ATTRIBUTE_NODE): + raise xml.dom.NotSupportedErr( + "renameNode() only applies to element and attribute nodes") + if namespaceURI != EMPTY_NAMESPACE: + if ':' in name: + prefix, localName = name.split(':', 1) + if ( prefix == "xmlns" + and namespaceURI != xml.dom.XMLNS_NAMESPACE): + raise xml.dom.NamespaceErr( + "illegal use of 'xmlns' prefix") + else: + if ( name == "xmlns" + and namespaceURI != xml.dom.XMLNS_NAMESPACE + and n.nodeType == Node.ATTRIBUTE_NODE): + raise xml.dom.NamespaceErr( + "illegal use of the 'xmlns' attribute") + prefix = None + localName = name + else: + prefix = None + localName = None + if n.nodeType == Node.ATTRIBUTE_NODE: + element = n.ownerElement + if element is not None: + is_id = n._is_id + element.removeAttributeNode(n) + else: + element = None + n.prefix = prefix + n._localName = localName + n.namespaceURI = namespaceURI + n.nodeName = name + if n.nodeType == Node.ELEMENT_NODE: + n.tagName = name + else: + # attribute node + n.name = name + if element is not None: + element.setAttributeNode(n) + if is_id: + element.setIdAttributeNode(n) + # It's not clear from a semantic perspective whether we should + # call the user data handlers for the NODE_RENAMED event since + # we're re-using the existing node. The draft spec has been + # interpreted as meaning "no, don't call the handler unless a + # new node is created." + return n + +defproperty(Document, "documentElement", + doc="Top-level element of this document.") + + +def _clone_node(node, deep, newOwnerDocument): + """ + Clone a node and give it the new owner document. + Called by Node.cloneNode and Document.importNode + """ + if node.ownerDocument.isSameNode(newOwnerDocument): + operation = xml.dom.UserDataHandler.NODE_CLONED + else: + operation = xml.dom.UserDataHandler.NODE_IMPORTED + if node.nodeType == Node.ELEMENT_NODE: + clone = newOwnerDocument.createElementNS(node.namespaceURI, + node.nodeName) + for attr in node.attributes.values(): + clone.setAttributeNS(attr.namespaceURI, attr.nodeName, attr.value) + a = clone.getAttributeNodeNS(attr.namespaceURI, attr.localName) + a.specified = attr.specified + + if deep: + for child in node.childNodes: + c = _clone_node(child, deep, newOwnerDocument) + clone.appendChild(c) + + elif node.nodeType == Node.DOCUMENT_FRAGMENT_NODE: + clone = newOwnerDocument.createDocumentFragment() + if deep: + for child in node.childNodes: + c = _clone_node(child, deep, newOwnerDocument) + clone.appendChild(c) + + elif node.nodeType == Node.TEXT_NODE: + clone = newOwnerDocument.createTextNode(node.data) + elif node.nodeType == Node.CDATA_SECTION_NODE: + clone = newOwnerDocument.createCDATASection(node.data) + elif node.nodeType == Node.PROCESSING_INSTRUCTION_NODE: + clone = newOwnerDocument.createProcessingInstruction(node.target, + node.data) + elif node.nodeType == Node.COMMENT_NODE: + clone = newOwnerDocument.createComment(node.data) + elif node.nodeType == Node.ATTRIBUTE_NODE: + clone = newOwnerDocument.createAttributeNS(node.namespaceURI, + node.nodeName) + clone.specified = True + clone.value = node.value + elif node.nodeType == Node.DOCUMENT_TYPE_NODE: + assert node.ownerDocument is not newOwnerDocument + operation = xml.dom.UserDataHandler.NODE_IMPORTED + clone = newOwnerDocument.implementation.createDocumentType( + node.name, node.publicId, node.systemId) + clone.ownerDocument = newOwnerDocument + if deep: + clone.entities._seq = [] + clone.notations._seq = [] + for n in node.notations._seq: + notation = Notation(n.nodeName, n.publicId, n.systemId) + notation.ownerDocument = newOwnerDocument + clone.notations._seq.append(notation) + if hasattr(n, '_call_user_data_handler'): + n._call_user_data_handler(operation, n, notation) + for e in node.entities._seq: + entity = Entity(e.nodeName, e.publicId, e.systemId, + e.notationName) + entity.actualEncoding = e.actualEncoding + entity.encoding = e.encoding + entity.version = e.version + entity.ownerDocument = newOwnerDocument + clone.entities._seq.append(entity) + if hasattr(e, '_call_user_data_handler'): + e._call_user_data_handler(operation, e, entity) + else: + # Note the cloning of Document and DocumentType nodes is + # implementation specific. minidom handles those cases + # directly in the cloneNode() methods. + raise xml.dom.NotSupportedErr("Cannot clone node %s" % repr(node)) + + # Check for _call_user_data_handler() since this could conceivably + # used with other DOM implementations (one of the FourThought + # DOMs, perhaps?). + if hasattr(node, '_call_user_data_handler'): + node._call_user_data_handler(operation, node, clone) + return clone + + +def _nssplit(qualifiedName): + fields = qualifiedName.split(':', 1) + if len(fields) == 2: + return fields + else: + return (None, fields[0]) + + +def _do_pulldom_parse(func, args, kwargs): + events = func(*args, **kwargs) + toktype, rootNode = events.getEvent() + events.expandNode(rootNode) + events.clear() + return rootNode + +def parse(file, parser=None, bufsize=None): + """Parse a file into a DOM by filename or file object.""" + if parser is None and not bufsize: + from xml.dom import expatbuilder + return expatbuilder.parse(file) + else: + from xml.dom import pulldom + return _do_pulldom_parse(pulldom.parse, (file,), + {'parser': parser, 'bufsize': bufsize}) + +def parseString(string, parser=None): + """Parse a file into a DOM from a string.""" + if parser is None: + from xml.dom import expatbuilder + return expatbuilder.parseString(string) + else: + from xml.dom import pulldom + return _do_pulldom_parse(pulldom.parseString, (string,), + {'parser': parser}) + +def getDOMImplementation(features=None): + if features: + if isinstance(features, str): + features = domreg._parse_feature_string(features) + for f, v in features: + if not Document.implementation.hasFeature(f, v): + return None + return Document.implementation diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/pulldom.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/pulldom.py new file mode 100644 index 0000000000000000000000000000000000000000..913141cd7ef3cebbb28683c6be6b33cd477b4bf3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/pulldom.py @@ -0,0 +1,336 @@ +import xml.sax +import xml.sax.handler + +START_ELEMENT = "START_ELEMENT" +END_ELEMENT = "END_ELEMENT" +COMMENT = "COMMENT" +START_DOCUMENT = "START_DOCUMENT" +END_DOCUMENT = "END_DOCUMENT" +PROCESSING_INSTRUCTION = "PROCESSING_INSTRUCTION" +IGNORABLE_WHITESPACE = "IGNORABLE_WHITESPACE" +CHARACTERS = "CHARACTERS" + +class PullDOM(xml.sax.ContentHandler): + _locator = None + document = None + + def __init__(self, documentFactory=None): + from xml.dom import XML_NAMESPACE + self.documentFactory = documentFactory + self.firstEvent = [None, None] + self.lastEvent = self.firstEvent + self.elementStack = [] + self.push = self.elementStack.append + try: + self.pop = self.elementStack.pop + except AttributeError: + # use class' pop instead + pass + self._ns_contexts = [{XML_NAMESPACE:'xml'}] # contains uri -> prefix dicts + self._current_context = self._ns_contexts[-1] + self.pending_events = [] + + def pop(self): + result = self.elementStack[-1] + del self.elementStack[-1] + return result + + def setDocumentLocator(self, locator): + self._locator = locator + + def startPrefixMapping(self, prefix, uri): + if not hasattr(self, '_xmlns_attrs'): + self._xmlns_attrs = [] + self._xmlns_attrs.append((prefix or 'xmlns', uri)) + self._ns_contexts.append(self._current_context.copy()) + self._current_context[uri] = prefix or None + + def endPrefixMapping(self, prefix): + self._current_context = self._ns_contexts.pop() + + def startElementNS(self, name, tagName , attrs): + # Retrieve xml namespace declaration attributes. + xmlns_uri = 'http://www.w3.org/2000/xmlns/' + xmlns_attrs = getattr(self, '_xmlns_attrs', None) + if xmlns_attrs is not None: + for aname, value in xmlns_attrs: + attrs._attrs[(xmlns_uri, aname)] = value + self._xmlns_attrs = [] + uri, localname = name + if uri: + # When using namespaces, the reader may or may not + # provide us with the original name. If not, create + # *a* valid tagName from the current context. + if tagName is None: + prefix = self._current_context[uri] + if prefix: + tagName = prefix + ":" + localname + else: + tagName = localname + if self.document: + node = self.document.createElementNS(uri, tagName) + else: + node = self.buildDocument(uri, tagName) + else: + # When the tagname is not prefixed, it just appears as + # localname + if self.document: + node = self.document.createElement(localname) + else: + node = self.buildDocument(None, localname) + + for aname,value in attrs.items(): + a_uri, a_localname = aname + if a_uri == xmlns_uri: + if a_localname == 'xmlns': + qname = a_localname + else: + qname = 'xmlns:' + a_localname + attr = self.document.createAttributeNS(a_uri, qname) + node.setAttributeNodeNS(attr) + elif a_uri: + prefix = self._current_context[a_uri] + if prefix: + qname = prefix + ":" + a_localname + else: + qname = a_localname + attr = self.document.createAttributeNS(a_uri, qname) + node.setAttributeNodeNS(attr) + else: + attr = self.document.createAttribute(a_localname) + node.setAttributeNode(attr) + attr.value = value + + self.lastEvent[1] = [(START_ELEMENT, node), None] + self.lastEvent = self.lastEvent[1] + self.push(node) + + def endElementNS(self, name, tagName): + self.lastEvent[1] = [(END_ELEMENT, self.pop()), None] + self.lastEvent = self.lastEvent[1] + + def startElement(self, name, attrs): + if self.document: + node = self.document.createElement(name) + else: + node = self.buildDocument(None, name) + + for aname,value in attrs.items(): + attr = self.document.createAttribute(aname) + attr.value = value + node.setAttributeNode(attr) + + self.lastEvent[1] = [(START_ELEMENT, node), None] + self.lastEvent = self.lastEvent[1] + self.push(node) + + def endElement(self, name): + self.lastEvent[1] = [(END_ELEMENT, self.pop()), None] + self.lastEvent = self.lastEvent[1] + + def comment(self, s): + if self.document: + node = self.document.createComment(s) + self.lastEvent[1] = [(COMMENT, node), None] + self.lastEvent = self.lastEvent[1] + else: + event = [(COMMENT, s), None] + self.pending_events.append(event) + + def processingInstruction(self, target, data): + if self.document: + node = self.document.createProcessingInstruction(target, data) + self.lastEvent[1] = [(PROCESSING_INSTRUCTION, node), None] + self.lastEvent = self.lastEvent[1] + else: + event = [(PROCESSING_INSTRUCTION, target, data), None] + self.pending_events.append(event) + + def ignorableWhitespace(self, chars): + node = self.document.createTextNode(chars) + self.lastEvent[1] = [(IGNORABLE_WHITESPACE, node), None] + self.lastEvent = self.lastEvent[1] + + def characters(self, chars): + node = self.document.createTextNode(chars) + self.lastEvent[1] = [(CHARACTERS, node), None] + self.lastEvent = self.lastEvent[1] + + def startDocument(self): + if self.documentFactory is None: + import xml.dom.minidom + self.documentFactory = xml.dom.minidom.Document.implementation + + def buildDocument(self, uri, tagname): + # Can't do that in startDocument, since we need the tagname + # XXX: obtain DocumentType + node = self.documentFactory.createDocument(uri, tagname, None) + self.document = node + self.lastEvent[1] = [(START_DOCUMENT, node), None] + self.lastEvent = self.lastEvent[1] + self.push(node) + # Put everything we have seen so far into the document + for e in self.pending_events: + if e[0][0] == PROCESSING_INSTRUCTION: + _,target,data = e[0] + n = self.document.createProcessingInstruction(target, data) + e[0] = (PROCESSING_INSTRUCTION, n) + elif e[0][0] == COMMENT: + n = self.document.createComment(e[0][1]) + e[0] = (COMMENT, n) + else: + raise AssertionError("Unknown pending event ",e[0][0]) + self.lastEvent[1] = e + self.lastEvent = e + self.pending_events = None + return node.firstChild + + def endDocument(self): + self.lastEvent[1] = [(END_DOCUMENT, self.document), None] + self.pop() + + def clear(self): + "clear(): Explicitly release parsing structures" + self.document = None + +class ErrorHandler: + def warning(self, exception): + print(exception) + def error(self, exception): + raise exception + def fatalError(self, exception): + raise exception + +class DOMEventStream: + def __init__(self, stream, parser, bufsize): + self.stream = stream + self.parser = parser + self.bufsize = bufsize + if not hasattr(self.parser, 'feed'): + self.getEvent = self._slurp + self.reset() + + def reset(self): + self.pulldom = PullDOM() + # This content handler relies on namespace support + self.parser.setFeature(xml.sax.handler.feature_namespaces, 1) + self.parser.setContentHandler(self.pulldom) + + def __next__(self): + rc = self.getEvent() + if rc: + return rc + raise StopIteration + + def __iter__(self): + return self + + def expandNode(self, node): + event = self.getEvent() + parents = [node] + while event: + token, cur_node = event + if cur_node is node: + return + if token != END_ELEMENT: + parents[-1].appendChild(cur_node) + if token == START_ELEMENT: + parents.append(cur_node) + elif token == END_ELEMENT: + del parents[-1] + event = self.getEvent() + + def getEvent(self): + # use IncrementalParser interface, so we get the desired + # pull effect + if not self.pulldom.firstEvent[1]: + self.pulldom.lastEvent = self.pulldom.firstEvent + while not self.pulldom.firstEvent[1]: + buf = self.stream.read(self.bufsize) + if not buf: + self.parser.close() + return None + self.parser.feed(buf) + rc = self.pulldom.firstEvent[1][0] + self.pulldom.firstEvent[1] = self.pulldom.firstEvent[1][1] + return rc + + def _slurp(self): + """ Fallback replacement for getEvent() using the + standard SAX2 interface, which means we slurp the + SAX events into memory (no performance gain, but + we are compatible to all SAX parsers). + """ + self.parser.parse(self.stream) + self.getEvent = self._emit + return self._emit() + + def _emit(self): + """ Fallback replacement for getEvent() that emits + the events that _slurp() read previously. + """ + rc = self.pulldom.firstEvent[1][0] + self.pulldom.firstEvent[1] = self.pulldom.firstEvent[1][1] + return rc + + def clear(self): + """clear(): Explicitly release parsing objects""" + self.pulldom.clear() + del self.pulldom + self.parser = None + self.stream = None + +class SAX2DOM(PullDOM): + + def startElementNS(self, name, tagName , attrs): + PullDOM.startElementNS(self, name, tagName, attrs) + curNode = self.elementStack[-1] + parentNode = self.elementStack[-2] + parentNode.appendChild(curNode) + + def startElement(self, name, attrs): + PullDOM.startElement(self, name, attrs) + curNode = self.elementStack[-1] + parentNode = self.elementStack[-2] + parentNode.appendChild(curNode) + + def processingInstruction(self, target, data): + PullDOM.processingInstruction(self, target, data) + node = self.lastEvent[0][1] + parentNode = self.elementStack[-1] + parentNode.appendChild(node) + + def ignorableWhitespace(self, chars): + PullDOM.ignorableWhitespace(self, chars) + node = self.lastEvent[0][1] + parentNode = self.elementStack[-1] + parentNode.appendChild(node) + + def characters(self, chars): + PullDOM.characters(self, chars) + node = self.lastEvent[0][1] + parentNode = self.elementStack[-1] + parentNode.appendChild(node) + + +default_bufsize = (2 ** 14) - 20 + +def parse(stream_or_string, parser=None, bufsize=None): + if bufsize is None: + bufsize = default_bufsize + if isinstance(stream_or_string, str): + stream = open(stream_or_string, 'rb') + else: + stream = stream_or_string + if not parser: + parser = xml.sax.make_parser() + return DOMEventStream(stream, parser, bufsize) + +def parseString(string, parser=None): + from io import StringIO + + bufsize = len(string) + buf = StringIO(string) + if not parser: + parser = xml.sax.make_parser() + return DOMEventStream(buf, parser, bufsize) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/xmlbuilder.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/xmlbuilder.py new file mode 100644 index 0000000000000000000000000000000000000000..a8852625a2f9a2c22227cac152f6c4e34281710e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/dom/xmlbuilder.py @@ -0,0 +1,389 @@ +"""Implementation of the DOM Level 3 'LS-Load' feature.""" + +import copy +import xml.dom + +from xml.dom.NodeFilter import NodeFilter + + +__all__ = ["DOMBuilder", "DOMEntityResolver", "DOMInputSource"] + + +class Options: + """Features object that has variables set for each DOMBuilder feature. + + The DOMBuilder class uses an instance of this class to pass settings to + the ExpatBuilder class. + """ + + # Note that the DOMBuilder class in LoadSave constrains which of these + # values can be set using the DOM Level 3 LoadSave feature. + + namespaces = 1 + namespace_declarations = True + validation = False + external_parameter_entities = True + external_general_entities = True + external_dtd_subset = True + validate_if_schema = False + validate = False + datatype_normalization = False + create_entity_ref_nodes = True + entities = True + whitespace_in_element_content = True + cdata_sections = True + comments = True + charset_overrides_xml_encoding = True + infoset = False + supported_mediatypes_only = False + + errorHandler = None + filter = None + + +class DOMBuilder: + entityResolver = None + errorHandler = None + filter = None + + ACTION_REPLACE = 1 + ACTION_APPEND_AS_CHILDREN = 2 + ACTION_INSERT_AFTER = 3 + ACTION_INSERT_BEFORE = 4 + + _legal_actions = (ACTION_REPLACE, ACTION_APPEND_AS_CHILDREN, + ACTION_INSERT_AFTER, ACTION_INSERT_BEFORE) + + def __init__(self): + self._options = Options() + + def _get_entityResolver(self): + return self.entityResolver + def _set_entityResolver(self, entityResolver): + self.entityResolver = entityResolver + + def _get_errorHandler(self): + return self.errorHandler + def _set_errorHandler(self, errorHandler): + self.errorHandler = errorHandler + + def _get_filter(self): + return self.filter + def _set_filter(self, filter): + self.filter = filter + + def setFeature(self, name, state): + if self.supportsFeature(name): + state = state and 1 or 0 + try: + settings = self._settings[(_name_xform(name), state)] + except KeyError: + raise xml.dom.NotSupportedErr( + "unsupported feature: %r" % (name,)) from None + else: + for name, value in settings: + setattr(self._options, name, value) + else: + raise xml.dom.NotFoundErr("unknown feature: " + repr(name)) + + def supportsFeature(self, name): + return hasattr(self._options, _name_xform(name)) + + def canSetFeature(self, name, state): + key = (_name_xform(name), state and 1 or 0) + return key in self._settings + + # This dictionary maps from (feature,value) to a list of + # (option,value) pairs that should be set on the Options object. + # If a (feature,value) setting is not in this dictionary, it is + # not supported by the DOMBuilder. + # + _settings = { + ("namespace_declarations", 0): [ + ("namespace_declarations", 0)], + ("namespace_declarations", 1): [ + ("namespace_declarations", 1)], + ("validation", 0): [ + ("validation", 0)], + ("external_general_entities", 0): [ + ("external_general_entities", 0)], + ("external_general_entities", 1): [ + ("external_general_entities", 1)], + ("external_parameter_entities", 0): [ + ("external_parameter_entities", 0)], + ("external_parameter_entities", 1): [ + ("external_parameter_entities", 1)], + ("validate_if_schema", 0): [ + ("validate_if_schema", 0)], + ("create_entity_ref_nodes", 0): [ + ("create_entity_ref_nodes", 0)], + ("create_entity_ref_nodes", 1): [ + ("create_entity_ref_nodes", 1)], + ("entities", 0): [ + ("create_entity_ref_nodes", 0), + ("entities", 0)], + ("entities", 1): [ + ("entities", 1)], + ("whitespace_in_element_content", 0): [ + ("whitespace_in_element_content", 0)], + ("whitespace_in_element_content", 1): [ + ("whitespace_in_element_content", 1)], + ("cdata_sections", 0): [ + ("cdata_sections", 0)], + ("cdata_sections", 1): [ + ("cdata_sections", 1)], + ("comments", 0): [ + ("comments", 0)], + ("comments", 1): [ + ("comments", 1)], + ("charset_overrides_xml_encoding", 0): [ + ("charset_overrides_xml_encoding", 0)], + ("charset_overrides_xml_encoding", 1): [ + ("charset_overrides_xml_encoding", 1)], + ("infoset", 0): [], + ("infoset", 1): [ + ("namespace_declarations", 0), + ("validate_if_schema", 0), + ("create_entity_ref_nodes", 0), + ("entities", 0), + ("cdata_sections", 0), + ("datatype_normalization", 1), + ("whitespace_in_element_content", 1), + ("comments", 1), + ("charset_overrides_xml_encoding", 1)], + ("supported_mediatypes_only", 0): [ + ("supported_mediatypes_only", 0)], + ("namespaces", 0): [ + ("namespaces", 0)], + ("namespaces", 1): [ + ("namespaces", 1)], + } + + def getFeature(self, name): + xname = _name_xform(name) + try: + return getattr(self._options, xname) + except AttributeError: + if name == "infoset": + options = self._options + return (options.datatype_normalization + and options.whitespace_in_element_content + and options.comments + and options.charset_overrides_xml_encoding + and not (options.namespace_declarations + or options.validate_if_schema + or options.create_entity_ref_nodes + or options.entities + or options.cdata_sections)) + raise xml.dom.NotFoundErr("feature %s not known" % repr(name)) + + def parseURI(self, uri): + if self.entityResolver: + input = self.entityResolver.resolveEntity(None, uri) + else: + input = DOMEntityResolver().resolveEntity(None, uri) + return self.parse(input) + + def parse(self, input): + options = copy.copy(self._options) + options.filter = self.filter + options.errorHandler = self.errorHandler + fp = input.byteStream + if fp is None and input.systemId: + import urllib.request + fp = urllib.request.urlopen(input.systemId) + return self._parse_bytestream(fp, options) + + def parseWithContext(self, input, cnode, action): + if action not in self._legal_actions: + raise ValueError("not a legal action") + raise NotImplementedError("Haven't written this yet...") + + def _parse_bytestream(self, stream, options): + import xml.dom.expatbuilder + builder = xml.dom.expatbuilder.makeBuilder(options) + return builder.parseFile(stream) + + +def _name_xform(name): + return name.lower().replace('-', '_') + + +class DOMEntityResolver(object): + __slots__ = '_opener', + + def resolveEntity(self, publicId, systemId): + assert systemId is not None + source = DOMInputSource() + source.publicId = publicId + source.systemId = systemId + source.byteStream = self._get_opener().open(systemId) + + # determine the encoding if the transport provided it + source.encoding = self._guess_media_encoding(source) + + # determine the base URI is we can + import posixpath, urllib.parse + parts = urllib.parse.urlparse(systemId) + scheme, netloc, path, params, query, fragment = parts + # XXX should we check the scheme here as well? + if path and not path.endswith("/"): + path = posixpath.dirname(path) + "/" + parts = scheme, netloc, path, params, query, fragment + source.baseURI = urllib.parse.urlunparse(parts) + + return source + + def _get_opener(self): + try: + return self._opener + except AttributeError: + self._opener = self._create_opener() + return self._opener + + def _create_opener(self): + import urllib.request + return urllib.request.build_opener() + + def _guess_media_encoding(self, source): + info = source.byteStream.info() + # import email.message + # assert isinstance(info, email.message.Message) + charset = info.get_param('charset') + if charset is not None: + return charset.lower() + return None + + +class DOMInputSource(object): + __slots__ = ('byteStream', 'characterStream', 'stringData', + 'encoding', 'publicId', 'systemId', 'baseURI') + + def __init__(self): + self.byteStream = None + self.characterStream = None + self.stringData = None + self.encoding = None + self.publicId = None + self.systemId = None + self.baseURI = None + + def _get_byteStream(self): + return self.byteStream + def _set_byteStream(self, byteStream): + self.byteStream = byteStream + + def _get_characterStream(self): + return self.characterStream + def _set_characterStream(self, characterStream): + self.characterStream = characterStream + + def _get_stringData(self): + return self.stringData + def _set_stringData(self, data): + self.stringData = data + + def _get_encoding(self): + return self.encoding + def _set_encoding(self, encoding): + self.encoding = encoding + + def _get_publicId(self): + return self.publicId + def _set_publicId(self, publicId): + self.publicId = publicId + + def _get_systemId(self): + return self.systemId + def _set_systemId(self, systemId): + self.systemId = systemId + + def _get_baseURI(self): + return self.baseURI + def _set_baseURI(self, uri): + self.baseURI = uri + + +class DOMBuilderFilter: + """Element filter which can be used to tailor construction of + a DOM instance. + """ + + # There's really no need for this class; concrete implementations + # should just implement the endElement() and startElement() + # methods as appropriate. Using this makes it easy to only + # implement one of them. + + FILTER_ACCEPT = 1 + FILTER_REJECT = 2 + FILTER_SKIP = 3 + FILTER_INTERRUPT = 4 + + whatToShow = NodeFilter.SHOW_ALL + + def _get_whatToShow(self): + return self.whatToShow + + def acceptNode(self, element): + return self.FILTER_ACCEPT + + def startContainer(self, element): + return self.FILTER_ACCEPT + +del NodeFilter + + +class DocumentLS: + """Mixin to create documents that conform to the load/save spec.""" + + async_ = False + + def _get_async(self): + return False + + def _set_async(self, flag): + if flag: + raise xml.dom.NotSupportedErr( + "asynchronous document loading is not supported") + + def abort(self): + # What does it mean to "clear" a document? Does the + # documentElement disappear? + raise NotImplementedError( + "haven't figured out what this means yet") + + def load(self, uri): + raise NotImplementedError("haven't written this yet") + + def loadXML(self, source): + raise NotImplementedError("haven't written this yet") + + def saveXML(self, snode): + if snode is None: + snode = self + elif snode.ownerDocument is not self: + raise xml.dom.WrongDocumentErr() + return snode.toxml() + + +class DOMImplementationLS: + MODE_SYNCHRONOUS = 1 + MODE_ASYNCHRONOUS = 2 + + def createDOMBuilder(self, mode, schemaType): + if schemaType is not None: + raise xml.dom.NotSupportedErr( + "schemaType not yet supported") + if mode == self.MODE_SYNCHRONOUS: + return DOMBuilder() + if mode == self.MODE_ASYNCHRONOUS: + raise xml.dom.NotSupportedErr( + "asynchronous builders are not supported") + raise ValueError("unknown value for mode") + + def createDOMWriter(self): + raise NotImplementedError( + "the writer interface hasn't been written yet!") + + def createDOMInputSource(self): + return DOMInputSource() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/ElementInclude.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/ElementInclude.py new file mode 100644 index 0000000000000000000000000000000000000000..986e6c3bbe90f65ef7ba42134caedd8579c16753 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/ElementInclude.py @@ -0,0 +1,186 @@ +# +# ElementTree +# $Id: ElementInclude.py 3375 2008-02-13 08:05:08Z fredrik $ +# +# limited xinclude support for element trees +# +# history: +# 2003-08-15 fl created +# 2003-11-14 fl fixed default loader +# +# Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved. +# +# fredrik@pythonware.com +# http://www.pythonware.com +# +# -------------------------------------------------------------------- +# The ElementTree toolkit is +# +# Copyright (c) 1999-2008 by Fredrik Lundh +# +# By obtaining, using, and/or copying this software and/or its +# associated documentation, you agree that you have read, understood, +# and will comply with the following terms and conditions: +# +# Permission to use, copy, modify, and distribute this software and +# its associated documentation for any purpose and without fee is +# hereby granted, provided that the above copyright notice appears in +# all copies, and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name of +# Secret Labs AB or the author not be used in advertising or publicity +# pertaining to distribution of the software without specific, written +# prior permission. +# +# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD +# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- +# ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR +# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY +# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. +# -------------------------------------------------------------------- + +# Licensed to PSF under a Contributor Agreement. +# See https://www.python.org/psf/license for licensing details. + +## +# Limited XInclude support for the ElementTree package. +## + +import copy +from . import ElementTree +from urllib.parse import urljoin + +XINCLUDE = "{http://www.w3.org/2001/XInclude}" + +XINCLUDE_INCLUDE = XINCLUDE + "include" +XINCLUDE_FALLBACK = XINCLUDE + "fallback" + +# For security reasons, the inclusion depth is limited to this read-only value by default. +DEFAULT_MAX_INCLUSION_DEPTH = 6 + + +## +# Fatal include error. + +class FatalIncludeError(SyntaxError): + pass + + +class LimitedRecursiveIncludeError(FatalIncludeError): + pass + + +## +# Default loader. This loader reads an included resource from disk. +# +# @param href Resource reference. +# @param parse Parse mode. Either "xml" or "text". +# @param encoding Optional text encoding (UTF-8 by default for "text"). +# @return The expanded resource. If the parse mode is "xml", this +# is an Element instance. If the parse mode is "text", this +# is a string. If the loader fails, it can return None +# or raise an OSError exception. +# @throws OSError If the loader fails to load the resource. + +def default_loader(href, parse, encoding=None): + if parse == "xml": + with open(href, 'rb') as file: + data = ElementTree.parse(file).getroot() + else: + if not encoding: + encoding = 'UTF-8' + with open(href, 'r', encoding=encoding) as file: + data = file.read() + return data + +## +# Expand XInclude directives. +# +# @param elem Root Element or any ElementTree of a tree to be expanded +# @param loader Optional resource loader. If omitted, it defaults +# to {@link default_loader}. If given, it should be a callable +# that implements the same interface as default_loader. +# @param base_url The base URL of the original file, to resolve +# relative include file references. +# @param max_depth The maximum number of recursive inclusions. +# Limited to reduce the risk of malicious content explosion. +# Pass None to disable the limitation. +# @throws LimitedRecursiveIncludeError If the {@link max_depth} was exceeded. +# @throws FatalIncludeError If the function fails to include a given +# resource, or if the tree contains malformed XInclude elements. +# @throws OSError If the function fails to load a given resource. +# @throws ValueError If negative {@link max_depth} is passed. +# @returns None. Modifies tree pointed by {@link elem} + +def include(elem, loader=None, base_url=None, + max_depth=DEFAULT_MAX_INCLUSION_DEPTH): + if max_depth is None: + max_depth = -1 + elif max_depth < 0: + raise ValueError("expected non-negative depth or None for 'max_depth', got %r" % max_depth) + + if hasattr(elem, 'getroot'): + elem = elem.getroot() + if loader is None: + loader = default_loader + + _include(elem, loader, base_url, max_depth, set()) + + +def _include(elem, loader, base_url, max_depth, _parent_hrefs): + # look for xinclude elements + i = 0 + while i < len(elem): + e = elem[i] + if e.tag == XINCLUDE_INCLUDE: + # process xinclude directive + href = e.get("href") + if base_url: + href = urljoin(base_url, href) + parse = e.get("parse", "xml") + if parse == "xml": + if href in _parent_hrefs: + raise FatalIncludeError("recursive include of %s" % href) + if max_depth == 0: + raise LimitedRecursiveIncludeError( + "maximum xinclude depth reached when including file %s" % href) + _parent_hrefs.add(href) + node = loader(href, parse) + if node is None: + raise FatalIncludeError( + "cannot load %r as %r" % (href, parse) + ) + node = copy.copy(node) # FIXME: this makes little sense with recursive includes + _include(node, loader, href, max_depth - 1, _parent_hrefs) + _parent_hrefs.remove(href) + if e.tail: + node.tail = (node.tail or "") + e.tail + elem[i] = node + elif parse == "text": + text = loader(href, parse, e.get("encoding")) + if text is None: + raise FatalIncludeError( + "cannot load %r as %r" % (href, parse) + ) + if e.tail: + text += e.tail + if i: + node = elem[i-1] + node.tail = (node.tail or "") + text + else: + elem.text = (elem.text or "") + text + del elem[i] + continue + else: + raise FatalIncludeError( + "unknown parse type in xi:include tag (%r)" % parse + ) + elif e.tag == XINCLUDE_FALLBACK: + raise FatalIncludeError( + "xi:fallback tag must be child of xi:include (%r)" % e.tag + ) + else: + _include(e, loader, base_url, max_depth, _parent_hrefs) + i += 1 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/ElementPath.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/ElementPath.py new file mode 100644 index 0000000000000000000000000000000000000000..dc6bd28c03137de1968b41d2b857dc57f6549f08 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/ElementPath.py @@ -0,0 +1,423 @@ +# +# ElementTree +# $Id: ElementPath.py 3375 2008-02-13 08:05:08Z fredrik $ +# +# limited xpath support for element trees +# +# history: +# 2003-05-23 fl created +# 2003-05-28 fl added support for // etc +# 2003-08-27 fl fixed parsing of periods in element names +# 2007-09-10 fl new selection engine +# 2007-09-12 fl fixed parent selector +# 2007-09-13 fl added iterfind; changed findall to return a list +# 2007-11-30 fl added namespaces support +# 2009-10-30 fl added child element value filter +# +# Copyright (c) 2003-2009 by Fredrik Lundh. All rights reserved. +# +# fredrik@pythonware.com +# http://www.pythonware.com +# +# -------------------------------------------------------------------- +# The ElementTree toolkit is +# +# Copyright (c) 1999-2009 by Fredrik Lundh +# +# By obtaining, using, and/or copying this software and/or its +# associated documentation, you agree that you have read, understood, +# and will comply with the following terms and conditions: +# +# Permission to use, copy, modify, and distribute this software and +# its associated documentation for any purpose and without fee is +# hereby granted, provided that the above copyright notice appears in +# all copies, and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name of +# Secret Labs AB or the author not be used in advertising or publicity +# pertaining to distribution of the software without specific, written +# prior permission. +# +# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD +# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- +# ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR +# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY +# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. +# -------------------------------------------------------------------- + +# Licensed to PSF under a Contributor Agreement. +# See https://www.python.org/psf/license for licensing details. + +## +# Implementation module for XPath support. There's usually no reason +# to import this module directly; the ElementTree does this for +# you, if needed. +## + +import re + +xpath_tokenizer_re = re.compile( + r"(" + r"'[^']*'|\"[^\"]*\"|" + r"::|" + r"//?|" + r"\.\.|" + r"\(\)|" + r"!=|" + r"[/.*:\[\]\(\)@=])|" + r"((?:\{[^}]+\})?[^/\[\]\(\)@!=\s]+)|" + r"\s+" + ) + +def xpath_tokenizer(pattern, namespaces=None): + default_namespace = namespaces.get('') if namespaces else None + parsing_attribute = False + for token in xpath_tokenizer_re.findall(pattern): + ttype, tag = token + if tag and tag[0] != "{": + if ":" in tag: + prefix, uri = tag.split(":", 1) + try: + if not namespaces: + raise KeyError + yield ttype, "{%s}%s" % (namespaces[prefix], uri) + except KeyError: + raise SyntaxError("prefix %r not found in prefix map" % prefix) from None + elif default_namespace and not parsing_attribute: + yield ttype, "{%s}%s" % (default_namespace, tag) + else: + yield token + parsing_attribute = False + else: + yield token + parsing_attribute = ttype == '@' + + +def get_parent_map(context): + parent_map = context.parent_map + if parent_map is None: + context.parent_map = parent_map = {} + for p in context.root.iter(): + for e in p: + parent_map[e] = p + return parent_map + + +def _is_wildcard_tag(tag): + return tag[:3] == '{*}' or tag[-2:] == '}*' + + +def _prepare_tag(tag): + _isinstance, _str = isinstance, str + if tag == '{*}*': + # Same as '*', but no comments or processing instructions. + # It can be a surprise that '*' includes those, but there is no + # justification for '{*}*' doing the same. + def select(context, result): + for elem in result: + if _isinstance(elem.tag, _str): + yield elem + elif tag == '{}*': + # Any tag that is not in a namespace. + def select(context, result): + for elem in result: + el_tag = elem.tag + if _isinstance(el_tag, _str) and el_tag[0] != '{': + yield elem + elif tag[:3] == '{*}': + # The tag in any (or no) namespace. + suffix = tag[2:] # '}name' + no_ns = slice(-len(suffix), None) + tag = tag[3:] + def select(context, result): + for elem in result: + el_tag = elem.tag + if el_tag == tag or _isinstance(el_tag, _str) and el_tag[no_ns] == suffix: + yield elem + elif tag[-2:] == '}*': + # Any tag in the given namespace. + ns = tag[:-1] + ns_only = slice(None, len(ns)) + def select(context, result): + for elem in result: + el_tag = elem.tag + if _isinstance(el_tag, _str) and el_tag[ns_only] == ns: + yield elem + else: + raise RuntimeError(f"internal parser error, got {tag}") + return select + + +def prepare_child(next, token): + tag = token[1] + if _is_wildcard_tag(tag): + select_tag = _prepare_tag(tag) + def select(context, result): + def select_child(result): + for elem in result: + yield from elem + return select_tag(context, select_child(result)) + else: + if tag[:2] == '{}': + tag = tag[2:] # '{}tag' == 'tag' + def select(context, result): + for elem in result: + for e in elem: + if e.tag == tag: + yield e + return select + +def prepare_star(next, token): + def select(context, result): + for elem in result: + yield from elem + return select + +def prepare_self(next, token): + def select(context, result): + yield from result + return select + +def prepare_descendant(next, token): + try: + token = next() + except StopIteration: + return + if token[0] == "*": + tag = "*" + elif not token[0]: + tag = token[1] + else: + raise SyntaxError("invalid descendant") + + if _is_wildcard_tag(tag): + select_tag = _prepare_tag(tag) + def select(context, result): + def select_child(result): + for elem in result: + for e in elem.iter(): + if e is not elem: + yield e + return select_tag(context, select_child(result)) + else: + if tag[:2] == '{}': + tag = tag[2:] # '{}tag' == 'tag' + def select(context, result): + for elem in result: + for e in elem.iter(tag): + if e is not elem: + yield e + return select + +def prepare_parent(next, token): + def select(context, result): + # FIXME: raise error if .. is applied at toplevel? + parent_map = get_parent_map(context) + result_map = {} + for elem in result: + if elem in parent_map: + parent = parent_map[elem] + if parent not in result_map: + result_map[parent] = None + yield parent + return select + +def prepare_predicate(next, token): + # FIXME: replace with real parser!!! refs: + # http://javascript.crockford.com/tdop/tdop.html + signature = [] + predicate = [] + while 1: + try: + token = next() + except StopIteration: + return + if token[0] == "]": + break + if token == ('', ''): + # ignore whitespace + continue + if token[0] and token[0][:1] in "'\"": + token = "'", token[0][1:-1] + signature.append(token[0] or "-") + predicate.append(token[1]) + signature = "".join(signature) + # use signature to determine predicate type + if signature == "@-": + # [@attribute] predicate + key = predicate[1] + def select(context, result): + for elem in result: + if elem.get(key) is not None: + yield elem + return select + if signature == "@-='" or signature == "@-!='": + # [@attribute='value'] or [@attribute!='value'] + key = predicate[1] + value = predicate[-1] + def select(context, result): + for elem in result: + if elem.get(key) == value: + yield elem + def select_negated(context, result): + for elem in result: + if (attr_value := elem.get(key)) is not None and attr_value != value: + yield elem + return select_negated if '!=' in signature else select + if signature == "-" and not re.match(r"\-?\d+$", predicate[0]): + # [tag] + tag = predicate[0] + def select(context, result): + for elem in result: + if elem.find(tag) is not None: + yield elem + return select + if signature == ".='" or signature == ".!='" or ( + (signature == "-='" or signature == "-!='") + and not re.match(r"\-?\d+$", predicate[0])): + # [.='value'] or [tag='value'] or [.!='value'] or [tag!='value'] + tag = predicate[0] + value = predicate[-1] + if tag: + def select(context, result): + for elem in result: + for e in elem.findall(tag): + if "".join(e.itertext()) == value: + yield elem + break + def select_negated(context, result): + for elem in result: + for e in elem.iterfind(tag): + if "".join(e.itertext()) != value: + yield elem + break + else: + def select(context, result): + for elem in result: + if "".join(elem.itertext()) == value: + yield elem + def select_negated(context, result): + for elem in result: + if "".join(elem.itertext()) != value: + yield elem + return select_negated if '!=' in signature else select + if signature == "-" or signature == "-()" or signature == "-()-": + # [index] or [last()] or [last()-index] + if signature == "-": + # [index] + index = int(predicate[0]) - 1 + if index < 0: + raise SyntaxError("XPath position >= 1 expected") + else: + if predicate[0] != "last": + raise SyntaxError("unsupported function") + if signature == "-()-": + try: + index = int(predicate[2]) - 1 + except ValueError: + raise SyntaxError("unsupported expression") + if index > -2: + raise SyntaxError("XPath offset from last() must be negative") + else: + index = -1 + def select(context, result): + parent_map = get_parent_map(context) + for elem in result: + try: + parent = parent_map[elem] + # FIXME: what if the selector is "*" ? + elems = list(parent.findall(elem.tag)) + if elems[index] is elem: + yield elem + except (IndexError, KeyError): + pass + return select + raise SyntaxError("invalid predicate") + +ops = { + "": prepare_child, + "*": prepare_star, + ".": prepare_self, + "..": prepare_parent, + "//": prepare_descendant, + "[": prepare_predicate, + } + +_cache = {} + +class _SelectorContext: + parent_map = None + def __init__(self, root): + self.root = root + +# -------------------------------------------------------------------- + +## +# Generate all matching objects. + +def iterfind(elem, path, namespaces=None): + # compile selector pattern + if path[-1:] == "/": + path = path + "*" # implicit all (FIXME: keep this?) + + cache_key = (path,) + if namespaces: + cache_key += tuple(sorted(namespaces.items())) + + try: + selector = _cache[cache_key] + except KeyError: + if len(_cache) > 100: + _cache.clear() + if path[:1] == "/": + raise SyntaxError("cannot use absolute path on element") + next = iter(xpath_tokenizer(path, namespaces)).__next__ + try: + token = next() + except StopIteration: + return + selector = [] + while 1: + try: + selector.append(ops[token[0]](next, token)) + except StopIteration: + raise SyntaxError("invalid path") from None + try: + token = next() + if token[0] == "/": + token = next() + except StopIteration: + break + _cache[cache_key] = selector + # execute selector pattern + result = [elem] + context = _SelectorContext(elem) + for select in selector: + result = select(context, result) + return result + +## +# Find first matching object. + +def find(elem, path, namespaces=None): + return next(iterfind(elem, path, namespaces), None) + +## +# Find all matching objects. + +def findall(elem, path, namespaces=None): + return list(iterfind(elem, path, namespaces)) + +## +# Find text for first matching object. + +def findtext(elem, path, default=None, namespaces=None): + try: + elem = next(iterfind(elem, path, namespaces)) + if elem.text is None: + return "" + return elem.text + except StopIteration: + return default diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/ElementTree.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/ElementTree.py new file mode 100644 index 0000000000000000000000000000000000000000..dafe5b1b8a0c3f7b1ddbdadf49f2a536489faaba --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/ElementTree.py @@ -0,0 +1,2102 @@ +"""Lightweight XML support for Python. + + XML is an inherently hierarchical data format, and the most natural way to + represent it is with a tree. This module has two classes for this purpose: + + 1. ElementTree represents the whole XML document as a tree and + + 2. Element represents a single node in this tree. + + Interactions with the whole document (reading and writing to/from files) are + usually done on the ElementTree level. Interactions with a single XML element + and its sub-elements are done on the Element level. + + Element is a flexible container object designed to store hierarchical data + structures in memory. It can be described as a cross between a list and a + dictionary. Each Element has a number of properties associated with it: + + 'tag' - a string containing the element's name. + + 'attributes' - a Python dictionary storing the element's attributes. + + 'text' - a string containing the element's text content. + + 'tail' - an optional string containing text after the element's end tag. + + And a number of child elements stored in a Python sequence. + + To create an element instance, use the Element constructor, + or the SubElement factory function. + + You can also use the ElementTree class to wrap an element structure + and convert it to and from XML. + +""" + +#--------------------------------------------------------------------- +# Licensed to PSF under a Contributor Agreement. +# See https://www.python.org/psf/license for licensing details. +# +# ElementTree +# Copyright (c) 1999-2008 by Fredrik Lundh. All rights reserved. +# +# fredrik@pythonware.com +# http://www.pythonware.com +# -------------------------------------------------------------------- +# The ElementTree toolkit is +# +# Copyright (c) 1999-2008 by Fredrik Lundh +# +# By obtaining, using, and/or copying this software and/or its +# associated documentation, you agree that you have read, understood, +# and will comply with the following terms and conditions: +# +# Permission to use, copy, modify, and distribute this software and +# its associated documentation for any purpose and without fee is +# hereby granted, provided that the above copyright notice appears in +# all copies, and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name of +# Secret Labs AB or the author not be used in advertising or publicity +# pertaining to distribution of the software without specific, written +# prior permission. +# +# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD +# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- +# ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR +# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY +# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. +# -------------------------------------------------------------------- + +__all__ = [ + # public symbols + "Comment", + "dump", + "Element", "ElementTree", + "fromstring", "fromstringlist", + "indent", "iselement", "iterparse", + "parse", "ParseError", + "PI", "ProcessingInstruction", + "QName", + "SubElement", + "tostring", "tostringlist", + "TreeBuilder", + "VERSION", + "XML", "XMLID", + "XMLParser", "XMLPullParser", + "register_namespace", + "canonicalize", "C14NWriterTarget", + ] + +VERSION = "1.3.0" + +import sys +import re +import warnings +import io +import collections +import collections.abc +import contextlib +import weakref + +from . import ElementPath + + +class ParseError(SyntaxError): + """An error when parsing an XML document. + + In addition to its exception value, a ParseError contains + two extra attributes: + 'code' - the specific exception code + 'position' - the line and column of the error + + """ + pass + +# -------------------------------------------------------------------- + + +def iselement(element): + """Return True if *element* appears to be an Element.""" + return hasattr(element, 'tag') + + +class Element: + """An XML element. + + This class is the reference implementation of the Element interface. + + An element's length is its number of subelements. That means if you + want to check if an element is truly empty, you should check BOTH + its length AND its text attribute. + + The element tag, attribute names, and attribute values can be either + bytes or strings. + + *tag* is the element name. *attrib* is an optional dictionary containing + element attributes. *extra* are additional element attributes given as + keyword arguments. + + Example form: + text...tail + + """ + + tag = None + """The element's name.""" + + attrib = None + """Dictionary of the element's attributes.""" + + text = None + """ + Text before first subelement. This is either a string or the value None. + Note that if there is no text, this attribute may be either + None or the empty string, depending on the parser. + + """ + + tail = None + """ + Text after this element's end tag, but before the next sibling element's + start tag. This is either a string or the value None. Note that if there + was no text, this attribute may be either None or an empty string, + depending on the parser. + + """ + + def __init__(self, tag, attrib={}, **extra): + if not isinstance(attrib, dict): + raise TypeError("attrib must be dict, not %s" % ( + attrib.__class__.__name__,)) + self.tag = tag + self.attrib = {**attrib, **extra} + self._children = [] + + def __repr__(self): + return "<%s %r at %#x>" % (self.__class__.__name__, self.tag, id(self)) + + def makeelement(self, tag, attrib): + """Create a new element with the same type. + + *tag* is a string containing the element name. + *attrib* is a dictionary containing the element attributes. + + Do not call this method, use the SubElement factory function instead. + + """ + return self.__class__(tag, attrib) + + def __copy__(self): + elem = self.makeelement(self.tag, self.attrib) + elem.text = self.text + elem.tail = self.tail + elem[:] = self + return elem + + def __len__(self): + return len(self._children) + + def __bool__(self): + warnings.warn( + "Testing an element's truth value will always return True in " + "future versions. " + "Use specific 'len(elem)' or 'elem is not None' test instead.", + DeprecationWarning, stacklevel=2 + ) + return len(self._children) != 0 # emulate old behaviour, for now + + def __getitem__(self, index): + return self._children[index] + + def __setitem__(self, index, element): + if isinstance(index, slice): + for elt in element: + self._assert_is_element(elt) + else: + self._assert_is_element(element) + self._children[index] = element + + def __delitem__(self, index): + del self._children[index] + + def append(self, subelement): + """Add *subelement* to the end of this element. + + The new element will appear in document order after the last existing + subelement (or directly after the text, if it's the first subelement), + but before the end tag for this element. + + """ + self._assert_is_element(subelement) + self._children.append(subelement) + + def extend(self, elements): + """Append subelements from a sequence. + + *elements* is a sequence with zero or more elements. + + """ + for element in elements: + self._assert_is_element(element) + self._children.append(element) + + def insert(self, index, subelement): + """Insert *subelement* at position *index*.""" + self._assert_is_element(subelement) + self._children.insert(index, subelement) + + def _assert_is_element(self, e): + # Need to refer to the actual Python implementation, not the + # shadowing C implementation. + if not isinstance(e, _Element_Py): + raise TypeError('expected an Element, not %s' % type(e).__name__) + + def remove(self, subelement): + """Remove matching subelement. + + Unlike the find methods, this method compares elements based on + identity, NOT ON tag value or contents. To remove subelements by + other means, the easiest way is to use a list comprehension to + select what elements to keep, and then use slice assignment to update + the parent element. + + ValueError is raised if a matching element could not be found. + + """ + # assert iselement(element) + try: + self._children.remove(subelement) + except ValueError: + # to align the error message with the C implementation + raise ValueError("Element.remove(x): element not found") from None + + def find(self, path, namespaces=None): + """Find first matching element by tag name or path. + + *path* is a string having either an element tag or an XPath, + *namespaces* is an optional mapping from namespace prefix to full name. + + Return the first matching element, or None if no element was found. + + """ + return ElementPath.find(self, path, namespaces) + + def findtext(self, path, default=None, namespaces=None): + """Find text for first matching element by tag name or path. + + *path* is a string having either an element tag or an XPath, + *default* is the value to return if the element was not found, + *namespaces* is an optional mapping from namespace prefix to full name. + + Return text content of first matching element, or default value if + none was found. Note that if an element is found having no text + content, the empty string is returned. + + """ + return ElementPath.findtext(self, path, default, namespaces) + + def findall(self, path, namespaces=None): + """Find all matching subelements by tag name or path. + + *path* is a string having either an element tag or an XPath, + *namespaces* is an optional mapping from namespace prefix to full name. + + Returns list containing all matching elements in document order. + + """ + return ElementPath.findall(self, path, namespaces) + + def iterfind(self, path, namespaces=None): + """Find all matching subelements by tag name or path. + + *path* is a string having either an element tag or an XPath, + *namespaces* is an optional mapping from namespace prefix to full name. + + Return an iterable yielding all matching elements in document order. + + """ + return ElementPath.iterfind(self, path, namespaces) + + def clear(self): + """Reset element. + + This function removes all subelements, clears all attributes, and sets + the text and tail attributes to None. + + """ + self.attrib.clear() + self._children = [] + self.text = self.tail = None + + def get(self, key, default=None): + """Get element attribute. + + Equivalent to attrib.get, but some implementations may handle this a + bit more efficiently. *key* is what attribute to look for, and + *default* is what to return if the attribute was not found. + + Returns a string containing the attribute value, or the default if + attribute was not found. + + """ + return self.attrib.get(key, default) + + def set(self, key, value): + """Set element attribute. + + Equivalent to attrib[key] = value, but some implementations may handle + this a bit more efficiently. *key* is what attribute to set, and + *value* is the attribute value to set it to. + + """ + self.attrib[key] = value + + def keys(self): + """Get list of attribute names. + + Names are returned in an arbitrary order, just like an ordinary + Python dict. Equivalent to attrib.keys() + + """ + return self.attrib.keys() + + def items(self): + """Get element attributes as a sequence. + + The attributes are returned in arbitrary order. Equivalent to + attrib.items(). + + Return a list of (name, value) tuples. + + """ + return self.attrib.items() + + def iter(self, tag=None): + """Create tree iterator. + + The iterator loops over the element and all subelements in document + order, returning all elements with a matching tag. + + If the tree structure is modified during iteration, new or removed + elements may or may not be included. To get a stable set, use the + list() function on the iterator, and loop over the resulting list. + + *tag* is what tags to look for (default is to return all elements) + + Return an iterator containing all the matching elements. + + """ + if tag == "*": + tag = None + if tag is None or self.tag == tag: + yield self + for e in self._children: + yield from e.iter(tag) + + def itertext(self): + """Create text iterator. + + The iterator loops over the element and all subelements in document + order, returning all inner text. + + """ + tag = self.tag + if not isinstance(tag, str) and tag is not None: + return + t = self.text + if t: + yield t + for e in self: + yield from e.itertext() + t = e.tail + if t: + yield t + + +def SubElement(parent, tag, attrib={}, **extra): + """Subelement factory which creates an element instance, and appends it + to an existing parent. + + The element tag, attribute names, and attribute values can be either + bytes or Unicode strings. + + *parent* is the parent element, *tag* is the subelements name, *attrib* is + an optional directory containing element attributes, *extra* are + additional attributes given as keyword arguments. + + """ + attrib = {**attrib, **extra} + element = parent.makeelement(tag, attrib) + parent.append(element) + return element + + +def Comment(text=None): + """Comment element factory. + + This function creates a special element which the standard serializer + serializes as an XML comment. + + *text* is a string containing the comment string. + + """ + element = Element(Comment) + element.text = text + return element + + +def ProcessingInstruction(target, text=None): + """Processing Instruction element factory. + + This function creates a special element which the standard serializer + serializes as an XML comment. + + *target* is a string containing the processing instruction, *text* is a + string containing the processing instruction contents, if any. + + """ + element = Element(ProcessingInstruction) + element.text = target + if text: + element.text = element.text + " " + text + return element + +PI = ProcessingInstruction + + +class QName: + """Qualified name wrapper. + + This class can be used to wrap a QName attribute value in order to get + proper namespace handing on output. + + *text_or_uri* is a string containing the QName value either in the form + {uri}local, or if the tag argument is given, the URI part of a QName. + + *tag* is an optional argument which if given, will make the first + argument (text_or_uri) be interpreted as a URI, and this argument (tag) + be interpreted as a local name. + + """ + def __init__(self, text_or_uri, tag=None): + if tag: + text_or_uri = "{%s}%s" % (text_or_uri, tag) + self.text = text_or_uri + def __str__(self): + return self.text + def __repr__(self): + return '<%s %r>' % (self.__class__.__name__, self.text) + def __hash__(self): + return hash(self.text) + def __le__(self, other): + if isinstance(other, QName): + return self.text <= other.text + return self.text <= other + def __lt__(self, other): + if isinstance(other, QName): + return self.text < other.text + return self.text < other + def __ge__(self, other): + if isinstance(other, QName): + return self.text >= other.text + return self.text >= other + def __gt__(self, other): + if isinstance(other, QName): + return self.text > other.text + return self.text > other + def __eq__(self, other): + if isinstance(other, QName): + return self.text == other.text + return self.text == other + +# -------------------------------------------------------------------- + + +class ElementTree: + """An XML element hierarchy. + + This class also provides support for serialization to and from + standard XML. + + *element* is an optional root element node, + *file* is an optional file handle or file name of an XML file whose + contents will be used to initialize the tree with. + + """ + def __init__(self, element=None, file=None): + if element is not None and not iselement(element): + raise TypeError('expected an Element, not %s' % + type(element).__name__) + self._root = element # first node + if file: + self.parse(file) + + def getroot(self): + """Return root element of this tree.""" + return self._root + + def _setroot(self, element): + """Replace root element of this tree. + + This will discard the current contents of the tree and replace it + with the given element. Use with care! + + """ + if not iselement(element): + raise TypeError('expected an Element, not %s' + % type(element).__name__) + self._root = element + + def parse(self, source, parser=None): + """Load external XML document into element tree. + + *source* is a file name or file object, *parser* is an optional parser + instance that defaults to XMLParser. + + ParseError is raised if the parser fails to parse the document. + + Returns the root element of the given source document. + + """ + close_source = False + if not hasattr(source, "read"): + source = open(source, "rb") + close_source = True + try: + if parser is None: + # If no parser was specified, create a default XMLParser + parser = XMLParser() + if hasattr(parser, '_parse_whole'): + # The default XMLParser, when it comes from an accelerator, + # can define an internal _parse_whole API for efficiency. + # It can be used to parse the whole source without feeding + # it with chunks. + self._root = parser._parse_whole(source) + return self._root + while data := source.read(65536): + parser.feed(data) + self._root = parser.close() + return self._root + finally: + if close_source: + source.close() + + def iter(self, tag=None): + """Create and return tree iterator for the root element. + + The iterator loops over all elements in this tree, in document order. + + *tag* is a string with the tag name to iterate over + (default is to return all elements). + + """ + # assert self._root is not None + return self._root.iter(tag) + + def find(self, path, namespaces=None): + """Find first matching element by tag name or path. + + Same as getroot().find(path), which is Element.find() + + *path* is a string having either an element tag or an XPath, + *namespaces* is an optional mapping from namespace prefix to full name. + + Return the first matching element, or None if no element was found. + + """ + # assert self._root is not None + if path[:1] == "/": + path = "." + path + warnings.warn( + "This search is broken in 1.3 and earlier, and will be " + "fixed in a future version. If you rely on the current " + "behaviour, change it to %r" % path, + FutureWarning, stacklevel=2 + ) + return self._root.find(path, namespaces) + + def findtext(self, path, default=None, namespaces=None): + """Find first matching element by tag name or path. + + Same as getroot().findtext(path), which is Element.findtext() + + *path* is a string having either an element tag or an XPath, + *namespaces* is an optional mapping from namespace prefix to full name. + + Return the first matching element, or None if no element was found. + + """ + # assert self._root is not None + if path[:1] == "/": + path = "." + path + warnings.warn( + "This search is broken in 1.3 and earlier, and will be " + "fixed in a future version. If you rely on the current " + "behaviour, change it to %r" % path, + FutureWarning, stacklevel=2 + ) + return self._root.findtext(path, default, namespaces) + + def findall(self, path, namespaces=None): + """Find all matching subelements by tag name or path. + + Same as getroot().findall(path), which is Element.findall(). + + *path* is a string having either an element tag or an XPath, + *namespaces* is an optional mapping from namespace prefix to full name. + + Return list containing all matching elements in document order. + + """ + # assert self._root is not None + if path[:1] == "/": + path = "." + path + warnings.warn( + "This search is broken in 1.3 and earlier, and will be " + "fixed in a future version. If you rely on the current " + "behaviour, change it to %r" % path, + FutureWarning, stacklevel=2 + ) + return self._root.findall(path, namespaces) + + def iterfind(self, path, namespaces=None): + """Find all matching subelements by tag name or path. + + Same as getroot().iterfind(path), which is element.iterfind() + + *path* is a string having either an element tag or an XPath, + *namespaces* is an optional mapping from namespace prefix to full name. + + Return an iterable yielding all matching elements in document order. + + """ + # assert self._root is not None + if path[:1] == "/": + path = "." + path + warnings.warn( + "This search is broken in 1.3 and earlier, and will be " + "fixed in a future version. If you rely on the current " + "behaviour, change it to %r" % path, + FutureWarning, stacklevel=2 + ) + return self._root.iterfind(path, namespaces) + + def write(self, file_or_filename, + encoding=None, + xml_declaration=None, + default_namespace=None, + method=None, *, + short_empty_elements=True): + """Write element tree to a file as XML. + + Arguments: + *file_or_filename* -- file name or a file object opened for writing + + *encoding* -- the output encoding (default: US-ASCII) + + *xml_declaration* -- bool indicating if an XML declaration should be + added to the output. If None, an XML declaration + is added if encoding IS NOT either of: + US-ASCII, UTF-8, or Unicode + + *default_namespace* -- sets the default XML namespace (for "xmlns") + + *method* -- either "xml" (default), "html, "text", or "c14n" + + *short_empty_elements* -- controls the formatting of elements + that contain no content. If True (default) + they are emitted as a single self-closed + tag, otherwise they are emitted as a pair + of start/end tags + + """ + if self._root is None: + raise TypeError('ElementTree not initialized') + if not method: + method = "xml" + elif method not in _serialize: + raise ValueError("unknown method %r" % method) + if not encoding: + if method == "c14n": + encoding = "utf-8" + else: + encoding = "us-ascii" + with _get_writer(file_or_filename, encoding) as (write, declared_encoding): + if method == "xml" and (xml_declaration or + (xml_declaration is None and + encoding.lower() != "unicode" and + declared_encoding.lower() not in ("utf-8", "us-ascii"))): + write("\n" % ( + declared_encoding,)) + if method == "text": + _serialize_text(write, self._root) + else: + qnames, namespaces = _namespaces(self._root, default_namespace) + serialize = _serialize[method] + serialize(write, self._root, qnames, namespaces, + short_empty_elements=short_empty_elements) + + def write_c14n(self, file): + # lxml.etree compatibility. use output method instead + return self.write(file, method="c14n") + +# -------------------------------------------------------------------- +# serialization support + +@contextlib.contextmanager +def _get_writer(file_or_filename, encoding): + # returns text write method and release all resources after using + try: + write = file_or_filename.write + except AttributeError: + # file_or_filename is a file name + if encoding.lower() == "unicode": + encoding="utf-8" + with open(file_or_filename, "w", encoding=encoding, + errors="xmlcharrefreplace") as file: + yield file.write, encoding + else: + # file_or_filename is a file-like object + # encoding determines if it is a text or binary writer + if encoding.lower() == "unicode": + # use a text writer as is + yield write, getattr(file_or_filename, "encoding", None) or "utf-8" + else: + # wrap a binary writer with TextIOWrapper + with contextlib.ExitStack() as stack: + if isinstance(file_or_filename, io.BufferedIOBase): + file = file_or_filename + elif isinstance(file_or_filename, io.RawIOBase): + file = io.BufferedWriter(file_or_filename) + # Keep the original file open when the BufferedWriter is + # destroyed + stack.callback(file.detach) + else: + # This is to handle passed objects that aren't in the + # IOBase hierarchy, but just have a write method + file = io.BufferedIOBase() + file.writable = lambda: True + file.write = write + try: + # TextIOWrapper uses this methods to determine + # if BOM (for UTF-16, etc) should be added + file.seekable = file_or_filename.seekable + file.tell = file_or_filename.tell + except AttributeError: + pass + file = io.TextIOWrapper(file, + encoding=encoding, + errors="xmlcharrefreplace", + newline="\n") + # Keep the original file open when the TextIOWrapper is + # destroyed + stack.callback(file.detach) + yield file.write, encoding + +def _namespaces(elem, default_namespace=None): + # identify namespaces used in this tree + + # maps qnames to *encoded* prefix:local names + qnames = {None: None} + + # maps uri:s to prefixes + namespaces = {} + if default_namespace: + namespaces[default_namespace] = "" + + def add_qname(qname): + # calculate serialized qname representation + try: + if qname[:1] == "{": + uri, tag = qname[1:].rsplit("}", 1) + prefix = namespaces.get(uri) + if prefix is None: + prefix = _namespace_map.get(uri) + if prefix is None: + prefix = "ns%d" % len(namespaces) + if prefix != "xml": + namespaces[uri] = prefix + if prefix: + qnames[qname] = "%s:%s" % (prefix, tag) + else: + qnames[qname] = tag # default element + else: + if default_namespace: + # FIXME: can this be handled in XML 1.0? + raise ValueError( + "cannot use non-qualified names with " + "default_namespace option" + ) + qnames[qname] = qname + except TypeError: + _raise_serialization_error(qname) + + # populate qname and namespaces table + for elem in elem.iter(): + tag = elem.tag + if isinstance(tag, QName): + if tag.text not in qnames: + add_qname(tag.text) + elif isinstance(tag, str): + if tag not in qnames: + add_qname(tag) + elif tag is not None and tag is not Comment and tag is not PI: + _raise_serialization_error(tag) + for key, value in elem.items(): + if isinstance(key, QName): + key = key.text + if key not in qnames: + add_qname(key) + if isinstance(value, QName) and value.text not in qnames: + add_qname(value.text) + text = elem.text + if isinstance(text, QName) and text.text not in qnames: + add_qname(text.text) + return qnames, namespaces + +def _serialize_xml(write, elem, qnames, namespaces, + short_empty_elements, **kwargs): + tag = elem.tag + text = elem.text + if tag is Comment: + write("" % text) + elif tag is ProcessingInstruction: + write("" % text) + else: + tag = qnames[tag] + if tag is None: + if text: + write(_escape_cdata(text)) + for e in elem: + _serialize_xml(write, e, qnames, None, + short_empty_elements=short_empty_elements) + else: + write("<" + tag) + items = list(elem.items()) + if items or namespaces: + if namespaces: + for v, k in sorted(namespaces.items(), + key=lambda x: x[1]): # sort on prefix + if k: + k = ":" + k + write(" xmlns%s=\"%s\"" % ( + k, + _escape_attrib(v) + )) + for k, v in items: + if isinstance(k, QName): + k = k.text + if isinstance(v, QName): + v = qnames[v.text] + else: + v = _escape_attrib(v) + write(" %s=\"%s\"" % (qnames[k], v)) + if text or len(elem) or not short_empty_elements: + write(">") + if text: + write(_escape_cdata(text)) + for e in elem: + _serialize_xml(write, e, qnames, None, + short_empty_elements=short_empty_elements) + write("") + else: + write(" />") + if elem.tail: + write(_escape_cdata(elem.tail)) + +HTML_EMPTY = {"area", "base", "basefont", "br", "col", "embed", "frame", "hr", + "img", "input", "isindex", "link", "meta", "param", "source", + "track", "wbr"} + +def _serialize_html(write, elem, qnames, namespaces, **kwargs): + tag = elem.tag + text = elem.text + if tag is Comment: + write("" % _escape_cdata(text)) + elif tag is ProcessingInstruction: + write("" % _escape_cdata(text)) + else: + tag = qnames[tag] + if tag is None: + if text: + write(_escape_cdata(text)) + for e in elem: + _serialize_html(write, e, qnames, None) + else: + write("<" + tag) + items = list(elem.items()) + if items or namespaces: + if namespaces: + for v, k in sorted(namespaces.items(), + key=lambda x: x[1]): # sort on prefix + if k: + k = ":" + k + write(" xmlns%s=\"%s\"" % ( + k, + _escape_attrib(v) + )) + for k, v in items: + if isinstance(k, QName): + k = k.text + if isinstance(v, QName): + v = qnames[v.text] + else: + v = _escape_attrib_html(v) + # FIXME: handle boolean attributes + write(" %s=\"%s\"" % (qnames[k], v)) + write(">") + ltag = tag.lower() + if text: + if ltag == "script" or ltag == "style": + write(text) + else: + write(_escape_cdata(text)) + for e in elem: + _serialize_html(write, e, qnames, None) + if ltag not in HTML_EMPTY: + write("") + if elem.tail: + write(_escape_cdata(elem.tail)) + +def _serialize_text(write, elem): + for part in elem.itertext(): + write(part) + if elem.tail: + write(elem.tail) + +_serialize = { + "xml": _serialize_xml, + "html": _serialize_html, + "text": _serialize_text, +# this optional method is imported at the end of the module +# "c14n": _serialize_c14n, +} + + +def register_namespace(prefix, uri): + """Register a namespace prefix. + + The registry is global, and any existing mapping for either the + given prefix or the namespace URI will be removed. + + *prefix* is the namespace prefix, *uri* is a namespace uri. Tags and + attributes in this namespace will be serialized with prefix if possible. + + ValueError is raised if prefix is reserved or is invalid. + + """ + if re.match(r"ns\d+$", prefix): + raise ValueError("Prefix format reserved for internal use") + for k, v in list(_namespace_map.items()): + if k == uri or v == prefix: + del _namespace_map[k] + _namespace_map[uri] = prefix + +_namespace_map = { + # "well-known" namespace prefixes + "http://www.w3.org/XML/1998/namespace": "xml", + "http://www.w3.org/1999/xhtml": "html", + "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf", + "http://schemas.xmlsoap.org/wsdl/": "wsdl", + # xml schema + "http://www.w3.org/2001/XMLSchema": "xs", + "http://www.w3.org/2001/XMLSchema-instance": "xsi", + # dublin core + "http://purl.org/dc/elements/1.1/": "dc", +} +# For tests and troubleshooting +register_namespace._namespace_map = _namespace_map + +def _raise_serialization_error(text): + raise TypeError( + "cannot serialize %r (type %s)" % (text, type(text).__name__) + ) + +def _escape_cdata(text): + # escape character data + try: + # it's worth avoiding do-nothing calls for strings that are + # shorter than 500 characters, or so. assume that's, by far, + # the most common case in most applications. + if "&" in text: + text = text.replace("&", "&") + if "<" in text: + text = text.replace("<", "<") + if ">" in text: + text = text.replace(">", ">") + return text + except (TypeError, AttributeError): + _raise_serialization_error(text) + +def _escape_attrib(text): + # escape attribute value + try: + if "&" in text: + text = text.replace("&", "&") + if "<" in text: + text = text.replace("<", "<") + if ">" in text: + text = text.replace(">", ">") + if "\"" in text: + text = text.replace("\"", """) + # Although section 2.11 of the XML specification states that CR or + # CR LN should be replaced with just LN, it applies only to EOLNs + # which take part of organizing file into lines. Within attributes, + # we are replacing these with entity numbers, so they do not count. + # http://www.w3.org/TR/REC-xml/#sec-line-ends + # The current solution, contained in following six lines, was + # discussed in issue 17582 and 39011. + if "\r" in text: + text = text.replace("\r", " ") + if "\n" in text: + text = text.replace("\n", " ") + if "\t" in text: + text = text.replace("\t", " ") + return text + except (TypeError, AttributeError): + _raise_serialization_error(text) + +def _escape_attrib_html(text): + # escape attribute value + try: + if "&" in text: + text = text.replace("&", "&") + if ">" in text: + text = text.replace(">", ">") + if "\"" in text: + text = text.replace("\"", """) + return text + except (TypeError, AttributeError): + _raise_serialization_error(text) + +# -------------------------------------------------------------------- + +def tostring(element, encoding=None, method=None, *, + xml_declaration=None, default_namespace=None, + short_empty_elements=True): + """Generate string representation of XML element. + + All subelements are included. If encoding is "unicode", a string + is returned. Otherwise a bytestring is returned. + + *element* is an Element instance, *encoding* is an optional output + encoding defaulting to US-ASCII, *method* is an optional output which can + be one of "xml" (default), "html", "text" or "c14n", *default_namespace* + sets the default XML namespace (for "xmlns"). + + Returns an (optionally) encoded string containing the XML data. + + """ + stream = io.StringIO() if encoding == 'unicode' else io.BytesIO() + ElementTree(element).write(stream, encoding, + xml_declaration=xml_declaration, + default_namespace=default_namespace, + method=method, + short_empty_elements=short_empty_elements) + return stream.getvalue() + +class _ListDataStream(io.BufferedIOBase): + """An auxiliary stream accumulating into a list reference.""" + def __init__(self, lst): + self.lst = lst + + def writable(self): + return True + + def seekable(self): + return True + + def write(self, b): + self.lst.append(b) + + def tell(self): + return len(self.lst) + +def tostringlist(element, encoding=None, method=None, *, + xml_declaration=None, default_namespace=None, + short_empty_elements=True): + lst = [] + stream = _ListDataStream(lst) + ElementTree(element).write(stream, encoding, + xml_declaration=xml_declaration, + default_namespace=default_namespace, + method=method, + short_empty_elements=short_empty_elements) + return lst + + +def dump(elem): + """Write element tree or element structure to sys.stdout. + + This function should be used for debugging only. + + *elem* is either an ElementTree, or a single Element. The exact output + format is implementation dependent. In this version, it's written as an + ordinary XML file. + + """ + # debugging + if not isinstance(elem, ElementTree): + elem = ElementTree(elem) + elem.write(sys.stdout, encoding="unicode") + tail = elem.getroot().tail + if not tail or tail[-1] != "\n": + sys.stdout.write("\n") + + +def indent(tree, space=" ", level=0): + """Indent an XML document by inserting newlines and indentation space + after elements. + + *tree* is the ElementTree or Element to modify. The (root) element + itself will not be changed, but the tail text of all elements in its + subtree will be adapted. + + *space* is the whitespace to insert for each indentation level, two + space characters by default. + + *level* is the initial indentation level. Setting this to a higher + value than 0 can be used for indenting subtrees that are more deeply + nested inside of a document. + """ + if isinstance(tree, ElementTree): + tree = tree.getroot() + if level < 0: + raise ValueError(f"Initial indentation level must be >= 0, got {level}") + if not len(tree): + return + + # Reduce the memory consumption by reusing indentation strings. + indentations = ["\n" + level * space] + + def _indent_children(elem, level): + # Start a new indentation level for the first child. + child_level = level + 1 + try: + child_indentation = indentations[child_level] + except IndexError: + child_indentation = indentations[level] + space + indentations.append(child_indentation) + + if not elem.text or not elem.text.strip(): + elem.text = child_indentation + + for child in elem: + if len(child): + _indent_children(child, child_level) + if not child.tail or not child.tail.strip(): + child.tail = child_indentation + + # Dedent after the last child by overwriting the previous indentation. + if not child.tail.strip(): + child.tail = indentations[level] + + _indent_children(tree, 0) + + +# -------------------------------------------------------------------- +# parsing + + +def parse(source, parser=None): + """Parse XML document into element tree. + + *source* is a filename or file object containing XML data, + *parser* is an optional parser instance defaulting to XMLParser. + + Return an ElementTree instance. + + """ + tree = ElementTree() + tree.parse(source, parser) + return tree + + +def iterparse(source, events=None, parser=None): + """Incrementally parse XML document into ElementTree. + + This class also reports what's going on to the user based on the + *events* it is initialized with. The supported events are the strings + "start", "end", "start-ns" and "end-ns" (the "ns" events are used to get + detailed namespace information). If *events* is omitted, only + "end" events are reported. + + *source* is a filename or file object containing XML data, *events* is + a list of events to report back, *parser* is an optional parser instance. + + Returns an iterator providing (event, elem) pairs. + + """ + # Use the internal, undocumented _parser argument for now; When the + # parser argument of iterparse is removed, this can be killed. + pullparser = XMLPullParser(events=events, _parser=parser) + + if not hasattr(source, "read"): + source = open(source, "rb") + close_source = True + else: + close_source = False + + def iterator(source): + try: + while True: + yield from pullparser.read_events() + # load event buffer + data = source.read(16 * 1024) + if not data: + break + pullparser.feed(data) + root = pullparser._close_and_return_root() + yield from pullparser.read_events() + it = wr() + if it is not None: + it.root = root + finally: + if close_source: + source.close() + + gen = iterator(source) + class IterParseIterator(collections.abc.Iterator): + __next__ = gen.__next__ + def close(self): + if close_source: + source.close() + gen.close() + + def __del__(self): + # TODO: Emit a ResourceWarning if it was not explicitly closed. + # (When the close() method will be supported in all maintained Python versions.) + if close_source: + source.close() + + it = IterParseIterator() + it.root = None + wr = weakref.ref(it) + return it + + +class XMLPullParser: + + def __init__(self, events=None, *, _parser=None): + # The _parser argument is for internal use only and must not be relied + # upon in user code. It will be removed in a future release. + # See https://bugs.python.org/issue17741 for more details. + + self._events_queue = collections.deque() + self._parser = _parser or XMLParser(target=TreeBuilder()) + # wire up the parser for event reporting + if events is None: + events = ("end",) + self._parser._setevents(self._events_queue, events) + + def feed(self, data): + """Feed encoded data to parser.""" + if self._parser is None: + raise ValueError("feed() called after end of stream") + if data: + try: + self._parser.feed(data) + except SyntaxError as exc: + self._events_queue.append(exc) + + def _close_and_return_root(self): + # iterparse needs this to set its root attribute properly :( + root = self._parser.close() + self._parser = None + return root + + def close(self): + """Finish feeding data to parser. + + Unlike XMLParser, does not return the root element. Use + read_events() to consume elements from XMLPullParser. + """ + self._close_and_return_root() + + def read_events(self): + """Return an iterator over currently available (event, elem) pairs. + + Events are consumed from the internal event queue as they are + retrieved from the iterator. + """ + events = self._events_queue + while events: + event = events.popleft() + if isinstance(event, Exception): + raise event + else: + yield event + + def flush(self): + if self._parser is None: + raise ValueError("flush() called after end of stream") + self._parser.flush() + + +def XML(text, parser=None): + """Parse XML document from string constant. + + This function can be used to embed "XML Literals" in Python code. + + *text* is a string containing XML data, *parser* is an + optional parser instance, defaulting to the standard XMLParser. + + Returns an Element instance. + + """ + if not parser: + parser = XMLParser(target=TreeBuilder()) + parser.feed(text) + return parser.close() + + +def XMLID(text, parser=None): + """Parse XML document from string constant for its IDs. + + *text* is a string containing XML data, *parser* is an + optional parser instance, defaulting to the standard XMLParser. + + Returns an (Element, dict) tuple, in which the + dict maps element id:s to elements. + + """ + if not parser: + parser = XMLParser(target=TreeBuilder()) + parser.feed(text) + tree = parser.close() + ids = {} + for elem in tree.iter(): + id = elem.get("id") + if id: + ids[id] = elem + return tree, ids + +# Parse XML document from string constant. Alias for XML(). +fromstring = XML + +def fromstringlist(sequence, parser=None): + """Parse XML document from sequence of string fragments. + + *sequence* is a list of other sequence, *parser* is an optional parser + instance, defaulting to the standard XMLParser. + + Returns an Element instance. + + """ + if not parser: + parser = XMLParser(target=TreeBuilder()) + for text in sequence: + parser.feed(text) + return parser.close() + +# -------------------------------------------------------------------- + + +class TreeBuilder: + """Generic element structure builder. + + This builder converts a sequence of start, data, and end method + calls to a well-formed element structure. + + You can use this class to build an element structure using a custom XML + parser, or a parser for some other XML-like format. + + *element_factory* is an optional element factory which is called + to create new Element instances, as necessary. + + *comment_factory* is a factory to create comments to be used instead of + the standard factory. If *insert_comments* is false (the default), + comments will not be inserted into the tree. + + *pi_factory* is a factory to create processing instructions to be used + instead of the standard factory. If *insert_pis* is false (the default), + processing instructions will not be inserted into the tree. + """ + def __init__(self, element_factory=None, *, + comment_factory=None, pi_factory=None, + insert_comments=False, insert_pis=False): + self._data = [] # data collector + self._elem = [] # element stack + self._last = None # last element + self._root = None # root element + self._tail = None # true if we're after an end tag + if comment_factory is None: + comment_factory = Comment + self._comment_factory = comment_factory + self.insert_comments = insert_comments + if pi_factory is None: + pi_factory = ProcessingInstruction + self._pi_factory = pi_factory + self.insert_pis = insert_pis + if element_factory is None: + element_factory = Element + self._factory = element_factory + + def close(self): + """Flush builder buffers and return toplevel document Element.""" + assert len(self._elem) == 0, "missing end tags" + assert self._root is not None, "missing toplevel element" + return self._root + + def _flush(self): + if self._data: + if self._last is not None: + text = "".join(self._data) + if self._tail: + assert self._last.tail is None, "internal error (tail)" + self._last.tail = text + else: + assert self._last.text is None, "internal error (text)" + self._last.text = text + self._data = [] + + def data(self, data): + """Add text to current element.""" + self._data.append(data) + + def start(self, tag, attrs): + """Open new element and return it. + + *tag* is the element name, *attrs* is a dict containing element + attributes. + + """ + self._flush() + self._last = elem = self._factory(tag, attrs) + if self._elem: + self._elem[-1].append(elem) + elif self._root is None: + self._root = elem + self._elem.append(elem) + self._tail = 0 + return elem + + def end(self, tag): + """Close and return current Element. + + *tag* is the element name. + + """ + self._flush() + self._last = self._elem.pop() + assert self._last.tag == tag,\ + "end tag mismatch (expected %s, got %s)" % ( + self._last.tag, tag) + self._tail = 1 + return self._last + + def comment(self, text): + """Create a comment using the comment_factory. + + *text* is the text of the comment. + """ + return self._handle_single( + self._comment_factory, self.insert_comments, text) + + def pi(self, target, text=None): + """Create a processing instruction using the pi_factory. + + *target* is the target name of the processing instruction. + *text* is the data of the processing instruction, or ''. + """ + return self._handle_single( + self._pi_factory, self.insert_pis, target, text) + + def _handle_single(self, factory, insert, *args): + elem = factory(*args) + if insert: + self._flush() + self._last = elem + if self._elem: + self._elem[-1].append(elem) + self._tail = 1 + return elem + + +# also see ElementTree and TreeBuilder +class XMLParser: + """Element structure builder for XML source data based on the expat parser. + + *target* is an optional target object which defaults to an instance of the + standard TreeBuilder class, *encoding* is an optional encoding string + which if given, overrides the encoding specified in the XML file: + http://www.iana.org/assignments/character-sets + + """ + + def __init__(self, *, target=None, encoding=None): + try: + from xml.parsers import expat + except ImportError: + try: + import pyexpat as expat + except ImportError: + raise ImportError( + "No module named expat; use SimpleXMLTreeBuilder instead" + ) + parser = expat.ParserCreate(encoding, "}") + if target is None: + target = TreeBuilder() + # underscored names are provided for compatibility only + self.parser = self._parser = parser + self.target = self._target = target + self._error = expat.error + self._names = {} # name memo cache + # main callbacks + parser.DefaultHandlerExpand = self._default + if hasattr(target, 'start'): + parser.StartElementHandler = self._start + if hasattr(target, 'end'): + parser.EndElementHandler = self._end + if hasattr(target, 'start_ns'): + parser.StartNamespaceDeclHandler = self._start_ns + if hasattr(target, 'end_ns'): + parser.EndNamespaceDeclHandler = self._end_ns + if hasattr(target, 'data'): + parser.CharacterDataHandler = target.data + # miscellaneous callbacks + if hasattr(target, 'comment'): + parser.CommentHandler = target.comment + if hasattr(target, 'pi'): + parser.ProcessingInstructionHandler = target.pi + # Configure pyexpat: buffering, new-style attribute handling. + parser.buffer_text = 1 + parser.ordered_attributes = 1 + self._doctype = None + self.entity = {} + try: + self.version = "Expat %d.%d.%d" % expat.version_info + except AttributeError: + pass # unknown + + def _setevents(self, events_queue, events_to_report): + # Internal API for XMLPullParser + # events_to_report: a list of events to report during parsing (same as + # the *events* of XMLPullParser's constructor. + # events_queue: a list of actual parsing events that will be populated + # by the underlying parser. + # + parser = self._parser + append = events_queue.append + for event_name in events_to_report: + if event_name == "start": + parser.ordered_attributes = 1 + def handler(tag, attrib_in, event=event_name, append=append, + start=self._start): + append((event, start(tag, attrib_in))) + parser.StartElementHandler = handler + elif event_name == "end": + def handler(tag, event=event_name, append=append, + end=self._end): + append((event, end(tag))) + parser.EndElementHandler = handler + elif event_name == "start-ns": + # TreeBuilder does not implement .start_ns() + if hasattr(self.target, "start_ns"): + def handler(prefix, uri, event=event_name, append=append, + start_ns=self._start_ns): + append((event, start_ns(prefix, uri))) + else: + def handler(prefix, uri, event=event_name, append=append): + append((event, (prefix or '', uri or ''))) + parser.StartNamespaceDeclHandler = handler + elif event_name == "end-ns": + # TreeBuilder does not implement .end_ns() + if hasattr(self.target, "end_ns"): + def handler(prefix, event=event_name, append=append, + end_ns=self._end_ns): + append((event, end_ns(prefix))) + else: + def handler(prefix, event=event_name, append=append): + append((event, None)) + parser.EndNamespaceDeclHandler = handler + elif event_name == 'comment': + def handler(text, event=event_name, append=append, self=self): + append((event, self.target.comment(text))) + parser.CommentHandler = handler + elif event_name == 'pi': + def handler(pi_target, data, event=event_name, append=append, + self=self): + append((event, self.target.pi(pi_target, data))) + parser.ProcessingInstructionHandler = handler + else: + raise ValueError("unknown event %r" % event_name) + + def _raiseerror(self, value): + err = ParseError(value) + err.code = value.code + err.position = value.lineno, value.offset + raise err + + def _fixname(self, key): + # expand qname, and convert name string to ascii, if possible + try: + name = self._names[key] + except KeyError: + name = key + if "}" in name: + name = "{" + name + self._names[key] = name + return name + + def _start_ns(self, prefix, uri): + return self.target.start_ns(prefix or '', uri or '') + + def _end_ns(self, prefix): + return self.target.end_ns(prefix or '') + + def _start(self, tag, attr_list): + # Handler for expat's StartElementHandler. Since ordered_attributes + # is set, the attributes are reported as a list of alternating + # attribute name,value. + fixname = self._fixname + tag = fixname(tag) + attrib = {} + if attr_list: + for i in range(0, len(attr_list), 2): + attrib[fixname(attr_list[i])] = attr_list[i+1] + return self.target.start(tag, attrib) + + def _end(self, tag): + return self.target.end(self._fixname(tag)) + + def _default(self, text): + prefix = text[:1] + if prefix == "&": + # deal with undefined entities + try: + data_handler = self.target.data + except AttributeError: + return + try: + data_handler(self.entity[text[1:-1]]) + except KeyError: + from xml.parsers import expat + err = expat.error( + "undefined entity %s: line %d, column %d" % + (text, self.parser.ErrorLineNumber, + self.parser.ErrorColumnNumber) + ) + err.code = 11 # XML_ERROR_UNDEFINED_ENTITY + err.lineno = self.parser.ErrorLineNumber + err.offset = self.parser.ErrorColumnNumber + raise err + elif prefix == "<" and text[:9] == "": + self._doctype = None + return + text = text.strip() + if not text: + return + self._doctype.append(text) + n = len(self._doctype) + if n > 2: + type = self._doctype[1] + if type == "PUBLIC" and n == 4: + name, type, pubid, system = self._doctype + if pubid: + pubid = pubid[1:-1] + elif type == "SYSTEM" and n == 3: + name, type, system = self._doctype + pubid = None + else: + return + if hasattr(self.target, "doctype"): + self.target.doctype(name, pubid, system[1:-1]) + elif hasattr(self, "doctype"): + warnings.warn( + "The doctype() method of XMLParser is ignored. " + "Define doctype() method on the TreeBuilder target.", + RuntimeWarning) + + self._doctype = None + + def feed(self, data): + """Feed encoded data to parser.""" + try: + self.parser.Parse(data, False) + except self._error as v: + self._raiseerror(v) + + def close(self): + """Finish feeding data to parser and return element structure.""" + try: + self.parser.Parse(b"", True) # end of data + except self._error as v: + self._raiseerror(v) + try: + close_handler = self.target.close + except AttributeError: + pass + else: + return close_handler() + finally: + # get rid of circular references + del self.parser, self._parser + del self.target, self._target + + def flush(self): + was_enabled = self.parser.GetReparseDeferralEnabled() + try: + self.parser.SetReparseDeferralEnabled(False) + self.parser.Parse(b"", False) + except self._error as v: + self._raiseerror(v) + finally: + self.parser.SetReparseDeferralEnabled(was_enabled) + +# -------------------------------------------------------------------- +# C14N 2.0 + +def canonicalize(xml_data=None, *, out=None, from_file=None, **options): + """Convert XML to its C14N 2.0 serialised form. + + If *out* is provided, it must be a file or file-like object that receives + the serialised canonical XML output (text, not bytes) through its ``.write()`` + method. To write to a file, open it in text mode with encoding "utf-8". + If *out* is not provided, this function returns the output as text string. + + Either *xml_data* (an XML string) or *from_file* (a file path or + file-like object) must be provided as input. + + The configuration options are the same as for the ``C14NWriterTarget``. + """ + if xml_data is None and from_file is None: + raise ValueError("Either 'xml_data' or 'from_file' must be provided as input") + sio = None + if out is None: + sio = out = io.StringIO() + + parser = XMLParser(target=C14NWriterTarget(out.write, **options)) + + if xml_data is not None: + parser.feed(xml_data) + parser.close() + elif from_file is not None: + parse(from_file, parser=parser) + + return sio.getvalue() if sio is not None else None + + +_looks_like_prefix_name = re.compile(r'^\w+:\w+$', re.UNICODE).match + + +class C14NWriterTarget: + """ + Canonicalization writer target for the XMLParser. + + Serialises parse events to XML C14N 2.0. + + The *write* function is used for writing out the resulting data stream + as text (not bytes). To write to a file, open it in text mode with encoding + "utf-8" and pass its ``.write`` method. + + Configuration options: + + - *with_comments*: set to true to include comments + - *strip_text*: set to true to strip whitespace before and after text content + - *rewrite_prefixes*: set to true to replace namespace prefixes by "n{number}" + - *qname_aware_tags*: a set of qname aware tag names in which prefixes + should be replaced in text content + - *qname_aware_attrs*: a set of qname aware attribute names in which prefixes + should be replaced in text content + - *exclude_attrs*: a set of attribute names that should not be serialised + - *exclude_tags*: a set of tag names that should not be serialised + """ + def __init__(self, write, *, + with_comments=False, strip_text=False, rewrite_prefixes=False, + qname_aware_tags=None, qname_aware_attrs=None, + exclude_attrs=None, exclude_tags=None): + self._write = write + self._data = [] + self._with_comments = with_comments + self._strip_text = strip_text + self._exclude_attrs = set(exclude_attrs) if exclude_attrs else None + self._exclude_tags = set(exclude_tags) if exclude_tags else None + + self._rewrite_prefixes = rewrite_prefixes + if qname_aware_tags: + self._qname_aware_tags = set(qname_aware_tags) + else: + self._qname_aware_tags = None + if qname_aware_attrs: + self._find_qname_aware_attrs = set(qname_aware_attrs).intersection + else: + self._find_qname_aware_attrs = None + + # Stack with globally and newly declared namespaces as (uri, prefix) pairs. + self._declared_ns_stack = [[ + ("http://www.w3.org/XML/1998/namespace", "xml"), + ]] + # Stack with user declared namespace prefixes as (uri, prefix) pairs. + self._ns_stack = [] + if not rewrite_prefixes: + self._ns_stack.append(list(_namespace_map.items())) + self._ns_stack.append([]) + self._prefix_map = {} + self._preserve_space = [False] + self._pending_start = None + self._root_seen = False + self._root_done = False + self._ignored_depth = 0 + + def _iter_namespaces(self, ns_stack, _reversed=reversed): + for namespaces in _reversed(ns_stack): + if namespaces: # almost no element declares new namespaces + yield from namespaces + + def _resolve_prefix_name(self, prefixed_name): + prefix, name = prefixed_name.split(':', 1) + for uri, p in self._iter_namespaces(self._ns_stack): + if p == prefix: + return f'{{{uri}}}{name}' + raise ValueError(f'Prefix {prefix} of QName "{prefixed_name}" is not declared in scope') + + def _qname(self, qname, uri=None): + if uri is None: + uri, tag = qname[1:].rsplit('}', 1) if qname[:1] == '{' else ('', qname) + else: + tag = qname + + prefixes_seen = set() + for u, prefix in self._iter_namespaces(self._declared_ns_stack): + if u == uri and prefix not in prefixes_seen: + return f'{prefix}:{tag}' if prefix else tag, tag, uri + prefixes_seen.add(prefix) + + # Not declared yet => add new declaration. + if self._rewrite_prefixes: + if uri in self._prefix_map: + prefix = self._prefix_map[uri] + else: + prefix = self._prefix_map[uri] = f'n{len(self._prefix_map)}' + self._declared_ns_stack[-1].append((uri, prefix)) + return f'{prefix}:{tag}', tag, uri + + if not uri and '' not in prefixes_seen: + # No default namespace declared => no prefix needed. + return tag, tag, uri + + for u, prefix in self._iter_namespaces(self._ns_stack): + if u == uri: + self._declared_ns_stack[-1].append((uri, prefix)) + return f'{prefix}:{tag}' if prefix else tag, tag, uri + + if not uri: + # As soon as a default namespace is defined, + # anything that has no namespace (and thus, no prefix) goes there. + return tag, tag, uri + + raise ValueError(f'Namespace "{uri}" is not declared in scope') + + def data(self, data): + if not self._ignored_depth: + self._data.append(data) + + def _flush(self, _join_text=''.join): + data = _join_text(self._data) + del self._data[:] + if self._strip_text and not self._preserve_space[-1]: + data = data.strip() + if self._pending_start is not None: + args, self._pending_start = self._pending_start, None + qname_text = data if data and _looks_like_prefix_name(data) else None + self._start(*args, qname_text) + if qname_text is not None: + return + if data and self._root_seen: + self._write(_escape_cdata_c14n(data)) + + def start_ns(self, prefix, uri): + if self._ignored_depth: + return + # we may have to resolve qnames in text content + if self._data: + self._flush() + self._ns_stack[-1].append((uri, prefix)) + + def start(self, tag, attrs): + if self._exclude_tags is not None and ( + self._ignored_depth or tag in self._exclude_tags): + self._ignored_depth += 1 + return + if self._data: + self._flush() + + new_namespaces = [] + self._declared_ns_stack.append(new_namespaces) + + if self._qname_aware_tags is not None and tag in self._qname_aware_tags: + # Need to parse text first to see if it requires a prefix declaration. + self._pending_start = (tag, attrs, new_namespaces) + return + self._start(tag, attrs, new_namespaces) + + def _start(self, tag, attrs, new_namespaces, qname_text=None): + if self._exclude_attrs is not None and attrs: + attrs = {k: v for k, v in attrs.items() if k not in self._exclude_attrs} + + qnames = {tag, *attrs} + resolved_names = {} + + # Resolve prefixes in attribute and tag text. + if qname_text is not None: + qname = resolved_names[qname_text] = self._resolve_prefix_name(qname_text) + qnames.add(qname) + if self._find_qname_aware_attrs is not None and attrs: + qattrs = self._find_qname_aware_attrs(attrs) + if qattrs: + for attr_name in qattrs: + value = attrs[attr_name] + if _looks_like_prefix_name(value): + qname = resolved_names[value] = self._resolve_prefix_name(value) + qnames.add(qname) + else: + qattrs = None + else: + qattrs = None + + # Assign prefixes in lexicographical order of used URIs. + parse_qname = self._qname + parsed_qnames = {n: parse_qname(n) for n in sorted( + qnames, key=lambda n: n.split('}', 1))} + + # Write namespace declarations in prefix order ... + if new_namespaces: + attr_list = [ + ('xmlns:' + prefix if prefix else 'xmlns', uri) + for uri, prefix in new_namespaces + ] + attr_list.sort() + else: + # almost always empty + attr_list = [] + + # ... followed by attributes in URI+name order + if attrs: + for k, v in sorted(attrs.items()): + if qattrs is not None and k in qattrs and v in resolved_names: + v = parsed_qnames[resolved_names[v]][0] + attr_qname, attr_name, uri = parsed_qnames[k] + # No prefix for attributes in default ('') namespace. + attr_list.append((attr_qname if uri else attr_name, v)) + + # Honour xml:space attributes. + space_behaviour = attrs.get('{http://www.w3.org/XML/1998/namespace}space') + self._preserve_space.append( + space_behaviour == 'preserve' if space_behaviour + else self._preserve_space[-1]) + + # Write the tag. + write = self._write + write('<' + parsed_qnames[tag][0]) + if attr_list: + write(''.join([f' {k}="{_escape_attrib_c14n(v)}"' for k, v in attr_list])) + write('>') + + # Write the resolved qname text content. + if qname_text is not None: + write(_escape_cdata_c14n(parsed_qnames[resolved_names[qname_text]][0])) + + self._root_seen = True + self._ns_stack.append([]) + + def end(self, tag): + if self._ignored_depth: + self._ignored_depth -= 1 + return + if self._data: + self._flush() + self._write(f'') + self._preserve_space.pop() + self._root_done = len(self._preserve_space) == 1 + self._declared_ns_stack.pop() + self._ns_stack.pop() + + def comment(self, text): + if not self._with_comments: + return + if self._ignored_depth: + return + if self._root_done: + self._write('\n') + elif self._root_seen and self._data: + self._flush() + self._write(f'') + if not self._root_seen: + self._write('\n') + + def pi(self, target, data): + if self._ignored_depth: + return + if self._root_done: + self._write('\n') + elif self._root_seen and self._data: + self._flush() + self._write( + f'' if data else f'') + if not self._root_seen: + self._write('\n') + + +def _escape_cdata_c14n(text): + # escape character data + try: + # it's worth avoiding do-nothing calls for strings that are + # shorter than 500 character, or so. assume that's, by far, + # the most common case in most applications. + if '&' in text: + text = text.replace('&', '&') + if '<' in text: + text = text.replace('<', '<') + if '>' in text: + text = text.replace('>', '>') + if '\r' in text: + text = text.replace('\r', ' ') + return text + except (TypeError, AttributeError): + _raise_serialization_error(text) + + +def _escape_attrib_c14n(text): + # escape attribute value + try: + if '&' in text: + text = text.replace('&', '&') + if '<' in text: + text = text.replace('<', '<') + if '"' in text: + text = text.replace('"', '"') + if '\t' in text: + text = text.replace('\t', ' ') + if '\n' in text: + text = text.replace('\n', ' ') + if '\r' in text: + text = text.replace('\r', ' ') + return text + except (TypeError, AttributeError): + _raise_serialization_error(text) + + +# -------------------------------------------------------------------- + +# Import the C accelerators +try: + # Element is going to be shadowed by the C implementation. We need to keep + # the Python version of it accessible for some "creative" by external code + # (see tests) + _Element_Py = Element + + # Element, SubElement, ParseError, TreeBuilder, XMLParser, _set_factories + from _elementtree import * + from _elementtree import _set_factories +except ImportError: + pass +else: + _set_factories(Comment, ProcessingInstruction) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e2ec53421d3f70267ddc34436eec6a30ee9f1855 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/__init__.py @@ -0,0 +1,33 @@ +# $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $ +# elementtree package + +# -------------------------------------------------------------------- +# The ElementTree toolkit is +# +# Copyright (c) 1999-2008 by Fredrik Lundh +# +# By obtaining, using, and/or copying this software and/or its +# associated documentation, you agree that you have read, understood, +# and will comply with the following terms and conditions: +# +# Permission to use, copy, modify, and distribute this software and +# its associated documentation for any purpose and without fee is +# hereby granted, provided that the above copyright notice appears in +# all copies, and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name of +# Secret Labs AB or the author not be used in advertising or publicity +# pertaining to distribution of the software without specific, written +# prior permission. +# +# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD +# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- +# ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR +# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY +# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. +# -------------------------------------------------------------------- + +# Licensed to PSF under a Contributor Agreement. +# See https://www.python.org/psf/license for licensing details. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/__pycache__/ElementInclude.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/__pycache__/ElementInclude.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..937c2f2f27dee5387f7ed64edf9301c5751b55e7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/__pycache__/ElementInclude.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/__pycache__/ElementPath.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/__pycache__/ElementPath.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f8e3328ab19254f01fa558dceb3b06d8b7231ffb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/__pycache__/ElementPath.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/__pycache__/ElementTree.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/__pycache__/ElementTree.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eacb4ecf99cfe85d75f9bb179a3b94600599a903 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/__pycache__/ElementTree.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cad69e842ee30f063a4d562ad966b97dfa4a7f33 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/__pycache__/cElementTree.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/__pycache__/cElementTree.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8dbe388fa3ce7239df543f15de3e0e1b97d3c0ab Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/__pycache__/cElementTree.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/cElementTree.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/cElementTree.py new file mode 100644 index 0000000000000000000000000000000000000000..368e679189582990ab92cd73b8b820e74df253a7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/etree/cElementTree.py @@ -0,0 +1,3 @@ +# Deprecated alias for xml.etree.ElementTree + +from xml.etree.ElementTree import * diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/parsers/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/parsers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..eb314a3b40573763835ad959acff985fad014537 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/parsers/__init__.py @@ -0,0 +1,8 @@ +"""Python interfaces to XML parsers. + +This package contains one module: + +expat -- Python wrapper for James Clark's Expat parser, with namespace + support. + +""" diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/parsers/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/parsers/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..64efc6e3a36471e67026adf85651df0189856862 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/parsers/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/parsers/__pycache__/expat.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/parsers/__pycache__/expat.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..754eac8c6870d4e1cf0e62e08ce2cff0e6809fee Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/parsers/__pycache__/expat.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/parsers/expat.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/parsers/expat.py new file mode 100644 index 0000000000000000000000000000000000000000..bcbe9fb1f8f00e568f76fce02fdbe7528012b622 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/parsers/expat.py @@ -0,0 +1,8 @@ +"""Interface to the Expat non-validating XML parser.""" +import sys + +from pyexpat import * + +# provide pyexpat submodules as xml.parsers.expat submodules +sys.modules['xml.parsers.expat.model'] = model +sys.modules['xml.parsers.expat.errors'] = errors diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fe4582c6f8b758c9ac5c0b7ac408c90dbe5c1f50 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__init__.py @@ -0,0 +1,100 @@ +"""Simple API for XML (SAX) implementation for Python. + +This module provides an implementation of the SAX 2 interface; +information about the Java version of the interface can be found at +http://www.megginson.com/SAX/. The Python version of the interface is +documented at <...>. + +This package contains the following modules: + +handler -- Base classes and constants which define the SAX 2 API for + the 'client-side' of SAX for Python. + +saxutils -- Implementation of the convenience classes commonly used to + work with SAX. + +xmlreader -- Base classes and constants which define the SAX 2 API for + the parsers used with SAX for Python. + +expatreader -- Driver that allows use of the Expat parser with SAX. +""" + +from .xmlreader import InputSource +from .handler import ContentHandler, ErrorHandler +from ._exceptions import (SAXException, SAXNotRecognizedException, + SAXParseException, SAXNotSupportedException, + SAXReaderNotAvailable) + + +def parse(source, handler, errorHandler=ErrorHandler()): + parser = make_parser() + parser.setContentHandler(handler) + parser.setErrorHandler(errorHandler) + parser.parse(source) + +def parseString(string, handler, errorHandler=ErrorHandler()): + import io + if errorHandler is None: + errorHandler = ErrorHandler() + parser = make_parser() + parser.setContentHandler(handler) + parser.setErrorHandler(errorHandler) + + inpsrc = InputSource() + if isinstance(string, str): + inpsrc.setCharacterStream(io.StringIO(string)) + else: + inpsrc.setByteStream(io.BytesIO(string)) + parser.parse(inpsrc) + +# this is the parser list used by the make_parser function if no +# alternatives are given as parameters to the function + +default_parser_list = ["xml.sax.expatreader"] + +# tell modulefinder that importing sax potentially imports expatreader +_false = 0 +if _false: + import xml.sax.expatreader # noqa: F401 + +import os, sys +if not sys.flags.ignore_environment and "PY_SAX_PARSER" in os.environ: + default_parser_list = os.environ["PY_SAX_PARSER"].split(",") +del os, sys + + +def make_parser(parser_list=()): + """Creates and returns a SAX parser. + + Creates the first parser it is able to instantiate of the ones + given in the iterable created by chaining parser_list and + default_parser_list. The iterables must contain the names of Python + modules containing both a SAX parser and a create_parser function.""" + + for parser_name in list(parser_list) + default_parser_list: + try: + return _create_parser(parser_name) + except ImportError: + import sys + if parser_name in sys.modules: + # The parser module was found, but importing it + # failed unexpectedly, pass this exception through + raise + except SAXReaderNotAvailable: + # The parser module detected that it won't work properly, + # so try the next one + pass + + raise SAXReaderNotAvailable("No parsers found", None) + +# --- Internal utility methods used by make_parser + +def _create_parser(parser_name): + drv_module = __import__(parser_name,{},{},['create_parser']) + return drv_module.create_parser() + + +__all__ = ['ContentHandler', 'ErrorHandler', 'InputSource', 'SAXException', + 'SAXNotRecognizedException', 'SAXNotSupportedException', + 'SAXParseException', 'SAXReaderNotAvailable', + 'default_parser_list', 'make_parser', 'parse', 'parseString'] diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7782f465e9def08c4e42f0e3a3defb5251dbf654 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__pycache__/_exceptions.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__pycache__/_exceptions.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b497ed6fa82569cbcaeaf39063553dfcc69e3fd0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__pycache__/_exceptions.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__pycache__/expatreader.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__pycache__/expatreader.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0f9f94276d81805cec17ecfd8d731b94450874bb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__pycache__/expatreader.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__pycache__/handler.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__pycache__/handler.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3327770b4f01e4765196f9900cafd59826209d07 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__pycache__/handler.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__pycache__/saxutils.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__pycache__/saxutils.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5bd7cc3fcb05f8480a28e7486e51908cec3e3132 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__pycache__/saxutils.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__pycache__/xmlreader.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__pycache__/xmlreader.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7dd60a63a251668ab682691fd10f7efb3fdee11a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/__pycache__/xmlreader.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/_exceptions.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/_exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..f292dc3a8e50123ecb0579c8bf0467d07f1e60a8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/_exceptions.py @@ -0,0 +1,127 @@ +"""Different kinds of SAX Exceptions""" + +# ===== SAXEXCEPTION ===== + +class SAXException(Exception): + """Encapsulate an XML error or warning. This class can contain + basic error or warning information from either the XML parser or + the application: you can subclass it to provide additional + functionality, or to add localization. Note that although you will + receive a SAXException as the argument to the handlers in the + ErrorHandler interface, you are not actually required to raise + the exception; instead, you can simply read the information in + it.""" + + def __init__(self, msg, exception=None): + """Creates an exception. The message is required, but the exception + is optional.""" + self._msg = msg + self._exception = exception + Exception.__init__(self, msg) + + def getMessage(self): + "Return a message for this exception." + return self._msg + + def getException(self): + "Return the embedded exception, or None if there was none." + return self._exception + + def __str__(self): + "Create a string representation of the exception." + return self._msg + + def __getitem__(self, ix): + """Avoids weird error messages if someone does exception[ix] by + mistake, since Exception has __getitem__ defined.""" + raise AttributeError("__getitem__") + + +# ===== SAXPARSEEXCEPTION ===== + +class SAXParseException(SAXException): + """Encapsulate an XML parse error or warning. + + This exception will include information for locating the error in + the original XML document. Note that although the application will + receive a SAXParseException as the argument to the handlers in the + ErrorHandler interface, the application is not actually required + to raise the exception; instead, it can simply read the + information in it and take a different action. + + Since this exception is a subclass of SAXException, it inherits + the ability to wrap another exception.""" + + def __init__(self, msg, exception, locator): + "Creates the exception. The exception parameter is allowed to be None." + SAXException.__init__(self, msg, exception) + self._locator = locator + + # We need to cache this stuff at construction time. + # If this exception is raised, the objects through which we must + # traverse to get this information may be deleted by the time + # it gets caught. + self._systemId = self._locator.getSystemId() + self._colnum = self._locator.getColumnNumber() + self._linenum = self._locator.getLineNumber() + + def getColumnNumber(self): + """The column number of the end of the text where the exception + occurred.""" + return self._colnum + + def getLineNumber(self): + "The line number of the end of the text where the exception occurred." + return self._linenum + + def getPublicId(self): + "Get the public identifier of the entity where the exception occurred." + return self._locator.getPublicId() + + def getSystemId(self): + "Get the system identifier of the entity where the exception occurred." + return self._systemId + + def __str__(self): + "Create a string representation of the exception." + sysid = self.getSystemId() + if sysid is None: + sysid = "" + linenum = self.getLineNumber() + if linenum is None: + linenum = "?" + colnum = self.getColumnNumber() + if colnum is None: + colnum = "?" + return "%s:%s:%s: %s" % (sysid, linenum, colnum, self._msg) + + +# ===== SAXNOTRECOGNIZEDEXCEPTION ===== + +class SAXNotRecognizedException(SAXException): + """Exception class for an unrecognized identifier. + + An XMLReader will raise this exception when it is confronted with an + unrecognized feature or property. SAX applications and extensions may + use this class for similar purposes.""" + + +# ===== SAXNOTSUPPORTEDEXCEPTION ===== + +class SAXNotSupportedException(SAXException): + """Exception class for an unsupported operation. + + An XMLReader will raise this exception when a service it cannot + perform is requested (specifically setting a state or value). SAX + applications and extensions may use this class for similar + purposes.""" + +# ===== SAXNOTSUPPORTEDEXCEPTION ===== + +class SAXReaderNotAvailable(SAXNotSupportedException): + """Exception class for a missing driver. + + An XMLReader module (driver) should raise this exception when it + is first imported, e.g. when a support module cannot be imported. + It also may be raised during parsing, e.g. if executing an external + program is not permitted.""" diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/expatreader.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/expatreader.py new file mode 100644 index 0000000000000000000000000000000000000000..ba3c1e98517429bf8463fd36d10e31440ea6c178 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/expatreader.py @@ -0,0 +1,454 @@ +""" +SAX driver for the pyexpat C module. This driver works with +pyexpat.__version__ == '2.22'. +""" + +version = "0.20" + +from xml.sax._exceptions import * +from xml.sax.handler import feature_validation, feature_namespaces +from xml.sax.handler import feature_namespace_prefixes +from xml.sax.handler import feature_external_ges, feature_external_pes +from xml.sax.handler import feature_string_interning +from xml.sax.handler import property_xml_string, property_interning_dict + +try: + from xml.parsers import expat +except ImportError: + raise SAXReaderNotAvailable("expat not supported", None) +else: + if not hasattr(expat, "ParserCreate"): + raise SAXReaderNotAvailable("expat not supported", None) +from xml.sax import xmlreader, saxutils, handler + +AttributesImpl = xmlreader.AttributesImpl +AttributesNSImpl = xmlreader.AttributesNSImpl + +# If we're using a sufficiently recent version of Python, we can use +# weak references to avoid cycles between the parser and content +# handler, otherwise we'll just have to pretend. +try: + import _weakref +except ImportError: + def _mkproxy(o): + return o +else: + import weakref + _mkproxy = weakref.proxy + del weakref, _weakref + +class _ClosedParser: + pass + +# --- ExpatLocator + +class ExpatLocator(xmlreader.Locator): + """Locator for use with the ExpatParser class. + + This uses a weak reference to the parser object to avoid creating + a circular reference between the parser and the content handler. + """ + def __init__(self, parser): + self._ref = _mkproxy(parser) + + def getColumnNumber(self): + parser = self._ref + if parser._parser is None: + return None + return parser._parser.ErrorColumnNumber + + def getLineNumber(self): + parser = self._ref + if parser._parser is None: + return 1 + return parser._parser.ErrorLineNumber + + def getPublicId(self): + parser = self._ref + if parser is None: + return None + return parser._source.getPublicId() + + def getSystemId(self): + parser = self._ref + if parser is None: + return None + return parser._source.getSystemId() + + +# --- ExpatParser + +class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator): + """SAX driver for the pyexpat C module.""" + + def __init__(self, namespaceHandling=0, bufsize=2**16-20): + xmlreader.IncrementalParser.__init__(self, bufsize) + self._source = xmlreader.InputSource() + self._parser = None + self._namespaces = namespaceHandling + self._lex_handler_prop = None + self._parsing = False + self._entity_stack = [] + self._external_ges = 0 + self._interning = None + + # XMLReader methods + + def parse(self, source): + "Parse an XML document from a URL or an InputSource." + source = saxutils.prepare_input_source(source) + + self._source = source + try: + self.reset() + self._cont_handler.setDocumentLocator(ExpatLocator(self)) + xmlreader.IncrementalParser.parse(self, source) + except: + # bpo-30264: Close the source on error to not leak resources: + # xml.sax.parse() doesn't give access to the underlying parser + # to the caller + self._close_source() + raise + + def prepareParser(self, source): + if source.getSystemId() is not None: + self._parser.SetBase(source.getSystemId()) + + # Redefined setContentHandler to allow changing handlers during parsing + + def setContentHandler(self, handler): + xmlreader.IncrementalParser.setContentHandler(self, handler) + if self._parsing: + self._reset_cont_handler() + + def getFeature(self, name): + if name == feature_namespaces: + return self._namespaces + elif name == feature_string_interning: + return self._interning is not None + elif name in (feature_validation, feature_external_pes, + feature_namespace_prefixes): + return 0 + elif name == feature_external_ges: + return self._external_ges + raise SAXNotRecognizedException("Feature '%s' not recognized" % name) + + def setFeature(self, name, state): + if self._parsing: + raise SAXNotSupportedException("Cannot set features while parsing") + + if name == feature_namespaces: + self._namespaces = state + elif name == feature_external_ges: + self._external_ges = state + elif name == feature_string_interning: + if state: + if self._interning is None: + self._interning = {} + else: + self._interning = None + elif name == feature_validation: + if state: + raise SAXNotSupportedException( + "expat does not support validation") + elif name == feature_external_pes: + if state: + raise SAXNotSupportedException( + "expat does not read external parameter entities") + elif name == feature_namespace_prefixes: + if state: + raise SAXNotSupportedException( + "expat does not report namespace prefixes") + else: + raise SAXNotRecognizedException( + "Feature '%s' not recognized" % name) + + def getProperty(self, name): + if name == handler.property_lexical_handler: + return self._lex_handler_prop + elif name == property_interning_dict: + return self._interning + elif name == property_xml_string: + if self._parser: + if hasattr(self._parser, "GetInputContext"): + return self._parser.GetInputContext() + else: + raise SAXNotRecognizedException( + "This version of expat does not support getting" + " the XML string") + else: + raise SAXNotSupportedException( + "XML string cannot be returned when not parsing") + raise SAXNotRecognizedException("Property '%s' not recognized" % name) + + def setProperty(self, name, value): + if name == handler.property_lexical_handler: + self._lex_handler_prop = value + if self._parsing: + self._reset_lex_handler_prop() + elif name == property_interning_dict: + self._interning = value + elif name == property_xml_string: + raise SAXNotSupportedException("Property '%s' cannot be set" % + name) + else: + raise SAXNotRecognizedException("Property '%s' not recognized" % + name) + + # IncrementalParser methods + + def feed(self, data, isFinal=False): + if not self._parsing: + self.reset() + self._parsing = True + self._cont_handler.startDocument() + + try: + # The isFinal parameter is internal to the expat reader. + # If it is set to true, expat will check validity of the entire + # document. When feeding chunks, they are not normally final - + # except when invoked from close. + self._parser.Parse(data, isFinal) + except expat.error as e: + exc = SAXParseException(expat.ErrorString(e.code), e, self) + # FIXME: when to invoke error()? + self._err_handler.fatalError(exc) + + def flush(self): + if self._parser is None: + return + + was_enabled = self._parser.GetReparseDeferralEnabled() + try: + self._parser.SetReparseDeferralEnabled(False) + self._parser.Parse(b"", False) + except expat.error as e: + exc = SAXParseException(expat.ErrorString(e.code), e, self) + self._err_handler.fatalError(exc) + finally: + self._parser.SetReparseDeferralEnabled(was_enabled) + + def _close_source(self): + source = self._source + try: + file = source.getCharacterStream() + if file is not None: + file.close() + finally: + file = source.getByteStream() + if file is not None: + file.close() + + def close(self): + if (self._entity_stack or self._parser is None or + isinstance(self._parser, _ClosedParser)): + # If we are completing an external entity, do nothing here + return + try: + self.feed(b"", isFinal=True) + self._cont_handler.endDocument() + self._parsing = False + # break cycle created by expat handlers pointing to our methods + self._parser = None + finally: + self._parsing = False + if self._parser is not None: + # Keep ErrorColumnNumber and ErrorLineNumber after closing. + parser = _ClosedParser() + parser.ErrorColumnNumber = self._parser.ErrorColumnNumber + parser.ErrorLineNumber = self._parser.ErrorLineNumber + self._parser = parser + self._close_source() + + def _reset_cont_handler(self): + self._parser.ProcessingInstructionHandler = \ + self._cont_handler.processingInstruction + self._parser.CharacterDataHandler = self._cont_handler.characters + + def _reset_lex_handler_prop(self): + lex = self._lex_handler_prop + parser = self._parser + if lex is None: + parser.CommentHandler = None + parser.StartCdataSectionHandler = None + parser.EndCdataSectionHandler = None + parser.StartDoctypeDeclHandler = None + parser.EndDoctypeDeclHandler = None + else: + parser.CommentHandler = lex.comment + parser.StartCdataSectionHandler = lex.startCDATA + parser.EndCdataSectionHandler = lex.endCDATA + parser.StartDoctypeDeclHandler = self.start_doctype_decl + parser.EndDoctypeDeclHandler = lex.endDTD + + def reset(self): + if self._namespaces: + self._parser = expat.ParserCreate(self._source.getEncoding(), " ", + intern=self._interning) + self._parser.namespace_prefixes = 1 + self._parser.StartElementHandler = self.start_element_ns + self._parser.EndElementHandler = self.end_element_ns + else: + self._parser = expat.ParserCreate(self._source.getEncoding(), + intern = self._interning) + self._parser.StartElementHandler = self.start_element + self._parser.EndElementHandler = self.end_element + + self._reset_cont_handler() + self._parser.UnparsedEntityDeclHandler = self.unparsed_entity_decl + self._parser.NotationDeclHandler = self.notation_decl + self._parser.StartNamespaceDeclHandler = self.start_namespace_decl + self._parser.EndNamespaceDeclHandler = self.end_namespace_decl + + self._decl_handler_prop = None + if self._lex_handler_prop: + self._reset_lex_handler_prop() +# self._parser.DefaultHandler = +# self._parser.DefaultHandlerExpand = +# self._parser.NotStandaloneHandler = + self._parser.ExternalEntityRefHandler = self.external_entity_ref + try: + self._parser.SkippedEntityHandler = self.skipped_entity_handler + except AttributeError: + # This pyexpat does not support SkippedEntity + pass + self._parser.SetParamEntityParsing( + expat.XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE) + + self._parsing = False + self._entity_stack = [] + + # Locator methods + + def getColumnNumber(self): + if self._parser is None: + return None + return self._parser.ErrorColumnNumber + + def getLineNumber(self): + if self._parser is None: + return 1 + return self._parser.ErrorLineNumber + + def getPublicId(self): + return self._source.getPublicId() + + def getSystemId(self): + return self._source.getSystemId() + + # event handlers + def start_element(self, name, attrs): + self._cont_handler.startElement(name, AttributesImpl(attrs)) + + def end_element(self, name): + self._cont_handler.endElement(name) + + def start_element_ns(self, name, attrs): + pair = name.split() + if len(pair) == 1: + # no namespace + pair = (None, name) + elif len(pair) == 3: + pair = pair[0], pair[1] + else: + # default namespace + pair = tuple(pair) + + newattrs = {} + qnames = {} + for (aname, value) in attrs.items(): + parts = aname.split() + length = len(parts) + if length == 1: + # no namespace + qname = aname + apair = (None, aname) + elif length == 3: + qname = "%s:%s" % (parts[2], parts[1]) + apair = parts[0], parts[1] + else: + # default namespace + qname = parts[1] + apair = tuple(parts) + + newattrs[apair] = value + qnames[apair] = qname + + self._cont_handler.startElementNS(pair, None, + AttributesNSImpl(newattrs, qnames)) + + def end_element_ns(self, name): + pair = name.split() + if len(pair) == 1: + pair = (None, name) + elif len(pair) == 3: + pair = pair[0], pair[1] + else: + pair = tuple(pair) + + self._cont_handler.endElementNS(pair, None) + + # this is not used (call directly to ContentHandler) + def processing_instruction(self, target, data): + self._cont_handler.processingInstruction(target, data) + + # this is not used (call directly to ContentHandler) + def character_data(self, data): + self._cont_handler.characters(data) + + def start_namespace_decl(self, prefix, uri): + self._cont_handler.startPrefixMapping(prefix, uri) + + def end_namespace_decl(self, prefix): + self._cont_handler.endPrefixMapping(prefix) + + def start_doctype_decl(self, name, sysid, pubid, has_internal_subset): + self._lex_handler_prop.startDTD(name, pubid, sysid) + + def unparsed_entity_decl(self, name, base, sysid, pubid, notation_name): + self._dtd_handler.unparsedEntityDecl(name, pubid, sysid, notation_name) + + def notation_decl(self, name, base, sysid, pubid): + self._dtd_handler.notationDecl(name, pubid, sysid) + + def external_entity_ref(self, context, base, sysid, pubid): + if not self._external_ges: + return 1 + + source = self._ent_handler.resolveEntity(pubid, sysid) + source = saxutils.prepare_input_source(source, + self._source.getSystemId() or + "") + + self._entity_stack.append((self._parser, self._source)) + self._parser = self._parser.ExternalEntityParserCreate(context) + self._source = source + + try: + xmlreader.IncrementalParser.parse(self, source) + except: + return 0 # FIXME: save error info here? + + (self._parser, self._source) = self._entity_stack[-1] + del self._entity_stack[-1] + return 1 + + def skipped_entity_handler(self, name, is_pe): + if is_pe: + # The SAX spec requires to report skipped PEs with a '%' + name = '%'+name + self._cont_handler.skippedEntity(name) + +# --- + +def create_parser(*args, **kwargs): + return ExpatParser(*args, **kwargs) + +# --- + +if __name__ == "__main__": + import xml.sax.saxutils + p = create_parser() + p.setContentHandler(xml.sax.saxutils.XMLGenerator()) + p.setErrorHandler(xml.sax.ErrorHandler()) + p.parse("http://www.ibiblio.org/xml/examples/shakespeare/hamlet.xml") diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/handler.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/handler.py new file mode 100644 index 0000000000000000000000000000000000000000..3183c3fe96d74fb35cc6b185cdbce3dc7dc911b4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/handler.py @@ -0,0 +1,387 @@ +""" +This module contains the core classes of version 2.0 of SAX for Python. +This file provides only default classes with absolutely minimum +functionality, from which drivers and applications can be subclassed. + +Many of these classes are empty and are included only as documentation +of the interfaces. + +$Id$ +""" + +version = '2.0beta' + +#============================================================================ +# +# HANDLER INTERFACES +# +#============================================================================ + +# ===== ERRORHANDLER ===== + +class ErrorHandler: + """Basic interface for SAX error handlers. + + If you create an object that implements this interface, then + register the object with your XMLReader, the parser will call the + methods in your object to report all warnings and errors. There + are three levels of errors available: warnings, (possibly) + recoverable errors, and unrecoverable errors. All methods take a + SAXParseException as the only parameter.""" + + def error(self, exception): + "Handle a recoverable error." + raise exception + + def fatalError(self, exception): + "Handle a non-recoverable error." + raise exception + + def warning(self, exception): + "Handle a warning." + print(exception) + + +# ===== CONTENTHANDLER ===== + +class ContentHandler: + """Interface for receiving logical document content events. + + This is the main callback interface in SAX, and the one most + important to applications. The order of events in this interface + mirrors the order of the information in the document.""" + + def __init__(self): + self._locator = None + + def setDocumentLocator(self, locator): + """Called by the parser to give the application a locator for + locating the origin of document events. + + SAX parsers are strongly encouraged (though not absolutely + required) to supply a locator: if it does so, it must supply + the locator to the application by invoking this method before + invoking any of the other methods in the DocumentHandler + interface. + + The locator allows the application to determine the end + position of any document-related event, even if the parser is + not reporting an error. Typically, the application will use + this information for reporting its own errors (such as + character content that does not match an application's + business rules). The information returned by the locator is + probably not sufficient for use with a search engine. + + Note that the locator will return correct information only + during the invocation of the events in this interface. The + application should not attempt to use it at any other time.""" + self._locator = locator + + def startDocument(self): + """Receive notification of the beginning of a document. + + The SAX parser will invoke this method only once, before any + other methods in this interface or in DTDHandler (except for + setDocumentLocator).""" + + def endDocument(self): + """Receive notification of the end of a document. + + The SAX parser will invoke this method only once, and it will + be the last method invoked during the parse. The parser shall + not invoke this method until it has either abandoned parsing + (because of an unrecoverable error) or reached the end of + input.""" + + def startPrefixMapping(self, prefix, uri): + """Begin the scope of a prefix-URI Namespace mapping. + + The information from this event is not necessary for normal + Namespace processing: the SAX XML reader will automatically + replace prefixes for element and attribute names when the + http://xml.org/sax/features/namespaces feature is true (the + default). + + There are cases, however, when applications need to use + prefixes in character data or in attribute values, where they + cannot safely be expanded automatically; the + start/endPrefixMapping event supplies the information to the + application to expand prefixes in those contexts itself, if + necessary. + + Note that start/endPrefixMapping events are not guaranteed to + be properly nested relative to each-other: all + startPrefixMapping events will occur before the corresponding + startElement event, and all endPrefixMapping events will occur + after the corresponding endElement event, but their order is + not guaranteed.""" + + def endPrefixMapping(self, prefix): + """End the scope of a prefix-URI mapping. + + See startPrefixMapping for details. This event will always + occur after the corresponding endElement event, but the order + of endPrefixMapping events is not otherwise guaranteed.""" + + def startElement(self, name, attrs): + """Signals the start of an element in non-namespace mode. + + The name parameter contains the raw XML 1.0 name of the + element type as a string and the attrs parameter holds an + instance of the Attributes class containing the attributes of + the element.""" + + def endElement(self, name): + """Signals the end of an element in non-namespace mode. + + The name parameter contains the name of the element type, just + as with the startElement event.""" + + def startElementNS(self, name, qname, attrs): + """Signals the start of an element in namespace mode. + + The name parameter contains the name of the element type as a + (uri, localname) tuple, the qname parameter the raw XML 1.0 + name used in the source document, and the attrs parameter + holds an instance of the Attributes class containing the + attributes of the element. + + The uri part of the name tuple is None for elements which have + no namespace.""" + + def endElementNS(self, name, qname): + """Signals the end of an element in namespace mode. + + The name parameter contains the name of the element type, just + as with the startElementNS event.""" + + def characters(self, content): + """Receive notification of character data. + + The Parser will call this method to report each chunk of + character data. SAX parsers may return all contiguous + character data in a single chunk, or they may split it into + several chunks; however, all of the characters in any single + event must come from the same external entity so that the + Locator provides useful information.""" + + def ignorableWhitespace(self, whitespace): + """Receive notification of ignorable whitespace in element content. + + Validating Parsers must use this method to report each chunk + of ignorable whitespace (see the W3C XML 1.0 recommendation, + section 2.10): non-validating parsers may also use this method + if they are capable of parsing and using content models. + + SAX parsers may return all contiguous whitespace in a single + chunk, or they may split it into several chunks; however, all + of the characters in any single event must come from the same + external entity, so that the Locator provides useful + information.""" + + def processingInstruction(self, target, data): + """Receive notification of a processing instruction. + + The Parser will invoke this method once for each processing + instruction found: note that processing instructions may occur + before or after the main document element. + + A SAX parser should never report an XML declaration (XML 1.0, + section 2.8) or a text declaration (XML 1.0, section 4.3.1) + using this method.""" + + def skippedEntity(self, name): + """Receive notification of a skipped entity. + + The Parser will invoke this method once for each entity + skipped. Non-validating processors may skip entities if they + have not seen the declarations (because, for example, the + entity was declared in an external DTD subset). All processors + may skip external entities, depending on the values of the + http://xml.org/sax/features/external-general-entities and the + http://xml.org/sax/features/external-parameter-entities + properties.""" + + +# ===== DTDHandler ===== + +class DTDHandler: + """Handle DTD events. + + This interface specifies only those DTD events required for basic + parsing (unparsed entities and attributes).""" + + def notationDecl(self, name, publicId, systemId): + "Handle a notation declaration event." + + def unparsedEntityDecl(self, name, publicId, systemId, ndata): + "Handle an unparsed entity declaration event." + + +# ===== ENTITYRESOLVER ===== + +class EntityResolver: + """Basic interface for resolving entities. If you create an object + implementing this interface, then register the object with your + Parser, the parser will call the method in your object to + resolve all external entities. Note that DefaultHandler implements + this interface with the default behaviour.""" + + def resolveEntity(self, publicId, systemId): + """Resolve the system identifier of an entity and return either + the system identifier to read from as a string, or an InputSource + to read from.""" + return systemId + + +#============================================================================ +# +# CORE FEATURES +# +#============================================================================ + +feature_namespaces = "http://xml.org/sax/features/namespaces" +# true: Perform Namespace processing (default). +# false: Optionally do not perform Namespace processing +# (implies namespace-prefixes). +# access: (parsing) read-only; (not parsing) read/write + +feature_namespace_prefixes = "http://xml.org/sax/features/namespace-prefixes" +# true: Report the original prefixed names and attributes used for Namespace +# declarations. +# false: Do not report attributes used for Namespace declarations, and +# optionally do not report original prefixed names (default). +# access: (parsing) read-only; (not parsing) read/write + +feature_string_interning = "http://xml.org/sax/features/string-interning" +# true: All element names, prefixes, attribute names, Namespace URIs, and +# local names are interned using the built-in intern function. +# false: Names are not necessarily interned, although they may be (default). +# access: (parsing) read-only; (not parsing) read/write + +feature_validation = "http://xml.org/sax/features/validation" +# true: Report all validation errors (implies external-general-entities and +# external-parameter-entities). +# false: Do not report validation errors. +# access: (parsing) read-only; (not parsing) read/write + +feature_external_ges = "http://xml.org/sax/features/external-general-entities" +# true: Include all external general (text) entities. +# false: Do not include external general entities. +# access: (parsing) read-only; (not parsing) read/write + +feature_external_pes = "http://xml.org/sax/features/external-parameter-entities" +# true: Include all external parameter entities, including the external +# DTD subset. +# false: Do not include any external parameter entities, even the external +# DTD subset. +# access: (parsing) read-only; (not parsing) read/write + +all_features = [feature_namespaces, + feature_namespace_prefixes, + feature_string_interning, + feature_validation, + feature_external_ges, + feature_external_pes] + + +#============================================================================ +# +# CORE PROPERTIES +# +#============================================================================ + +property_lexical_handler = "http://xml.org/sax/properties/lexical-handler" +# data type: xml.sax.sax2lib.LexicalHandler +# description: An optional extension handler for lexical events like comments. +# access: read/write + +property_declaration_handler = "http://xml.org/sax/properties/declaration-handler" +# data type: xml.sax.sax2lib.DeclHandler +# description: An optional extension handler for DTD-related events other +# than notations and unparsed entities. +# access: read/write + +property_dom_node = "http://xml.org/sax/properties/dom-node" +# data type: org.w3c.dom.Node +# description: When parsing, the current DOM node being visited if this is +# a DOM iterator; when not parsing, the root DOM node for +# iteration. +# access: (parsing) read-only; (not parsing) read/write + +property_xml_string = "http://xml.org/sax/properties/xml-string" +# data type: String +# description: The literal string of characters that was the source for +# the current event. +# access: read-only + +property_encoding = "http://www.python.org/sax/properties/encoding" +# data type: String +# description: The name of the encoding to assume for input data. +# access: write: set the encoding, e.g. established by a higher-level +# protocol. May change during parsing (e.g. after +# processing a META tag) +# read: return the current encoding (possibly established through +# auto-detection. +# initial value: UTF-8 +# + +property_interning_dict = "http://www.python.org/sax/properties/interning-dict" +# data type: Dictionary +# description: The dictionary used to intern common strings in the document +# access: write: Request that the parser uses a specific dictionary, to +# allow interning across different documents +# read: return the current interning dictionary, or None +# + +all_properties = [property_lexical_handler, + property_dom_node, + property_declaration_handler, + property_xml_string, + property_encoding, + property_interning_dict] + + +class LexicalHandler: + """Optional SAX2 handler for lexical events. + + This handler is used to obtain lexical information about an XML + document, that is, information about how the document was encoded + (as opposed to what it contains, which is reported to the + ContentHandler), such as comments and CDATA marked section + boundaries. + + To set the LexicalHandler of an XMLReader, use the setProperty + method with the property identifier + 'http://xml.org/sax/properties/lexical-handler'.""" + + def comment(self, content): + """Reports a comment anywhere in the document (including the + DTD and outside the document element). + + content is a string that holds the contents of the comment.""" + + def startDTD(self, name, public_id, system_id): + """Report the start of the DTD declarations, if the document + has an associated DTD. + + A startEntity event will be reported before declaration events + from the external DTD subset are reported, and this can be + used to infer from which subset DTD declarations derive. + + name is the name of the document element type, public_id the + public identifier of the DTD (or None if none were supplied) + and system_id the system identifier of the external subset (or + None if none were supplied).""" + + def endDTD(self): + """Signals the end of DTD declarations.""" + + def startCDATA(self): + """Reports the beginning of a CDATA marked section. + + The contents of the CDATA marked section will be reported + through the characters event.""" + + def endCDATA(self): + """Reports the end of a CDATA marked section.""" diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/saxutils.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/saxutils.py new file mode 100644 index 0000000000000000000000000000000000000000..c1612ea1cebc5d064280e7d2d617d0fc2cf1f0f0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/saxutils.py @@ -0,0 +1,369 @@ +"""\ +A library of useful helper classes to the SAX classes, for the +convenience of application and driver writers. +""" + +import os, urllib.parse, urllib.request +import io +import codecs +from . import handler +from . import xmlreader + +def __dict_replace(s, d): + """Replace substrings of a string using a dictionary.""" + for key, value in d.items(): + s = s.replace(key, value) + return s + +def escape(data, entities={}): + """Escape &, <, and > in a string of data. + + You can escape other strings of data by passing a dictionary as + the optional entities parameter. The keys and values must all be + strings; each key will be replaced with its corresponding value. + """ + + # must do ampersand first + data = data.replace("&", "&") + data = data.replace(">", ">") + data = data.replace("<", "<") + if entities: + data = __dict_replace(data, entities) + return data + +def unescape(data, entities={}): + """Unescape &, <, and > in a string of data. + + You can unescape other strings of data by passing a dictionary as + the optional entities parameter. The keys and values must all be + strings; each key will be replaced with its corresponding value. + """ + data = data.replace("<", "<") + data = data.replace(">", ">") + if entities: + data = __dict_replace(data, entities) + # must do ampersand last + return data.replace("&", "&") + +def quoteattr(data, entities={}): + """Escape and quote an attribute value. + + Escape &, <, and > in a string of data, then quote it for use as + an attribute value. The \" character will be escaped as well, if + necessary. + + You can escape other strings of data by passing a dictionary as + the optional entities parameter. The keys and values must all be + strings; each key will be replaced with its corresponding value. + """ + entities = {**entities, '\n': ' ', '\r': ' ', '\t':' '} + data = escape(data, entities) + if '"' in data: + if "'" in data: + data = '"%s"' % data.replace('"', """) + else: + data = "'%s'" % data + else: + data = '"%s"' % data + return data + + +def _gettextwriter(out, encoding): + if out is None: + import sys + return sys.stdout + + if isinstance(out, io.TextIOBase): + # use a text writer as is + return out + + if isinstance(out, (codecs.StreamWriter, codecs.StreamReaderWriter)): + # use a codecs stream writer as is + return out + + # wrap a binary writer with TextIOWrapper + if isinstance(out, io.RawIOBase): + # Keep the original file open when the TextIOWrapper is + # destroyed + class _wrapper: + __class__ = out.__class__ + def __getattr__(self, name): + return getattr(out, name) + buffer = _wrapper() + buffer.close = lambda: None + else: + # This is to handle passed objects that aren't in the + # IOBase hierarchy, but just have a write method + buffer = io.BufferedIOBase() + buffer.writable = lambda: True + buffer.write = out.write + try: + # TextIOWrapper uses this methods to determine + # if BOM (for UTF-16, etc) should be added + buffer.seekable = out.seekable + buffer.tell = out.tell + except AttributeError: + pass + return io.TextIOWrapper(buffer, encoding=encoding, + errors='xmlcharrefreplace', + newline='\n', + write_through=True) + +class XMLGenerator(handler.ContentHandler): + + def __init__(self, out=None, encoding="iso-8859-1", short_empty_elements=False): + handler.ContentHandler.__init__(self) + out = _gettextwriter(out, encoding) + self._write = out.write + self._flush = out.flush + self._ns_contexts = [{}] # contains uri -> prefix dicts + self._current_context = self._ns_contexts[-1] + self._undeclared_ns_maps = [] + self._encoding = encoding + self._short_empty_elements = short_empty_elements + self._pending_start_element = False + + def _qname(self, name): + """Builds a qualified name from a (ns_url, localname) pair""" + if name[0]: + # Per http://www.w3.org/XML/1998/namespace, The 'xml' prefix is + # bound by definition to http://www.w3.org/XML/1998/namespace. It + # does not need to be declared and will not usually be found in + # self._current_context. + if 'http://www.w3.org/XML/1998/namespace' == name[0]: + return 'xml:' + name[1] + # The name is in a non-empty namespace + prefix = self._current_context[name[0]] + if prefix: + # If it is not the default namespace, prepend the prefix + return prefix + ":" + name[1] + # Return the unqualified name + return name[1] + + def _finish_pending_start_element(self,endElement=False): + if self._pending_start_element: + self._write('>') + self._pending_start_element = False + + # ContentHandler methods + + def startDocument(self): + self._write('\n' % + self._encoding) + + def endDocument(self): + self._flush() + + def startPrefixMapping(self, prefix, uri): + self._ns_contexts.append(self._current_context.copy()) + self._current_context[uri] = prefix + self._undeclared_ns_maps.append((prefix, uri)) + + def endPrefixMapping(self, prefix): + self._current_context = self._ns_contexts[-1] + del self._ns_contexts[-1] + + def startElement(self, name, attrs): + self._finish_pending_start_element() + self._write('<' + name) + for (name, value) in attrs.items(): + self._write(' %s=%s' % (name, quoteattr(value))) + if self._short_empty_elements: + self._pending_start_element = True + else: + self._write(">") + + def endElement(self, name): + if self._pending_start_element: + self._write('/>') + self._pending_start_element = False + else: + self._write('' % name) + + def startElementNS(self, name, qname, attrs): + self._finish_pending_start_element() + self._write('<' + self._qname(name)) + + for prefix, uri in self._undeclared_ns_maps: + if prefix: + self._write(' xmlns:%s="%s"' % (prefix, uri)) + else: + self._write(' xmlns="%s"' % uri) + self._undeclared_ns_maps = [] + + for (name, value) in attrs.items(): + self._write(' %s=%s' % (self._qname(name), quoteattr(value))) + if self._short_empty_elements: + self._pending_start_element = True + else: + self._write(">") + + def endElementNS(self, name, qname): + if self._pending_start_element: + self._write('/>') + self._pending_start_element = False + else: + self._write('' % self._qname(name)) + + def characters(self, content): + if content: + self._finish_pending_start_element() + if not isinstance(content, str): + content = str(content, self._encoding) + self._write(escape(content)) + + def ignorableWhitespace(self, content): + if content: + self._finish_pending_start_element() + if not isinstance(content, str): + content = str(content, self._encoding) + self._write(content) + + def processingInstruction(self, target, data): + self._finish_pending_start_element() + self._write('' % (target, data)) + + +class XMLFilterBase(xmlreader.XMLReader): + """This class is designed to sit between an XMLReader and the + client application's event handlers. By default, it does nothing + but pass requests up to the reader and events on to the handlers + unmodified, but subclasses can override specific methods to modify + the event stream or the configuration requests as they pass + through.""" + + def __init__(self, parent = None): + xmlreader.XMLReader.__init__(self) + self._parent = parent + + # ErrorHandler methods + + def error(self, exception): + self._err_handler.error(exception) + + def fatalError(self, exception): + self._err_handler.fatalError(exception) + + def warning(self, exception): + self._err_handler.warning(exception) + + # ContentHandler methods + + def setDocumentLocator(self, locator): + self._cont_handler.setDocumentLocator(locator) + + def startDocument(self): + self._cont_handler.startDocument() + + def endDocument(self): + self._cont_handler.endDocument() + + def startPrefixMapping(self, prefix, uri): + self._cont_handler.startPrefixMapping(prefix, uri) + + def endPrefixMapping(self, prefix): + self._cont_handler.endPrefixMapping(prefix) + + def startElement(self, name, attrs): + self._cont_handler.startElement(name, attrs) + + def endElement(self, name): + self._cont_handler.endElement(name) + + def startElementNS(self, name, qname, attrs): + self._cont_handler.startElementNS(name, qname, attrs) + + def endElementNS(self, name, qname): + self._cont_handler.endElementNS(name, qname) + + def characters(self, content): + self._cont_handler.characters(content) + + def ignorableWhitespace(self, chars): + self._cont_handler.ignorableWhitespace(chars) + + def processingInstruction(self, target, data): + self._cont_handler.processingInstruction(target, data) + + def skippedEntity(self, name): + self._cont_handler.skippedEntity(name) + + # DTDHandler methods + + def notationDecl(self, name, publicId, systemId): + self._dtd_handler.notationDecl(name, publicId, systemId) + + def unparsedEntityDecl(self, name, publicId, systemId, ndata): + self._dtd_handler.unparsedEntityDecl(name, publicId, systemId, ndata) + + # EntityResolver methods + + def resolveEntity(self, publicId, systemId): + return self._ent_handler.resolveEntity(publicId, systemId) + + # XMLReader methods + + def parse(self, source): + self._parent.setContentHandler(self) + self._parent.setErrorHandler(self) + self._parent.setEntityResolver(self) + self._parent.setDTDHandler(self) + self._parent.parse(source) + + def setLocale(self, locale): + self._parent.setLocale(locale) + + def getFeature(self, name): + return self._parent.getFeature(name) + + def setFeature(self, name, state): + self._parent.setFeature(name, state) + + def getProperty(self, name): + return self._parent.getProperty(name) + + def setProperty(self, name, value): + self._parent.setProperty(name, value) + + # XMLFilter methods + + def getParent(self): + return self._parent + + def setParent(self, parent): + self._parent = parent + +# --- Utility functions + +def prepare_input_source(source, base=""): + """This function takes an InputSource and an optional base URL and + returns a fully resolved InputSource object ready for reading.""" + + if isinstance(source, os.PathLike): + source = os.fspath(source) + if isinstance(source, str): + source = xmlreader.InputSource(source) + elif hasattr(source, "read"): + f = source + source = xmlreader.InputSource() + if isinstance(f.read(0), str): + source.setCharacterStream(f) + else: + source.setByteStream(f) + if hasattr(f, "name") and isinstance(f.name, str): + source.setSystemId(f.name) + + if source.getCharacterStream() is None and source.getByteStream() is None: + sysid = source.getSystemId() + basehead = os.path.dirname(os.path.normpath(base)) + sysidfilename = os.path.join(basehead, sysid) + if os.path.isfile(sysidfilename): + source.setSystemId(sysidfilename) + f = open(sysidfilename, "rb") + else: + source.setSystemId(urllib.parse.urljoin(base, sysid)) + f = urllib.request.urlopen(source.getSystemId()) + + source.setByteStream(f) + + return source diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/xmlreader.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/xmlreader.py new file mode 100644 index 0000000000000000000000000000000000000000..e906121d23b9ef31d3071475e7b6c7246d393103 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xml/sax/xmlreader.py @@ -0,0 +1,378 @@ +"""An XML Reader is the SAX 2 name for an XML parser. XML Parsers +should be based on this code. """ + +from . import handler + +from ._exceptions import SAXNotSupportedException, SAXNotRecognizedException + + +# ===== XMLREADER ===== + +class XMLReader: + """Interface for reading an XML document using callbacks. + + XMLReader is the interface that an XML parser's SAX2 driver must + implement. This interface allows an application to set and query + features and properties in the parser, to register event handlers + for document processing, and to initiate a document parse. + + All SAX interfaces are assumed to be synchronous: the parse + methods must not return until parsing is complete, and readers + must wait for an event-handler callback to return before reporting + the next event.""" + + def __init__(self): + self._cont_handler = handler.ContentHandler() + self._dtd_handler = handler.DTDHandler() + self._ent_handler = handler.EntityResolver() + self._err_handler = handler.ErrorHandler() + + def parse(self, source): + "Parse an XML document from a system identifier or an InputSource." + raise NotImplementedError("This method must be implemented!") + + def getContentHandler(self): + "Returns the current ContentHandler." + return self._cont_handler + + def setContentHandler(self, handler): + "Registers a new object to receive document content events." + self._cont_handler = handler + + def getDTDHandler(self): + "Returns the current DTD handler." + return self._dtd_handler + + def setDTDHandler(self, handler): + "Register an object to receive basic DTD-related events." + self._dtd_handler = handler + + def getEntityResolver(self): + "Returns the current EntityResolver." + return self._ent_handler + + def setEntityResolver(self, resolver): + "Register an object to resolve external entities." + self._ent_handler = resolver + + def getErrorHandler(self): + "Returns the current ErrorHandler." + return self._err_handler + + def setErrorHandler(self, handler): + "Register an object to receive error-message events." + self._err_handler = handler + + def setLocale(self, locale): + """Allow an application to set the locale for errors and warnings. + + SAX parsers are not required to provide localization for errors + and warnings; if they cannot support the requested locale, + however, they must raise a SAX exception. Applications may + request a locale change in the middle of a parse.""" + raise SAXNotSupportedException("Locale support not implemented") + + def getFeature(self, name): + "Looks up and returns the state of a SAX2 feature." + raise SAXNotRecognizedException("Feature '%s' not recognized" % name) + + def setFeature(self, name, state): + "Sets the state of a SAX2 feature." + raise SAXNotRecognizedException("Feature '%s' not recognized" % name) + + def getProperty(self, name): + "Looks up and returns the value of a SAX2 property." + raise SAXNotRecognizedException("Property '%s' not recognized" % name) + + def setProperty(self, name, value): + "Sets the value of a SAX2 property." + raise SAXNotRecognizedException("Property '%s' not recognized" % name) + +class IncrementalParser(XMLReader): + """This interface adds three extra methods to the XMLReader + interface that allow XML parsers to support incremental + parsing. Support for this interface is optional, since not all + underlying XML parsers support this functionality. + + When the parser is instantiated it is ready to begin accepting + data from the feed method immediately. After parsing has been + finished with a call to close the reset method must be called to + make the parser ready to accept new data, either from feed or + using the parse method. + + Note that these methods must _not_ be called during parsing, that + is, after parse has been called and before it returns. + + By default, the class also implements the parse method of the XMLReader + interface using the feed, close and reset methods of the + IncrementalParser interface as a convenience to SAX 2.0 driver + writers.""" + + def __init__(self, bufsize=2**16): + self._bufsize = bufsize + XMLReader.__init__(self) + + def parse(self, source): + from . import saxutils + source = saxutils.prepare_input_source(source) + + self.prepareParser(source) + file = source.getCharacterStream() + if file is None: + file = source.getByteStream() + while buffer := file.read(self._bufsize): + self.feed(buffer) + self.close() + + def feed(self, data): + """This method gives the raw XML data in the data parameter to + the parser and makes it parse the data, emitting the + corresponding events. It is allowed for XML constructs to be + split across several calls to feed. + + feed may raise SAXException.""" + raise NotImplementedError("This method must be implemented!") + + def prepareParser(self, source): + """This method is called by the parse implementation to allow + the SAX 2.0 driver to prepare itself for parsing.""" + raise NotImplementedError("prepareParser must be overridden!") + + def close(self): + """This method is called when the entire XML document has been + passed to the parser through the feed method, to notify the + parser that there are no more data. This allows the parser to + do the final checks on the document and empty the internal + data buffer. + + The parser will not be ready to parse another document until + the reset method has been called. + + close may raise SAXException.""" + raise NotImplementedError("This method must be implemented!") + + def reset(self): + """This method is called after close has been called to reset + the parser so that it is ready to parse new documents. The + results of calling parse or feed after close without calling + reset are undefined.""" + raise NotImplementedError("This method must be implemented!") + +# ===== LOCATOR ===== + +class Locator: + """Interface for associating a SAX event with a document + location. A locator object will return valid results only during + calls to DocumentHandler methods; at any other time, the + results are unpredictable.""" + + def getColumnNumber(self): + "Return the column number where the current event ends." + return -1 + + def getLineNumber(self): + "Return the line number where the current event ends." + return -1 + + def getPublicId(self): + "Return the public identifier for the current event." + return None + + def getSystemId(self): + "Return the system identifier for the current event." + return None + +# ===== INPUTSOURCE ===== + +class InputSource: + """Encapsulation of the information needed by the XMLReader to + read entities. + + This class may include information about the public identifier, + system identifier, byte stream (possibly with character encoding + information) and/or the character stream of an entity. + + Applications will create objects of this class for use in the + XMLReader.parse method and for returning from + EntityResolver.resolveEntity. + + An InputSource belongs to the application, the XMLReader is not + allowed to modify InputSource objects passed to it from the + application, although it may make copies and modify those.""" + + def __init__(self, system_id = None): + self.__system_id = system_id + self.__public_id = None + self.__encoding = None + self.__bytefile = None + self.__charfile = None + + def setPublicId(self, public_id): + "Sets the public identifier of this InputSource." + self.__public_id = public_id + + def getPublicId(self): + "Returns the public identifier of this InputSource." + return self.__public_id + + def setSystemId(self, system_id): + "Sets the system identifier of this InputSource." + self.__system_id = system_id + + def getSystemId(self): + "Returns the system identifier of this InputSource." + return self.__system_id + + def setEncoding(self, encoding): + """Sets the character encoding of this InputSource. + + The encoding must be a string acceptable for an XML encoding + declaration (see section 4.3.3 of the XML recommendation). + + The encoding attribute of the InputSource is ignored if the + InputSource also contains a character stream.""" + self.__encoding = encoding + + def getEncoding(self): + "Get the character encoding of this InputSource." + return self.__encoding + + def setByteStream(self, bytefile): + """Set the byte stream (a Python file-like object which does + not perform byte-to-character conversion) for this input + source. + + The SAX parser will ignore this if there is also a character + stream specified, but it will use a byte stream in preference + to opening a URI connection itself. + + If the application knows the character encoding of the byte + stream, it should set it with the setEncoding method.""" + self.__bytefile = bytefile + + def getByteStream(self): + """Get the byte stream for this input source. + + The getEncoding method will return the character encoding for + this byte stream, or None if unknown.""" + return self.__bytefile + + def setCharacterStream(self, charfile): + """Set the character stream for this input source. (The stream + must be a Python 2.0 Unicode-wrapped file-like that performs + conversion to Unicode strings.) + + If there is a character stream specified, the SAX parser will + ignore any byte stream and will not attempt to open a URI + connection to the system identifier.""" + self.__charfile = charfile + + def getCharacterStream(self): + "Get the character stream for this input source." + return self.__charfile + +# ===== ATTRIBUTESIMPL ===== + +class AttributesImpl: + + def __init__(self, attrs): + """Non-NS-aware implementation. + + attrs should be of the form {name : value}.""" + self._attrs = attrs + + def getLength(self): + return len(self._attrs) + + def getType(self, name): + return "CDATA" + + def getValue(self, name): + return self._attrs[name] + + def getValueByQName(self, name): + return self._attrs[name] + + def getNameByQName(self, name): + if name not in self._attrs: + raise KeyError(name) + return name + + def getQNameByName(self, name): + if name not in self._attrs: + raise KeyError(name) + return name + + def getNames(self): + return list(self._attrs.keys()) + + def getQNames(self): + return list(self._attrs.keys()) + + def __len__(self): + return len(self._attrs) + + def __getitem__(self, name): + return self._attrs[name] + + def keys(self): + return list(self._attrs.keys()) + + def __contains__(self, name): + return name in self._attrs + + def get(self, name, alternative=None): + return self._attrs.get(name, alternative) + + def copy(self): + return self.__class__(self._attrs) + + def items(self): + return list(self._attrs.items()) + + def values(self): + return list(self._attrs.values()) + +# ===== ATTRIBUTESNSIMPL ===== + +class AttributesNSImpl(AttributesImpl): + + def __init__(self, attrs, qnames): + """NS-aware implementation. + + attrs should be of the form {(ns_uri, lname): value, ...}. + qnames of the form {(ns_uri, lname): qname, ...}.""" + self._attrs = attrs + self._qnames = qnames + + def getValueByQName(self, name): + for (nsname, qname) in self._qnames.items(): + if qname == name: + return self._attrs[nsname] + + raise KeyError(name) + + def getNameByQName(self, name): + for (nsname, qname) in self._qnames.items(): + if qname == name: + return nsname + + raise KeyError(name) + + def getQNameByName(self, name): + return self._qnames[name] + + def getQNames(self): + return list(self._qnames.values()) + + def copy(self): + return self.__class__(self._attrs, self._qnames) + + +def _test(): + XMLReader() + IncrementalParser() + Locator() + +if __name__ == "__main__": + _test() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xmlrpc/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xmlrpc/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2b4033ccd9117734d007af271de99e8ba59b01fa Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xmlrpc/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xmlrpc/__pycache__/client.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xmlrpc/__pycache__/client.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e79095ba7cb234466ecb371169c34726c39ad42f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xmlrpc/__pycache__/client.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xmlrpc/__pycache__/server.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xmlrpc/__pycache__/server.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4b3f9ac0a48f71fc470d2f36dfb6e3fa96dab57b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/xmlrpc/__pycache__/server.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zipfile/__pycache__/__main__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zipfile/__pycache__/__main__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2b9db9b608237d6e3f6caa242c84bf791deaa335 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zipfile/__pycache__/__main__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zipfile/_path/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zipfile/_path/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..80f5d607731fd78a3706f1be1885b4dc30ded7c9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zipfile/_path/__init__.py @@ -0,0 +1,452 @@ +""" +A Path-like interface for zipfiles. + +This codebase is shared between zipfile.Path in the stdlib +and zipp in PyPI. See +https://github.com/python/importlib_metadata/wiki/Development-Methodology +for more detail. +""" + +import contextlib +import io +import itertools +import pathlib +import posixpath +import re +import stat +import sys +import zipfile + +from .glob import Translator + +__all__ = ['Path'] + + +def _parents(path): + """ + Given a path with elements separated by + posixpath.sep, generate all parents of that path. + + >>> list(_parents('b/d')) + ['b'] + >>> list(_parents('/b/d/')) + ['/b'] + >>> list(_parents('b/d/f/')) + ['b/d', 'b'] + >>> list(_parents('b')) + [] + >>> list(_parents('')) + [] + """ + return itertools.islice(_ancestry(path), 1, None) + + +def _ancestry(path): + """ + Given a path with elements separated by + posixpath.sep, generate all elements of that path. + + >>> list(_ancestry('b/d')) + ['b/d', 'b'] + >>> list(_ancestry('/b/d/')) + ['/b/d', '/b'] + >>> list(_ancestry('b/d/f/')) + ['b/d/f', 'b/d', 'b'] + >>> list(_ancestry('b')) + ['b'] + >>> list(_ancestry('')) + [] + + Multiple separators are treated like a single. + + >>> list(_ancestry('//b//d///f//')) + ['//b//d///f', '//b//d', '//b'] + """ + path = path.rstrip(posixpath.sep) + while path.rstrip(posixpath.sep): + yield path + path, tail = posixpath.split(path) + + +_dedupe = dict.fromkeys +"""Deduplicate an iterable in original order""" + + +def _difference(minuend, subtrahend): + """ + Return items in minuend not in subtrahend, retaining order + with O(1) lookup. + """ + return itertools.filterfalse(set(subtrahend).__contains__, minuend) + + +class InitializedState: + """ + Mix-in to save the initialization state for pickling. + """ + + def __init__(self, *args, **kwargs): + self.__args = args + self.__kwargs = kwargs + super().__init__(*args, **kwargs) + + def __getstate__(self): + return self.__args, self.__kwargs + + def __setstate__(self, state): + args, kwargs = state + super().__init__(*args, **kwargs) + + +class CompleteDirs(InitializedState, zipfile.ZipFile): + """ + A ZipFile subclass that ensures that implied directories + are always included in the namelist. + + >>> list(CompleteDirs._implied_dirs(['foo/bar.txt', 'foo/bar/baz.txt'])) + ['foo/', 'foo/bar/'] + >>> list(CompleteDirs._implied_dirs(['foo/bar.txt', 'foo/bar/baz.txt', 'foo/bar/'])) + ['foo/'] + """ + + @staticmethod + def _implied_dirs(names): + parents = itertools.chain.from_iterable(map(_parents, names)) + as_dirs = (p + posixpath.sep for p in parents) + return _dedupe(_difference(as_dirs, names)) + + def namelist(self): + names = super().namelist() + return names + list(self._implied_dirs(names)) + + def _name_set(self): + return set(self.namelist()) + + def resolve_dir(self, name): + """ + If the name represents a directory, return that name + as a directory (with the trailing slash). + """ + names = self._name_set() + dirname = name + '/' + dir_match = name not in names and dirname in names + return dirname if dir_match else name + + def getinfo(self, name): + """ + Supplement getinfo for implied dirs. + """ + try: + return super().getinfo(name) + except KeyError: + if not name.endswith('/') or name not in self._name_set(): + raise + return zipfile.ZipInfo(filename=name) + + @classmethod + def make(cls, source): + """ + Given a source (filename or zipfile), return an + appropriate CompleteDirs subclass. + """ + if isinstance(source, CompleteDirs): + return source + + if not isinstance(source, zipfile.ZipFile): + return cls(source) + + # Only allow for FastLookup when supplied zipfile is read-only + if 'r' not in source.mode: + cls = CompleteDirs + + source.__class__ = cls + return source + + @classmethod + def inject(cls, zf: zipfile.ZipFile) -> zipfile.ZipFile: + """ + Given a writable zip file zf, inject directory entries for + any directories implied by the presence of children. + """ + for name in cls._implied_dirs(zf.namelist()): + zf.writestr(name, b"") + return zf + + +class FastLookup(CompleteDirs): + """ + ZipFile subclass to ensure implicit + dirs exist and are resolved rapidly. + """ + + def namelist(self): + with contextlib.suppress(AttributeError): + return self.__names + self.__names = super().namelist() + return self.__names + + def _name_set(self): + with contextlib.suppress(AttributeError): + return self.__lookup + self.__lookup = super()._name_set() + return self.__lookup + +def _extract_text_encoding(encoding=None, *args, **kwargs): + # compute stack level so that the caller of the caller sees any warning. + is_pypy = sys.implementation.name == 'pypy' + # PyPy no longer special cased after 7.3.19 (or maybe 7.3.18) + # See jaraco/zipp#143 + is_old_pypi = is_pypy and sys.pypy_version_info < (7, 3, 19) + stack_level = 3 + is_old_pypi + return io.text_encoding(encoding, stack_level), args, kwargs + + +class Path: + """ + A :class:`importlib.resources.abc.Traversable` interface for zip files. + + Implements many of the features users enjoy from + :class:`pathlib.Path`. + + Consider a zip file with this structure:: + + . + ├── a.txt + └── b + ├── c.txt + └── d + └── e.txt + + >>> data = io.BytesIO() + >>> zf = ZipFile(data, 'w') + >>> zf.writestr('a.txt', 'content of a') + >>> zf.writestr('b/c.txt', 'content of c') + >>> zf.writestr('b/d/e.txt', 'content of e') + >>> zf.filename = 'mem/abcde.zip' + + Path accepts the zipfile object itself or a filename + + >>> path = Path(zf) + + From there, several path operations are available. + + Directory iteration (including the zip file itself): + + >>> a, b = path.iterdir() + >>> a + Path('mem/abcde.zip', 'a.txt') + >>> b + Path('mem/abcde.zip', 'b/') + + name property: + + >>> b.name + 'b' + + join with divide operator: + + >>> c = b / 'c.txt' + >>> c + Path('mem/abcde.zip', 'b/c.txt') + >>> c.name + 'c.txt' + + Read text: + + >>> c.read_text(encoding='utf-8') + 'content of c' + + existence: + + >>> c.exists() + True + >>> (b / 'missing.txt').exists() + False + + Coercion to string: + + >>> import os + >>> str(c).replace(os.sep, posixpath.sep) + 'mem/abcde.zip/b/c.txt' + + At the root, ``name``, ``filename``, and ``parent`` + resolve to the zipfile. + + >>> str(path) + 'mem/abcde.zip/' + >>> path.name + 'abcde.zip' + >>> path.filename == pathlib.Path('mem/abcde.zip') + True + >>> str(path.parent) + 'mem' + + If the zipfile has no filename, such attributes are not + valid and accessing them will raise an Exception. + + >>> zf.filename = None + >>> path.name + Traceback (most recent call last): + ... + TypeError: ... + + >>> path.filename + Traceback (most recent call last): + ... + TypeError: ... + + >>> path.parent + Traceback (most recent call last): + ... + TypeError: ... + + # workaround python/cpython#106763 + >>> pass + """ + + __repr = "{self.__class__.__name__}({self.root.filename!r}, {self.at!r})" + + def __init__(self, root, at=""): + """ + Construct a Path from a ZipFile or filename. + + Note: When the source is an existing ZipFile object, + its type (__class__) will be mutated to a + specialized type. If the caller wishes to retain the + original type, the caller should either create a + separate ZipFile object or pass a filename. + """ + self.root = FastLookup.make(root) + self.at = at + + def __eq__(self, other): + """ + >>> Path(zipfile.ZipFile(io.BytesIO(), 'w')) == 'foo' + False + """ + if self.__class__ is not other.__class__: + return NotImplemented + return (self.root, self.at) == (other.root, other.at) + + def __hash__(self): + return hash((self.root, self.at)) + + def open(self, mode='r', *args, pwd=None, **kwargs): + """ + Open this entry as text or binary following the semantics + of ``pathlib.Path.open()`` by passing arguments through + to io.TextIOWrapper(). + """ + if self.is_dir(): + raise IsADirectoryError(self) + zip_mode = mode[0] + if zip_mode == 'r' and not self.exists(): + raise FileNotFoundError(self) + stream = self.root.open(self.at, zip_mode, pwd=pwd) + if 'b' in mode: + if args or kwargs: + raise ValueError("encoding args invalid for binary operation") + return stream + # Text mode: + encoding, args, kwargs = _extract_text_encoding(*args, **kwargs) + return io.TextIOWrapper(stream, encoding, *args, **kwargs) + + def _base(self): + return pathlib.PurePosixPath(self.at) if self.at else self.filename + + @property + def name(self): + return self._base().name + + @property + def suffix(self): + return self._base().suffix + + @property + def suffixes(self): + return self._base().suffixes + + @property + def stem(self): + return self._base().stem + + @property + def filename(self): + return pathlib.Path(self.root.filename).joinpath(self.at) + + def read_text(self, *args, **kwargs): + encoding, args, kwargs = _extract_text_encoding(*args, **kwargs) + with self.open('r', encoding, *args, **kwargs) as strm: + return strm.read() + + def read_bytes(self): + with self.open('rb') as strm: + return strm.read() + + def _is_child(self, path): + return posixpath.dirname(path.at.rstrip("/")) == self.at.rstrip("/") + + def _next(self, at): + return self.__class__(self.root, at) + + def is_dir(self): + return not self.at or self.at.endswith("/") + + def is_file(self): + return self.exists() and not self.is_dir() + + def exists(self): + return self.at in self.root._name_set() + + def iterdir(self): + if not self.is_dir(): + raise ValueError("Can't listdir a file") + subs = map(self._next, self.root.namelist()) + return filter(self._is_child, subs) + + def match(self, path_pattern): + return pathlib.PurePosixPath(self.at).match(path_pattern) + + def is_symlink(self): + """ + Return whether this path is a symlink. + """ + info = self.root.getinfo(self.at) + mode = info.external_attr >> 16 + return stat.S_ISLNK(mode) + + def glob(self, pattern): + if not pattern: + raise ValueError(f"Unacceptable pattern: {pattern!r}") + + prefix = re.escape(self.at) + tr = Translator(seps='/') + matches = re.compile(prefix + tr.translate(pattern)).fullmatch + return map(self._next, filter(matches, self.root.namelist())) + + def rglob(self, pattern): + return self.glob(f'**/{pattern}') + + def relative_to(self, other, *extra): + return posixpath.relpath(str(self), str(other.joinpath(*extra))) + + def __str__(self): + return posixpath.join(self.root.filename, self.at) + + def __repr__(self): + return self.__repr.format(self=self) + + def joinpath(self, *other): + next = posixpath.join(self.at, *other) + return self._next(self.root.resolve_dir(next)) + + __truediv__ = joinpath + + @property + def parent(self): + if not self.at: + return self.filename.parent + parent_at = posixpath.dirname(self.at.rstrip('/')) + if parent_at: + parent_at += '/' + return self._next(parent_at) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zipfile/_path/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zipfile/_path/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2c917987b63d4f1440af61bdb8f6142ce02295d2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zipfile/_path/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zipfile/_path/__pycache__/glob.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zipfile/_path/__pycache__/glob.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d228534bd1c8af793849a3346ed12ad398b10c15 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zipfile/_path/__pycache__/glob.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zipfile/_path/glob.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zipfile/_path/glob.py new file mode 100644 index 0000000000000000000000000000000000000000..bd2839304b7db2a628c7d3785f1d0a0d316424f8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zipfile/_path/glob.py @@ -0,0 +1,113 @@ +import os +import re + +_default_seps = os.sep + str(os.altsep) * bool(os.altsep) + + +class Translator: + """ + >>> Translator('xyz') + Traceback (most recent call last): + ... + AssertionError: Invalid separators + + >>> Translator('') + Traceback (most recent call last): + ... + AssertionError: Invalid separators + """ + + seps: str + + def __init__(self, seps: str = _default_seps): + assert seps and set(seps) <= set(_default_seps), "Invalid separators" + self.seps = seps + + def translate(self, pattern): + """ + Given a glob pattern, produce a regex that matches it. + """ + return self.extend(self.match_dirs(self.translate_core(pattern))) + + def extend(self, pattern): + r""" + Extend regex for pattern-wide concerns. + + Apply '(?s:)' to create a non-matching group that + matches newlines (valid on Unix). + + Append '\z' to imply fullmatch even when match is used. + """ + return rf'(?s:{pattern})\z' + + def match_dirs(self, pattern): + """ + Ensure that zipfile.Path directory names are matched. + + zipfile.Path directory names always end in a slash. + """ + return rf'{pattern}[/]?' + + def translate_core(self, pattern): + r""" + Given a glob pattern, produce a regex that matches it. + + >>> t = Translator() + >>> t.translate_core('*.txt').replace('\\\\', '') + '[^/]*\\.txt' + >>> t.translate_core('a?txt') + 'a[^/]txt' + >>> t.translate_core('**/*').replace('\\\\', '') + '.*/[^/][^/]*' + """ + self.restrict_rglob(pattern) + return ''.join(map(self.replace, separate(self.star_not_empty(pattern)))) + + def replace(self, match): + """ + Perform the replacements for a match from :func:`separate`. + """ + return match.group('set') or ( + re.escape(match.group(0)) + .replace('\\*\\*', r'.*') + .replace('\\*', rf'[^{re.escape(self.seps)}]*') + .replace('\\?', r'[^/]') + ) + + def restrict_rglob(self, pattern): + """ + Raise ValueError if ** appears in anything but a full path segment. + + >>> Translator().translate('**foo') + Traceback (most recent call last): + ... + ValueError: ** must appear alone in a path segment + """ + seps_pattern = rf'[{re.escape(self.seps)}]+' + segments = re.split(seps_pattern, pattern) + if any('**' in segment and segment != '**' for segment in segments): + raise ValueError("** must appear alone in a path segment") + + def star_not_empty(self, pattern): + """ + Ensure that * will not match an empty segment. + """ + + def handle_segment(match): + segment = match.group(0) + return '?*' if segment == '*' else segment + + not_seps_pattern = rf'[^{re.escape(self.seps)}]+' + return re.sub(not_seps_pattern, handle_segment, pattern) + + +def separate(pattern): + """ + Separate out character sets to avoid translating their contents. + + >>> [m.group(0) for m in separate('*.txt')] + ['*.txt'] + >>> [m.group(0) for m in separate('a[?]txt')] + ['a', '[?]', 'txt'] + """ + return re.finditer(r'([^\[]+)|(?P[\[].*?[\]])|([\[][^\]]*$)', pattern) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zoneinfo/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zoneinfo/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..db075922d4e139354278511928f6854ae3b0e23e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zoneinfo/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zoneinfo/__pycache__/_common.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zoneinfo/__pycache__/_common.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a3300d04e99d029195c43aabda0c0d4a8406c296 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zoneinfo/__pycache__/_common.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zoneinfo/__pycache__/_tzpath.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zoneinfo/__pycache__/_tzpath.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c0976420da5bb00feffe44ac985d8038335b37d4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zoneinfo/__pycache__/_tzpath.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zoneinfo/__pycache__/_zoneinfo.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zoneinfo/__pycache__/_zoneinfo.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..05ccf6950cf2aa2e259792c6e93854c82852c40d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zoneinfo/__pycache__/_zoneinfo.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/abstract.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/abstract.h new file mode 100644 index 0000000000000000000000000000000000000000..ffd19ccd3500fac847eb379eaed953aa67d12bec --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/abstract.h @@ -0,0 +1,104 @@ +#ifndef Py_CPYTHON_ABSTRACTOBJECT_H +# error "this header file must not be included directly" +#endif + +/* === Object Protocol ================================================== */ + +/* Like PyObject_CallMethod(), but expect a _Py_Identifier* + as the method name. */ +PyAPI_FUNC(PyObject*) _PyObject_CallMethodId( + PyObject *obj, + _Py_Identifier *name, + const char *format, ...); + +/* Convert keyword arguments from the FASTCALL (stack: C array, kwnames: tuple) + format to a Python dictionary ("kwargs" dict). + + The type of kwnames keys is not checked. The final function getting + arguments is responsible to check if all keys are strings, for example using + PyArg_ParseTupleAndKeywords() or PyArg_ValidateKeywordArguments(). + + Duplicate keys are merged using the last value. If duplicate keys must raise + an exception, the caller is responsible to implement an explicit keys on + kwnames. */ +PyAPI_FUNC(PyObject*) _PyStack_AsDict(PyObject *const *values, PyObject *kwnames); + + +/* === Vectorcall protocol (PEP 590) ============================= */ + +// PyVectorcall_NARGS() is exported as a function for the stable ABI. +// Here (when we are not using the stable ABI), the name is overridden to +// call a static inline function for best performance. +static inline Py_ssize_t +_PyVectorcall_NARGS(size_t n) +{ + return n & ~PY_VECTORCALL_ARGUMENTS_OFFSET; +} +#define PyVectorcall_NARGS(n) _PyVectorcall_NARGS(n) + +PyAPI_FUNC(vectorcallfunc) PyVectorcall_Function(PyObject *callable); + +// Backwards compatibility aliases (PEP 590) for API that was provisional +// in Python 3.8 +#define _PyObject_Vectorcall PyObject_Vectorcall +#define _PyObject_VectorcallMethod PyObject_VectorcallMethod +#define _PyObject_FastCallDict PyObject_VectorcallDict +#define _PyVectorcall_Function PyVectorcall_Function +#define _PyObject_CallOneArg PyObject_CallOneArg +#define _PyObject_CallMethodNoArgs PyObject_CallMethodNoArgs +#define _PyObject_CallMethodOneArg PyObject_CallMethodOneArg + +/* Same as PyObject_Vectorcall except that keyword arguments are passed as + dict, which may be NULL if there are no keyword arguments. */ +PyAPI_FUNC(PyObject *) PyObject_VectorcallDict( + PyObject *callable, + PyObject *const *args, + size_t nargsf, + PyObject *kwargs); + +PyAPI_FUNC(PyObject *) PyObject_CallOneArg(PyObject *func, PyObject *arg); + +static inline PyObject * +PyObject_CallMethodNoArgs(PyObject *self, PyObject *name) +{ + size_t nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET; + return PyObject_VectorcallMethod(name, &self, nargsf, _Py_NULL); +} + +static inline PyObject * +PyObject_CallMethodOneArg(PyObject *self, PyObject *name, PyObject *arg) +{ + PyObject *args[2] = {self, arg}; + size_t nargsf = 2 | PY_VECTORCALL_ARGUMENTS_OFFSET; + assert(arg != NULL); + return PyObject_VectorcallMethod(name, args, nargsf, _Py_NULL); +} + +/* Guess the size of object 'o' using len(o) or o.__length_hint__(). + If neither of those return a non-negative value, then return the default + value. If one of the calls fails, this function returns -1. */ +PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t); + +/* === Sequence protocol ================================================ */ + +/* Assume tp_as_sequence and sq_item exist and that 'i' does not + need to be corrected for a negative index. */ +#define PySequence_ITEM(o, i)\ + ( Py_TYPE(o)->tp_as_sequence->sq_item((o), (i)) ) + +/* Return the size of the sequence 'o', assuming that 'o' was returned by + PySequence_Fast and is not NULL. */ +#define PySequence_Fast_GET_SIZE(o) \ + (PyList_Check(o) ? PyList_GET_SIZE(o) : PyTuple_GET_SIZE(o)) + +/* Return the 'i'-th element of the sequence 'o', assuming that o was returned + by PySequence_Fast, and that i is within bounds. */ +#define PySequence_Fast_GET_ITEM(o, i)\ + (PyList_Check(o) ? PyList_GET_ITEM((o), (i)) : PyTuple_GET_ITEM((o), (i))) + +/* Return a pointer to the underlying item array for + an object returned by PySequence_Fast */ +#define PySequence_Fast_ITEMS(sf) \ + (PyList_Check(sf) ? ((PyListObject *)(sf))->ob_item \ + : ((PyTupleObject *)(sf))->ob_item) + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/audit.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/audit.h new file mode 100644 index 0000000000000000000000000000000000000000..536f92486320974bea1a70786a36bbdbec68d902 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/audit.h @@ -0,0 +1,8 @@ +#ifndef _Py_CPYTHON_AUDIT_H +# error "this header file must not be included directly" +#endif + + +typedef int(*Py_AuditHookFunction)(const char *, PyObject *, void *); + +PyAPI_FUNC(int) PySys_AddAuditHook(Py_AuditHookFunction, void*); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/bytearrayobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/bytearrayobject.h new file mode 100644 index 0000000000000000000000000000000000000000..4dddef713ce0970abc2acb2302c63469538edbe0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/bytearrayobject.h @@ -0,0 +1,38 @@ +#ifndef Py_CPYTHON_BYTEARRAYOBJECT_H +# error "this header file must not be included directly" +#endif + +/* Object layout */ +typedef struct { + PyObject_VAR_HEAD + Py_ssize_t ob_alloc; /* How many bytes allocated in ob_bytes */ + char *ob_bytes; /* Physical backing buffer */ + char *ob_start; /* Logical start inside ob_bytes */ + Py_ssize_t ob_exports; /* How many buffer exports */ +} PyByteArrayObject; + +PyAPI_DATA(char) _PyByteArray_empty_string[]; + +/* Macros and static inline functions, trading safety for speed */ +#define _PyByteArray_CAST(op) \ + (assert(PyByteArray_Check(op)), _Py_CAST(PyByteArrayObject*, op)) + +static inline char* PyByteArray_AS_STRING(PyObject *op) +{ + PyByteArrayObject *self = _PyByteArray_CAST(op); + if (Py_SIZE(self)) { + return self->ob_start; + } + return _PyByteArray_empty_string; +} +#define PyByteArray_AS_STRING(self) PyByteArray_AS_STRING(_PyObject_CAST(self)) + +static inline Py_ssize_t PyByteArray_GET_SIZE(PyObject *op) { + PyByteArrayObject *self = _PyByteArray_CAST(op); +#ifdef Py_GIL_DISABLED + return _Py_atomic_load_ssize_relaxed(&(_PyVarObject_CAST(self)->ob_size)); +#else + return Py_SIZE(self); +#endif +} +#define PyByteArray_GET_SIZE(self) PyByteArray_GET_SIZE(_PyObject_CAST(self)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/bytesobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/bytesobject.h new file mode 100644 index 0000000000000000000000000000000000000000..71c133f173f157ffe85fa2fe09dfaf526a093216 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/bytesobject.h @@ -0,0 +1,42 @@ +#ifndef Py_CPYTHON_BYTESOBJECT_H +# error "this header file must not be included directly" +#endif + +typedef struct { + PyObject_VAR_HEAD + Py_DEPRECATED(3.11) Py_hash_t ob_shash; + char ob_sval[1]; + + /* Invariants: + * ob_sval contains space for 'ob_size+1' elements. + * ob_sval[ob_size] == 0. + * ob_shash is the hash of the byte string or -1 if not computed yet. + */ +} PyBytesObject; + +PyAPI_FUNC(int) _PyBytes_Resize(PyObject **, Py_ssize_t); + +/* Macros and static inline functions, trading safety for speed */ +#define _PyBytes_CAST(op) \ + (assert(PyBytes_Check(op)), _Py_CAST(PyBytesObject*, op)) + +static inline char* PyBytes_AS_STRING(PyObject *op) +{ + return _PyBytes_CAST(op)->ob_sval; +} +#define PyBytes_AS_STRING(op) PyBytes_AS_STRING(_PyObject_CAST(op)) + +static inline Py_ssize_t PyBytes_GET_SIZE(PyObject *op) { + PyBytesObject *self = _PyBytes_CAST(op); + return Py_SIZE(self); +} +#define PyBytes_GET_SIZE(self) PyBytes_GET_SIZE(_PyObject_CAST(self)) + +PyAPI_FUNC(PyObject*) PyBytes_Join(PyObject *sep, PyObject *iterable); + +// Deprecated alias kept for backward compatibility +Py_DEPRECATED(3.14) static inline PyObject* +_PyBytes_Join(PyObject *sep, PyObject *iterable) +{ + return PyBytes_Join(sep, iterable); +} diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/cellobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/cellobject.h new file mode 100644 index 0000000000000000000000000000000000000000..85a63a13747d872a24df507bc5ef926843632d53 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/cellobject.h @@ -0,0 +1,50 @@ +/* Cell object interface */ + +#ifndef Py_LIMITED_API +#ifndef Py_CELLOBJECT_H +#define Py_CELLOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + PyObject_HEAD + /* Content of the cell or NULL when empty */ + PyObject *ob_ref; +} PyCellObject; + +PyAPI_DATA(PyTypeObject) PyCell_Type; + +#define PyCell_Check(op) Py_IS_TYPE((op), &PyCell_Type) + +PyAPI_FUNC(PyObject *) PyCell_New(PyObject *); +PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *); +PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *); + +static inline PyObject* PyCell_GET(PyObject *op) { + PyObject *res; + PyCellObject *cell; + assert(PyCell_Check(op)); + cell = _Py_CAST(PyCellObject*, op); + Py_BEGIN_CRITICAL_SECTION(cell); + res = cell->ob_ref; + Py_END_CRITICAL_SECTION(); + return res; +} +#define PyCell_GET(op) PyCell_GET(_PyObject_CAST(op)) + +static inline void PyCell_SET(PyObject *op, PyObject *value) { + PyCellObject *cell; + assert(PyCell_Check(op)); + cell = _Py_CAST(PyCellObject*, op); + Py_BEGIN_CRITICAL_SECTION(cell); + cell->ob_ref = value; + Py_END_CRITICAL_SECTION(); +} +#define PyCell_SET(op, value) PyCell_SET(_PyObject_CAST(op), (value)) + +#ifdef __cplusplus +} +#endif +#endif /* !Py_TUPLEOBJECT_H */ +#endif /* Py_LIMITED_API */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/ceval.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/ceval.h new file mode 100644 index 0000000000000000000000000000000000000000..ca8109e3248a8d894a4407ac091a26599e30d44b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/ceval.h @@ -0,0 +1,43 @@ +#ifndef Py_CPYTHON_CEVAL_H +# error "this header file must not be included directly" +#endif + +PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *); +PyAPI_FUNC(void) PyEval_SetProfileAllThreads(Py_tracefunc, PyObject *); +PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *); +PyAPI_FUNC(void) PyEval_SetTraceAllThreads(Py_tracefunc, PyObject *); + +/* Look at the current frame's (if any) code's co_flags, and turn on + the corresponding compiler flags in cf->cf_flags. Return 1 if any + flag was set, else return 0. */ +PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf); + +PyAPI_FUNC(PyObject *) _PyEval_EvalFrameDefault(PyThreadState *tstate, struct _PyInterpreterFrame *f, int exc); + +PyAPI_FUNC(Py_ssize_t) PyUnstable_Eval_RequestCodeExtraIndex(freefunc); +// Old name -- remove when this API changes: +_Py_DEPRECATED_EXTERNALLY(3.12) static inline Py_ssize_t +_PyEval_RequestCodeExtraIndex(freefunc f) { + return PyUnstable_Eval_RequestCodeExtraIndex(f); +} + +PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *); +PyAPI_FUNC(int) _PyEval_SliceIndexNotNone(PyObject *, Py_ssize_t *); + + +// Trampoline API + +typedef struct { + FILE* perf_map; + PyThread_type_lock map_lock; +} PerfMapState; + +PyAPI_FUNC(int) PyUnstable_PerfMapState_Init(void); +PyAPI_FUNC(int) PyUnstable_WritePerfMapEntry( + const void *code_addr, + unsigned int code_size, + const char *entry_name); +PyAPI_FUNC(void) PyUnstable_PerfMapState_Fini(void); +PyAPI_FUNC(int) PyUnstable_CopyPerfMapFile(const char* parent_filename); +PyAPI_FUNC(int) PyUnstable_PerfTrampoline_CompileCode(PyCodeObject *); +PyAPI_FUNC(int) PyUnstable_PerfTrampoline_SetPersistAfterFork(int enable); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/classobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/classobject.h new file mode 100644 index 0000000000000000000000000000000000000000..d7c9ddd1336c46d8a57898cdcfcb0731c0cfb6a9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/classobject.h @@ -0,0 +1,71 @@ +/* Former class object interface -- now only bound methods are here */ + +/* Revealing some structures (not for general use) */ + +#ifndef Py_LIMITED_API +#ifndef Py_CLASSOBJECT_H +#define Py_CLASSOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + PyObject_HEAD + PyObject *im_func; /* The callable object implementing the method */ + PyObject *im_self; /* The instance it is bound to */ + PyObject *im_weakreflist; /* List of weak references */ + vectorcallfunc vectorcall; +} PyMethodObject; + +PyAPI_DATA(PyTypeObject) PyMethod_Type; + +#define PyMethod_Check(op) Py_IS_TYPE((op), &PyMethod_Type) + +PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *); + +PyAPI_FUNC(PyObject *) PyMethod_Function(PyObject *); +PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *); + +#define _PyMethod_CAST(meth) \ + (assert(PyMethod_Check(meth)), _Py_CAST(PyMethodObject*, meth)) + +/* Static inline functions for direct access to these values. + Type checks are *not* done, so use with care. */ +static inline PyObject* PyMethod_GET_FUNCTION(PyObject *meth) { + return _PyMethod_CAST(meth)->im_func; +} +#define PyMethod_GET_FUNCTION(meth) PyMethod_GET_FUNCTION(_PyObject_CAST(meth)) + +static inline PyObject* PyMethod_GET_SELF(PyObject *meth) { + return _PyMethod_CAST(meth)->im_self; +} +#define PyMethod_GET_SELF(meth) PyMethod_GET_SELF(_PyObject_CAST(meth)) + +typedef struct { + PyObject_HEAD + PyObject *func; +} PyInstanceMethodObject; + +PyAPI_DATA(PyTypeObject) PyInstanceMethod_Type; + +#define PyInstanceMethod_Check(op) Py_IS_TYPE((op), &PyInstanceMethod_Type) + +PyAPI_FUNC(PyObject *) PyInstanceMethod_New(PyObject *); +PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *); + +#define _PyInstanceMethod_CAST(meth) \ + (assert(PyInstanceMethod_Check(meth)), \ + _Py_CAST(PyInstanceMethodObject*, meth)) + +/* Static inline function for direct access to these values. + Type checks are *not* done, so use with care. */ +static inline PyObject* PyInstanceMethod_GET_FUNCTION(PyObject *meth) { + return _PyInstanceMethod_CAST(meth)->func; +} +#define PyInstanceMethod_GET_FUNCTION(meth) PyInstanceMethod_GET_FUNCTION(_PyObject_CAST(meth)) + +#ifdef __cplusplus +} +#endif +#endif // !Py_CLASSOBJECT_H +#endif // !Py_LIMITED_API diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/code.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/code.h new file mode 100644 index 0000000000000000000000000000000000000000..3f0dce0345552605b4b38f8d4248ccd973ed75a0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/code.h @@ -0,0 +1,340 @@ +/* Definitions for bytecode */ + +#ifndef Py_LIMITED_API +#ifndef Py_CODE_H +#define Py_CODE_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + PyObject *_co_code; + PyObject *_co_varnames; + PyObject *_co_cellvars; + PyObject *_co_freevars; +} _PyCoCached; + +typedef struct { + int size; + int capacity; + struct _PyExecutorObject *executors[1]; +} _PyExecutorArray; + + +#ifdef Py_GIL_DISABLED + +/* Each thread specializes a thread-local copy of the bytecode in free-threaded + * builds. These copies are stored on the code object in a `_PyCodeArray`. The + * first entry in the array always points to the "main" copy of the bytecode + * that is stored at the end of the code object. + */ +typedef struct { + Py_ssize_t size; + char *entries[1]; +} _PyCodeArray; + +#define _PyCode_DEF_THREAD_LOCAL_BYTECODE() \ + _PyCodeArray *co_tlbc; +#else +#define _PyCode_DEF_THREAD_LOCAL_BYTECODE() +#endif + +// To avoid repeating ourselves in deepfreeze.py, all PyCodeObject members are +// defined in this macro: +#define _PyCode_DEF(SIZE) { \ + PyObject_VAR_HEAD \ + \ + /* Note only the following fields are used in hash and/or comparisons \ + * \ + * - co_name \ + * - co_argcount \ + * - co_posonlyargcount \ + * - co_kwonlyargcount \ + * - co_nlocals \ + * - co_stacksize \ + * - co_flags \ + * - co_firstlineno \ + * - co_consts \ + * - co_names \ + * - co_localsplusnames \ + * This is done to preserve the name and line number for tracebacks \ + * and debuggers; otherwise, constant de-duplication would collapse \ + * identical functions/lambdas defined on different lines. \ + */ \ + \ + /* These fields are set with provided values on new code objects. */ \ + \ + /* The hottest fields (in the eval loop) are grouped here at the top. */ \ + PyObject *co_consts; /* list (constants used) */ \ + PyObject *co_names; /* list of strings (names used) */ \ + PyObject *co_exceptiontable; /* Byte string encoding exception handling \ + table */ \ + int co_flags; /* CO_..., see below */ \ + \ + /* The rest are not so impactful on performance. */ \ + int co_argcount; /* #arguments, except *args */ \ + int co_posonlyargcount; /* #positional only arguments */ \ + int co_kwonlyargcount; /* #keyword only arguments */ \ + int co_stacksize; /* #entries needed for evaluation stack */ \ + int co_firstlineno; /* first source line number */ \ + \ + /* redundant values (derived from co_localsplusnames and \ + co_localspluskinds) */ \ + int co_nlocalsplus; /* number of spaces for holding local, cell, \ + and free variables */ \ + int co_framesize; /* Size of frame in words */ \ + int co_nlocals; /* number of local variables */ \ + int co_ncellvars; /* total number of cell variables */ \ + int co_nfreevars; /* number of free variables */ \ + uint32_t co_version; /* version number */ \ + \ + PyObject *co_localsplusnames; /* tuple mapping offsets to names */ \ + PyObject *co_localspluskinds; /* Bytes mapping to local kinds (one byte \ + per variable) */ \ + PyObject *co_filename; /* unicode (where it was loaded from) */ \ + PyObject *co_name; /* unicode (name, for reference) */ \ + PyObject *co_qualname; /* unicode (qualname, for reference) */ \ + PyObject *co_linetable; /* bytes object that holds location info */ \ + PyObject *co_weakreflist; /* to support weakrefs to code objects */ \ + _PyExecutorArray *co_executors; /* executors from optimizer */ \ + _PyCoCached *_co_cached; /* cached co_* attributes */ \ + uintptr_t _co_instrumentation_version; /* current instrumentation version */ \ + struct _PyCoMonitoringData *_co_monitoring; /* Monitoring data */ \ + Py_ssize_t _co_unique_id; /* ID used for per-thread refcounting */ \ + int _co_firsttraceable; /* index of first traceable instruction */ \ + /* Scratch space for extra data relating to the code object. \ + Type is a void* to keep the format private in codeobject.c to force \ + people to go through the proper APIs. */ \ + void *co_extra; \ + _PyCode_DEF_THREAD_LOCAL_BYTECODE() \ + char co_code_adaptive[(SIZE)]; \ +} + +/* Bytecode object */ +struct PyCodeObject _PyCode_DEF(1); + +/* Masks for co_flags above */ +#define CO_OPTIMIZED 0x0001 +#define CO_NEWLOCALS 0x0002 +#define CO_VARARGS 0x0004 +#define CO_VARKEYWORDS 0x0008 +#define CO_NESTED 0x0010 +#define CO_GENERATOR 0x0020 + +/* The CO_COROUTINE flag is set for coroutine functions (defined with + ``async def`` keywords) */ +#define CO_COROUTINE 0x0080 +#define CO_ITERABLE_COROUTINE 0x0100 +#define CO_ASYNC_GENERATOR 0x0200 + +/* bpo-39562: These constant values are changed in Python 3.9 + to prevent collision with compiler flags. CO_FUTURE_ and PyCF_ + constants must be kept unique. PyCF_ constants can use bits from + 0x0100 to 0x10000. CO_FUTURE_ constants use bits starting at 0x20000. */ +#define CO_FUTURE_DIVISION 0x20000 +#define CO_FUTURE_ABSOLUTE_IMPORT 0x40000 /* do absolute imports by default */ +#define CO_FUTURE_WITH_STATEMENT 0x80000 +#define CO_FUTURE_PRINT_FUNCTION 0x100000 +#define CO_FUTURE_UNICODE_LITERALS 0x200000 + +#define CO_FUTURE_BARRY_AS_BDFL 0x400000 +#define CO_FUTURE_GENERATOR_STOP 0x800000 +#define CO_FUTURE_ANNOTATIONS 0x1000000 + +#define CO_NO_MONITORING_EVENTS 0x2000000 + +/* Whether the code object has a docstring, + If so, it will be the first item in co_consts +*/ +#define CO_HAS_DOCSTRING 0x4000000 + +/* A function defined in class scope */ +#define CO_METHOD 0x8000000 + +/* This should be defined if a future statement modifies the syntax. + For example, when a keyword is added. +*/ +#define PY_PARSER_REQUIRES_FUTURE_KEYWORD + +#define CO_MAXBLOCKS 21 /* Max static block nesting within a function */ + +PyAPI_DATA(PyTypeObject) PyCode_Type; + +#define PyCode_Check(op) Py_IS_TYPE((op), &PyCode_Type) + +static inline Py_ssize_t PyCode_GetNumFree(PyCodeObject *op) { + assert(PyCode_Check(op)); + return op->co_nfreevars; +} + +static inline int PyUnstable_Code_GetFirstFree(PyCodeObject *op) { + assert(PyCode_Check(op)); + return op->co_nlocalsplus - op->co_nfreevars; +} + +Py_DEPRECATED(3.13) static inline int PyCode_GetFirstFree(PyCodeObject *op) { + return PyUnstable_Code_GetFirstFree(op); +} + +/* Unstable public interface */ +PyAPI_FUNC(PyCodeObject *) PyUnstable_Code_New( + int, int, int, int, int, PyObject *, PyObject *, + PyObject *, PyObject *, PyObject *, PyObject *, + PyObject *, PyObject *, PyObject *, int, PyObject *, + PyObject *); + +PyAPI_FUNC(PyCodeObject *) PyUnstable_Code_NewWithPosOnlyArgs( + int, int, int, int, int, int, PyObject *, PyObject *, + PyObject *, PyObject *, PyObject *, PyObject *, + PyObject *, PyObject *, PyObject *, int, PyObject *, + PyObject *); + /* same as struct above */ +// Old names -- remove when this API changes: +_Py_DEPRECATED_EXTERNALLY(3.12) static inline PyCodeObject * +PyCode_New( + int a, int b, int c, int d, int e, PyObject *f, PyObject *g, + PyObject *h, PyObject *i, PyObject *j, PyObject *k, + PyObject *l, PyObject *m, PyObject *n, int o, PyObject *p, + PyObject *q) +{ + return PyUnstable_Code_New( + a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q); +} +_Py_DEPRECATED_EXTERNALLY(3.12) static inline PyCodeObject * +PyCode_NewWithPosOnlyArgs( + int a, int poac, int b, int c, int d, int e, PyObject *f, PyObject *g, + PyObject *h, PyObject *i, PyObject *j, PyObject *k, + PyObject *l, PyObject *m, PyObject *n, int o, PyObject *p, + PyObject *q) +{ + return PyUnstable_Code_NewWithPosOnlyArgs( + a, poac, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q); +} + +/* Creates a new empty code object with the specified source location. */ +PyAPI_FUNC(PyCodeObject *) +PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno); + +/* Return the line number associated with the specified bytecode index + in this code object. If you just need the line number of a frame, + use PyFrame_GetLineNumber() instead. */ +PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int); + +PyAPI_FUNC(int) PyCode_Addr2Location(PyCodeObject *, int, int *, int *, int *, int *); + +#define PY_FOREACH_CODE_EVENT(V) \ + V(CREATE) \ + V(DESTROY) + +typedef enum { + #define PY_DEF_EVENT(op) PY_CODE_EVENT_##op, + PY_FOREACH_CODE_EVENT(PY_DEF_EVENT) + #undef PY_DEF_EVENT +} PyCodeEvent; + + +/* + * A callback that is invoked for different events in a code object's lifecycle. + * + * The callback is invoked with a borrowed reference to co, after it is + * created and before it is destroyed. + * + * If the callback sets an exception, it must return -1. Otherwise + * it should return 0. + */ +typedef int (*PyCode_WatchCallback)( + PyCodeEvent event, + PyCodeObject* co); + +/* + * Register a per-interpreter callback that will be invoked for code object + * lifecycle events. + * + * Returns a handle that may be passed to PyCode_ClearWatcher on success, + * or -1 and sets an error if no more handles are available. + */ +PyAPI_FUNC(int) PyCode_AddWatcher(PyCode_WatchCallback callback); + +/* + * Clear the watcher associated with the watcher_id handle. + * + * Returns 0 on success or -1 if no watcher exists for the provided id. + */ +PyAPI_FUNC(int) PyCode_ClearWatcher(int watcher_id); + +/* for internal use only */ +struct _opaque { + int computed_line; + const uint8_t *lo_next; + const uint8_t *limit; +}; + +typedef struct _line_offsets { + int ar_start; + int ar_end; + int ar_line; + struct _opaque opaque; +} PyCodeAddressRange; + +/* Update *bounds to describe the first and one-past-the-last instructions in the + same line as lasti. Return the number of that line. +*/ +PyAPI_FUNC(int) _PyCode_CheckLineNumber(int lasti, PyCodeAddressRange *bounds); + +/* Create a comparable key used to compare constants taking in account the + * object type. It is used to make sure types are not coerced (e.g., float and + * complex) _and_ to distinguish 0.0 from -0.0 e.g. on IEEE platforms + * + * Return (type(obj), obj, ...): a tuple with variable size (at least 2 items) + * depending on the type and the value. The type is the first item to not + * compare bytes and str which can raise a BytesWarning exception. */ +PyAPI_FUNC(PyObject*) _PyCode_ConstantKey(PyObject *obj); + +PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts, + PyObject *names, PyObject *lnotab); + +PyAPI_FUNC(int) PyUnstable_Code_GetExtra( + PyObject *code, Py_ssize_t index, void **extra); +PyAPI_FUNC(int) PyUnstable_Code_SetExtra( + PyObject *code, Py_ssize_t index, void *extra); +// Old names -- remove when this API changes: +_Py_DEPRECATED_EXTERNALLY(3.12) static inline int +_PyCode_GetExtra(PyObject *code, Py_ssize_t index, void **extra) +{ + return PyUnstable_Code_GetExtra(code, index, extra); +} +_Py_DEPRECATED_EXTERNALLY(3.12) static inline int +_PyCode_SetExtra(PyObject *code, Py_ssize_t index, void *extra) +{ + return PyUnstable_Code_SetExtra(code, index, extra); +} + +/* Equivalent to getattr(code, 'co_code') in Python. + Returns a strong reference to a bytes object. */ +PyAPI_FUNC(PyObject *) PyCode_GetCode(PyCodeObject *code); +/* Equivalent to getattr(code, 'co_varnames') in Python. */ +PyAPI_FUNC(PyObject *) PyCode_GetVarnames(PyCodeObject *code); +/* Equivalent to getattr(code, 'co_cellvars') in Python. */ +PyAPI_FUNC(PyObject *) PyCode_GetCellvars(PyCodeObject *code); +/* Equivalent to getattr(code, 'co_freevars') in Python. */ +PyAPI_FUNC(PyObject *) PyCode_GetFreevars(PyCodeObject *code); + +typedef enum _PyCodeLocationInfoKind { + /* short forms are 0 to 9 */ + PY_CODE_LOCATION_INFO_SHORT0 = 0, + /* one lineforms are 10 to 12 */ + PY_CODE_LOCATION_INFO_ONE_LINE0 = 10, + PY_CODE_LOCATION_INFO_ONE_LINE1 = 11, + PY_CODE_LOCATION_INFO_ONE_LINE2 = 12, + + PY_CODE_LOCATION_INFO_NO_COLUMNS = 13, + PY_CODE_LOCATION_INFO_LONG = 14, + PY_CODE_LOCATION_INFO_NONE = 15 +} _PyCodeLocationInfoKind; + +#ifdef __cplusplus +} +#endif +#endif // !Py_CODE_H +#endif // !Py_LIMITED_API diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/compile.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/compile.h new file mode 100644 index 0000000000000000000000000000000000000000..cfdb7080d45f2b166082df0be2f1508a3eef9946 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/compile.h @@ -0,0 +1,50 @@ +#ifndef Py_CPYTHON_COMPILE_H +# error "this header file must not be included directly" +#endif + +/* Public interface */ +#define PyCF_MASK (CO_FUTURE_DIVISION | CO_FUTURE_ABSOLUTE_IMPORT | \ + CO_FUTURE_WITH_STATEMENT | CO_FUTURE_PRINT_FUNCTION | \ + CO_FUTURE_UNICODE_LITERALS | CO_FUTURE_BARRY_AS_BDFL | \ + CO_FUTURE_GENERATOR_STOP | CO_FUTURE_ANNOTATIONS) +#define PyCF_MASK_OBSOLETE (CO_NESTED) + +/* bpo-39562: CO_FUTURE_ and PyCF_ constants must be kept unique. + PyCF_ constants can use bits from 0x0100 to 0x10000. + CO_FUTURE_ constants use bits starting at 0x20000. */ +#define PyCF_SOURCE_IS_UTF8 0x0100 +#define PyCF_DONT_IMPLY_DEDENT 0x0200 +#define PyCF_ONLY_AST 0x0400 +#define PyCF_IGNORE_COOKIE 0x0800 +#define PyCF_TYPE_COMMENTS 0x1000 +#define PyCF_ALLOW_TOP_LEVEL_AWAIT 0x2000 +#define PyCF_ALLOW_INCOMPLETE_INPUT 0x4000 +#define PyCF_OPTIMIZED_AST (0x8000 | PyCF_ONLY_AST) +#define PyCF_COMPILE_MASK (PyCF_ONLY_AST | PyCF_ALLOW_TOP_LEVEL_AWAIT | \ + PyCF_TYPE_COMMENTS | PyCF_DONT_IMPLY_DEDENT | \ + PyCF_ALLOW_INCOMPLETE_INPUT | PyCF_OPTIMIZED_AST) + +typedef struct { + int cf_flags; /* bitmask of CO_xxx flags relevant to future */ + int cf_feature_version; /* minor Python version (PyCF_ONLY_AST) */ +} PyCompilerFlags; + +#define _PyCompilerFlags_INIT \ + (PyCompilerFlags){.cf_flags = 0, .cf_feature_version = PY_MINOR_VERSION} + +/* Future feature support */ + +#define FUTURE_NESTED_SCOPES "nested_scopes" +#define FUTURE_GENERATORS "generators" +#define FUTURE_DIVISION "division" +#define FUTURE_ABSOLUTE_IMPORT "absolute_import" +#define FUTURE_WITH_STATEMENT "with_statement" +#define FUTURE_PRINT_FUNCTION "print_function" +#define FUTURE_UNICODE_LITERALS "unicode_literals" +#define FUTURE_BARRY_AS_BDFL "barry_as_FLUFL" +#define FUTURE_GENERATOR_STOP "generator_stop" +#define FUTURE_ANNOTATIONS "annotations" + +#define PY_INVALID_STACK_EFFECT INT_MAX +PyAPI_FUNC(int) PyCompile_OpcodeStackEffect(int opcode, int oparg); +PyAPI_FUNC(int) PyCompile_OpcodeStackEffectWithJump(int opcode, int oparg, int jump); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/complexobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/complexobject.h new file mode 100644 index 0000000000000000000000000000000000000000..fbdc6a91fe895c0f7af0bff6a3836a1991709c20 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/complexobject.h @@ -0,0 +1,33 @@ +#ifndef Py_CPYTHON_COMPLEXOBJECT_H +# error "this header file must not be included directly" +#endif + +typedef struct { + double real; + double imag; +} Py_complex; + +// Operations on complex numbers. +PyAPI_FUNC(Py_complex) _Py_c_sum(Py_complex, Py_complex); +PyAPI_FUNC(Py_complex) _Py_c_diff(Py_complex, Py_complex); +PyAPI_FUNC(Py_complex) _Py_c_neg(Py_complex); +PyAPI_FUNC(Py_complex) _Py_c_prod(Py_complex, Py_complex); +PyAPI_FUNC(Py_complex) _Py_c_quot(Py_complex, Py_complex); +PyAPI_FUNC(Py_complex) _Py_c_pow(Py_complex, Py_complex); +PyAPI_FUNC(double) _Py_c_abs(Py_complex); + + +/* Complex object interface */ + +/* +PyComplexObject represents a complex number with double-precision +real and imaginary parts. +*/ +typedef struct { + PyObject_HEAD + Py_complex cval; +} PyComplexObject; + +PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex); + +PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/context.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/context.h new file mode 100644 index 0000000000000000000000000000000000000000..3a7a4b459c09ad04d0dcd469b3cc556c36bf390f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/context.h @@ -0,0 +1,107 @@ +#ifndef Py_LIMITED_API +#ifndef Py_CONTEXT_H +#define Py_CONTEXT_H +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_DATA(PyTypeObject) PyContext_Type; +typedef struct _pycontextobject PyContext; + +PyAPI_DATA(PyTypeObject) PyContextVar_Type; +typedef struct _pycontextvarobject PyContextVar; + +PyAPI_DATA(PyTypeObject) PyContextToken_Type; +typedef struct _pycontexttokenobject PyContextToken; + + +#define PyContext_CheckExact(o) Py_IS_TYPE((o), &PyContext_Type) +#define PyContextVar_CheckExact(o) Py_IS_TYPE((o), &PyContextVar_Type) +#define PyContextToken_CheckExact(o) Py_IS_TYPE((o), &PyContextToken_Type) + + +PyAPI_FUNC(PyObject *) PyContext_New(void); +PyAPI_FUNC(PyObject *) PyContext_Copy(PyObject *); +PyAPI_FUNC(PyObject *) PyContext_CopyCurrent(void); + +PyAPI_FUNC(int) PyContext_Enter(PyObject *); +PyAPI_FUNC(int) PyContext_Exit(PyObject *); + +typedef enum { + /* + * The current context has switched to a different context. The object + * passed to the watch callback is the now-current contextvars.Context + * object, or None if no context is current. + */ + Py_CONTEXT_SWITCHED = 1, +} PyContextEvent; + +/* + * Context object watcher callback function. The object passed to the callback + * is event-specific; see PyContextEvent for details. + * + * if the callback returns with an exception set, it must return -1. Otherwise + * it should return 0 + */ +typedef int (*PyContext_WatchCallback)(PyContextEvent, PyObject *); + +/* + * Register a per-interpreter callback that will be invoked for context object + * enter/exit events. + * + * Returns a handle that may be passed to PyContext_ClearWatcher on success, + * or -1 and sets and error if no more handles are available. + */ +PyAPI_FUNC(int) PyContext_AddWatcher(PyContext_WatchCallback callback); + +/* + * Clear the watcher associated with the watcher_id handle. + * + * Returns 0 on success or -1 if no watcher exists for the provided id. + */ +PyAPI_FUNC(int) PyContext_ClearWatcher(int watcher_id); + +/* Create a new context variable. + + default_value can be NULL. +*/ +PyAPI_FUNC(PyObject *) PyContextVar_New( + const char *name, PyObject *default_value); + + +/* Get a value for the variable. + + Returns -1 if an error occurred during lookup. + + Returns 0 if value either was or was not found. + + If value was found, *value will point to it. + If not, it will point to: + + - default_value, if not NULL; + - the default value of "var", if not NULL; + - NULL. + + '*value' will be a new ref, if not NULL. +*/ +PyAPI_FUNC(int) PyContextVar_Get( + PyObject *var, PyObject *default_value, PyObject **value); + + +/* Set a new value for the variable. + Returns NULL if an error occurs. +*/ +PyAPI_FUNC(PyObject *) PyContextVar_Set(PyObject *var, PyObject *value); + + +/* Reset a variable to its previous value. + Returns 0 on success, -1 on error. +*/ +PyAPI_FUNC(int) PyContextVar_Reset(PyObject *var, PyObject *token); + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_CONTEXT_H */ +#endif /* !Py_LIMITED_API */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/critical_section.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/critical_section.h new file mode 100644 index 0000000000000000000000000000000000000000..4fc46fefb93a24a5f385a38f4cfe9b108263e209 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/critical_section.h @@ -0,0 +1,154 @@ +#ifndef Py_CPYTHON_CRITICAL_SECTION_H +# error "this header file must not be included directly" +#endif + +// Python critical sections +// +// Conceptually, critical sections are a deadlock avoidance layer on top of +// per-object locks. These helpers, in combination with those locks, replace +// our usage of the global interpreter lock to provide thread-safety for +// otherwise thread-unsafe objects, such as dict. +// +// NOTE: These APIs are no-ops in non-free-threaded builds. +// +// Straightforward per-object locking could introduce deadlocks that were not +// present when running with the GIL. Threads may hold locks for multiple +// objects simultaneously because Python operations can nest. If threads were +// to acquire the same locks in different orders, they would deadlock. +// +// One way to avoid deadlocks is to allow threads to hold only the lock (or +// locks) for a single operation at a time (typically a single lock, but some +// operations involve two locks). When a thread begins a nested operation it +// could suspend the locks for any outer operation: before beginning the nested +// operation, the locks for the outer operation are released and when the +// nested operation completes, the locks for the outer operation are +// reacquired. +// +// To improve performance, this API uses a variation of the above scheme. +// Instead of immediately suspending locks any time a nested operation begins, +// locks are only suspended if the thread would block. This reduces the number +// of lock acquisitions and releases for nested operations, while still +// avoiding deadlocks. +// +// Additionally, the locks for any active operation are suspended around +// other potentially blocking operations, such as I/O. This is because the +// interaction between locks and blocking operations can lead to deadlocks in +// the same way as the interaction between multiple locks. +// +// Each thread's critical sections and their corresponding locks are tracked in +// a stack in `PyThreadState.critical_section`. When a thread calls +// `_PyThreadState_Detach()`, such as before a blocking I/O operation or when +// waiting to acquire a lock, the thread suspends all of its active critical +// sections, temporarily releasing the associated locks. When the thread calls +// `_PyThreadState_Attach()`, it resumes the top-most (i.e., most recent) +// critical section by reacquiring the associated lock or locks. See +// `_PyCriticalSection_Resume()`. +// +// NOTE: Only the top-most critical section is guaranteed to be active. +// Operations that need to lock two objects at once must use +// `Py_BEGIN_CRITICAL_SECTION2()`. You *CANNOT* use nested critical sections +// to lock more than one object at once, because the inner critical section +// may suspend the outer critical sections. This API does not provide a way +// to lock more than two objects at once (though it could be added later +// if actually needed). +// +// NOTE: Critical sections implicitly behave like reentrant locks because +// attempting to acquire the same lock will suspend any outer (earlier) +// critical sections. However, they are less efficient for this use case than +// purposefully designed reentrant locks. +// +// Example usage: +// Py_BEGIN_CRITICAL_SECTION(op); +// ... +// Py_END_CRITICAL_SECTION(); +// +// To lock two objects at once: +// Py_BEGIN_CRITICAL_SECTION2(op1, op2); +// ... +// Py_END_CRITICAL_SECTION2(); + +typedef struct PyCriticalSection PyCriticalSection; +typedef struct PyCriticalSection2 PyCriticalSection2; + +PyAPI_FUNC(void) +PyCriticalSection_Begin(PyCriticalSection *c, PyObject *op); + +PyAPI_FUNC(void) +PyCriticalSection_BeginMutex(PyCriticalSection *c, PyMutex *m); + +PyAPI_FUNC(void) +PyCriticalSection_End(PyCriticalSection *c); + +PyAPI_FUNC(void) +PyCriticalSection2_Begin(PyCriticalSection2 *c, PyObject *a, PyObject *b); + +PyAPI_FUNC(void) +PyCriticalSection2_BeginMutex(PyCriticalSection2 *c, PyMutex *m1, PyMutex *m2); + +PyAPI_FUNC(void) +PyCriticalSection2_End(PyCriticalSection2 *c); + +#ifndef Py_GIL_DISABLED +# define Py_BEGIN_CRITICAL_SECTION(op) \ + { +# define Py_BEGIN_CRITICAL_SECTION_MUTEX(mutex) \ + { +# define Py_END_CRITICAL_SECTION() \ + } +# define Py_BEGIN_CRITICAL_SECTION2(a, b) \ + { +# define Py_BEGIN_CRITICAL_SECTION2_MUTEX(m1, m2) \ + { +# define Py_END_CRITICAL_SECTION2() \ + } +#else /* !Py_GIL_DISABLED */ + +// NOTE: the contents of this struct are private and may change betweeen +// Python releases without a deprecation period. +struct PyCriticalSection { + // Tagged pointer to an outer active critical section (or 0). + uintptr_t _cs_prev; + + // Mutex used to protect critical section + PyMutex *_cs_mutex; +}; + +// A critical section protected by two mutexes. Use +// Py_BEGIN_CRITICAL_SECTION2 and Py_END_CRITICAL_SECTION2. +// NOTE: the contents of this struct are private and may change betweeen +// Python releases without a deprecation period. +struct PyCriticalSection2 { + PyCriticalSection _cs_base; + + PyMutex *_cs_mutex2; +}; + +# define Py_BEGIN_CRITICAL_SECTION(op) \ + { \ + PyCriticalSection _py_cs; \ + PyCriticalSection_Begin(&_py_cs, _PyObject_CAST(op)) + +# define Py_BEGIN_CRITICAL_SECTION_MUTEX(mutex) \ + { \ + PyCriticalSection _py_cs; \ + PyCriticalSection_BeginMutex(&_py_cs, mutex) + +# define Py_END_CRITICAL_SECTION() \ + PyCriticalSection_End(&_py_cs); \ + } + +# define Py_BEGIN_CRITICAL_SECTION2(a, b) \ + { \ + PyCriticalSection2 _py_cs2; \ + PyCriticalSection2_Begin(&_py_cs2, _PyObject_CAST(a), _PyObject_CAST(b)) + +# define Py_BEGIN_CRITICAL_SECTION2_MUTEX(m1, m2) \ + { \ + PyCriticalSection2 _py_cs2; \ + PyCriticalSection2_BeginMutex(&_py_cs2, m1, m2) + +# define Py_END_CRITICAL_SECTION2() \ + PyCriticalSection2_End(&_py_cs2); \ + } + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/descrobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/descrobject.h new file mode 100644 index 0000000000000000000000000000000000000000..bbad8b59c225ab5a8e52493dcebd08ab7499e67e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/descrobject.h @@ -0,0 +1,62 @@ +#ifndef Py_CPYTHON_DESCROBJECT_H +# error "this header file must not be included directly" +#endif + +typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args, + void *wrapped); + +typedef PyObject *(*wrapperfunc_kwds)(PyObject *self, PyObject *args, + void *wrapped, PyObject *kwds); + +struct wrapperbase { + const char *name; + int offset; + void *function; + wrapperfunc wrapper; + const char *doc; + int flags; + PyObject *name_strobj; +}; + +/* Flags for above struct */ +#define PyWrapperFlag_KEYWORDS 1 /* wrapper function takes keyword args */ + +/* Various kinds of descriptor objects */ + +typedef struct { + PyObject_HEAD + PyTypeObject *d_type; + PyObject *d_name; + PyObject *d_qualname; +} PyDescrObject; + +#define PyDescr_COMMON PyDescrObject d_common + +#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) +#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) + +typedef struct { + PyDescr_COMMON; + PyMethodDef *d_method; + vectorcallfunc vectorcall; +} PyMethodDescrObject; + +typedef struct { + PyDescr_COMMON; + PyMemberDef *d_member; +} PyMemberDescrObject; + +typedef struct { + PyDescr_COMMON; + PyGetSetDef *d_getset; +} PyGetSetDescrObject; + +typedef struct { + PyDescr_COMMON; + struct wrapperbase *d_base; + void *d_wrapped; /* This can be any function pointer */ +} PyWrapperDescrObject; + +PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *, + struct wrapperbase *, void *); +PyAPI_FUNC(int) PyDescr_IsData(PyObject *); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/dictobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/dictobject.h new file mode 100644 index 0000000000000000000000000000000000000000..df9ec7050fca1a99f66a4f5c70e60f15ded89ca7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/dictobject.h @@ -0,0 +1,105 @@ +#ifndef Py_CPYTHON_DICTOBJECT_H +# error "this header file must not be included directly" +#endif + +typedef struct _dictkeysobject PyDictKeysObject; +typedef struct _dictvalues PyDictValues; + +/* The ma_values pointer is NULL for a combined table + * or points to an array of PyObject* for a split table + */ +typedef struct { + PyObject_HEAD + + /* Number of items in the dictionary */ + Py_ssize_t ma_used; + + /* This is a private field for CPython's internal use. + * Bits 0-7 are for dict watchers. + * Bits 8-11 are for the watched mutation counter (used by tier2 optimization) + * Bits 12-31 are currently unused + * Bits 32-63 are a unique id in the free threading build (used for per-thread refcounting) + */ + uint64_t _ma_watcher_tag; + + PyDictKeysObject *ma_keys; + + /* If ma_values is NULL, the table is "combined": keys and values + are stored in ma_keys. + + If ma_values is not NULL, the table is split: + keys are stored in ma_keys and values are stored in ma_values */ + PyDictValues *ma_values; +} PyDictObject; + +PyAPI_FUNC(PyObject *) _PyDict_GetItem_KnownHash(PyObject *mp, PyObject *key, + Py_hash_t hash); +// PyDict_GetItemStringRef() can be used instead +Py_DEPRECATED(3.14) PyAPI_FUNC(PyObject *) _PyDict_GetItemStringWithError(PyObject *, const char *); +PyAPI_FUNC(PyObject *) PyDict_SetDefault( + PyObject *mp, PyObject *key, PyObject *defaultobj); + +// Inserts `key` with a value `default_value`, if `key` is not already present +// in the dictionary. If `result` is not NULL, then the value associated +// with `key` is returned in `*result` (either the existing value, or the now +// inserted `default_value`). +// Returns: +// -1 on error +// 0 if `key` was not present and `default_value` was inserted +// 1 if `key` was present and `default_value` was not inserted +PyAPI_FUNC(int) PyDict_SetDefaultRef(PyObject *mp, PyObject *key, PyObject *default_value, PyObject **result); + +/* Get the number of items of a dictionary. */ +static inline Py_ssize_t PyDict_GET_SIZE(PyObject *op) { + PyDictObject *mp; + assert(PyDict_Check(op)); + mp = _Py_CAST(PyDictObject*, op); +#ifdef Py_GIL_DISABLED + return _Py_atomic_load_ssize_relaxed(&mp->ma_used); +#else + return mp->ma_used; +#endif +} +#define PyDict_GET_SIZE(op) PyDict_GET_SIZE(_PyObject_CAST(op)) + +PyAPI_FUNC(int) PyDict_ContainsString(PyObject *mp, const char *key); + +PyAPI_FUNC(PyObject *) _PyDict_NewPresized(Py_ssize_t minused); + +PyAPI_FUNC(int) PyDict_Pop(PyObject *dict, PyObject *key, PyObject **result); +PyAPI_FUNC(int) PyDict_PopString(PyObject *dict, const char *key, PyObject **result); + +// Use PyDict_Pop() instead +Py_DEPRECATED(3.14) PyAPI_FUNC(PyObject *) _PyDict_Pop( + PyObject *dict, + PyObject *key, + PyObject *default_value); + +/* Dictionary watchers */ + +#define PY_FOREACH_DICT_EVENT(V) \ + V(ADDED) \ + V(MODIFIED) \ + V(DELETED) \ + V(CLONED) \ + V(CLEARED) \ + V(DEALLOCATED) + +typedef enum { + #define PY_DEF_EVENT(EVENT) PyDict_EVENT_##EVENT, + PY_FOREACH_DICT_EVENT(PY_DEF_EVENT) + #undef PY_DEF_EVENT +} PyDict_WatchEvent; + +// Callback to be invoked when a watched dict is cleared, dealloced, or modified. +// In clear/dealloc case, key and new_value will be NULL. Otherwise, new_value will be the +// new value for key, NULL if key is being deleted. +typedef int(*PyDict_WatchCallback)(PyDict_WatchEvent event, PyObject* dict, PyObject* key, PyObject* new_value); + +// Register/unregister a dict-watcher callback +PyAPI_FUNC(int) PyDict_AddWatcher(PyDict_WatchCallback callback); +PyAPI_FUNC(int) PyDict_ClearWatcher(int watcher_id); + +// Mark given dictionary as "watched" (callback will be called if it is modified) +PyAPI_FUNC(int) PyDict_Watch(int watcher_id, PyObject* dict); +PyAPI_FUNC(int) PyDict_Unwatch(int watcher_id, PyObject* dict); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/fileobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/fileobject.h new file mode 100644 index 0000000000000000000000000000000000000000..e2d89c522bdd1326b440421c76f4cc0f77d6ba87 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/fileobject.h @@ -0,0 +1,16 @@ +#ifndef Py_CPYTHON_FILEOBJECT_H +# error "this header file must not be included directly" +#endif + +PyAPI_FUNC(char *) Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *); + +/* The std printer acts as a preliminary sys.stderr until the new io + infrastructure is in place. */ +PyAPI_FUNC(PyObject *) PyFile_NewStdPrinter(int); +PyAPI_DATA(PyTypeObject) PyStdPrinter_Type; + +typedef PyObject * (*Py_OpenCodeHookFunction)(PyObject *, void *); + +PyAPI_FUNC(PyObject *) PyFile_OpenCode(const char *utf8path); +PyAPI_FUNC(PyObject *) PyFile_OpenCodeObject(PyObject *path); +PyAPI_FUNC(int) PyFile_SetOpenCodeHook(Py_OpenCodeHookFunction hook, void *userData); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/fileutils.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/fileutils.h new file mode 100644 index 0000000000000000000000000000000000000000..626b1ad57b384688609f0add0a2b52a3bbf8c97a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/fileutils.h @@ -0,0 +1,16 @@ +#ifndef Py_CPYTHON_FILEUTILS_H +# error "this header file must not be included directly" +#endif + +PyAPI_FUNC(FILE*) Py_fopen( + PyObject *path, + const char *mode); + +// Deprecated alias kept for backward compatibility +Py_DEPRECATED(3.14) static inline FILE* +_Py_fopen_obj(PyObject *path, const char *mode) +{ + return Py_fopen(path, mode); +} + +PyAPI_FUNC(int) Py_fclose(FILE *file); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/floatobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/floatobject.h new file mode 100644 index 0000000000000000000000000000000000000000..127093098bfe642355383c0be1ba6e560b1f93cd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/floatobject.h @@ -0,0 +1,27 @@ +#ifndef Py_CPYTHON_FLOATOBJECT_H +# error "this header file must not be included directly" +#endif + +typedef struct { + PyObject_HEAD + double ob_fval; +} PyFloatObject; + +#define _PyFloat_CAST(op) \ + (assert(PyFloat_Check(op)), _Py_CAST(PyFloatObject*, op)) + +// Static inline version of PyFloat_AsDouble() trading safety for speed. +// It doesn't check if op is a double object. +static inline double PyFloat_AS_DOUBLE(PyObject *op) { + return _PyFloat_CAST(op)->ob_fval; +} +#define PyFloat_AS_DOUBLE(op) PyFloat_AS_DOUBLE(_PyObject_CAST(op)) + + +PyAPI_FUNC(int) PyFloat_Pack2(double x, char *p, int le); +PyAPI_FUNC(int) PyFloat_Pack4(double x, char *p, int le); +PyAPI_FUNC(int) PyFloat_Pack8(double x, char *p, int le); + +PyAPI_FUNC(double) PyFloat_Unpack2(const char *p, int le); +PyAPI_FUNC(double) PyFloat_Unpack4(const char *p, int le); +PyAPI_FUNC(double) PyFloat_Unpack8(const char *p, int le); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/frameobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/frameobject.h new file mode 100644 index 0000000000000000000000000000000000000000..dbbfbb5105ba7aa51840beff4a90b4e103d497da --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/frameobject.h @@ -0,0 +1,35 @@ +/* Frame object interface */ + +#ifndef Py_CPYTHON_FRAMEOBJECT_H +# error "this header file must not be included directly" +#endif + +/* Standard object interface */ + +PyAPI_FUNC(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *, + PyObject *, PyObject *); + +/* The rest of the interface is specific for frame objects */ + +/* Conversions between "fast locals" and locals in dictionary */ + +PyAPI_FUNC(void) PyFrame_LocalsToFast(PyFrameObject *, int); + +/* -- Caveat emptor -- + * The concept of entry frames is an implementation detail of the CPython + * interpreter. This API is considered unstable and is provided for the + * convenience of debuggers, profilers and state-inspecting tools. Notice that + * this API can be changed in future minor versions if the underlying frame + * mechanism change or the concept of an 'entry frame' or its semantics becomes + * obsolete or outdated. */ + +PyAPI_FUNC(int) _PyFrame_IsEntryFrame(PyFrameObject *frame); + +PyAPI_FUNC(int) PyFrame_FastToLocalsWithError(PyFrameObject *f); +PyAPI_FUNC(void) PyFrame_FastToLocals(PyFrameObject *); + + +typedef struct { + PyObject_HEAD + PyFrameObject* frame; +} PyFrameLocalsProxyObject; diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/funcobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/funcobject.h new file mode 100644 index 0000000000000000000000000000000000000000..598cd330bc9ca958a50a4ebc6ea09892d4a693d6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/funcobject.h @@ -0,0 +1,185 @@ +/* Function object interface */ + +#ifndef Py_LIMITED_API +#ifndef Py_FUNCOBJECT_H +#define Py_FUNCOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + + +#define _Py_COMMON_FIELDS(PREFIX) \ + PyObject *PREFIX ## globals; \ + PyObject *PREFIX ## builtins; \ + PyObject *PREFIX ## name; \ + PyObject *PREFIX ## qualname; \ + PyObject *PREFIX ## code; /* A code object, the __code__ attribute */ \ + PyObject *PREFIX ## defaults; /* NULL or a tuple */ \ + PyObject *PREFIX ## kwdefaults; /* NULL or a dict */ \ + PyObject *PREFIX ## closure; /* NULL or a tuple of cell objects */ + +typedef struct { + _Py_COMMON_FIELDS(fc_) +} PyFrameConstructor; + +/* Function objects and code objects should not be confused with each other: + * + * Function objects are created by the execution of the 'def' statement. + * They reference a code object in their __code__ attribute, which is a + * purely syntactic object, i.e. nothing more than a compiled version of some + * source code lines. There is one code object per source code "fragment", + * but each code object can be referenced by zero or many function objects + * depending only on how many times the 'def' statement in the source was + * executed so far. + */ + +typedef struct { + PyObject_HEAD + _Py_COMMON_FIELDS(func_) + PyObject *func_doc; /* The __doc__ attribute, can be anything */ + PyObject *func_dict; /* The __dict__ attribute, a dict or NULL */ + PyObject *func_weakreflist; /* List of weak references */ + PyObject *func_module; /* The __module__ attribute, can be anything */ + PyObject *func_annotations; /* Annotations, a dict or NULL */ + PyObject *func_annotate; /* Callable to fill the annotations dictionary */ + PyObject *func_typeparams; /* Tuple of active type variables or NULL */ + vectorcallfunc vectorcall; + /* Version number for use by specializer. + * Can set to non-zero when we want to specialize. + * Will be set to zero if any of these change: + * defaults + * kwdefaults (only if the object changes, not the contents of the dict) + * code + * annotations + * vectorcall function pointer */ + uint32_t func_version; + + /* Invariant: + * func_closure contains the bindings for func_code->co_freevars, so + * PyTuple_Size(func_closure) == PyCode_GetNumFree(func_code) + * (func_closure may be NULL if PyCode_GetNumFree(func_code) == 0). + */ +} PyFunctionObject; + +#undef _Py_COMMON_FIELDS + +PyAPI_DATA(PyTypeObject) PyFunction_Type; + +#define PyFunction_Check(op) Py_IS_TYPE((op), &PyFunction_Type) + +PyAPI_FUNC(PyObject *) PyFunction_New(PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_NewWithQualName(PyObject *, PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_GetCode(PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_GetGlobals(PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_GetModule(PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_GetDefaults(PyObject *); +PyAPI_FUNC(int) PyFunction_SetDefaults(PyObject *, PyObject *); +PyAPI_FUNC(void) PyFunction_SetVectorcall(PyFunctionObject *, vectorcallfunc); +PyAPI_FUNC(PyObject *) PyFunction_GetKwDefaults(PyObject *); +PyAPI_FUNC(int) PyFunction_SetKwDefaults(PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_GetClosure(PyObject *); +PyAPI_FUNC(int) PyFunction_SetClosure(PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_GetAnnotations(PyObject *); +PyAPI_FUNC(int) PyFunction_SetAnnotations(PyObject *, PyObject *); + +#define _PyFunction_CAST(func) \ + (assert(PyFunction_Check(func)), _Py_CAST(PyFunctionObject*, func)) + +/* Static inline functions for direct access to these values. + Type checks are *not* done, so use with care. */ +static inline PyObject* PyFunction_GET_CODE(PyObject *func) { + return _PyFunction_CAST(func)->func_code; +} +#define PyFunction_GET_CODE(func) PyFunction_GET_CODE(_PyObject_CAST(func)) + +static inline PyObject* PyFunction_GET_GLOBALS(PyObject *func) { + return _PyFunction_CAST(func)->func_globals; +} +#define PyFunction_GET_GLOBALS(func) PyFunction_GET_GLOBALS(_PyObject_CAST(func)) + +static inline PyObject* PyFunction_GET_MODULE(PyObject *func) { + return _PyFunction_CAST(func)->func_module; +} +#define PyFunction_GET_MODULE(func) PyFunction_GET_MODULE(_PyObject_CAST(func)) + +static inline PyObject* PyFunction_GET_DEFAULTS(PyObject *func) { + return _PyFunction_CAST(func)->func_defaults; +} +#define PyFunction_GET_DEFAULTS(func) PyFunction_GET_DEFAULTS(_PyObject_CAST(func)) + +static inline PyObject* PyFunction_GET_KW_DEFAULTS(PyObject *func) { + return _PyFunction_CAST(func)->func_kwdefaults; +} +#define PyFunction_GET_KW_DEFAULTS(func) PyFunction_GET_KW_DEFAULTS(_PyObject_CAST(func)) + +static inline PyObject* PyFunction_GET_CLOSURE(PyObject *func) { + return _PyFunction_CAST(func)->func_closure; +} +#define PyFunction_GET_CLOSURE(func) PyFunction_GET_CLOSURE(_PyObject_CAST(func)) + +static inline PyObject* PyFunction_GET_ANNOTATIONS(PyObject *func) { + return _PyFunction_CAST(func)->func_annotations; +} +#define PyFunction_GET_ANNOTATIONS(func) PyFunction_GET_ANNOTATIONS(_PyObject_CAST(func)) + +/* The classmethod and staticmethod types lives here, too */ +PyAPI_DATA(PyTypeObject) PyClassMethod_Type; +PyAPI_DATA(PyTypeObject) PyStaticMethod_Type; + +PyAPI_FUNC(PyObject *) PyClassMethod_New(PyObject *); +PyAPI_FUNC(PyObject *) PyStaticMethod_New(PyObject *); + +#define PY_FOREACH_FUNC_EVENT(V) \ + V(CREATE) \ + V(DESTROY) \ + V(MODIFY_CODE) \ + V(MODIFY_DEFAULTS) \ + V(MODIFY_KWDEFAULTS) + +typedef enum { + #define PY_DEF_EVENT(EVENT) PyFunction_EVENT_##EVENT, + PY_FOREACH_FUNC_EVENT(PY_DEF_EVENT) + #undef PY_DEF_EVENT +} PyFunction_WatchEvent; + +/* + * A callback that is invoked for different events in a function's lifecycle. + * + * The callback is invoked with a borrowed reference to func, after it is + * created and before it is modified or destroyed. The callback should not + * modify func. + * + * When a function's code object, defaults, or kwdefaults are modified the + * callback will be invoked with the respective event and new_value will + * contain a borrowed reference to the new value that is about to be stored in + * the function. Otherwise the third argument is NULL. + * + * If the callback returns with an exception set, it must return -1. Otherwise + * it should return 0. + */ +typedef int (*PyFunction_WatchCallback)( + PyFunction_WatchEvent event, + PyFunctionObject *func, + PyObject *new_value); + +/* + * Register a per-interpreter callback that will be invoked for function lifecycle + * events. + * + * Returns a handle that may be passed to PyFunction_ClearWatcher on success, + * or -1 and sets an error if no more handles are available. + */ +PyAPI_FUNC(int) PyFunction_AddWatcher(PyFunction_WatchCallback callback); + +/* + * Clear the watcher associated with the watcher_id handle. + * + * Returns 0 on success or -1 if no watcher exists for the supplied id. + */ +PyAPI_FUNC(int) PyFunction_ClearWatcher(int watcher_id); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_FUNCOBJECT_H */ +#endif /* Py_LIMITED_API */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/genobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/genobject.h new file mode 100644 index 0000000000000000000000000000000000000000..f75884e597e2c247f211d0159f72b051070531d0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/genobject.h @@ -0,0 +1,56 @@ +/* Generator object interface */ + +#ifndef Py_LIMITED_API +#ifndef Py_GENOBJECT_H +#define Py_GENOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +/* --- Generators --------------------------------------------------------- */ + +typedef struct _PyGenObject PyGenObject; + +PyAPI_DATA(PyTypeObject) PyGen_Type; + +#define PyGen_Check(op) PyObject_TypeCheck((op), &PyGen_Type) +#define PyGen_CheckExact(op) Py_IS_TYPE((op), &PyGen_Type) + +PyAPI_FUNC(PyObject *) PyGen_New(PyFrameObject *); +PyAPI_FUNC(PyObject *) PyGen_NewWithQualName(PyFrameObject *, + PyObject *name, PyObject *qualname); +PyAPI_FUNC(PyCodeObject *) PyGen_GetCode(PyGenObject *gen); + + +/* --- PyCoroObject ------------------------------------------------------- */ + +typedef struct _PyCoroObject PyCoroObject; + +PyAPI_DATA(PyTypeObject) PyCoro_Type; + +#define PyCoro_CheckExact(op) Py_IS_TYPE((op), &PyCoro_Type) +PyAPI_FUNC(PyObject *) PyCoro_New(PyFrameObject *, + PyObject *name, PyObject *qualname); + + +/* --- Asynchronous Generators -------------------------------------------- */ + +typedef struct _PyAsyncGenObject PyAsyncGenObject; + +PyAPI_DATA(PyTypeObject) PyAsyncGen_Type; +PyAPI_DATA(PyTypeObject) _PyAsyncGenASend_Type; + +PyAPI_FUNC(PyObject *) PyAsyncGen_New(PyFrameObject *, + PyObject *name, PyObject *qualname); + +#define PyAsyncGen_CheckExact(op) Py_IS_TYPE((op), &PyAsyncGen_Type) + +#define PyAsyncGenASend_CheckExact(op) Py_IS_TYPE((op), &_PyAsyncGenASend_Type) + +#undef _PyGenObject_HEAD + +#ifdef __cplusplus +} +#endif +#endif /* !Py_GENOBJECT_H */ +#endif /* Py_LIMITED_API */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/import.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/import.h new file mode 100644 index 0000000000000000000000000000000000000000..0ce0b1ee6cce2a2c373e3cffb4f4ffcf1d0893fb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/import.h @@ -0,0 +1,30 @@ +#ifndef Py_CPYTHON_IMPORT_H +# error "this header file must not be included directly" +#endif + +struct _inittab { + const char *name; /* ASCII encoded string */ + PyObject* (*initfunc)(void); +}; +// This is not used after Py_Initialize() is called. +PyAPI_DATA(struct _inittab *) PyImport_Inittab; +PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab); + +struct _frozen { + const char *name; /* ASCII encoded string */ + const unsigned char *code; + int size; + int is_package; +}; + +/* Embedding apps may change this pointer to point to their favorite + collection of frozen modules: */ + +PyAPI_DATA(const struct _frozen *) PyImport_FrozenModules; + +PyAPI_FUNC(PyObject*) PyImport_ImportModuleAttr( + PyObject *mod_name, + PyObject *attr_name); +PyAPI_FUNC(PyObject*) PyImport_ImportModuleAttrString( + const char *mod_name, + const char *attr_name); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/initconfig.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/initconfig.h new file mode 100644 index 0000000000000000000000000000000000000000..7ce4acfeb7177d9ea99222b79caabb27815717cf --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/initconfig.h @@ -0,0 +1,334 @@ +#ifndef Py_PYCORECONFIG_H +#define Py_PYCORECONFIG_H +#ifndef Py_LIMITED_API +#ifdef __cplusplus +extern "C" { +#endif + +/* --- PyStatus ----------------------------------------------- */ + +typedef struct { + enum { + _PyStatus_TYPE_OK=0, + _PyStatus_TYPE_ERROR=1, + _PyStatus_TYPE_EXIT=2 + } _type; + const char *func; + const char *err_msg; + int exitcode; +} PyStatus; + +PyAPI_FUNC(PyStatus) PyStatus_Ok(void); +PyAPI_FUNC(PyStatus) PyStatus_Error(const char *err_msg); +PyAPI_FUNC(PyStatus) PyStatus_NoMemory(void); +PyAPI_FUNC(PyStatus) PyStatus_Exit(int exitcode); +PyAPI_FUNC(int) PyStatus_IsError(PyStatus err); +PyAPI_FUNC(int) PyStatus_IsExit(PyStatus err); +PyAPI_FUNC(int) PyStatus_Exception(PyStatus err); + +/* --- PyWideStringList ------------------------------------------------ */ + +typedef struct { + /* If length is greater than zero, items must be non-NULL + and all items strings must be non-NULL */ + Py_ssize_t length; + wchar_t **items; +} PyWideStringList; + +PyAPI_FUNC(PyStatus) PyWideStringList_Append(PyWideStringList *list, + const wchar_t *item); +PyAPI_FUNC(PyStatus) PyWideStringList_Insert(PyWideStringList *list, + Py_ssize_t index, + const wchar_t *item); + + +/* --- PyPreConfig ----------------------------------------------- */ + +typedef struct PyPreConfig { + int _config_init; /* _PyConfigInitEnum value */ + + /* Parse Py_PreInitializeFromBytesArgs() arguments? + See PyConfig.parse_argv */ + int parse_argv; + + /* If greater than 0, enable isolated mode: sys.path contains + neither the script's directory nor the user's site-packages directory. + + Set to 1 by the -I command line option. If set to -1 (default), inherit + Py_IsolatedFlag value. */ + int isolated; + + /* If greater than 0: use environment variables. + Set to 0 by -E command line option. If set to -1 (default), it is + set to !Py_IgnoreEnvironmentFlag. */ + int use_environment; + + /* Set the LC_CTYPE locale to the user preferred locale? If equals to 0, + set coerce_c_locale and coerce_c_locale_warn to 0. */ + int configure_locale; + + /* Coerce the LC_CTYPE locale if it's equal to "C"? (PEP 538) + + Set to 0 by PYTHONCOERCECLOCALE=0. Set to 1 by PYTHONCOERCECLOCALE=1. + Set to 2 if the user preferred LC_CTYPE locale is "C". + + If it is equal to 1, LC_CTYPE locale is read to decide if it should be + coerced or not (ex: PYTHONCOERCECLOCALE=1). Internally, it is set to 2 + if the LC_CTYPE locale must be coerced. + + Disable by default (set to 0). Set it to -1 to let Python decide if it + should be enabled or not. */ + int coerce_c_locale; + + /* Emit a warning if the LC_CTYPE locale is coerced? + + Set to 1 by PYTHONCOERCECLOCALE=warn. + + Disable by default (set to 0). Set it to -1 to let Python decide if it + should be enabled or not. */ + int coerce_c_locale_warn; + +#ifdef MS_WINDOWS + /* If greater than 1, use the "mbcs" encoding instead of the UTF-8 + encoding for the filesystem encoding. + + Set to 1 if the PYTHONLEGACYWINDOWSFSENCODING environment variable is + set to a non-empty string. If set to -1 (default), inherit + Py_LegacyWindowsFSEncodingFlag value. + + See PEP 529 for more details. */ + int legacy_windows_fs_encoding; +#endif + + /* Enable UTF-8 mode? (PEP 540) + + Disabled by default (equals to 0). + + Set to 1 by "-X utf8" and "-X utf8=1" command line options. + Set to 1 by PYTHONUTF8=1 environment variable. + + Set to 0 by "-X utf8=0" and PYTHONUTF8=0. + + If equals to -1, it is set to 1 if the LC_CTYPE locale is "C" or + "POSIX", otherwise it is set to 0. Inherit Py_UTF8Mode value value. */ + int utf8_mode; + + /* If non-zero, enable the Python Development Mode. + + Set to 1 by the -X dev command line option. Set by the PYTHONDEVMODE + environment variable. */ + int dev_mode; + + /* Memory allocator: PYTHONMALLOC env var. + See PyMemAllocatorName for valid values. */ + int allocator; +} PyPreConfig; + +PyAPI_FUNC(void) PyPreConfig_InitPythonConfig(PyPreConfig *config); +PyAPI_FUNC(void) PyPreConfig_InitIsolatedConfig(PyPreConfig *config); + + +/* --- PyConfig ---------------------------------------------- */ + +/* This structure is best documented in the Doc/c-api/init_config.rst file. */ +typedef struct PyConfig { + int _config_init; /* _PyConfigInitEnum value */ + + int isolated; + int use_environment; + int dev_mode; + int install_signal_handlers; + int use_hash_seed; + unsigned long hash_seed; + int faulthandler; + int tracemalloc; + int perf_profiling; + int remote_debug; + int import_time; + int code_debug_ranges; + int show_ref_count; + int dump_refs; + wchar_t *dump_refs_file; + int malloc_stats; + wchar_t *filesystem_encoding; + wchar_t *filesystem_errors; + wchar_t *pycache_prefix; + int parse_argv; + PyWideStringList orig_argv; + PyWideStringList argv; + PyWideStringList xoptions; + PyWideStringList warnoptions; + int site_import; + int bytes_warning; + int warn_default_encoding; + int inspect; + int interactive; + int optimization_level; + int parser_debug; + int write_bytecode; + int verbose; + int quiet; + int user_site_directory; + int configure_c_stdio; + int buffered_stdio; + wchar_t *stdio_encoding; + wchar_t *stdio_errors; +#ifdef MS_WINDOWS + int legacy_windows_stdio; +#endif + wchar_t *check_hash_pycs_mode; + int use_frozen_modules; + int safe_path; + int int_max_str_digits; + int thread_inherit_context; + int context_aware_warnings; +#ifdef __APPLE__ + int use_system_logger; +#endif + + int cpu_count; +#ifdef Py_GIL_DISABLED + int enable_gil; + int tlbc_enabled; +#endif + + /* --- Path configuration inputs ------------ */ + int pathconfig_warnings; + wchar_t *program_name; + wchar_t *pythonpath_env; + wchar_t *home; + wchar_t *platlibdir; + + /* --- Path configuration outputs ----------- */ + int module_search_paths_set; + PyWideStringList module_search_paths; + wchar_t *stdlib_dir; + wchar_t *executable; + wchar_t *base_executable; + wchar_t *prefix; + wchar_t *base_prefix; + wchar_t *exec_prefix; + wchar_t *base_exec_prefix; + + /* --- Parameter only used by Py_Main() ---------- */ + int skip_source_first_line; + wchar_t *run_command; + wchar_t *run_module; + wchar_t *run_filename; + + /* --- Set by Py_Main() -------------------------- */ + wchar_t *sys_path_0; + + /* --- Private fields ---------------------------- */ + + // Install importlib? If equals to 0, importlib is not initialized at all. + // Needed by freeze_importlib. + int _install_importlib; + + // If equal to 0, stop Python initialization before the "main" phase. + int _init_main; + + // If non-zero, we believe we're running from a source tree. + int _is_python_build; + +#ifdef Py_STATS + // If non-zero, turns on statistics gathering. + int _pystats; +#endif + +#ifdef Py_DEBUG + // If not empty, import a non-__main__ module before site.py is executed. + // PYTHON_PRESITE=package.module or -X presite=package.module + wchar_t *run_presite; +#endif +} PyConfig; + +PyAPI_FUNC(void) PyConfig_InitPythonConfig(PyConfig *config); +PyAPI_FUNC(void) PyConfig_InitIsolatedConfig(PyConfig *config); +PyAPI_FUNC(void) PyConfig_Clear(PyConfig *); +PyAPI_FUNC(PyStatus) PyConfig_SetString( + PyConfig *config, + wchar_t **config_str, + const wchar_t *str); +PyAPI_FUNC(PyStatus) PyConfig_SetBytesString( + PyConfig *config, + wchar_t **config_str, + const char *str); +PyAPI_FUNC(PyStatus) PyConfig_Read(PyConfig *config); +PyAPI_FUNC(PyStatus) PyConfig_SetBytesArgv( + PyConfig *config, + Py_ssize_t argc, + char * const *argv); +PyAPI_FUNC(PyStatus) PyConfig_SetArgv(PyConfig *config, + Py_ssize_t argc, + wchar_t * const *argv); +PyAPI_FUNC(PyStatus) PyConfig_SetWideStringList(PyConfig *config, + PyWideStringList *list, + Py_ssize_t length, wchar_t **items); + + +/* --- PyConfig_Get() ----------------------------------------- */ + +PyAPI_FUNC(PyObject*) PyConfig_Get(const char *name); +PyAPI_FUNC(int) PyConfig_GetInt(const char *name, int *value); +PyAPI_FUNC(PyObject*) PyConfig_Names(void); +PyAPI_FUNC(int) PyConfig_Set(const char *name, PyObject *value); + + +/* --- Helper functions --------------------------------------- */ + +/* Get the original command line arguments, before Python modified them. + + See also PyConfig.orig_argv. */ +PyAPI_FUNC(void) Py_GetArgcArgv(int *argc, wchar_t ***argv); + + +// --- PyInitConfig --------------------------------------------------------- + +typedef struct PyInitConfig PyInitConfig; + +PyAPI_FUNC(PyInitConfig*) PyInitConfig_Create(void); +PyAPI_FUNC(void) PyInitConfig_Free(PyInitConfig *config); + +PyAPI_FUNC(int) PyInitConfig_GetError(PyInitConfig* config, + const char **err_msg); +PyAPI_FUNC(int) PyInitConfig_GetExitCode(PyInitConfig* config, + int *exitcode); + +PyAPI_FUNC(int) PyInitConfig_HasOption(PyInitConfig *config, + const char *name); +PyAPI_FUNC(int) PyInitConfig_GetInt(PyInitConfig *config, + const char *name, + int64_t *value); +PyAPI_FUNC(int) PyInitConfig_GetStr(PyInitConfig *config, + const char *name, + char **value); +PyAPI_FUNC(int) PyInitConfig_GetStrList(PyInitConfig *config, + const char *name, + size_t *length, + char ***items); +PyAPI_FUNC(void) PyInitConfig_FreeStrList(size_t length, char **items); + +PyAPI_FUNC(int) PyInitConfig_SetInt(PyInitConfig *config, + const char *name, + int64_t value); +PyAPI_FUNC(int) PyInitConfig_SetStr(PyInitConfig *config, + const char *name, + const char *value); +PyAPI_FUNC(int) PyInitConfig_SetStrList(PyInitConfig *config, + const char *name, + size_t length, + char * const *items); + +PyAPI_FUNC(int) PyInitConfig_AddModule(PyInitConfig *config, + const char *name, + PyObject* (*initfunc)(void)); + +PyAPI_FUNC(int) Py_InitializeFromInitConfig(PyInitConfig *config); + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_LIMITED_API */ +#endif /* !Py_PYCORECONFIG_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/listobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/listobject.h new file mode 100644 index 0000000000000000000000000000000000000000..49f5e8d6d1a0d6c2863925daaac16c07b6066948 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/listobject.h @@ -0,0 +1,53 @@ +#ifndef Py_CPYTHON_LISTOBJECT_H +# error "this header file must not be included directly" +#endif + +typedef struct { + PyObject_VAR_HEAD + /* Vector of pointers to list elements. list[0] is ob_item[0], etc. */ + PyObject **ob_item; + + /* ob_item contains space for 'allocated' elements. The number + * currently in use is ob_size. + * Invariants: + * 0 <= ob_size <= allocated + * len(list) == ob_size + * ob_item == NULL implies ob_size == allocated == 0 + * list.sort() temporarily sets allocated to -1 to detect mutations. + * + * Items must normally not be NULL, except during construction when + * the list is not yet visible outside the function that builds it. + */ + Py_ssize_t allocated; +} PyListObject; + +/* Cast argument to PyListObject* type. */ +#define _PyList_CAST(op) \ + (assert(PyList_Check(op)), _Py_CAST(PyListObject*, (op))) + +// Macros and static inline functions, trading safety for speed + +static inline Py_ssize_t PyList_GET_SIZE(PyObject *op) { + PyListObject *list = _PyList_CAST(op); +#ifdef Py_GIL_DISABLED + return _Py_atomic_load_ssize_relaxed(&(_PyVarObject_CAST(list)->ob_size)); +#else + return Py_SIZE(list); +#endif +} +#define PyList_GET_SIZE(op) PyList_GET_SIZE(_PyObject_CAST(op)) + +#define PyList_GET_ITEM(op, index) (_PyList_CAST(op)->ob_item[(index)]) + +static inline void +PyList_SET_ITEM(PyObject *op, Py_ssize_t index, PyObject *value) { + PyListObject *list = _PyList_CAST(op); + assert(0 <= index); + assert(index < list->allocated); + list->ob_item[index] = value; +} +#define PyList_SET_ITEM(op, index, value) \ + PyList_SET_ITEM(_PyObject_CAST(op), (index), _PyObject_CAST(value)) + +PyAPI_FUNC(int) PyList_Extend(PyObject *self, PyObject *iterable); +PyAPI_FUNC(int) PyList_Clear(PyObject *self); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/lock.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/lock.h new file mode 100644 index 0000000000000000000000000000000000000000..63886fca28eae24ac903a5267ffd03c8d2e469b7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/lock.h @@ -0,0 +1,74 @@ +#ifndef Py_CPYTHON_LOCK_H +# error "this header file must not be included directly" +#endif + +#define _Py_UNLOCKED 0 +#define _Py_LOCKED 1 + +// A mutex that occupies one byte. The lock can be zero initialized to +// represent the unlocked state. +// +// Typical initialization: +// PyMutex m = (PyMutex){0}; +// +// Or initialize as global variables: +// static PyMutex m; +// +// Typical usage: +// PyMutex_Lock(&m); +// ... +// PyMutex_Unlock(&m); +// +// The contents of the PyMutex are not part of the public API, but are +// described to aid in understanding the implementation and debugging. Only +// the two least significant bits are used. The remaining bits are always zero: +// 0b00: unlocked +// 0b01: locked +// 0b10: unlocked and has parked threads +// 0b11: locked and has parked threads +typedef struct PyMutex { + uint8_t _bits; // (private) +} PyMutex; + +// exported function for locking the mutex +PyAPI_FUNC(void) PyMutex_Lock(PyMutex *m); + +// exported function for unlocking the mutex +PyAPI_FUNC(void) PyMutex_Unlock(PyMutex *m); + +// exported function for checking if the mutex is locked +PyAPI_FUNC(int) PyMutex_IsLocked(PyMutex *m); + +// Locks the mutex. +// +// If the mutex is currently locked, the calling thread will be parked until +// the mutex is unlocked. If the current thread holds the GIL, then the GIL +// will be released while the thread is parked. +static inline void +_PyMutex_Lock(PyMutex *m) +{ + uint8_t expected = _Py_UNLOCKED; + if (!_Py_atomic_compare_exchange_uint8(&m->_bits, &expected, _Py_LOCKED)) { + PyMutex_Lock(m); + } +} +#define PyMutex_Lock _PyMutex_Lock + +// Unlocks the mutex. +static inline void +_PyMutex_Unlock(PyMutex *m) +{ + uint8_t expected = _Py_LOCKED; + if (!_Py_atomic_compare_exchange_uint8(&m->_bits, &expected, _Py_UNLOCKED)) { + PyMutex_Unlock(m); + } +} +#define PyMutex_Unlock _PyMutex_Unlock + +// Checks if the mutex is currently locked. +static inline int +_PyMutex_IsLocked(PyMutex *m) +{ + return (_Py_atomic_load_uint8(&m->_bits) & _Py_LOCKED) != 0; +} +#define PyMutex_IsLocked _PyMutex_IsLocked diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/longintrepr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/longintrepr.h new file mode 100644 index 0000000000000000000000000000000000000000..4b6f97a5e475d65497a0bc0b1d51425b612ae5c2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/longintrepr.h @@ -0,0 +1,184 @@ +#ifndef Py_LIMITED_API +#ifndef Py_LONGINTREPR_H +#define Py_LONGINTREPR_H +#ifdef __cplusplus +extern "C" { +#endif + + +/* This is published for the benefit of "friends" marshal.c and _decimal.c. */ + +/* Parameters of the integer representation. There are two different + sets of parameters: one set for 30-bit digits, stored in an unsigned 32-bit + integer type, and one set for 15-bit digits with each digit stored in an + unsigned short. The value of PYLONG_BITS_IN_DIGIT, defined either at + configure time or in pyport.h, is used to decide which digit size to use. + + Type 'digit' should be able to hold 2*PyLong_BASE-1, and type 'twodigits' + should be an unsigned integer type able to hold all integers up to + PyLong_BASE*PyLong_BASE-1. x_sub assumes that 'digit' is an unsigned type, + and that overflow is handled by taking the result modulo 2**N for some N > + PyLong_SHIFT. The majority of the code doesn't care about the precise + value of PyLong_SHIFT, but there are some notable exceptions: + + - PyLong_{As,From}ByteArray require that PyLong_SHIFT be at least 8 + + - long_hash() requires that PyLong_SHIFT is *strictly* less than the number + of bits in an unsigned long, as do the PyLong <-> long (or unsigned long) + conversion functions + + - the Python int <-> size_t/Py_ssize_t conversion functions expect that + PyLong_SHIFT is strictly less than the number of bits in a size_t + + - the marshal code currently expects that PyLong_SHIFT is a multiple of 15 + + - NSMALLNEGINTS and NSMALLPOSINTS should be small enough to fit in a single + digit; with the current values this forces PyLong_SHIFT >= 9 + + The values 15 and 30 should fit all of the above requirements, on any + platform. +*/ + +#if PYLONG_BITS_IN_DIGIT == 30 +typedef uint32_t digit; +typedef int32_t sdigit; /* signed variant of digit */ +typedef uint64_t twodigits; +typedef int64_t stwodigits; /* signed variant of twodigits */ +#define PyLong_SHIFT 30 +#define _PyLong_DECIMAL_SHIFT 9 /* max(e such that 10**e fits in a digit) */ +#define _PyLong_DECIMAL_BASE ((digit)1000000000) /* 10 ** DECIMAL_SHIFT */ +#elif PYLONG_BITS_IN_DIGIT == 15 +typedef unsigned short digit; +typedef short sdigit; /* signed variant of digit */ +typedef unsigned long twodigits; +typedef long stwodigits; /* signed variant of twodigits */ +#define PyLong_SHIFT 15 +#define _PyLong_DECIMAL_SHIFT 4 /* max(e such that 10**e fits in a digit) */ +#define _PyLong_DECIMAL_BASE ((digit)10000) /* 10 ** DECIMAL_SHIFT */ +#else +#error "PYLONG_BITS_IN_DIGIT should be 15 or 30" +#endif +#define PyLong_BASE ((digit)1 << PyLong_SHIFT) +#define PyLong_MASK ((digit)(PyLong_BASE - 1)) + +/* Long integer representation. + + Long integers are made up of a number of 30- or 15-bit digits, depending on + the platform. The number of digits (ndigits) is stored in the high bits of + the lv_tag field (lvtag >> _PyLong_NON_SIZE_BITS). + + The absolute value of a number is equal to + SUM(for i=0 through ndigits-1) ob_digit[i] * 2**(PyLong_SHIFT*i) + + The sign of the value is stored in the lower 2 bits of lv_tag. + + - 0: Positive + - 1: Zero + - 2: Negative + + The third lowest bit of lv_tag is + set to 1 for the small ints. + + In a normalized number, ob_digit[ndigits-1] (the most significant + digit) is never zero. Also, in all cases, for all valid i, + 0 <= ob_digit[i] <= PyLong_MASK. + + The allocation function takes care of allocating extra memory + so that ob_digit[0] ... ob_digit[ndigits-1] are actually available. + We always allocate memory for at least one digit, so accessing ob_digit[0] + is always safe. However, in the case ndigits == 0, the contents of + ob_digit[0] may be undefined. +*/ + +typedef struct _PyLongValue { + uintptr_t lv_tag; /* Number of digits, sign and flags */ + digit ob_digit[1]; +} _PyLongValue; + +struct _longobject { + PyObject_HEAD + _PyLongValue long_value; +}; + +Py_DEPRECATED(3.14) PyAPI_FUNC(PyLongObject*) _PyLong_New(Py_ssize_t); + +// Return a copy of src. +PyAPI_FUNC(PyObject*) _PyLong_Copy(PyLongObject *src); + +Py_DEPRECATED(3.14) PyAPI_FUNC(PyLongObject*) _PyLong_FromDigits( + int negative, + Py_ssize_t digit_count, + digit *digits); + + +/* Inline some internals for speed. These should be in pycore_long.h + * if user code didn't need them inlined. */ + +#define _PyLong_SIGN_MASK 3 +#define _PyLong_NON_SIZE_BITS 3 + + +static inline int +_PyLong_IsCompact(const PyLongObject* op) { + assert(PyType_HasFeature(op->ob_base.ob_type, Py_TPFLAGS_LONG_SUBCLASS)); + return op->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS); +} + +#define PyUnstable_Long_IsCompact _PyLong_IsCompact + +static inline Py_ssize_t +_PyLong_CompactValue(const PyLongObject *op) +{ + Py_ssize_t sign; + assert(PyType_HasFeature(op->ob_base.ob_type, Py_TPFLAGS_LONG_SUBCLASS)); + assert(PyUnstable_Long_IsCompact(op)); + sign = 1 - (op->long_value.lv_tag & _PyLong_SIGN_MASK); + return sign * (Py_ssize_t)op->long_value.ob_digit[0]; +} + +#define PyUnstable_Long_CompactValue _PyLong_CompactValue + + +/* --- Import/Export API -------------------------------------------------- */ + +typedef struct PyLongLayout { + uint8_t bits_per_digit; + uint8_t digit_size; + int8_t digits_order; + int8_t digit_endianness; +} PyLongLayout; + +PyAPI_FUNC(const PyLongLayout*) PyLong_GetNativeLayout(void); + +typedef struct PyLongExport { + int64_t value; + uint8_t negative; + Py_ssize_t ndigits; + const void *digits; + // Member used internally, must not be used for other purpose. + Py_uintptr_t _reserved; +} PyLongExport; + +PyAPI_FUNC(int) PyLong_Export( + PyObject *obj, + PyLongExport *export_long); +PyAPI_FUNC(void) PyLong_FreeExport( + PyLongExport *export_long); + + +/* --- PyLongWriter API --------------------------------------------------- */ + +typedef struct PyLongWriter PyLongWriter; + +PyAPI_FUNC(PyLongWriter*) PyLongWriter_Create( + int negative, + Py_ssize_t ndigits, + void **digits); +PyAPI_FUNC(PyObject*) PyLongWriter_Finish(PyLongWriter *writer); +PyAPI_FUNC(void) PyLongWriter_Discard(PyLongWriter *writer); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_LONGINTREPR_H */ +#endif /* Py_LIMITED_API */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/longobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/longobject.h new file mode 100644 index 0000000000000000000000000000000000000000..32e6fd73fb5c604c066a933da19b59bddf6db698 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/longobject.h @@ -0,0 +1,89 @@ +#ifndef Py_CPYTHON_LONGOBJECT_H +# error "this header file must not be included directly" +#endif + +#define _PyLong_CAST(op) \ + (assert(PyLong_Check(op)), _Py_CAST(PyLongObject*, (op))) + +PyAPI_FUNC(PyObject*) PyLong_FromUnicodeObject(PyObject *u, int base); + +PyAPI_FUNC(int) PyUnstable_Long_IsCompact(const PyLongObject* op); +PyAPI_FUNC(Py_ssize_t) PyUnstable_Long_CompactValue(const PyLongObject* op); + +/* PyLong_IsPositive. Check if the integer object is positive. + + - On success, return 1 if *obj is positive, and 0 otherwise. + - On failure, set an exception, and return -1. */ +PyAPI_FUNC(int) PyLong_IsPositive(PyObject *obj); + +/* PyLong_IsNegative. Check if the integer object is negative. + + - On success, return 1 if *obj is negative, and 0 otherwise. + - On failure, set an exception, and return -1. */ +PyAPI_FUNC(int) PyLong_IsNegative(PyObject *obj); + +/* PyLong_IsZero. Check if the integer object is zero. + + - On success, return 1 if *obj is zero, and 0 if it is non-zero. + - On failure, set an exception, and return -1. */ +PyAPI_FUNC(int) PyLong_IsZero(PyObject *obj); + +/* PyLong_GetSign. Get the sign of an integer object: + 0, -1 or +1 for zero, negative or positive integer, respectively. + + - On success, set '*sign' to the integer sign, and return 0. + - On failure, set an exception, and return -1. */ +PyAPI_FUNC(int) PyLong_GetSign(PyObject *v, int *sign); + +Py_DEPRECATED(3.14) PyAPI_FUNC(int) _PyLong_Sign(PyObject *v); + +/* _PyLong_NumBits. Return the number of bits needed to represent the + absolute value of a long. For example, this returns 1 for 1 and -1, 2 + for 2 and -2, and 2 for 3 and -3. It returns 0 for 0. + v must not be NULL, and must be a normalized long. + Always successful. +*/ +PyAPI_FUNC(int64_t) _PyLong_NumBits(PyObject *v); + +/* _PyLong_FromByteArray: View the n unsigned bytes as a binary integer in + base 256, and return a Python int with the same numeric value. + If n is 0, the integer is 0. Else: + If little_endian is 1/true, bytes[n-1] is the MSB and bytes[0] the LSB; + else (little_endian is 0/false) bytes[0] is the MSB and bytes[n-1] the + LSB. + If is_signed is 0/false, view the bytes as a non-negative integer. + If is_signed is 1/true, view the bytes as a 2's-complement integer, + non-negative if bit 0x80 of the MSB is clear, negative if set. + Error returns: + + Return NULL with the appropriate exception set if there's not + enough memory to create the Python int. +*/ +PyAPI_FUNC(PyObject *) _PyLong_FromByteArray( + const unsigned char* bytes, size_t n, + int little_endian, int is_signed); + +/* _PyLong_AsByteArray: Convert the least-significant 8*n bits of long + v to a base-256 integer, stored in array bytes. Normally return 0, + return -1 on error. + If little_endian is 1/true, store the MSB at bytes[n-1] and the LSB at + bytes[0]; else (little_endian is 0/false) store the MSB at bytes[0] and + the LSB at bytes[n-1]. + If is_signed is 0/false, it's an error if v < 0; else (v >= 0) n bytes + are filled and there's nothing special about bit 0x80 of the MSB. + If is_signed is 1/true, bytes is filled with the 2's-complement + representation of v's value. Bit 0x80 of the MSB is the sign bit. + Error returns (-1): + + is_signed is 0 and v < 0. TypeError is set in this case, and bytes + isn't altered. + + n isn't big enough to hold the full mathematical value of v. For + example, if is_signed is 0 and there are more digits in the v than + fit in n; or if is_signed is 1, v < 0, and n is just 1 bit shy of + being large enough to hold a sign bit. OverflowError is set in this + case, but bytes holds the least-significant n bytes of the true value. +*/ +PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v, + unsigned char* bytes, size_t n, + int little_endian, int is_signed, int with_exceptions); + +/* For use by the gcd function in mathmodule.c */ +PyAPI_FUNC(PyObject *) _PyLong_GCD(PyObject *, PyObject *); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/memoryobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/memoryobject.h new file mode 100644 index 0000000000000000000000000000000000000000..961161b70f20580b9d1c1408b3b58aebf01214ec --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/memoryobject.h @@ -0,0 +1,50 @@ +#ifndef Py_CPYTHON_MEMORYOBJECT_H +# error "this header file must not be included directly" +#endif + +/* The structs are declared here so that macros can work, but they shouldn't + be considered public. Don't access their fields directly, use the macros + and functions instead! */ +#define _Py_MANAGED_BUFFER_RELEASED 0x001 /* access to exporter blocked */ +#define _Py_MANAGED_BUFFER_FREE_FORMAT 0x002 /* free format */ + +typedef struct { + PyObject_HEAD + int flags; /* state flags */ + Py_ssize_t exports; /* number of direct memoryview exports */ + Py_buffer master; /* snapshot buffer obtained from the original exporter */ +} _PyManagedBufferObject; + + +/* memoryview state flags */ +#define _Py_MEMORYVIEW_RELEASED 0x001 /* access to master buffer blocked */ +#define _Py_MEMORYVIEW_C 0x002 /* C-contiguous layout */ +#define _Py_MEMORYVIEW_FORTRAN 0x004 /* Fortran contiguous layout */ +#define _Py_MEMORYVIEW_SCALAR 0x008 /* scalar: ndim = 0 */ +#define _Py_MEMORYVIEW_PIL 0x010 /* PIL-style layout */ +#define _Py_MEMORYVIEW_RESTRICTED 0x020 /* Disallow new references to the memoryview's buffer */ + +typedef struct { + PyObject_VAR_HEAD + _PyManagedBufferObject *mbuf; /* managed buffer */ + Py_hash_t hash; /* hash value for read-only views */ + int flags; /* state flags */ + Py_ssize_t exports; /* number of buffer re-exports */ + Py_buffer view; /* private copy of the exporter's view */ + PyObject *weakreflist; + Py_ssize_t ob_array[1]; /* shape, strides, suboffsets */ +} PyMemoryViewObject; + +#define _PyMemoryView_CAST(op) _Py_CAST(PyMemoryViewObject*, op) + +/* Get a pointer to the memoryview's private copy of the exporter's buffer. */ +static inline Py_buffer* PyMemoryView_GET_BUFFER(PyObject *op) { + return (&_PyMemoryView_CAST(op)->view); +} +#define PyMemoryView_GET_BUFFER(op) PyMemoryView_GET_BUFFER(_PyObject_CAST(op)) + +/* Get a pointer to the exporting object (this may be NULL!). */ +static inline PyObject* PyMemoryView_GET_BASE(PyObject *op) { + return _PyMemoryView_CAST(op)->view.obj; +} +#define PyMemoryView_GET_BASE(op) PyMemoryView_GET_BASE(_PyObject_CAST(op)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/methodobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/methodobject.h new file mode 100644 index 0000000000000000000000000000000000000000..d541e1549480417fbce8933e222821ef8aab6247 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/methodobject.h @@ -0,0 +1,66 @@ +#ifndef Py_CPYTHON_METHODOBJECT_H +# error "this header file must not be included directly" +#endif + +// PyCFunctionObject structure + +typedef struct { + PyObject_HEAD + PyMethodDef *m_ml; /* Description of the C function to call */ + PyObject *m_self; /* Passed as 'self' arg to the C func, can be NULL */ + PyObject *m_module; /* The __module__ attribute, can be anything */ + PyObject *m_weakreflist; /* List of weak references */ + vectorcallfunc vectorcall; +} PyCFunctionObject; + +#define _PyCFunctionObject_CAST(func) \ + (assert(PyCFunction_Check(func)), \ + _Py_CAST(PyCFunctionObject*, (func))) + + +// PyCMethodObject structure + +typedef struct { + PyCFunctionObject func; + PyTypeObject *mm_class; /* Class that defines this method */ +} PyCMethodObject; + +#define _PyCMethodObject_CAST(func) \ + (assert(PyCMethod_Check(func)), \ + _Py_CAST(PyCMethodObject*, (func))) + +PyAPI_DATA(PyTypeObject) PyCMethod_Type; + +#define PyCMethod_CheckExact(op) Py_IS_TYPE((op), &PyCMethod_Type) +#define PyCMethod_Check(op) PyObject_TypeCheck((op), &PyCMethod_Type) + + +/* Static inline functions for direct access to these values. + Type checks are *not* done, so use with care. */ +static inline PyCFunction PyCFunction_GET_FUNCTION(PyObject *func) { + return _PyCFunctionObject_CAST(func)->m_ml->ml_meth; +} +#define PyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(_PyObject_CAST(func)) + +static inline PyObject* PyCFunction_GET_SELF(PyObject *func_obj) { + PyCFunctionObject *func = _PyCFunctionObject_CAST(func_obj); + if (func->m_ml->ml_flags & METH_STATIC) { + return _Py_NULL; + } + return func->m_self; +} +#define PyCFunction_GET_SELF(func) PyCFunction_GET_SELF(_PyObject_CAST(func)) + +static inline int PyCFunction_GET_FLAGS(PyObject *func) { + return _PyCFunctionObject_CAST(func)->m_ml->ml_flags; +} +#define PyCFunction_GET_FLAGS(func) PyCFunction_GET_FLAGS(_PyObject_CAST(func)) + +static inline PyTypeObject* PyCFunction_GET_CLASS(PyObject *func_obj) { + PyCFunctionObject *func = _PyCFunctionObject_CAST(func_obj); + if (func->m_ml->ml_flags & METH_METHOD) { + return _PyCMethodObject_CAST(func)->mm_class; + } + return _Py_NULL; +} +#define PyCFunction_GET_CLASS(func) PyCFunction_GET_CLASS(_PyObject_CAST(func)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/modsupport.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/modsupport.h new file mode 100644 index 0000000000000000000000000000000000000000..d3b88f58c82ca3e923cb7756871113f1dfcafec7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/modsupport.h @@ -0,0 +1,26 @@ +#ifndef Py_CPYTHON_MODSUPPORT_H +# error "this header file must not be included directly" +#endif + +// A data structure that can be used to run initialization code once in a +// thread-safe manner. The C++11 equivalent is std::call_once. +typedef struct { + uint8_t v; +} _PyOnceFlag; + +typedef struct _PyArg_Parser { + const char *format; + const char * const *keywords; + const char *fname; + const char *custom_msg; + _PyOnceFlag once; /* atomic one-time initialization flag */ + int is_kwtuple_owned; /* does this parser own the kwtuple object? */ + int pos; /* number of positional-only arguments */ + int min; /* minimal number of arguments */ + int max; /* maximal number of positional arguments */ + PyObject *kwtuple; /* tuple of keyword parameter names */ + struct _PyArg_Parser *next; +} _PyArg_Parser; + +PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *, + struct _PyArg_Parser *, ...); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/monitoring.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/monitoring.h new file mode 100644 index 0000000000000000000000000000000000000000..ce92942404c9f7db3f9bf0378c1fa6d500ccf7bc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/monitoring.h @@ -0,0 +1,269 @@ +#ifndef Py_CPYTHON_MONITORING_H +# error "this header file must not be included directly" +#endif + +/* Local events. + * These require bytecode instrumentation */ + +#define PY_MONITORING_EVENT_PY_START 0 +#define PY_MONITORING_EVENT_PY_RESUME 1 +#define PY_MONITORING_EVENT_PY_RETURN 2 +#define PY_MONITORING_EVENT_PY_YIELD 3 +#define PY_MONITORING_EVENT_CALL 4 +#define PY_MONITORING_EVENT_LINE 5 +#define PY_MONITORING_EVENT_INSTRUCTION 6 +#define PY_MONITORING_EVENT_JUMP 7 +#define PY_MONITORING_EVENT_BRANCH_LEFT 8 +#define PY_MONITORING_EVENT_BRANCH_RIGHT 9 +#define PY_MONITORING_EVENT_STOP_ITERATION 10 + +#define PY_MONITORING_IS_INSTRUMENTED_EVENT(ev) \ + ((ev) < _PY_MONITORING_LOCAL_EVENTS) + +/* Other events, mainly exceptions */ + +#define PY_MONITORING_EVENT_RAISE 11 +#define PY_MONITORING_EVENT_EXCEPTION_HANDLED 12 +#define PY_MONITORING_EVENT_PY_UNWIND 13 +#define PY_MONITORING_EVENT_PY_THROW 14 +#define PY_MONITORING_EVENT_RERAISE 15 + + +/* Ancillary events */ + +#define PY_MONITORING_EVENT_C_RETURN 16 +#define PY_MONITORING_EVENT_C_RAISE 17 +#define PY_MONITORING_EVENT_BRANCH 18 + + +typedef struct _PyMonitoringState { + uint8_t active; + uint8_t opaque; +} PyMonitoringState; + + +PyAPI_FUNC(int) +PyMonitoring_EnterScope(PyMonitoringState *state_array, uint64_t *version, + const uint8_t *event_types, Py_ssize_t length); + +PyAPI_FUNC(int) +PyMonitoring_ExitScope(void); + + +PyAPI_FUNC(int) +_PyMonitoring_FirePyStartEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset); + +PyAPI_FUNC(int) +_PyMonitoring_FirePyResumeEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset); + +PyAPI_FUNC(int) +_PyMonitoring_FirePyReturnEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, + PyObject *retval); + +PyAPI_FUNC(int) +_PyMonitoring_FirePyYieldEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, + PyObject *retval); + +PyAPI_FUNC(int) +_PyMonitoring_FireCallEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, + PyObject* callable, PyObject *arg0); + +PyAPI_FUNC(int) +_PyMonitoring_FireLineEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, + int lineno); + +PyAPI_FUNC(int) +_PyMonitoring_FireJumpEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, + PyObject *target_offset); + +Py_DEPRECATED(3.14) PyAPI_FUNC(int) +_PyMonitoring_FireBranchEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, + PyObject *target_offset); + +PyAPI_FUNC(int) +_PyMonitoring_FireBranchRightEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, + PyObject *target_offset); + +PyAPI_FUNC(int) +_PyMonitoring_FireBranchLeftEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, + PyObject *target_offset); + +PyAPI_FUNC(int) +_PyMonitoring_FireCReturnEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, + PyObject *retval); + +PyAPI_FUNC(int) +_PyMonitoring_FirePyThrowEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset); + +PyAPI_FUNC(int) +_PyMonitoring_FireRaiseEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset); + +PyAPI_FUNC(int) +_PyMonitoring_FireReraiseEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset); + +PyAPI_FUNC(int) +_PyMonitoring_FireExceptionHandledEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset); + +PyAPI_FUNC(int) +_PyMonitoring_FireCRaiseEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset); + +PyAPI_FUNC(int) +_PyMonitoring_FirePyUnwindEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset); + +PyAPI_FUNC(int) +_PyMonitoring_FireStopIterationEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, PyObject *value); + + +#define _PYMONITORING_IF_ACTIVE(STATE, X) \ + if ((STATE)->active) { \ + return (X); \ + } \ + else { \ + return 0; \ + } + +static inline int +PyMonitoring_FirePyStartEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset) +{ + _PYMONITORING_IF_ACTIVE( + state, + _PyMonitoring_FirePyStartEvent(state, codelike, offset)); +} + +static inline int +PyMonitoring_FirePyResumeEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset) +{ + _PYMONITORING_IF_ACTIVE( + state, + _PyMonitoring_FirePyResumeEvent(state, codelike, offset)); +} + +static inline int +PyMonitoring_FirePyReturnEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, + PyObject *retval) +{ + _PYMONITORING_IF_ACTIVE( + state, + _PyMonitoring_FirePyReturnEvent(state, codelike, offset, retval)); +} + +static inline int +PyMonitoring_FirePyYieldEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, + PyObject *retval) +{ + _PYMONITORING_IF_ACTIVE( + state, + _PyMonitoring_FirePyYieldEvent(state, codelike, offset, retval)); +} + +static inline int +PyMonitoring_FireCallEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, + PyObject* callable, PyObject *arg0) +{ + _PYMONITORING_IF_ACTIVE( + state, + _PyMonitoring_FireCallEvent(state, codelike, offset, callable, arg0)); +} + +static inline int +PyMonitoring_FireLineEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, + int lineno) +{ + _PYMONITORING_IF_ACTIVE( + state, + _PyMonitoring_FireLineEvent(state, codelike, offset, lineno)); +} + +static inline int +PyMonitoring_FireJumpEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, + PyObject *target_offset) +{ + _PYMONITORING_IF_ACTIVE( + state, + _PyMonitoring_FireJumpEvent(state, codelike, offset, target_offset)); +} + +static inline int +PyMonitoring_FireBranchRightEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, + PyObject *target_offset) +{ + _PYMONITORING_IF_ACTIVE( + state, + _PyMonitoring_FireBranchRightEvent(state, codelike, offset, target_offset)); +} + +static inline int +PyMonitoring_FireBranchLeftEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, + PyObject *target_offset) +{ + _PYMONITORING_IF_ACTIVE( + state, + _PyMonitoring_FireBranchLeftEvent(state, codelike, offset, target_offset)); +} + +static inline int +PyMonitoring_FireCReturnEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, + PyObject *retval) +{ + _PYMONITORING_IF_ACTIVE( + state, + _PyMonitoring_FireCReturnEvent(state, codelike, offset, retval)); +} + +static inline int +PyMonitoring_FirePyThrowEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset) +{ + _PYMONITORING_IF_ACTIVE( + state, + _PyMonitoring_FirePyThrowEvent(state, codelike, offset)); +} + +static inline int +PyMonitoring_FireRaiseEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset) +{ + _PYMONITORING_IF_ACTIVE( + state, + _PyMonitoring_FireRaiseEvent(state, codelike, offset)); +} + +static inline int +PyMonitoring_FireReraiseEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset) +{ + _PYMONITORING_IF_ACTIVE( + state, + _PyMonitoring_FireReraiseEvent(state, codelike, offset)); +} + +static inline int +PyMonitoring_FireExceptionHandledEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset) +{ + _PYMONITORING_IF_ACTIVE( + state, + _PyMonitoring_FireExceptionHandledEvent(state, codelike, offset)); +} + +static inline int +PyMonitoring_FireCRaiseEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset) +{ + _PYMONITORING_IF_ACTIVE( + state, + _PyMonitoring_FireCRaiseEvent(state, codelike, offset)); +} + +static inline int +PyMonitoring_FirePyUnwindEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset) +{ + _PYMONITORING_IF_ACTIVE( + state, + _PyMonitoring_FirePyUnwindEvent(state, codelike, offset)); +} + +static inline int +PyMonitoring_FireStopIterationEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, PyObject *value) +{ + _PYMONITORING_IF_ACTIVE( + state, + _PyMonitoring_FireStopIterationEvent(state, codelike, offset, value)); +} + +#undef _PYMONITORING_IF_ACTIVE diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/object.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/object.h new file mode 100644 index 0000000000000000000000000000000000000000..973d358ed8e4ec7c66c578d06869a00b73883a6f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/object.h @@ -0,0 +1,493 @@ +#ifndef Py_CPYTHON_OBJECT_H +# error "this header file must not be included directly" +#endif + +PyAPI_FUNC(void) _Py_NewReference(PyObject *op); +PyAPI_FUNC(void) _Py_NewReferenceNoTotal(PyObject *op); +PyAPI_FUNC(void) _Py_ResurrectReference(PyObject *op); +PyAPI_FUNC(void) _Py_ForgetReference(PyObject *op); + +#ifdef Py_REF_DEBUG +/* These are useful as debugging aids when chasing down refleaks. */ +PyAPI_FUNC(Py_ssize_t) _Py_GetGlobalRefTotal(void); +# define _Py_GetRefTotal() _Py_GetGlobalRefTotal() +PyAPI_FUNC(Py_ssize_t) _Py_GetLegacyRefTotal(void); +PyAPI_FUNC(Py_ssize_t) _PyInterpreterState_GetRefTotal(PyInterpreterState *); +#endif + + +/********************* String Literals ****************************************/ +/* This structure helps managing static strings. The basic usage goes like this: + Instead of doing + + r = PyObject_CallMethod(o, "foo", "args", ...); + + do + + _Py_IDENTIFIER(foo); + ... + r = _PyObject_CallMethodId(o, &PyId_foo, "args", ...); + + PyId_foo is a static variable, either on block level or file level. On first + usage, the string "foo" is interned, and the structures are linked. On interpreter + shutdown, all strings are released. + + Alternatively, _Py_static_string allows choosing the variable name. + _PyUnicode_FromId returns a borrowed reference to the interned string. + _PyObject_{Get,Set,Has}AttrId are __getattr__ versions using _Py_Identifier*. +*/ +typedef struct _Py_Identifier { + const char* string; + // Index in PyInterpreterState.unicode.ids.array. It is process-wide + // unique and must be initialized to -1. + Py_ssize_t index; + // Hidden PyMutex struct for non free-threaded build. + struct { + uint8_t v; + } mutex; +} _Py_Identifier; + +#ifndef Py_BUILD_CORE +// For now we are keeping _Py_IDENTIFIER for continued use +// in non-builtin extensions (and naughty PyPI modules). + +#define _Py_static_string_init(value) { .string = (value), .index = -1 } +#define _Py_static_string(varname, value) static _Py_Identifier varname = _Py_static_string_init(value) +#define _Py_IDENTIFIER(varname) _Py_static_string(PyId_##varname, #varname) + +#endif /* !Py_BUILD_CORE */ + + +typedef struct { + /* Number implementations must check *both* + arguments for proper type and implement the necessary conversions + in the slot functions themselves. */ + + binaryfunc nb_add; + binaryfunc nb_subtract; + binaryfunc nb_multiply; + binaryfunc nb_remainder; + binaryfunc nb_divmod; + ternaryfunc nb_power; + unaryfunc nb_negative; + unaryfunc nb_positive; + unaryfunc nb_absolute; + inquiry nb_bool; + unaryfunc nb_invert; + binaryfunc nb_lshift; + binaryfunc nb_rshift; + binaryfunc nb_and; + binaryfunc nb_xor; + binaryfunc nb_or; + unaryfunc nb_int; + void *nb_reserved; /* the slot formerly known as nb_long */ + unaryfunc nb_float; + + binaryfunc nb_inplace_add; + binaryfunc nb_inplace_subtract; + binaryfunc nb_inplace_multiply; + binaryfunc nb_inplace_remainder; + ternaryfunc nb_inplace_power; + binaryfunc nb_inplace_lshift; + binaryfunc nb_inplace_rshift; + binaryfunc nb_inplace_and; + binaryfunc nb_inplace_xor; + binaryfunc nb_inplace_or; + + binaryfunc nb_floor_divide; + binaryfunc nb_true_divide; + binaryfunc nb_inplace_floor_divide; + binaryfunc nb_inplace_true_divide; + + unaryfunc nb_index; + + binaryfunc nb_matrix_multiply; + binaryfunc nb_inplace_matrix_multiply; +} PyNumberMethods; + +typedef struct { + lenfunc sq_length; + binaryfunc sq_concat; + ssizeargfunc sq_repeat; + ssizeargfunc sq_item; + void *was_sq_slice; + ssizeobjargproc sq_ass_item; + void *was_sq_ass_slice; + objobjproc sq_contains; + + binaryfunc sq_inplace_concat; + ssizeargfunc sq_inplace_repeat; +} PySequenceMethods; + +typedef struct { + lenfunc mp_length; + binaryfunc mp_subscript; + objobjargproc mp_ass_subscript; +} PyMappingMethods; + +typedef PySendResult (*sendfunc)(PyObject *iter, PyObject *value, PyObject **result); + +typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + sendfunc am_send; +} PyAsyncMethods; + +typedef struct { + getbufferproc bf_getbuffer; + releasebufferproc bf_releasebuffer; +} PyBufferProcs; + +/* Allow printfunc in the tp_vectorcall_offset slot for + * backwards-compatibility */ +typedef Py_ssize_t printfunc; + +// If this structure is modified, Doc/includes/typestruct.h should be updated +// as well. +struct _typeobject { + PyObject_VAR_HEAD + const char *tp_name; /* For printing, in format "." */ + Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */ + + /* Methods to implement standard operations */ + + destructor tp_dealloc; + Py_ssize_t tp_vectorcall_offset; + getattrfunc tp_getattr; + setattrfunc tp_setattr; + PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 2) + or tp_reserved (Python 3) */ + reprfunc tp_repr; + + /* Method suites for standard classes */ + + PyNumberMethods *tp_as_number; + PySequenceMethods *tp_as_sequence; + PyMappingMethods *tp_as_mapping; + + /* More standard operations (here for binary compatibility) */ + + hashfunc tp_hash; + ternaryfunc tp_call; + reprfunc tp_str; + getattrofunc tp_getattro; + setattrofunc tp_setattro; + + /* Functions to access object as input/output buffer */ + PyBufferProcs *tp_as_buffer; + + /* Flags to define presence of optional/expanded features */ + unsigned long tp_flags; + + const char *tp_doc; /* Documentation string */ + + /* Assigned meaning in release 2.0 */ + /* call function for all accessible objects */ + traverseproc tp_traverse; + + /* delete references to contained objects */ + inquiry tp_clear; + + /* Assigned meaning in release 2.1 */ + /* rich comparisons */ + richcmpfunc tp_richcompare; + + /* weak reference enabler */ + Py_ssize_t tp_weaklistoffset; + + /* Iterators */ + getiterfunc tp_iter; + iternextfunc tp_iternext; + + /* Attribute descriptor and subclassing stuff */ + PyMethodDef *tp_methods; + PyMemberDef *tp_members; + PyGetSetDef *tp_getset; + // Strong reference on a heap type, borrowed reference on a static type + PyTypeObject *tp_base; + PyObject *tp_dict; + descrgetfunc tp_descr_get; + descrsetfunc tp_descr_set; + Py_ssize_t tp_dictoffset; + initproc tp_init; + allocfunc tp_alloc; + newfunc tp_new; + freefunc tp_free; /* Low-level free-memory routine */ + inquiry tp_is_gc; /* For PyObject_IS_GC */ + PyObject *tp_bases; + PyObject *tp_mro; /* method resolution order */ + PyObject *tp_cache; /* no longer used */ + void *tp_subclasses; /* for static builtin types this is an index */ + PyObject *tp_weaklist; /* not used for static builtin types */ + destructor tp_del; + + /* Type attribute cache version tag. Added in version 2.6. + * If zero, the cache is invalid and must be initialized. + */ + unsigned int tp_version_tag; + + destructor tp_finalize; + vectorcallfunc tp_vectorcall; + + /* bitset of which type-watchers care about this type */ + unsigned char tp_watched; + + /* Number of tp_version_tag values used. + * Set to _Py_ATTR_CACHE_UNUSED if the attribute cache is + * disabled for this type (e.g. due to custom MRO entries). + * Otherwise, limited to MAX_VERSIONS_PER_CLASS (defined elsewhere). + */ + uint16_t tp_versions_used; +}; + +#define _Py_ATTR_CACHE_UNUSED (30000) // (see tp_versions_used) + +/* This struct is used by the specializer + * It should be treated as an opaque blob + * by code other than the specializer and interpreter. */ +struct _specialization_cache { + // In order to avoid bloating the bytecode with lots of inline caches, the + // members of this structure have a somewhat unique contract. They are set + // by the specialization machinery, and are invalidated by PyType_Modified. + // The rules for using them are as follows: + // - If getitem is non-NULL, then it is the same Python function that + // PyType_Lookup(cls, "__getitem__") would return. + // - If getitem is NULL, then getitem_version is meaningless. + // - If getitem->func_version == getitem_version, then getitem can be called + // with two positional arguments and no keyword arguments, and has neither + // *args nor **kwargs (as required by BINARY_OP_SUBSCR_GETITEM): + PyObject *getitem; + uint32_t getitem_version; + PyObject *init; +}; + +/* The *real* layout of a type object when allocated on the heap */ +typedef struct _heaptypeobject { + /* Note: there's a dependency on the order of these members + in slotptr() in typeobject.c . */ + PyTypeObject ht_type; + PyAsyncMethods as_async; + PyNumberMethods as_number; + PyMappingMethods as_mapping; + PySequenceMethods as_sequence; /* as_sequence comes after as_mapping, + so that the mapping wins when both + the mapping and the sequence define + a given operator (e.g. __getitem__). + see add_operators() in typeobject.c . */ + PyBufferProcs as_buffer; + PyObject *ht_name, *ht_slots, *ht_qualname; + struct _dictkeysobject *ht_cached_keys; + PyObject *ht_module; + char *_ht_tpname; // Storage for "tp_name"; see PyType_FromModuleAndSpec + void *ht_token; // Storage for the "Py_tp_token" slot + struct _specialization_cache _spec_cache; // For use by the specializer. +#ifdef Py_GIL_DISABLED + Py_ssize_t unique_id; // ID used for per-thread refcounting +#endif + /* here are optional user slots, followed by the members. */ +} PyHeapTypeObject; + +PyAPI_FUNC(const char *) _PyType_Name(PyTypeObject *); +PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *); +PyAPI_FUNC(PyObject *) _PyType_LookupRef(PyTypeObject *, PyObject *); +PyAPI_FUNC(PyObject *) PyType_GetDict(PyTypeObject *); + +PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int); +PyAPI_FUNC(void) _Py_BreakPoint(void); +PyAPI_FUNC(void) _PyObject_Dump(PyObject *); + +PyAPI_FUNC(PyObject*) _PyObject_GetAttrId(PyObject *, _Py_Identifier *); + +PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *); +PyAPI_FUNC(void) PyObject_CallFinalizer(PyObject *); +PyAPI_FUNC(int) PyObject_CallFinalizerFromDealloc(PyObject *); + +PyAPI_FUNC(void) PyUnstable_Object_ClearWeakRefsNoCallbacks(PyObject *); + +/* Same as PyObject_Generic{Get,Set}Attr, but passing the attributes + dict as the last parameter. */ +PyAPI_FUNC(PyObject *) +_PyObject_GenericGetAttrWithDict(PyObject *, PyObject *, PyObject *, int); +PyAPI_FUNC(int) +_PyObject_GenericSetAttrWithDict(PyObject *, PyObject *, + PyObject *, PyObject *); + +PyAPI_FUNC(PyObject *) _PyObject_FunctionStr(PyObject *); + +/* Safely decref `dst` and set `dst` to `src`. + * + * As in case of Py_CLEAR "the obvious" code can be deadly: + * + * Py_DECREF(dst); + * dst = src; + * + * The safe way is: + * + * Py_SETREF(dst, src); + * + * That arranges to set `dst` to `src` _before_ decref'ing, so that any code + * triggered as a side-effect of `dst` getting torn down no longer believes + * `dst` points to a valid object. + * + * Temporary variables are used to only evaluate macro arguments once and so + * avoid the duplication of side effects. _Py_TYPEOF() or memcpy() is used to + * avoid a miscompilation caused by type punning. See Py_CLEAR() comment for + * implementation details about type punning. + * + * The memcpy() implementation does not emit a compiler warning if 'src' has + * not the same type than 'src': any pointer type is accepted for 'src'. + */ +#ifdef _Py_TYPEOF +#define Py_SETREF(dst, src) \ + do { \ + _Py_TYPEOF(dst)* _tmp_dst_ptr = &(dst); \ + _Py_TYPEOF(dst) _tmp_old_dst = (*_tmp_dst_ptr); \ + *_tmp_dst_ptr = (src); \ + Py_DECREF(_tmp_old_dst); \ + } while (0) +#else +#define Py_SETREF(dst, src) \ + do { \ + PyObject **_tmp_dst_ptr = _Py_CAST(PyObject**, &(dst)); \ + PyObject *_tmp_old_dst = (*_tmp_dst_ptr); \ + PyObject *_tmp_src = _PyObject_CAST(src); \ + memcpy(_tmp_dst_ptr, &_tmp_src, sizeof(PyObject*)); \ + Py_DECREF(_tmp_old_dst); \ + } while (0) +#endif + +/* Py_XSETREF() is a variant of Py_SETREF() that uses Py_XDECREF() instead of + * Py_DECREF(). + */ +#ifdef _Py_TYPEOF +#define Py_XSETREF(dst, src) \ + do { \ + _Py_TYPEOF(dst)* _tmp_dst_ptr = &(dst); \ + _Py_TYPEOF(dst) _tmp_old_dst = (*_tmp_dst_ptr); \ + *_tmp_dst_ptr = (src); \ + Py_XDECREF(_tmp_old_dst); \ + } while (0) +#else +#define Py_XSETREF(dst, src) \ + do { \ + PyObject **_tmp_dst_ptr = _Py_CAST(PyObject**, &(dst)); \ + PyObject *_tmp_old_dst = (*_tmp_dst_ptr); \ + PyObject *_tmp_src = _PyObject_CAST(src); \ + memcpy(_tmp_dst_ptr, &_tmp_src, sizeof(PyObject*)); \ + Py_XDECREF(_tmp_old_dst); \ + } while (0) +#endif + + +/* Define a pair of assertion macros: + _PyObject_ASSERT_FROM(), _PyObject_ASSERT_WITH_MSG() and _PyObject_ASSERT(). + + These work like the regular C assert(), in that they will abort the + process with a message on stderr if the given condition fails to hold, + but compile away to nothing if NDEBUG is defined. + + However, before aborting, Python will also try to call _PyObject_Dump() on + the given object. This may be of use when investigating bugs in which a + particular object is corrupt (e.g. buggy a tp_visit method in an extension + module breaking the garbage collector), to help locate the broken objects. + + The WITH_MSG variant allows you to supply an additional message that Python + will attempt to print to stderr, after the object dump. */ +#ifdef NDEBUG + /* No debugging: compile away the assertions: */ +# define _PyObject_ASSERT_FROM(obj, expr, msg, filename, lineno, func) \ + ((void)0) +#else + /* With debugging: generate checks: */ +# define _PyObject_ASSERT_FROM(obj, expr, msg, filename, lineno, func) \ + ((expr) \ + ? (void)(0) \ + : _PyObject_AssertFailed((obj), Py_STRINGIFY(expr), \ + (msg), (filename), (lineno), (func))) +#endif + +#define _PyObject_ASSERT_WITH_MSG(obj, expr, msg) \ + _PyObject_ASSERT_FROM((obj), expr, (msg), __FILE__, __LINE__, __func__) +#define _PyObject_ASSERT(obj, expr) \ + _PyObject_ASSERT_WITH_MSG((obj), expr, NULL) + +#define _PyObject_ASSERT_FAILED_MSG(obj, msg) \ + _PyObject_AssertFailed((obj), NULL, (msg), __FILE__, __LINE__, __func__) + +/* Declare and define _PyObject_AssertFailed() even when NDEBUG is defined, + to avoid causing compiler/linker errors when building extensions without + NDEBUG against a Python built with NDEBUG defined. + + msg, expr and function can be NULL. */ +PyAPI_FUNC(void) _Py_NO_RETURN _PyObject_AssertFailed( + PyObject *obj, + const char *expr, + const char *msg, + const char *file, + int line, + const char *function); + + +PyAPI_FUNC(void) _PyTrash_thread_deposit_object(PyThreadState *tstate, PyObject *op); +PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(PyThreadState *tstate); + +PyAPI_FUNC(int) _Py_ReachedRecursionLimitWithMargin(PyThreadState *tstate, int margin_count); + +/* For backwards compatibility with the old trashcan mechanism */ +#define Py_TRASHCAN_BEGIN(op, dealloc) +#define Py_TRASHCAN_END + + +PyAPI_FUNC(void *) PyObject_GetItemData(PyObject *obj); + +PyAPI_FUNC(int) PyObject_VisitManagedDict(PyObject *obj, visitproc visit, void *arg); +PyAPI_FUNC(int) _PyObject_SetManagedDict(PyObject *obj, PyObject *new_dict); +PyAPI_FUNC(void) PyObject_ClearManagedDict(PyObject *obj); + + +typedef int(*PyType_WatchCallback)(PyTypeObject *); +PyAPI_FUNC(int) PyType_AddWatcher(PyType_WatchCallback callback); +PyAPI_FUNC(int) PyType_ClearWatcher(int watcher_id); +PyAPI_FUNC(int) PyType_Watch(int watcher_id, PyObject *type); +PyAPI_FUNC(int) PyType_Unwatch(int watcher_id, PyObject *type); + +/* Attempt to assign a version tag to the given type. + * + * Returns 1 if the type already had a valid version tag or a new one was + * assigned, or 0 if a new tag could not be assigned. + */ +PyAPI_FUNC(int) PyUnstable_Type_AssignVersionTag(PyTypeObject *type); + + +typedef enum { + PyRefTracer_CREATE = 0, + PyRefTracer_DESTROY = 1, +} PyRefTracerEvent; + +typedef int (*PyRefTracer)(PyObject *, PyRefTracerEvent event, void *); +PyAPI_FUNC(int) PyRefTracer_SetTracer(PyRefTracer tracer, void *data); +PyAPI_FUNC(PyRefTracer) PyRefTracer_GetTracer(void**); + +/* Enable PEP-703 deferred reference counting on the object. + * + * Returns 1 if deferred reference counting was successfully enabled, and + * 0 if the runtime ignored it. This function cannot fail. + */ +PyAPI_FUNC(int) PyUnstable_Object_EnableDeferredRefcount(PyObject *); + +/* Determine if the object exists as a unique temporary variable on the + * topmost frame of the interpreter. + */ +PyAPI_FUNC(int) PyUnstable_Object_IsUniqueReferencedTemporary(PyObject *); + +/* Check whether the object is immortal. This cannot fail. */ +PyAPI_FUNC(int) PyUnstable_IsImmortal(PyObject *); + +// Increments the reference count of the object, if it's not zero. +// PyUnstable_EnableTryIncRef() should be called on the object +// before calling this function in order to avoid spurious failures. +PyAPI_FUNC(int) PyUnstable_TryIncRef(PyObject *); +PyAPI_FUNC(void) PyUnstable_EnableTryIncRef(PyObject *); + +PyAPI_FUNC(int) PyUnstable_Object_IsUniquelyReferenced(PyObject *); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/objimpl.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/objimpl.h new file mode 100644 index 0000000000000000000000000000000000000000..e0c2ce286f13ce38c3308c17e1cdc2308bf76edf --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/objimpl.h @@ -0,0 +1,104 @@ +#ifndef Py_CPYTHON_OBJIMPL_H +# error "this header file must not be included directly" +#endif + +static inline size_t _PyObject_SIZE(PyTypeObject *type) { + return _Py_STATIC_CAST(size_t, type->tp_basicsize); +} + +/* _PyObject_VAR_SIZE returns the number of bytes (as size_t) allocated for a + vrbl-size object with nitems items, exclusive of gc overhead (if any). The + value is rounded up to the closest multiple of sizeof(void *), in order to + ensure that pointer fields at the end of the object are correctly aligned + for the platform (this is of special importance for subclasses of, e.g., + str or int, so that pointers can be stored after the embedded data). + + Note that there's no memory wastage in doing this, as malloc has to + return (at worst) pointer-aligned memory anyway. +*/ +#if ((SIZEOF_VOID_P - 1) & SIZEOF_VOID_P) != 0 +# error "_PyObject_VAR_SIZE requires SIZEOF_VOID_P be a power of 2" +#endif + +static inline size_t _PyObject_VAR_SIZE(PyTypeObject *type, Py_ssize_t nitems) { + size_t size = _Py_STATIC_CAST(size_t, type->tp_basicsize); + size += _Py_STATIC_CAST(size_t, nitems) * _Py_STATIC_CAST(size_t, type->tp_itemsize); + return _Py_SIZE_ROUND_UP(size, SIZEOF_VOID_P); +} + + +/* This example code implements an object constructor with a custom + allocator, where PyObject_New is inlined, and shows the important + distinction between two steps (at least): + 1) the actual allocation of the object storage; + 2) the initialization of the Python specific fields + in this storage with PyObject_{Init, InitVar}. + + PyObject * + YourObject_New(...) + { + PyObject *op; + + op = (PyObject *) Your_Allocator(_PyObject_SIZE(YourTypeStruct)); + if (op == NULL) { + return PyErr_NoMemory(); + } + + PyObject_Init(op, &YourTypeStruct); + + op->ob_field = value; + ... + return op; + } + + Note that in C++, the use of the new operator usually implies that + the 1st step is performed automatically for you, so in a C++ class + constructor you would start directly with PyObject_Init/InitVar. */ + + +typedef struct { + /* user context passed as the first argument to the 2 functions */ + void *ctx; + + /* allocate an arena of size bytes */ + void* (*alloc) (void *ctx, size_t size); + + /* free an arena */ + void (*free) (void *ctx, void *ptr, size_t size); +} PyObjectArenaAllocator; + +/* Get the arena allocator. */ +PyAPI_FUNC(void) PyObject_GetArenaAllocator(PyObjectArenaAllocator *allocator); + +/* Set the arena allocator. */ +PyAPI_FUNC(void) PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator); + + +/* Test if an object implements the garbage collector protocol */ +PyAPI_FUNC(int) PyObject_IS_GC(PyObject *obj); + + +// Test if a type supports weak references +PyAPI_FUNC(int) PyType_SUPPORTS_WEAKREFS(PyTypeObject *type); + +PyAPI_FUNC(PyObject **) PyObject_GET_WEAKREFS_LISTPTR(PyObject *op); + +PyAPI_FUNC(PyObject *) PyUnstable_Object_GC_NewWithExtraData(PyTypeObject *, + size_t); + + +/* Visit all live GC-capable objects, similar to gc.get_objects(None). The + * supplied callback is called on every such object with the void* arg set + * to the supplied arg. Returning 0 from the callback ends iteration, returning + * 1 allows iteration to continue. Returning any other value may result in + * undefined behaviour. + * + * If new objects are (de)allocated by the callback it is undefined if they + * will be visited. + + * Garbage collection is disabled during operation. Explicitly running a + * collection in the callback may lead to undefined behaviour e.g. visiting the + * same objects multiple times or not at all. + */ +typedef int (*gcvisitobjects_t)(PyObject*, void*); +PyAPI_FUNC(void) PyUnstable_GC_VisitObjects(gcvisitobjects_t callback, void* arg); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/odictobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/odictobject.h new file mode 100644 index 0000000000000000000000000000000000000000..3822d554868c10e3910f13aad4272f2973726eed --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/odictobject.h @@ -0,0 +1,43 @@ +#ifndef Py_ODICTOBJECT_H +#define Py_ODICTOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + + +/* OrderedDict */ +/* This API is optional and mostly redundant. */ + +#ifndef Py_LIMITED_API + +typedef struct _odictobject PyODictObject; + +PyAPI_DATA(PyTypeObject) PyODict_Type; +PyAPI_DATA(PyTypeObject) PyODictIter_Type; +PyAPI_DATA(PyTypeObject) PyODictKeys_Type; +PyAPI_DATA(PyTypeObject) PyODictItems_Type; +PyAPI_DATA(PyTypeObject) PyODictValues_Type; + +#define PyODict_Check(op) PyObject_TypeCheck((op), &PyODict_Type) +#define PyODict_CheckExact(op) Py_IS_TYPE((op), &PyODict_Type) +#define PyODict_SIZE(op) PyDict_GET_SIZE((op)) + +PyAPI_FUNC(PyObject *) PyODict_New(void); +PyAPI_FUNC(int) PyODict_SetItem(PyObject *od, PyObject *key, PyObject *item); +PyAPI_FUNC(int) PyODict_DelItem(PyObject *od, PyObject *key); + +/* wrappers around PyDict* functions */ +#define PyODict_GetItem(od, key) PyDict_GetItem(_PyObject_CAST(od), (key)) +#define PyODict_GetItemWithError(od, key) \ + PyDict_GetItemWithError(_PyObject_CAST(od), (key)) +#define PyODict_Contains(od, key) PyDict_Contains(_PyObject_CAST(od), (key)) +#define PyODict_Size(od) PyDict_Size(_PyObject_CAST(od)) +#define PyODict_GetItemString(od, key) \ + PyDict_GetItemString(_PyObject_CAST(od), (key)) + +#endif + +#ifdef __cplusplus +} +#endif +#endif /* !Py_ODICTOBJECT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/picklebufobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/picklebufobject.h new file mode 100644 index 0000000000000000000000000000000000000000..f3cbaeef919518cd3154ce6cd4634210aebf42de --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/picklebufobject.h @@ -0,0 +1,31 @@ +/* PickleBuffer object. This is built-in for ease of use from third-party + * C extensions. + */ + +#ifndef Py_PICKLEBUFOBJECT_H +#define Py_PICKLEBUFOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_LIMITED_API + +PyAPI_DATA(PyTypeObject) PyPickleBuffer_Type; + +#define PyPickleBuffer_Check(op) Py_IS_TYPE((op), &PyPickleBuffer_Type) + +/* Create a PickleBuffer redirecting to the given buffer-enabled object */ +PyAPI_FUNC(PyObject *) PyPickleBuffer_FromObject(PyObject *); +/* Get the PickleBuffer's underlying view to the original object + * (NULL if released) + */ +PyAPI_FUNC(const Py_buffer *) PyPickleBuffer_GetBuffer(PyObject *); +/* Release the PickleBuffer. Returns 0 on success, -1 on error. */ +PyAPI_FUNC(int) PyPickleBuffer_Release(PyObject *); + +#endif /* !Py_LIMITED_API */ + +#ifdef __cplusplus +} +#endif +#endif /* !Py_PICKLEBUFOBJECT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pthread_stubs.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pthread_stubs.h new file mode 100644 index 0000000000000000000000000000000000000000..e542eaa5bff0cf0322441f18e05da6dba35ab417 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pthread_stubs.h @@ -0,0 +1,105 @@ +#ifndef Py_CPYTHON_PTRHEAD_STUBS_H +#define Py_CPYTHON_PTRHEAD_STUBS_H + +#if !defined(HAVE_PTHREAD_STUBS) +# error "this header file requires stubbed pthreads." +#endif + +#ifndef _POSIX_THREADS +# define _POSIX_THREADS 1 +#endif + +/* Minimal pthread stubs for CPython. + * + * The stubs implement the minimum pthread API for CPython. + * - pthread_create() fails. + * - pthread_exit() calls exit(0). + * - pthread_key_*() functions implement minimal TSS without destructor. + * - all other functions do nothing and return 0. + */ + +#ifdef __wasi__ +// WASI's bits/alltypes.h provides type definitions when __NEED_ is set. +// The header file can be included multiple times. +// +// may also define these macros. +# ifndef __NEED_pthread_cond_t +# define __NEED_pthread_cond_t 1 +# endif +# ifndef __NEED_pthread_condattr_t +# define __NEED_pthread_condattr_t 1 +# endif +# ifndef __NEED_pthread_mutex_t +# define __NEED_pthread_mutex_t 1 +# endif +# ifndef __NEED_pthread_mutexattr_t +# define __NEED_pthread_mutexattr_t 1 +# endif +# ifndef __NEED_pthread_key_t +# define __NEED_pthread_key_t 1 +# endif +# ifndef __NEED_pthread_t +# define __NEED_pthread_t 1 +# endif +# ifndef __NEED_pthread_attr_t +# define __NEED_pthread_attr_t 1 +# endif +# include +#else +typedef struct { void *__x; } pthread_cond_t; +typedef struct { unsigned __attr; } pthread_condattr_t; +typedef struct { void *__x; } pthread_mutex_t; +typedef struct { unsigned __attr; } pthread_mutexattr_t; +typedef unsigned pthread_key_t; +typedef unsigned pthread_t; +typedef struct { unsigned __attr; } pthread_attr_t; +#endif + +// mutex +PyAPI_FUNC(int) pthread_mutex_init(pthread_mutex_t *restrict mutex, + const pthread_mutexattr_t *restrict attr); +PyAPI_FUNC(int) pthread_mutex_destroy(pthread_mutex_t *mutex); +PyAPI_FUNC(int) pthread_mutex_trylock(pthread_mutex_t *mutex); +PyAPI_FUNC(int) pthread_mutex_lock(pthread_mutex_t *mutex); +PyAPI_FUNC(int) pthread_mutex_unlock(pthread_mutex_t *mutex); + +// condition +PyAPI_FUNC(int) pthread_cond_init(pthread_cond_t *restrict cond, + const pthread_condattr_t *restrict attr); +PyAPI_FUNC(int) pthread_cond_destroy(pthread_cond_t *cond); +PyAPI_FUNC(int) pthread_cond_wait(pthread_cond_t *restrict cond, + pthread_mutex_t *restrict mutex); +PyAPI_FUNC(int) pthread_cond_timedwait(pthread_cond_t *restrict cond, + pthread_mutex_t *restrict mutex, + const struct timespec *restrict abstime); +PyAPI_FUNC(int) pthread_cond_signal(pthread_cond_t *cond); +PyAPI_FUNC(int) pthread_condattr_init(pthread_condattr_t *attr); +PyAPI_FUNC(int) pthread_condattr_setclock( + pthread_condattr_t *attr, clockid_t clock_id); + +// pthread +PyAPI_FUNC(int) pthread_create(pthread_t *restrict thread, + const pthread_attr_t *restrict attr, + void *(*start_routine)(void *), + void *restrict arg); +PyAPI_FUNC(int) pthread_detach(pthread_t thread); +PyAPI_FUNC(int) pthread_join(pthread_t thread, void** value_ptr); +PyAPI_FUNC(pthread_t) pthread_self(void); +PyAPI_FUNC(int) pthread_exit(void *retval) __attribute__ ((__noreturn__)); +PyAPI_FUNC(int) pthread_attr_init(pthread_attr_t *attr); +PyAPI_FUNC(int) pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize); +PyAPI_FUNC(int) pthread_attr_destroy(pthread_attr_t *attr); + + +// pthread_key +#ifndef PTHREAD_KEYS_MAX +# define PTHREAD_KEYS_MAX 128 +#endif + +PyAPI_FUNC(int) pthread_key_create(pthread_key_t *key, + void (*destr_function)(void *)); +PyAPI_FUNC(int) pthread_key_delete(pthread_key_t key); +PyAPI_FUNC(void *) pthread_getspecific(pthread_key_t key); +PyAPI_FUNC(int) pthread_setspecific(pthread_key_t key, const void *value); + +#endif // Py_CPYTHON_PTRHEAD_STUBS_H diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyatomic.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyatomic.h new file mode 100644 index 0000000000000000000000000000000000000000..3a71ed689d88d8fbf8e907a41161596c27a458c6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyatomic.h @@ -0,0 +1,628 @@ +// This header provides cross-platform low-level atomic operations +// similar to C11 atomics. +// +// Operations are sequentially consistent unless they have a suffix indicating +// otherwise. If in doubt, prefer the sequentially consistent operations. +// +// The "_relaxed" suffix for load and store operations indicates the "relaxed" +// memory order. They don't provide synchronization, but (roughly speaking) +// guarantee somewhat sane behavior for races instead of undefined behavior. +// In practice, they correspond to "normal" hardware load and store +// instructions, so they are almost as inexpensive as plain loads and stores +// in C. +// +// Note that atomic read-modify-write operations like _Py_atomic_add_* return +// the previous value of the atomic variable, not the new value. +// +// See https://en.cppreference.com/w/c/atomic for more information on C11 +// atomics. +// See https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2055r0.pdf +// "A Relaxed Guide to memory_order_relaxed" for discussion of and common usage +// or relaxed atomics. +// +// Functions with pseudo Python code: +// +// def _Py_atomic_load(obj): +// return obj # sequential consistency +// +// def _Py_atomic_load_relaxed(obj): +// return obj # relaxed consistency +// +// def _Py_atomic_store(obj, value): +// obj = value # sequential consistency +// +// def _Py_atomic_store_relaxed(obj, value): +// obj = value # relaxed consistency +// +// def _Py_atomic_exchange(obj, value): +// # sequential consistency +// old_obj = obj +// obj = value +// return old_obj +// +// def _Py_atomic_compare_exchange(obj, expected, desired): +// # sequential consistency +// if obj == expected: +// obj = desired +// return True +// else: +// expected = obj +// return False +// +// def _Py_atomic_add(obj, value): +// # sequential consistency +// old_obj = obj +// obj += value +// return old_obj +// +// def _Py_atomic_and(obj, value): +// # sequential consistency +// old_obj = obj +// obj &= value +// return old_obj +// +// def _Py_atomic_or(obj, value): +// # sequential consistency +// old_obj = obj +// obj |= value +// return old_obj +// +// Other functions: +// +// def _Py_atomic_load_ptr_acquire(obj): +// return obj # acquire +// +// def _Py_atomic_store_ptr_release(obj, value): +// obj = value # release +// +// def _Py_atomic_fence_seq_cst(): +// # sequential consistency +// ... +// +// def _Py_atomic_fence_release(): +// # release +// ... + +#ifndef Py_CPYTHON_ATOMIC_H +# error "this header file must not be included directly" +#endif + +// --- _Py_atomic_add -------------------------------------------------------- +// Atomically adds `value` to `obj` and returns the previous value + +static inline int +_Py_atomic_add_int(int *obj, int value); + +static inline int8_t +_Py_atomic_add_int8(int8_t *obj, int8_t value); + +static inline int16_t +_Py_atomic_add_int16(int16_t *obj, int16_t value); + +static inline int32_t +_Py_atomic_add_int32(int32_t *obj, int32_t value); + +static inline int64_t +_Py_atomic_add_int64(int64_t *obj, int64_t value); + +static inline intptr_t +_Py_atomic_add_intptr(intptr_t *obj, intptr_t value); + +static inline unsigned int +_Py_atomic_add_uint(unsigned int *obj, unsigned int value); + +static inline uint8_t +_Py_atomic_add_uint8(uint8_t *obj, uint8_t value); + +static inline uint16_t +_Py_atomic_add_uint16(uint16_t *obj, uint16_t value); + +static inline uint32_t +_Py_atomic_add_uint32(uint32_t *obj, uint32_t value); + +static inline uint64_t +_Py_atomic_add_uint64(uint64_t *obj, uint64_t value); + +static inline uintptr_t +_Py_atomic_add_uintptr(uintptr_t *obj, uintptr_t value); + +static inline Py_ssize_t +_Py_atomic_add_ssize(Py_ssize_t *obj, Py_ssize_t value); + + +// --- _Py_atomic_compare_exchange ------------------------------------------- +// Performs an atomic compare-and-exchange. +// +// - If `*obj` and `*expected` are equal, store `desired` into `*obj` +// and return 1 (success). +// - Otherwise, store the `*obj` current value into `*expected` +// and return 0 (failure). +// +// These correspond to the C11 atomic_compare_exchange_strong() function. + +static inline int +_Py_atomic_compare_exchange_int(int *obj, int *expected, int desired); + +static inline int +_Py_atomic_compare_exchange_int8(int8_t *obj, int8_t *expected, int8_t desired); + +static inline int +_Py_atomic_compare_exchange_int16(int16_t *obj, int16_t *expected, int16_t desired); + +static inline int +_Py_atomic_compare_exchange_int32(int32_t *obj, int32_t *expected, int32_t desired); + +static inline int +_Py_atomic_compare_exchange_int64(int64_t *obj, int64_t *expected, int64_t desired); + +static inline int +_Py_atomic_compare_exchange_intptr(intptr_t *obj, intptr_t *expected, intptr_t desired); + +static inline int +_Py_atomic_compare_exchange_uint(unsigned int *obj, unsigned int *expected, unsigned int desired); + +static inline int +_Py_atomic_compare_exchange_uint8(uint8_t *obj, uint8_t *expected, uint8_t desired); + +static inline int +_Py_atomic_compare_exchange_uint16(uint16_t *obj, uint16_t *expected, uint16_t desired); + +static inline int +_Py_atomic_compare_exchange_uint32(uint32_t *obj, uint32_t *expected, uint32_t desired); + +static inline int +_Py_atomic_compare_exchange_uint64(uint64_t *obj, uint64_t *expected, uint64_t desired); + +static inline int +_Py_atomic_compare_exchange_uintptr(uintptr_t *obj, uintptr_t *expected, uintptr_t desired); + +static inline int +_Py_atomic_compare_exchange_ssize(Py_ssize_t *obj, Py_ssize_t *expected, Py_ssize_t desired); + +// NOTE: `obj` and `expected` are logically `void**` types, but we use `void*` +// so that we can pass types like `PyObject**` without a cast. +static inline int +_Py_atomic_compare_exchange_ptr(void *obj, void *expected, void *value); + + +// --- _Py_atomic_exchange --------------------------------------------------- +// Atomically replaces `*obj` with `value` and returns the previous value of `*obj`. + +static inline int +_Py_atomic_exchange_int(int *obj, int value); + +static inline int8_t +_Py_atomic_exchange_int8(int8_t *obj, int8_t value); + +static inline int16_t +_Py_atomic_exchange_int16(int16_t *obj, int16_t value); + +static inline int32_t +_Py_atomic_exchange_int32(int32_t *obj, int32_t value); + +static inline int64_t +_Py_atomic_exchange_int64(int64_t *obj, int64_t value); + +static inline intptr_t +_Py_atomic_exchange_intptr(intptr_t *obj, intptr_t value); + +static inline unsigned int +_Py_atomic_exchange_uint(unsigned int *obj, unsigned int value); + +static inline uint8_t +_Py_atomic_exchange_uint8(uint8_t *obj, uint8_t value); + +static inline uint16_t +_Py_atomic_exchange_uint16(uint16_t *obj, uint16_t value); + +static inline uint32_t +_Py_atomic_exchange_uint32(uint32_t *obj, uint32_t value); + +static inline uint64_t +_Py_atomic_exchange_uint64(uint64_t *obj, uint64_t value); + +static inline uintptr_t +_Py_atomic_exchange_uintptr(uintptr_t *obj, uintptr_t value); + +static inline Py_ssize_t +_Py_atomic_exchange_ssize(Py_ssize_t *obj, Py_ssize_t value); + +static inline void * +_Py_atomic_exchange_ptr(void *obj, void *value); + + +// --- _Py_atomic_and -------------------------------------------------------- +// Performs `*obj &= value` atomically and returns the previous value of `*obj`. + +static inline uint8_t +_Py_atomic_and_uint8(uint8_t *obj, uint8_t value); + +static inline uint16_t +_Py_atomic_and_uint16(uint16_t *obj, uint16_t value); + +static inline uint32_t +_Py_atomic_and_uint32(uint32_t *obj, uint32_t value); + +static inline uint64_t +_Py_atomic_and_uint64(uint64_t *obj, uint64_t value); + +static inline uintptr_t +_Py_atomic_and_uintptr(uintptr_t *obj, uintptr_t value); + + +// --- _Py_atomic_or --------------------------------------------------------- +// Performs `*obj |= value` atomically and returns the previous value of `*obj`. + +static inline uint8_t +_Py_atomic_or_uint8(uint8_t *obj, uint8_t value); + +static inline uint16_t +_Py_atomic_or_uint16(uint16_t *obj, uint16_t value); + +static inline uint32_t +_Py_atomic_or_uint32(uint32_t *obj, uint32_t value); + +static inline uint64_t +_Py_atomic_or_uint64(uint64_t *obj, uint64_t value); + +static inline uintptr_t +_Py_atomic_or_uintptr(uintptr_t *obj, uintptr_t value); + + +// --- _Py_atomic_load ------------------------------------------------------- +// Atomically loads `*obj` (sequential consistency) + +static inline int +_Py_atomic_load_int(const int *obj); + +static inline int8_t +_Py_atomic_load_int8(const int8_t *obj); + +static inline int16_t +_Py_atomic_load_int16(const int16_t *obj); + +static inline int32_t +_Py_atomic_load_int32(const int32_t *obj); + +static inline int64_t +_Py_atomic_load_int64(const int64_t *obj); + +static inline intptr_t +_Py_atomic_load_intptr(const intptr_t *obj); + +static inline uint8_t +_Py_atomic_load_uint8(const uint8_t *obj); + +static inline uint16_t +_Py_atomic_load_uint16(const uint16_t *obj); + +static inline uint32_t +_Py_atomic_load_uint32(const uint32_t *obj); + +static inline uint64_t +_Py_atomic_load_uint64(const uint64_t *obj); + +static inline uintptr_t +_Py_atomic_load_uintptr(const uintptr_t *obj); + +static inline unsigned int +_Py_atomic_load_uint(const unsigned int *obj); + +static inline Py_ssize_t +_Py_atomic_load_ssize(const Py_ssize_t *obj); + +static inline void * +_Py_atomic_load_ptr(const void *obj); + + +// --- _Py_atomic_load_relaxed ----------------------------------------------- +// Loads `*obj` (relaxed consistency, i.e., no ordering) + +static inline int +_Py_atomic_load_int_relaxed(const int *obj); + +static inline char +_Py_atomic_load_char_relaxed(const char *obj); + +static inline unsigned char +_Py_atomic_load_uchar_relaxed(const unsigned char *obj); + +static inline short +_Py_atomic_load_short_relaxed(const short *obj); + +static inline unsigned short +_Py_atomic_load_ushort_relaxed(const unsigned short *obj); + +static inline long +_Py_atomic_load_long_relaxed(const long *obj); + +static inline double +_Py_atomic_load_double_relaxed(const double *obj); + +static inline long long +_Py_atomic_load_llong_relaxed(const long long *obj); + +static inline int8_t +_Py_atomic_load_int8_relaxed(const int8_t *obj); + +static inline int16_t +_Py_atomic_load_int16_relaxed(const int16_t *obj); + +static inline int32_t +_Py_atomic_load_int32_relaxed(const int32_t *obj); + +static inline int64_t +_Py_atomic_load_int64_relaxed(const int64_t *obj); + +static inline intptr_t +_Py_atomic_load_intptr_relaxed(const intptr_t *obj); + +static inline uint8_t +_Py_atomic_load_uint8_relaxed(const uint8_t *obj); + +static inline uint16_t +_Py_atomic_load_uint16_relaxed(const uint16_t *obj); + +static inline uint32_t +_Py_atomic_load_uint32_relaxed(const uint32_t *obj); + +static inline uint64_t +_Py_atomic_load_uint64_relaxed(const uint64_t *obj); + +static inline uintptr_t +_Py_atomic_load_uintptr_relaxed(const uintptr_t *obj); + +static inline unsigned int +_Py_atomic_load_uint_relaxed(const unsigned int *obj); + +static inline Py_ssize_t +_Py_atomic_load_ssize_relaxed(const Py_ssize_t *obj); + +static inline void * +_Py_atomic_load_ptr_relaxed(const void *obj); + +static inline unsigned long long +_Py_atomic_load_ullong_relaxed(const unsigned long long *obj); + +// --- _Py_atomic_store ------------------------------------------------------ +// Atomically performs `*obj = value` (sequential consistency) + +static inline void +_Py_atomic_store_int(int *obj, int value); + +static inline void +_Py_atomic_store_int8(int8_t *obj, int8_t value); + +static inline void +_Py_atomic_store_int16(int16_t *obj, int16_t value); + +static inline void +_Py_atomic_store_int32(int32_t *obj, int32_t value); + +static inline void +_Py_atomic_store_int64(int64_t *obj, int64_t value); + +static inline void +_Py_atomic_store_intptr(intptr_t *obj, intptr_t value); + +static inline void +_Py_atomic_store_uint8(uint8_t *obj, uint8_t value); + +static inline void +_Py_atomic_store_uint16(uint16_t *obj, uint16_t value); + +static inline void +_Py_atomic_store_uint32(uint32_t *obj, uint32_t value); + +static inline void +_Py_atomic_store_uint64(uint64_t *obj, uint64_t value); + +static inline void +_Py_atomic_store_uintptr(uintptr_t *obj, uintptr_t value); + +static inline void +_Py_atomic_store_uint(unsigned int *obj, unsigned int value); + +static inline void +_Py_atomic_store_ptr(void *obj, void *value); + +static inline void +_Py_atomic_store_ssize(Py_ssize_t* obj, Py_ssize_t value); + + +// --- _Py_atomic_store_relaxed ---------------------------------------------- +// Stores `*obj = value` (relaxed consistency, i.e., no ordering) + +static inline void +_Py_atomic_store_int_relaxed(int *obj, int value); + +static inline void +_Py_atomic_store_int8_relaxed(int8_t *obj, int8_t value); + +static inline void +_Py_atomic_store_int16_relaxed(int16_t *obj, int16_t value); + +static inline void +_Py_atomic_store_int32_relaxed(int32_t *obj, int32_t value); + +static inline void +_Py_atomic_store_int64_relaxed(int64_t *obj, int64_t value); + +static inline void +_Py_atomic_store_intptr_relaxed(intptr_t *obj, intptr_t value); + +static inline void +_Py_atomic_store_uint8_relaxed(uint8_t* obj, uint8_t value); + +static inline void +_Py_atomic_store_uint16_relaxed(uint16_t *obj, uint16_t value); + +static inline void +_Py_atomic_store_uint32_relaxed(uint32_t *obj, uint32_t value); + +static inline void +_Py_atomic_store_uint64_relaxed(uint64_t *obj, uint64_t value); + +static inline void +_Py_atomic_store_uintptr_relaxed(uintptr_t *obj, uintptr_t value); + +static inline void +_Py_atomic_store_uint_relaxed(unsigned int *obj, unsigned int value); + +static inline void +_Py_atomic_store_ptr_relaxed(void *obj, void *value); + +static inline void +_Py_atomic_store_ssize_relaxed(Py_ssize_t *obj, Py_ssize_t value); + +static inline void +_Py_atomic_store_ullong_relaxed(unsigned long long *obj, + unsigned long long value); + +static inline void +_Py_atomic_store_char_relaxed(char *obj, char value); + +static inline void +_Py_atomic_store_uchar_relaxed(unsigned char *obj, unsigned char value); + +static inline void +_Py_atomic_store_short_relaxed(short *obj, short value); + +static inline void +_Py_atomic_store_ushort_relaxed(unsigned short *obj, unsigned short value); + +static inline void +_Py_atomic_store_long_relaxed(long *obj, long value); + +static inline void +_Py_atomic_store_float_relaxed(float *obj, float value); + +static inline void +_Py_atomic_store_double_relaxed(double *obj, double value); + +static inline void +_Py_atomic_store_llong_relaxed(long long *obj, long long value); + + +// --- _Py_atomic_load_ptr_acquire / _Py_atomic_store_ptr_release ------------ + +// Loads `*obj` (acquire operation) +static inline void * +_Py_atomic_load_ptr_acquire(const void *obj); + +static inline uintptr_t +_Py_atomic_load_uintptr_acquire(const uintptr_t *obj); + +// Stores `*obj = value` (release operation) +static inline void +_Py_atomic_store_ptr_release(void *obj, void *value); + +static inline void +_Py_atomic_store_uintptr_release(uintptr_t *obj, uintptr_t value); + +static inline void +_Py_atomic_store_ssize_release(Py_ssize_t *obj, Py_ssize_t value); + +static inline void +_Py_atomic_store_int_release(int *obj, int value); + +static inline int +_Py_atomic_load_int_acquire(const int *obj); + +static inline void +_Py_atomic_store_uint_release(unsigned int *obj, unsigned int value); + +static inline void +_Py_atomic_store_uint32_release(uint32_t *obj, uint32_t value); + +static inline void +_Py_atomic_store_uint64_release(uint64_t *obj, uint64_t value); + +static inline uint64_t +_Py_atomic_load_uint64_acquire(const uint64_t *obj); + +static inline uint32_t +_Py_atomic_load_uint32_acquire(const uint32_t *obj); + +static inline Py_ssize_t +_Py_atomic_load_ssize_acquire(const Py_ssize_t *obj); + + + + +// --- _Py_atomic_fence ------------------------------------------------------ + +// Sequential consistency fence. C11 fences have complex semantics. When +// possible, use the atomic operations on variables defined above, which +// generally do not require explicit use of a fence. +// See https://en.cppreference.com/w/cpp/atomic/atomic_thread_fence +static inline void _Py_atomic_fence_seq_cst(void); + +// Acquire fence +static inline void _Py_atomic_fence_acquire(void); + +// Release fence +static inline void _Py_atomic_fence_release(void); + + +#ifndef _Py_USE_GCC_BUILTIN_ATOMICS +# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) +# define _Py_USE_GCC_BUILTIN_ATOMICS 1 +# elif defined(__clang__) +# if __has_builtin(__atomic_load) +# define _Py_USE_GCC_BUILTIN_ATOMICS 1 +# endif +# endif +#endif + +#if _Py_USE_GCC_BUILTIN_ATOMICS +# define Py_ATOMIC_GCC_H +# include "pyatomic_gcc.h" +# undef Py_ATOMIC_GCC_H +#elif __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_ATOMICS__) +# define Py_ATOMIC_STD_H +# include "pyatomic_std.h" +# undef Py_ATOMIC_STD_H +#elif defined(_MSC_VER) +# define Py_ATOMIC_MSC_H +# include "pyatomic_msc.h" +# undef Py_ATOMIC_MSC_H +#else +# error "no available pyatomic implementation for this platform/compiler" +#endif + + +// --- aliases --------------------------------------------------------------- + +// Compilers don't really support "consume" semantics, so we fake it. Use +// "acquire" with TSan to support false positives. Use "relaxed" otherwise, +// because CPUs on all platforms we support respect address dependencies without +// extra barriers. +// See 2.6.7 in https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2055r0.pdf +#if defined(_Py_THREAD_SANITIZER) +# define _Py_atomic_load_ptr_consume _Py_atomic_load_ptr_acquire +#else +# define _Py_atomic_load_ptr_consume _Py_atomic_load_ptr_relaxed +#endif + +#if SIZEOF_LONG == 8 +# define _Py_atomic_load_ulong(p) \ + _Py_atomic_load_uint64((uint64_t *)p) +# define _Py_atomic_load_ulong_relaxed(p) \ + _Py_atomic_load_uint64_relaxed((uint64_t *)p) +# define _Py_atomic_store_ulong(p, v) \ + _Py_atomic_store_uint64((uint64_t *)p, v) +# define _Py_atomic_store_ulong_relaxed(p, v) \ + _Py_atomic_store_uint64_relaxed((uint64_t *)p, v) +#elif SIZEOF_LONG == 4 +# define _Py_atomic_load_ulong(p) \ + _Py_atomic_load_uint32((uint32_t *)p) +# define _Py_atomic_load_ulong_relaxed(p) \ + _Py_atomic_load_uint32_relaxed((uint32_t *)p) +# define _Py_atomic_store_ulong(p, v) \ + _Py_atomic_store_uint32((uint32_t *)p, v) +# define _Py_atomic_store_ulong_relaxed(p, v) \ + _Py_atomic_store_uint32_relaxed((uint32_t *)p, v) +#else +# error "long must be 4 or 8 bytes in size" +#endif // SIZEOF_LONG diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyatomic_gcc.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyatomic_gcc.h new file mode 100644 index 0000000000000000000000000000000000000000..465226a76ab2556b7c771ddb0fee8ce92d7daddd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyatomic_gcc.h @@ -0,0 +1,619 @@ +// This is the implementation of Python atomic operations using GCC's built-in +// functions that match the C+11 memory model. This implementation is preferred +// for GCC compatible compilers, such as Clang. These functions are available +// in GCC 4.8+ without needing to compile with --std=c11 or --std=gnu11. + +#ifndef Py_ATOMIC_GCC_H +# error "this header file must not be included directly" +#endif + + +// --- _Py_atomic_add -------------------------------------------------------- + +static inline int +_Py_atomic_add_int(int *obj, int value) +{ return __atomic_fetch_add(obj, value, __ATOMIC_SEQ_CST); } + +static inline int8_t +_Py_atomic_add_int8(int8_t *obj, int8_t value) +{ return __atomic_fetch_add(obj, value, __ATOMIC_SEQ_CST); } + +static inline int16_t +_Py_atomic_add_int16(int16_t *obj, int16_t value) +{ return __atomic_fetch_add(obj, value, __ATOMIC_SEQ_CST); } + +static inline int32_t +_Py_atomic_add_int32(int32_t *obj, int32_t value) +{ return __atomic_fetch_add(obj, value, __ATOMIC_SEQ_CST); } + +static inline int64_t +_Py_atomic_add_int64(int64_t *obj, int64_t value) +{ return __atomic_fetch_add(obj, value, __ATOMIC_SEQ_CST); } + +static inline intptr_t +_Py_atomic_add_intptr(intptr_t *obj, intptr_t value) +{ return __atomic_fetch_add(obj, value, __ATOMIC_SEQ_CST); } + +static inline unsigned int +_Py_atomic_add_uint(unsigned int *obj, unsigned int value) +{ return __atomic_fetch_add(obj, value, __ATOMIC_SEQ_CST); } + +static inline uint8_t +_Py_atomic_add_uint8(uint8_t *obj, uint8_t value) +{ return __atomic_fetch_add(obj, value, __ATOMIC_SEQ_CST); } + +static inline uint16_t +_Py_atomic_add_uint16(uint16_t *obj, uint16_t value) +{ return __atomic_fetch_add(obj, value, __ATOMIC_SEQ_CST); } + +static inline uint32_t +_Py_atomic_add_uint32(uint32_t *obj, uint32_t value) +{ return __atomic_fetch_add(obj, value, __ATOMIC_SEQ_CST); } + +static inline uint64_t +_Py_atomic_add_uint64(uint64_t *obj, uint64_t value) +{ return __atomic_fetch_add(obj, value, __ATOMIC_SEQ_CST); } + +static inline uintptr_t +_Py_atomic_add_uintptr(uintptr_t *obj, uintptr_t value) +{ return __atomic_fetch_add(obj, value, __ATOMIC_SEQ_CST); } + +static inline Py_ssize_t +_Py_atomic_add_ssize(Py_ssize_t *obj, Py_ssize_t value) +{ return __atomic_fetch_add(obj, value, __ATOMIC_SEQ_CST); } + + +// --- _Py_atomic_compare_exchange ------------------------------------------- + +static inline int +_Py_atomic_compare_exchange_int(int *obj, int *expected, int desired) +{ return __atomic_compare_exchange_n(obj, expected, desired, 0, + __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } + +static inline int +_Py_atomic_compare_exchange_int8(int8_t *obj, int8_t *expected, int8_t desired) +{ return __atomic_compare_exchange_n(obj, expected, desired, 0, + __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } + +static inline int +_Py_atomic_compare_exchange_int16(int16_t *obj, int16_t *expected, int16_t desired) +{ return __atomic_compare_exchange_n(obj, expected, desired, 0, + __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } + +static inline int +_Py_atomic_compare_exchange_int32(int32_t *obj, int32_t *expected, int32_t desired) +{ return __atomic_compare_exchange_n(obj, expected, desired, 0, + __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } + +static inline int +_Py_atomic_compare_exchange_int64(int64_t *obj, int64_t *expected, int64_t desired) +{ return __atomic_compare_exchange_n(obj, expected, desired, 0, + __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } + +static inline int +_Py_atomic_compare_exchange_intptr(intptr_t *obj, intptr_t *expected, intptr_t desired) +{ return __atomic_compare_exchange_n(obj, expected, desired, 0, + __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } + +static inline int +_Py_atomic_compare_exchange_uint(unsigned int *obj, unsigned int *expected, unsigned int desired) +{ return __atomic_compare_exchange_n(obj, expected, desired, 0, + __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } + +static inline int +_Py_atomic_compare_exchange_uint8(uint8_t *obj, uint8_t *expected, uint8_t desired) +{ return __atomic_compare_exchange_n(obj, expected, desired, 0, + __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } + +static inline int +_Py_atomic_compare_exchange_uint16(uint16_t *obj, uint16_t *expected, uint16_t desired) +{ return __atomic_compare_exchange_n(obj, expected, desired, 0, + __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } + +static inline int +_Py_atomic_compare_exchange_uint32(uint32_t *obj, uint32_t *expected, uint32_t desired) +{ return __atomic_compare_exchange_n(obj, expected, desired, 0, + __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } + +static inline int +_Py_atomic_compare_exchange_uint64(uint64_t *obj, uint64_t *expected, uint64_t desired) +{ return __atomic_compare_exchange_n(obj, expected, desired, 0, + __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } + +static inline int +_Py_atomic_compare_exchange_uintptr(uintptr_t *obj, uintptr_t *expected, uintptr_t desired) +{ return __atomic_compare_exchange_n(obj, expected, desired, 0, + __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } + +static inline int +_Py_atomic_compare_exchange_ssize(Py_ssize_t *obj, Py_ssize_t *expected, Py_ssize_t desired) +{ return __atomic_compare_exchange_n(obj, expected, desired, 0, + __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } + +static inline int +_Py_atomic_compare_exchange_ptr(void *obj, void *expected, void *desired) +{ return __atomic_compare_exchange_n((void **)obj, (void **)expected, desired, 0, + __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } + + +// --- _Py_atomic_exchange --------------------------------------------------- + +static inline int +_Py_atomic_exchange_int(int *obj, int value) +{ return __atomic_exchange_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline int8_t +_Py_atomic_exchange_int8(int8_t *obj, int8_t value) +{ return __atomic_exchange_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline int16_t +_Py_atomic_exchange_int16(int16_t *obj, int16_t value) +{ return __atomic_exchange_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline int32_t +_Py_atomic_exchange_int32(int32_t *obj, int32_t value) +{ return __atomic_exchange_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline int64_t +_Py_atomic_exchange_int64(int64_t *obj, int64_t value) +{ return __atomic_exchange_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline intptr_t +_Py_atomic_exchange_intptr(intptr_t *obj, intptr_t value) +{ return __atomic_exchange_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline unsigned int +_Py_atomic_exchange_uint(unsigned int *obj, unsigned int value) +{ return __atomic_exchange_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline uint8_t +_Py_atomic_exchange_uint8(uint8_t *obj, uint8_t value) +{ return __atomic_exchange_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline uint16_t +_Py_atomic_exchange_uint16(uint16_t *obj, uint16_t value) +{ return __atomic_exchange_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline uint32_t +_Py_atomic_exchange_uint32(uint32_t *obj, uint32_t value) +{ return __atomic_exchange_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline uint64_t +_Py_atomic_exchange_uint64(uint64_t *obj, uint64_t value) +{ return __atomic_exchange_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline uintptr_t +_Py_atomic_exchange_uintptr(uintptr_t *obj, uintptr_t value) +{ return __atomic_exchange_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline Py_ssize_t +_Py_atomic_exchange_ssize(Py_ssize_t *obj, Py_ssize_t value) +{ return __atomic_exchange_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline void * +_Py_atomic_exchange_ptr(void *obj, void *value) +{ return __atomic_exchange_n((void **)obj, value, __ATOMIC_SEQ_CST); } + + +// --- _Py_atomic_and -------------------------------------------------------- + +static inline uint8_t +_Py_atomic_and_uint8(uint8_t *obj, uint8_t value) +{ return __atomic_fetch_and(obj, value, __ATOMIC_SEQ_CST); } + +static inline uint16_t +_Py_atomic_and_uint16(uint16_t *obj, uint16_t value) +{ return __atomic_fetch_and(obj, value, __ATOMIC_SEQ_CST); } + +static inline uint32_t +_Py_atomic_and_uint32(uint32_t *obj, uint32_t value) +{ return __atomic_fetch_and(obj, value, __ATOMIC_SEQ_CST); } + +static inline uint64_t +_Py_atomic_and_uint64(uint64_t *obj, uint64_t value) +{ return __atomic_fetch_and(obj, value, __ATOMIC_SEQ_CST); } + +static inline uintptr_t +_Py_atomic_and_uintptr(uintptr_t *obj, uintptr_t value) +{ return __atomic_fetch_and(obj, value, __ATOMIC_SEQ_CST); } + + +// --- _Py_atomic_or --------------------------------------------------------- + +static inline uint8_t +_Py_atomic_or_uint8(uint8_t *obj, uint8_t value) +{ return __atomic_fetch_or(obj, value, __ATOMIC_SEQ_CST); } + +static inline uint16_t +_Py_atomic_or_uint16(uint16_t *obj, uint16_t value) +{ return __atomic_fetch_or(obj, value, __ATOMIC_SEQ_CST); } + +static inline uint32_t +_Py_atomic_or_uint32(uint32_t *obj, uint32_t value) +{ return __atomic_fetch_or(obj, value, __ATOMIC_SEQ_CST); } + +static inline uint64_t +_Py_atomic_or_uint64(uint64_t *obj, uint64_t value) +{ return __atomic_fetch_or(obj, value, __ATOMIC_SEQ_CST); } + +static inline uintptr_t +_Py_atomic_or_uintptr(uintptr_t *obj, uintptr_t value) +{ return __atomic_fetch_or(obj, value, __ATOMIC_SEQ_CST); } + + +// --- _Py_atomic_load ------------------------------------------------------- + +static inline int +_Py_atomic_load_int(const int *obj) +{ return __atomic_load_n(obj, __ATOMIC_SEQ_CST); } + +static inline int8_t +_Py_atomic_load_int8(const int8_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_SEQ_CST); } + +static inline int16_t +_Py_atomic_load_int16(const int16_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_SEQ_CST); } + +static inline int32_t +_Py_atomic_load_int32(const int32_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_SEQ_CST); } + +static inline int64_t +_Py_atomic_load_int64(const int64_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_SEQ_CST); } + +static inline intptr_t +_Py_atomic_load_intptr(const intptr_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_SEQ_CST); } + +static inline uint8_t +_Py_atomic_load_uint8(const uint8_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_SEQ_CST); } + +static inline uint16_t +_Py_atomic_load_uint16(const uint16_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_SEQ_CST); } + +static inline uint32_t +_Py_atomic_load_uint32(const uint32_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_SEQ_CST); } + +static inline uint64_t +_Py_atomic_load_uint64(const uint64_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_SEQ_CST); } + +static inline uintptr_t +_Py_atomic_load_uintptr(const uintptr_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_SEQ_CST); } + +static inline unsigned int +_Py_atomic_load_uint(const unsigned int *obj) +{ return __atomic_load_n(obj, __ATOMIC_SEQ_CST); } + +static inline Py_ssize_t +_Py_atomic_load_ssize(const Py_ssize_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_SEQ_CST); } + +static inline void * +_Py_atomic_load_ptr(const void *obj) +{ return (void *)__atomic_load_n((void * const *)obj, __ATOMIC_SEQ_CST); } + + +// --- _Py_atomic_load_relaxed ----------------------------------------------- + +static inline int +_Py_atomic_load_int_relaxed(const int *obj) +{ return __atomic_load_n(obj, __ATOMIC_RELAXED); } + +static inline char +_Py_atomic_load_char_relaxed(const char *obj) +{ return __atomic_load_n(obj, __ATOMIC_RELAXED); } + +static inline unsigned char +_Py_atomic_load_uchar_relaxed(const unsigned char *obj) +{ return __atomic_load_n(obj, __ATOMIC_RELAXED); } + +static inline short +_Py_atomic_load_short_relaxed(const short *obj) +{ return __atomic_load_n(obj, __ATOMIC_RELAXED); } + +static inline unsigned short +_Py_atomic_load_ushort_relaxed(const unsigned short *obj) +{ return __atomic_load_n(obj, __ATOMIC_RELAXED); } + +static inline long +_Py_atomic_load_long_relaxed(const long *obj) +{ return __atomic_load_n(obj, __ATOMIC_RELAXED); } + +static inline float +_Py_atomic_load_float_relaxed(const float *obj) +{ float ret; __atomic_load(obj, &ret, __ATOMIC_RELAXED); return ret; } + +static inline double +_Py_atomic_load_double_relaxed(const double *obj) +{ double ret; __atomic_load(obj, &ret, __ATOMIC_RELAXED); return ret; } + +static inline int8_t +_Py_atomic_load_int8_relaxed(const int8_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_RELAXED); } + +static inline int16_t +_Py_atomic_load_int16_relaxed(const int16_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_RELAXED); } + +static inline int32_t +_Py_atomic_load_int32_relaxed(const int32_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_RELAXED); } + +static inline int64_t +_Py_atomic_load_int64_relaxed(const int64_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_RELAXED); } + +static inline intptr_t +_Py_atomic_load_intptr_relaxed(const intptr_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_RELAXED); } + +static inline uint8_t +_Py_atomic_load_uint8_relaxed(const uint8_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_RELAXED); } + +static inline uint16_t +_Py_atomic_load_uint16_relaxed(const uint16_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_RELAXED); } + +static inline uint32_t +_Py_atomic_load_uint32_relaxed(const uint32_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_RELAXED); } + +static inline uint64_t +_Py_atomic_load_uint64_relaxed(const uint64_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_RELAXED); } + +static inline uintptr_t +_Py_atomic_load_uintptr_relaxed(const uintptr_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_RELAXED); } + +static inline unsigned int +_Py_atomic_load_uint_relaxed(const unsigned int *obj) +{ return __atomic_load_n(obj, __ATOMIC_RELAXED); } + +static inline Py_ssize_t +_Py_atomic_load_ssize_relaxed(const Py_ssize_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_RELAXED); } + +static inline void * +_Py_atomic_load_ptr_relaxed(const void *obj) +{ return (void *)__atomic_load_n((void * const *)obj, __ATOMIC_RELAXED); } + +static inline unsigned long long +_Py_atomic_load_ullong_relaxed(const unsigned long long *obj) +{ return __atomic_load_n(obj, __ATOMIC_RELAXED); } + +static inline long long +_Py_atomic_load_llong_relaxed(const long long *obj) +{ return __atomic_load_n(obj, __ATOMIC_RELAXED); } + + +// --- _Py_atomic_store ------------------------------------------------------ + +static inline void +_Py_atomic_store_int(int *obj, int value) +{ __atomic_store_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline void +_Py_atomic_store_int8(int8_t *obj, int8_t value) +{ __atomic_store_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline void +_Py_atomic_store_int16(int16_t *obj, int16_t value) +{ __atomic_store_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline void +_Py_atomic_store_int32(int32_t *obj, int32_t value) +{ __atomic_store_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline void +_Py_atomic_store_int64(int64_t *obj, int64_t value) +{ __atomic_store_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline void +_Py_atomic_store_intptr(intptr_t *obj, intptr_t value) +{ __atomic_store_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline void +_Py_atomic_store_uint8(uint8_t *obj, uint8_t value) +{ __atomic_store_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline void +_Py_atomic_store_uint16(uint16_t *obj, uint16_t value) +{ __atomic_store_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline void +_Py_atomic_store_uint32(uint32_t *obj, uint32_t value) +{ __atomic_store_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline void +_Py_atomic_store_uint64(uint64_t *obj, uint64_t value) +{ __atomic_store_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline void +_Py_atomic_store_uintptr(uintptr_t *obj, uintptr_t value) +{ __atomic_store_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline void +_Py_atomic_store_uint(unsigned int *obj, unsigned int value) +{ __atomic_store_n(obj, value, __ATOMIC_SEQ_CST); } + +static inline void +_Py_atomic_store_ptr(void *obj, void *value) +{ __atomic_store_n((void **)obj, value, __ATOMIC_SEQ_CST); } + +static inline void +_Py_atomic_store_ssize(Py_ssize_t *obj, Py_ssize_t value) +{ __atomic_store_n(obj, value, __ATOMIC_SEQ_CST); } + + +// --- _Py_atomic_store_relaxed ---------------------------------------------- + +static inline void +_Py_atomic_store_int_relaxed(int *obj, int value) +{ __atomic_store_n(obj, value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_int8_relaxed(int8_t *obj, int8_t value) +{ __atomic_store_n(obj, value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_int16_relaxed(int16_t *obj, int16_t value) +{ __atomic_store_n(obj, value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_int32_relaxed(int32_t *obj, int32_t value) +{ __atomic_store_n(obj, value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_int64_relaxed(int64_t *obj, int64_t value) +{ __atomic_store_n(obj, value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_intptr_relaxed(intptr_t *obj, intptr_t value) +{ __atomic_store_n(obj, value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_uint8_relaxed(uint8_t *obj, uint8_t value) +{ __atomic_store_n(obj, value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_uint16_relaxed(uint16_t *obj, uint16_t value) +{ __atomic_store_n(obj, value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_uint32_relaxed(uint32_t *obj, uint32_t value) +{ __atomic_store_n(obj, value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_uint64_relaxed(uint64_t *obj, uint64_t value) +{ __atomic_store_n(obj, value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_uintptr_relaxed(uintptr_t *obj, uintptr_t value) +{ __atomic_store_n(obj, value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_uint_relaxed(unsigned int *obj, unsigned int value) +{ __atomic_store_n(obj, value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_ptr_relaxed(void *obj, void *value) +{ __atomic_store_n((void **)obj, value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_ssize_relaxed(Py_ssize_t *obj, Py_ssize_t value) +{ __atomic_store_n(obj, value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_ullong_relaxed(unsigned long long *obj, + unsigned long long value) +{ __atomic_store_n(obj, value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_char_relaxed(char *obj, char value) +{ __atomic_store_n(obj, value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_uchar_relaxed(unsigned char *obj, unsigned char value) +{ __atomic_store_n(obj, value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_short_relaxed(short *obj, short value) +{ __atomic_store_n(obj, value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_ushort_relaxed(unsigned short *obj, unsigned short value) +{ __atomic_store_n(obj, value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_long_relaxed(long *obj, long value) +{ __atomic_store_n(obj, value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_float_relaxed(float *obj, float value) +{ __atomic_store(obj, &value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_double_relaxed(double *obj, double value) +{ __atomic_store(obj, &value, __ATOMIC_RELAXED); } + +static inline void +_Py_atomic_store_llong_relaxed(long long *obj, long long value) +{ __atomic_store_n(obj, value, __ATOMIC_RELAXED); } + + +// --- _Py_atomic_load_ptr_acquire / _Py_atomic_store_ptr_release ------------ + +static inline void * +_Py_atomic_load_ptr_acquire(const void *obj) +{ return (void *)__atomic_load_n((void * const *)obj, __ATOMIC_ACQUIRE); } + +static inline uintptr_t +_Py_atomic_load_uintptr_acquire(const uintptr_t *obj) +{ return (uintptr_t)__atomic_load_n(obj, __ATOMIC_ACQUIRE); } + +static inline void +_Py_atomic_store_ptr_release(void *obj, void *value) +{ __atomic_store_n((void **)obj, value, __ATOMIC_RELEASE); } + +static inline void +_Py_atomic_store_uintptr_release(uintptr_t *obj, uintptr_t value) +{ __atomic_store_n(obj, value, __ATOMIC_RELEASE); } + +static inline void +_Py_atomic_store_int_release(int *obj, int value) +{ __atomic_store_n(obj, value, __ATOMIC_RELEASE); } + +static inline void +_Py_atomic_store_ssize_release(Py_ssize_t *obj, Py_ssize_t value) +{ __atomic_store_n(obj, value, __ATOMIC_RELEASE); } + +static inline void +_Py_atomic_store_uint_release(unsigned int *obj, unsigned int value) +{ __atomic_store_n(obj, value, __ATOMIC_RELEASE); } + +static inline int +_Py_atomic_load_int_acquire(const int *obj) +{ return __atomic_load_n(obj, __ATOMIC_ACQUIRE); } + +static inline void +_Py_atomic_store_uint32_release(uint32_t *obj, uint32_t value) +{ __atomic_store_n(obj, value, __ATOMIC_RELEASE); } + +static inline void +_Py_atomic_store_uint64_release(uint64_t *obj, uint64_t value) +{ __atomic_store_n(obj, value, __ATOMIC_RELEASE); } + +static inline uint64_t +_Py_atomic_load_uint64_acquire(const uint64_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_ACQUIRE); } + +static inline uint32_t +_Py_atomic_load_uint32_acquire(const uint32_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_ACQUIRE); } + +static inline Py_ssize_t +_Py_atomic_load_ssize_acquire(const Py_ssize_t *obj) +{ return __atomic_load_n(obj, __ATOMIC_ACQUIRE); } + +// --- _Py_atomic_fence ------------------------------------------------------ + +static inline void +_Py_atomic_fence_seq_cst(void) +{ __atomic_thread_fence(__ATOMIC_SEQ_CST); } + + static inline void +_Py_atomic_fence_acquire(void) +{ __atomic_thread_fence(__ATOMIC_ACQUIRE); } + + static inline void +_Py_atomic_fence_release(void) +{ __atomic_thread_fence(__ATOMIC_RELEASE); } diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyatomic_msc.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyatomic_msc.h new file mode 100644 index 0000000000000000000000000000000000000000..eb6df819fa7ee88482e51836adf9d4200477b4bc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyatomic_msc.h @@ -0,0 +1,1204 @@ +// This is the implementation of Python atomic operations for MSVC if the +// compiler does not support C11 or C++11 atomics. +// +// MSVC intrinsics are defined on char, short, long, __int64, and pointer +// types. Note that long and int are both 32-bits even on 64-bit Windows, +// so operations on int are cast to long. +// +// The volatile keyword has additional memory ordering semantics on MSVC. On +// x86 and x86-64, volatile accesses have acquire-release semantics. On ARM64, +// volatile accesses behave like C11's memory_order_relaxed. + +#ifndef Py_ATOMIC_MSC_H +# error "this header file must not be included directly" +#endif + +#include + +#define _Py_atomic_ASSERT_ARG_TYPE(TYPE) \ + Py_BUILD_ASSERT(sizeof(*obj) == sizeof(TYPE)) + + +// --- _Py_atomic_add -------------------------------------------------------- + +static inline int8_t +_Py_atomic_add_int8(int8_t *obj, int8_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(char); + return (int8_t)_InterlockedExchangeAdd8((volatile char *)obj, (char)value); +} + +static inline int16_t +_Py_atomic_add_int16(int16_t *obj, int16_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(short); + return (int16_t)_InterlockedExchangeAdd16((volatile short *)obj, (short)value); +} + +static inline int32_t +_Py_atomic_add_int32(int32_t *obj, int32_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(long); + return (int32_t)_InterlockedExchangeAdd((volatile long *)obj, (long)value); +} + +static inline int64_t +_Py_atomic_add_int64(int64_t *obj, int64_t value) +{ +#if defined(_M_X64) || defined(_M_ARM64) + _Py_atomic_ASSERT_ARG_TYPE(__int64); + return (int64_t)_InterlockedExchangeAdd64((volatile __int64 *)obj, (__int64)value); +#else + int64_t old_value = _Py_atomic_load_int64_relaxed(obj); + for (;;) { + int64_t new_value = old_value + value; + if (_Py_atomic_compare_exchange_int64(obj, &old_value, new_value)) { + return old_value; + } + } +#endif +} + + +static inline uint8_t +_Py_atomic_add_uint8(uint8_t *obj, uint8_t value) +{ + return (uint8_t)_Py_atomic_add_int8((int8_t *)obj, (int8_t)value); +} + +static inline uint16_t +_Py_atomic_add_uint16(uint16_t *obj, uint16_t value) +{ + return (uint16_t)_Py_atomic_add_int16((int16_t *)obj, (int16_t)value); +} + +static inline uint32_t +_Py_atomic_add_uint32(uint32_t *obj, uint32_t value) +{ + return (uint32_t)_Py_atomic_add_int32((int32_t *)obj, (int32_t)value); +} + +static inline int +_Py_atomic_add_int(int *obj, int value) +{ + _Py_atomic_ASSERT_ARG_TYPE(int32_t); + return (int)_Py_atomic_add_int32((int32_t *)obj, (int32_t)value); +} + +static inline unsigned int +_Py_atomic_add_uint(unsigned int *obj, unsigned int value) +{ + _Py_atomic_ASSERT_ARG_TYPE(int32_t); + return (unsigned int)_Py_atomic_add_int32((int32_t *)obj, (int32_t)value); +} + +static inline uint64_t +_Py_atomic_add_uint64(uint64_t *obj, uint64_t value) +{ + return (uint64_t)_Py_atomic_add_int64((int64_t *)obj, (int64_t)value); +} + +static inline intptr_t +_Py_atomic_add_intptr(intptr_t *obj, intptr_t value) +{ +#if SIZEOF_VOID_P == 8 + _Py_atomic_ASSERT_ARG_TYPE(int64_t); + return (intptr_t)_Py_atomic_add_int64((int64_t *)obj, (int64_t)value); +#else + _Py_atomic_ASSERT_ARG_TYPE(int32_t); + return (intptr_t)_Py_atomic_add_int32((int32_t *)obj, (int32_t)value); +#endif +} + +static inline uintptr_t +_Py_atomic_add_uintptr(uintptr_t *obj, uintptr_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(intptr_t); + return (uintptr_t)_Py_atomic_add_intptr((intptr_t *)obj, (intptr_t)value); +} + +static inline Py_ssize_t +_Py_atomic_add_ssize(Py_ssize_t *obj, Py_ssize_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(intptr_t); + return (Py_ssize_t)_Py_atomic_add_intptr((intptr_t *)obj, (intptr_t)value); +} + + +// --- _Py_atomic_compare_exchange ------------------------------------------- + +static inline int +_Py_atomic_compare_exchange_int8(int8_t *obj, int8_t *expected, int8_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(char); + int8_t initial = (int8_t)_InterlockedCompareExchange8( + (volatile char *)obj, + (char)value, + (char)*expected); + if (initial == *expected) { + return 1; + } + *expected = initial; + return 0; +} + +static inline int +_Py_atomic_compare_exchange_int16(int16_t *obj, int16_t *expected, int16_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(short); + int16_t initial = (int16_t)_InterlockedCompareExchange16( + (volatile short *)obj, + (short)value, + (short)*expected); + if (initial == *expected) { + return 1; + } + *expected = initial; + return 0; +} + +static inline int +_Py_atomic_compare_exchange_int32(int32_t *obj, int32_t *expected, int32_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(long); + int32_t initial = (int32_t)_InterlockedCompareExchange( + (volatile long *)obj, + (long)value, + (long)*expected); + if (initial == *expected) { + return 1; + } + *expected = initial; + return 0; +} + +static inline int +_Py_atomic_compare_exchange_int64(int64_t *obj, int64_t *expected, int64_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(__int64); + int64_t initial = (int64_t)_InterlockedCompareExchange64( + (volatile __int64 *)obj, + (__int64)value, + (__int64)*expected); + if (initial == *expected) { + return 1; + } + *expected = initial; + return 0; +} + +static inline int +_Py_atomic_compare_exchange_ptr(void *obj, void *expected, void *value) +{ + void *initial = _InterlockedCompareExchangePointer( + (void**)obj, + value, + *(void**)expected); + if (initial == *(void**)expected) { + return 1; + } + *(void**)expected = initial; + return 0; +} + + +static inline int +_Py_atomic_compare_exchange_uint8(uint8_t *obj, uint8_t *expected, uint8_t value) +{ + return _Py_atomic_compare_exchange_int8((int8_t *)obj, + (int8_t *)expected, + (int8_t)value); +} + +static inline int +_Py_atomic_compare_exchange_uint16(uint16_t *obj, uint16_t *expected, uint16_t value) +{ + return _Py_atomic_compare_exchange_int16((int16_t *)obj, + (int16_t *)expected, + (int16_t)value); +} + +static inline int +_Py_atomic_compare_exchange_uint32(uint32_t *obj, uint32_t *expected, uint32_t value) +{ + return _Py_atomic_compare_exchange_int32((int32_t *)obj, + (int32_t *)expected, + (int32_t)value); +} + +static inline int +_Py_atomic_compare_exchange_int(int *obj, int *expected, int value) +{ + _Py_atomic_ASSERT_ARG_TYPE(int32_t); + return _Py_atomic_compare_exchange_int32((int32_t *)obj, + (int32_t *)expected, + (int32_t)value); +} + +static inline int +_Py_atomic_compare_exchange_uint(unsigned int *obj, unsigned int *expected, unsigned int value) +{ + _Py_atomic_ASSERT_ARG_TYPE(int32_t); + return _Py_atomic_compare_exchange_int32((int32_t *)obj, + (int32_t *)expected, + (int32_t)value); +} + +static inline int +_Py_atomic_compare_exchange_uint64(uint64_t *obj, uint64_t *expected, uint64_t value) +{ + return _Py_atomic_compare_exchange_int64((int64_t *)obj, + (int64_t *)expected, + (int64_t)value); +} + +static inline int +_Py_atomic_compare_exchange_intptr(intptr_t *obj, intptr_t *expected, intptr_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(void*); + return _Py_atomic_compare_exchange_ptr((void**)obj, + (void**)expected, + (void*)value); +} + +static inline int +_Py_atomic_compare_exchange_uintptr(uintptr_t *obj, uintptr_t *expected, uintptr_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(void*); + return _Py_atomic_compare_exchange_ptr((void**)obj, + (void**)expected, + (void*)value); +} + +static inline int +_Py_atomic_compare_exchange_ssize(Py_ssize_t *obj, Py_ssize_t *expected, Py_ssize_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(void*); + return _Py_atomic_compare_exchange_ptr((void**)obj, + (void**)expected, + (void*)value); +} + + +// --- _Py_atomic_exchange --------------------------------------------------- + +static inline int8_t +_Py_atomic_exchange_int8(int8_t *obj, int8_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(char); + return (int8_t)_InterlockedExchange8((volatile char *)obj, (char)value); +} + +static inline int16_t +_Py_atomic_exchange_int16(int16_t *obj, int16_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(short); + return (int16_t)_InterlockedExchange16((volatile short *)obj, (short)value); +} + +static inline int32_t +_Py_atomic_exchange_int32(int32_t *obj, int32_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(long); + return (int32_t)_InterlockedExchange((volatile long *)obj, (long)value); +} + +static inline int64_t +_Py_atomic_exchange_int64(int64_t *obj, int64_t value) +{ +#if defined(_M_X64) || defined(_M_ARM64) + _Py_atomic_ASSERT_ARG_TYPE(__int64); + return (int64_t)_InterlockedExchange64((volatile __int64 *)obj, (__int64)value); +#else + int64_t old_value = _Py_atomic_load_int64_relaxed(obj); + for (;;) { + if (_Py_atomic_compare_exchange_int64(obj, &old_value, value)) { + return old_value; + } + } +#endif +} + +static inline void* +_Py_atomic_exchange_ptr(void *obj, void *value) +{ + return (void*)_InterlockedExchangePointer((void * volatile *)obj, (void *)value); +} + + +static inline uint8_t +_Py_atomic_exchange_uint8(uint8_t *obj, uint8_t value) +{ + return (uint8_t)_Py_atomic_exchange_int8((int8_t *)obj, + (int8_t)value); +} + +static inline uint16_t +_Py_atomic_exchange_uint16(uint16_t *obj, uint16_t value) +{ + return (uint16_t)_Py_atomic_exchange_int16((int16_t *)obj, + (int16_t)value); +} + +static inline uint32_t +_Py_atomic_exchange_uint32(uint32_t *obj, uint32_t value) +{ + return (uint32_t)_Py_atomic_exchange_int32((int32_t *)obj, + (int32_t)value); +} + +static inline int +_Py_atomic_exchange_int(int *obj, int value) +{ + _Py_atomic_ASSERT_ARG_TYPE(int32_t); + return (int)_Py_atomic_exchange_int32((int32_t *)obj, + (int32_t)value); +} + +static inline unsigned int +_Py_atomic_exchange_uint(unsigned int *obj, unsigned int value) +{ + _Py_atomic_ASSERT_ARG_TYPE(int32_t); + return (unsigned int)_Py_atomic_exchange_int32((int32_t *)obj, + (int32_t)value); +} + +static inline uint64_t +_Py_atomic_exchange_uint64(uint64_t *obj, uint64_t value) +{ + return (uint64_t)_Py_atomic_exchange_int64((int64_t *)obj, + (int64_t)value); +} + +static inline intptr_t +_Py_atomic_exchange_intptr(intptr_t *obj, intptr_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(void*); + return (intptr_t)_Py_atomic_exchange_ptr((void**)obj, + (void*)value); +} + +static inline uintptr_t +_Py_atomic_exchange_uintptr(uintptr_t *obj, uintptr_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(void*); + return (uintptr_t)_Py_atomic_exchange_ptr((void**)obj, + (void*)value); +} + +static inline Py_ssize_t +_Py_atomic_exchange_ssize(Py_ssize_t *obj, Py_ssize_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(void*); + return (Py_ssize_t)_Py_atomic_exchange_ptr((void**)obj, + (void*)value); +} + + +// --- _Py_atomic_and -------------------------------------------------------- + +static inline uint8_t +_Py_atomic_and_uint8(uint8_t *obj, uint8_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(char); + return (uint8_t)_InterlockedAnd8((volatile char *)obj, (char)value); +} + +static inline uint16_t +_Py_atomic_and_uint16(uint16_t *obj, uint16_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(short); + return (uint16_t)_InterlockedAnd16((volatile short *)obj, (short)value); +} + +static inline uint32_t +_Py_atomic_and_uint32(uint32_t *obj, uint32_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(long); + return (uint32_t)_InterlockedAnd((volatile long *)obj, (long)value); +} + +static inline uint64_t +_Py_atomic_and_uint64(uint64_t *obj, uint64_t value) +{ +#if defined(_M_X64) || defined(_M_ARM64) + _Py_atomic_ASSERT_ARG_TYPE(__int64); + return (uint64_t)_InterlockedAnd64((volatile __int64 *)obj, (__int64)value); +#else + uint64_t old_value = _Py_atomic_load_uint64_relaxed(obj); + for (;;) { + uint64_t new_value = old_value & value; + if (_Py_atomic_compare_exchange_uint64(obj, &old_value, new_value)) { + return old_value; + } + } +#endif +} + +static inline uintptr_t +_Py_atomic_and_uintptr(uintptr_t *obj, uintptr_t value) +{ +#if SIZEOF_VOID_P == 8 + _Py_atomic_ASSERT_ARG_TYPE(uint64_t); + return (uintptr_t)_Py_atomic_and_uint64((uint64_t *)obj, + (uint64_t)value); +#else + _Py_atomic_ASSERT_ARG_TYPE(uint32_t); + return (uintptr_t)_Py_atomic_and_uint32((uint32_t *)obj, + (uint32_t)value); +#endif +} + + +// --- _Py_atomic_or --------------------------------------------------------- + +static inline uint8_t +_Py_atomic_or_uint8(uint8_t *obj, uint8_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(char); + return (uint8_t)_InterlockedOr8((volatile char *)obj, (char)value); +} + +static inline uint16_t +_Py_atomic_or_uint16(uint16_t *obj, uint16_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(short); + return (uint16_t)_InterlockedOr16((volatile short *)obj, (short)value); +} + +static inline uint32_t +_Py_atomic_or_uint32(uint32_t *obj, uint32_t value) +{ + _Py_atomic_ASSERT_ARG_TYPE(long); + return (uint32_t)_InterlockedOr((volatile long *)obj, (long)value); +} + +static inline uint64_t +_Py_atomic_or_uint64(uint64_t *obj, uint64_t value) +{ +#if defined(_M_X64) || defined(_M_ARM64) + _Py_atomic_ASSERT_ARG_TYPE(__int64); + return (uint64_t)_InterlockedOr64((volatile __int64 *)obj, (__int64)value); +#else + uint64_t old_value = _Py_atomic_load_uint64_relaxed(obj); + for (;;) { + uint64_t new_value = old_value | value; + if (_Py_atomic_compare_exchange_uint64(obj, &old_value, new_value)) { + return old_value; + } + } +#endif +} + + +static inline uintptr_t +_Py_atomic_or_uintptr(uintptr_t *obj, uintptr_t value) +{ +#if SIZEOF_VOID_P == 8 + _Py_atomic_ASSERT_ARG_TYPE(uint64_t); + return (uintptr_t)_Py_atomic_or_uint64((uint64_t *)obj, + (uint64_t)value); +#else + _Py_atomic_ASSERT_ARG_TYPE(uint32_t); + return (uintptr_t)_Py_atomic_or_uint32((uint32_t *)obj, + (uint32_t)value); +#endif +} + + +// --- _Py_atomic_load ------------------------------------------------------- + +static inline uint8_t +_Py_atomic_load_uint8(const uint8_t *obj) +{ +#if defined(_M_X64) || defined(_M_IX86) + return *(volatile uint8_t *)obj; +#elif defined(_M_ARM64) + return (uint8_t)__ldar8((unsigned __int8 volatile *)obj); +#else +# error "no implementation of _Py_atomic_load_uint8" +#endif +} + +static inline uint16_t +_Py_atomic_load_uint16(const uint16_t *obj) +{ +#if defined(_M_X64) || defined(_M_IX86) + return *(volatile uint16_t *)obj; +#elif defined(_M_ARM64) + return (uint16_t)__ldar16((unsigned __int16 volatile *)obj); +#else +# error "no implementation of _Py_atomic_load_uint16" +#endif +} + +static inline uint32_t +_Py_atomic_load_uint32(const uint32_t *obj) +{ +#if defined(_M_X64) || defined(_M_IX86) + return *(volatile uint32_t *)obj; +#elif defined(_M_ARM64) + return (uint32_t)__ldar32((unsigned __int32 volatile *)obj); +#else +# error "no implementation of _Py_atomic_load_uint32" +#endif +} + +static inline uint64_t +_Py_atomic_load_uint64(const uint64_t *obj) +{ +#if defined(_M_X64) || defined(_M_IX86) + return *(volatile uint64_t *)obj; +#elif defined(_M_ARM64) + return (uint64_t)__ldar64((unsigned __int64 volatile *)obj); +#else +# error "no implementation of _Py_atomic_load_uint64" +#endif +} + +static inline int8_t +_Py_atomic_load_int8(const int8_t *obj) +{ + return (int8_t)_Py_atomic_load_uint8((const uint8_t *)obj); +} + +static inline int16_t +_Py_atomic_load_int16(const int16_t *obj) +{ + return (int16_t)_Py_atomic_load_uint16((const uint16_t *)obj); +} + +static inline int32_t +_Py_atomic_load_int32(const int32_t *obj) +{ + return (int32_t)_Py_atomic_load_uint32((const uint32_t *)obj); +} + +static inline int +_Py_atomic_load_int(const int *obj) +{ + _Py_atomic_ASSERT_ARG_TYPE(uint32_t); + return (int)_Py_atomic_load_uint32((uint32_t *)obj); +} + +static inline unsigned int +_Py_atomic_load_uint(const unsigned int *obj) +{ + _Py_atomic_ASSERT_ARG_TYPE(uint32_t); + return (unsigned int)_Py_atomic_load_uint32((uint32_t *)obj); +} + +static inline int64_t +_Py_atomic_load_int64(const int64_t *obj) +{ + return (int64_t)_Py_atomic_load_uint64((const uint64_t *)obj); +} + +static inline void* +_Py_atomic_load_ptr(const void *obj) +{ +#if SIZEOF_VOID_P == 8 + return (void*)_Py_atomic_load_uint64((const uint64_t *)obj); +#else + return (void*)_Py_atomic_load_uint32((const uint32_t *)obj); +#endif +} + +static inline intptr_t +_Py_atomic_load_intptr(const intptr_t *obj) +{ + _Py_atomic_ASSERT_ARG_TYPE(void*); + return (intptr_t)_Py_atomic_load_ptr((void*)obj); +} + +static inline uintptr_t +_Py_atomic_load_uintptr(const uintptr_t *obj) +{ + _Py_atomic_ASSERT_ARG_TYPE(void*); + return (uintptr_t)_Py_atomic_load_ptr((void*)obj); +} + +static inline Py_ssize_t +_Py_atomic_load_ssize(const Py_ssize_t *obj) +{ + _Py_atomic_ASSERT_ARG_TYPE(void*); + return (Py_ssize_t)_Py_atomic_load_ptr((void*)obj); +} + + +// --- _Py_atomic_load_relaxed ----------------------------------------------- + +static inline int +_Py_atomic_load_int_relaxed(const int *obj) +{ + return *(volatile int *)obj; +} + +static inline char +_Py_atomic_load_char_relaxed(const char *obj) +{ + return *(volatile char *)obj; +} + +static inline unsigned char +_Py_atomic_load_uchar_relaxed(const unsigned char *obj) +{ + return *(volatile unsigned char *)obj; +} + +static inline short +_Py_atomic_load_short_relaxed(const short *obj) +{ + return *(volatile short *)obj; +} + +static inline unsigned short +_Py_atomic_load_ushort_relaxed(const unsigned short *obj) +{ + return *(volatile unsigned short *)obj; +} + +static inline long +_Py_atomic_load_long_relaxed(const long *obj) +{ + return *(volatile long *)obj; +} + +static inline float +_Py_atomic_load_float_relaxed(const float *obj) +{ + return *(volatile float *)obj; +} + +static inline double +_Py_atomic_load_double_relaxed(const double *obj) +{ + return *(volatile double *)obj; +} + +static inline int8_t +_Py_atomic_load_int8_relaxed(const int8_t *obj) +{ + return *(volatile int8_t *)obj; +} + +static inline int16_t +_Py_atomic_load_int16_relaxed(const int16_t *obj) +{ + return *(volatile int16_t *)obj; +} + +static inline int32_t +_Py_atomic_load_int32_relaxed(const int32_t *obj) +{ + return *(volatile int32_t *)obj; +} + +static inline int64_t +_Py_atomic_load_int64_relaxed(const int64_t *obj) +{ + return *(volatile int64_t *)obj; +} + +static inline intptr_t +_Py_atomic_load_intptr_relaxed(const intptr_t *obj) +{ + return *(volatile intptr_t *)obj; +} + +static inline uint8_t +_Py_atomic_load_uint8_relaxed(const uint8_t *obj) +{ + return *(volatile uint8_t *)obj; +} + +static inline uint16_t +_Py_atomic_load_uint16_relaxed(const uint16_t *obj) +{ + return *(volatile uint16_t *)obj; +} + +static inline uint32_t +_Py_atomic_load_uint32_relaxed(const uint32_t *obj) +{ + return *(volatile uint32_t *)obj; +} + +static inline uint64_t +_Py_atomic_load_uint64_relaxed(const uint64_t *obj) +{ + return *(volatile uint64_t *)obj; +} + +static inline uintptr_t +_Py_atomic_load_uintptr_relaxed(const uintptr_t *obj) +{ + return *(volatile uintptr_t *)obj; +} + +static inline unsigned int +_Py_atomic_load_uint_relaxed(const unsigned int *obj) +{ + return *(volatile unsigned int *)obj; +} + +static inline Py_ssize_t +_Py_atomic_load_ssize_relaxed(const Py_ssize_t *obj) +{ + return *(volatile Py_ssize_t *)obj; +} + +static inline void* +_Py_atomic_load_ptr_relaxed(const void *obj) +{ + return *(void * volatile *)obj; +} + +static inline unsigned long long +_Py_atomic_load_ullong_relaxed(const unsigned long long *obj) +{ + return *(volatile unsigned long long *)obj; +} + +static inline long long +_Py_atomic_load_llong_relaxed(const long long *obj) +{ + return *(volatile long long *)obj; +} + + +// --- _Py_atomic_store ------------------------------------------------------ + +static inline void +_Py_atomic_store_int(int *obj, int value) +{ + (void)_Py_atomic_exchange_int(obj, value); +} + +static inline void +_Py_atomic_store_int8(int8_t *obj, int8_t value) +{ + (void)_Py_atomic_exchange_int8(obj, value); +} + +static inline void +_Py_atomic_store_int16(int16_t *obj, int16_t value) +{ + (void)_Py_atomic_exchange_int16(obj, value); +} + +static inline void +_Py_atomic_store_int32(int32_t *obj, int32_t value) +{ + (void)_Py_atomic_exchange_int32(obj, value); +} + +static inline void +_Py_atomic_store_int64(int64_t *obj, int64_t value) +{ + (void)_Py_atomic_exchange_int64(obj, value); +} + +static inline void +_Py_atomic_store_intptr(intptr_t *obj, intptr_t value) +{ + (void)_Py_atomic_exchange_intptr(obj, value); +} + +static inline void +_Py_atomic_store_uint8(uint8_t *obj, uint8_t value) +{ + (void)_Py_atomic_exchange_uint8(obj, value); +} + +static inline void +_Py_atomic_store_uint16(uint16_t *obj, uint16_t value) +{ + (void)_Py_atomic_exchange_uint16(obj, value); +} + +static inline void +_Py_atomic_store_uint32(uint32_t *obj, uint32_t value) +{ + (void)_Py_atomic_exchange_uint32(obj, value); +} + +static inline void +_Py_atomic_store_uint64(uint64_t *obj, uint64_t value) +{ + (void)_Py_atomic_exchange_uint64(obj, value); +} + +static inline void +_Py_atomic_store_uintptr(uintptr_t *obj, uintptr_t value) +{ + (void)_Py_atomic_exchange_uintptr(obj, value); +} + +static inline void +_Py_atomic_store_uint(unsigned int *obj, unsigned int value) +{ + (void)_Py_atomic_exchange_uint(obj, value); +} + +static inline void +_Py_atomic_store_ptr(void *obj, void *value) +{ + (void)_Py_atomic_exchange_ptr(obj, value); +} + +static inline void +_Py_atomic_store_ssize(Py_ssize_t *obj, Py_ssize_t value) +{ + (void)_Py_atomic_exchange_ssize(obj, value); +} + + +// --- _Py_atomic_store_relaxed ---------------------------------------------- + +static inline void +_Py_atomic_store_int_relaxed(int *obj, int value) +{ + *(volatile int *)obj = value; +} + +static inline void +_Py_atomic_store_int8_relaxed(int8_t *obj, int8_t value) +{ + *(volatile int8_t *)obj = value; +} + +static inline void +_Py_atomic_store_int16_relaxed(int16_t *obj, int16_t value) +{ + *(volatile int16_t *)obj = value; +} + +static inline void +_Py_atomic_store_int32_relaxed(int32_t *obj, int32_t value) +{ + *(volatile int32_t *)obj = value; +} + +static inline void +_Py_atomic_store_int64_relaxed(int64_t *obj, int64_t value) +{ + *(volatile int64_t *)obj = value; +} + +static inline void +_Py_atomic_store_intptr_relaxed(intptr_t *obj, intptr_t value) +{ + *(volatile intptr_t *)obj = value; +} + +static inline void +_Py_atomic_store_uint8_relaxed(uint8_t *obj, uint8_t value) +{ + *(volatile uint8_t *)obj = value; +} + +static inline void +_Py_atomic_store_uint16_relaxed(uint16_t *obj, uint16_t value) +{ + *(volatile uint16_t *)obj = value; +} + +static inline void +_Py_atomic_store_uint32_relaxed(uint32_t *obj, uint32_t value) +{ + *(volatile uint32_t *)obj = value; +} + +static inline void +_Py_atomic_store_uint64_relaxed(uint64_t *obj, uint64_t value) +{ + *(volatile uint64_t *)obj = value; +} + +static inline void +_Py_atomic_store_uintptr_relaxed(uintptr_t *obj, uintptr_t value) +{ + *(volatile uintptr_t *)obj = value; +} + +static inline void +_Py_atomic_store_uint_relaxed(unsigned int *obj, unsigned int value) +{ + *(volatile unsigned int *)obj = value; +} + +static inline void +_Py_atomic_store_ptr_relaxed(void *obj, void* value) +{ + *(void * volatile *)obj = value; +} + +static inline void +_Py_atomic_store_ssize_relaxed(Py_ssize_t *obj, Py_ssize_t value) +{ + *(volatile Py_ssize_t *)obj = value; +} + +static inline void +_Py_atomic_store_ullong_relaxed(unsigned long long *obj, + unsigned long long value) +{ + *(volatile unsigned long long *)obj = value; +} + +static inline void +_Py_atomic_store_char_relaxed(char *obj, char value) +{ + *(volatile char *)obj = value; +} + +static inline void +_Py_atomic_store_uchar_relaxed(unsigned char *obj, unsigned char value) +{ + *(volatile unsigned char *)obj = value; +} + +static inline void +_Py_atomic_store_short_relaxed(short *obj, short value) +{ + *(volatile short *)obj = value; +} + +static inline void +_Py_atomic_store_ushort_relaxed(unsigned short *obj, unsigned short value) +{ + *(volatile unsigned short *)obj = value; +} + +static inline void +_Py_atomic_store_long_relaxed(long *obj, long value) +{ + *(volatile long *)obj = value; +} + +static inline void +_Py_atomic_store_float_relaxed(float *obj, float value) +{ + *(volatile float *)obj = value; +} + +static inline void +_Py_atomic_store_double_relaxed(double *obj, double value) +{ + *(volatile double *)obj = value; +} + +static inline void +_Py_atomic_store_llong_relaxed(long long *obj, long long value) +{ + *(volatile long long *)obj = value; +} + + +// --- _Py_atomic_load_ptr_acquire / _Py_atomic_store_ptr_release ------------ + +static inline void * +_Py_atomic_load_ptr_acquire(const void *obj) +{ +#if defined(_M_X64) || defined(_M_IX86) + return *(void * volatile *)obj; +#elif defined(_M_ARM64) + return (void *)__ldar64((unsigned __int64 volatile *)obj); +#else +# error "no implementation of _Py_atomic_load_ptr_acquire" +#endif +} + +static inline uintptr_t +_Py_atomic_load_uintptr_acquire(const uintptr_t *obj) +{ +#if defined(_M_X64) || defined(_M_IX86) + return *(uintptr_t volatile *)obj; +#elif defined(_M_ARM64) + return (uintptr_t)__ldar64((unsigned __int64 volatile *)obj); +#else +# error "no implementation of _Py_atomic_load_uintptr_acquire" +#endif +} + +static inline void +_Py_atomic_store_ptr_release(void *obj, void *value) +{ +#if defined(_M_X64) || defined(_M_IX86) + *(void * volatile *)obj = value; +#elif defined(_M_ARM64) + __stlr64((unsigned __int64 volatile *)obj, (uintptr_t)value); +#else +# error "no implementation of _Py_atomic_store_ptr_release" +#endif +} + +static inline void +_Py_atomic_store_uintptr_release(uintptr_t *obj, uintptr_t value) +{ +#if defined(_M_X64) || defined(_M_IX86) + *(uintptr_t volatile *)obj = value; +#elif defined(_M_ARM64) + _Py_atomic_ASSERT_ARG_TYPE(unsigned __int64); + __stlr64((unsigned __int64 volatile *)obj, (unsigned __int64)value); +#else +# error "no implementation of _Py_atomic_store_uintptr_release" +#endif +} + +static inline void +_Py_atomic_store_int_release(int *obj, int value) +{ +#if defined(_M_X64) || defined(_M_IX86) + *(int volatile *)obj = value; +#elif defined(_M_ARM64) + _Py_atomic_ASSERT_ARG_TYPE(unsigned __int32); + __stlr32((unsigned __int32 volatile *)obj, (unsigned __int32)value); +#else +# error "no implementation of _Py_atomic_store_int_release" +#endif +} + +static inline void +_Py_atomic_store_uint_release(unsigned int *obj, unsigned int value) +{ +#if defined(_M_X64) || defined(_M_IX86) + *(volatile unsigned int *)obj = value; +#elif defined(_M_ARM64) + _Py_atomic_ASSERT_ARG_TYPE(unsigned __int32); + __stlr32((unsigned __int32 volatile *)obj, (unsigned __int32)value); +#else +# error "no implementation of _Py_atomic_store_uint_release" +#endif +} + +static inline void +_Py_atomic_store_ssize_release(Py_ssize_t *obj, Py_ssize_t value) +{ +#if defined(_M_X64) || defined(_M_IX86) + *(Py_ssize_t volatile *)obj = value; +#elif defined(_M_ARM64) + __stlr64((unsigned __int64 volatile *)obj, (unsigned __int64)value); +#else +# error "no implementation of _Py_atomic_store_ssize_release" +#endif +} + +static inline int +_Py_atomic_load_int_acquire(const int *obj) +{ +#if defined(_M_X64) || defined(_M_IX86) + return *(int volatile *)obj; +#elif defined(_M_ARM64) + _Py_atomic_ASSERT_ARG_TYPE(unsigned __int32); + return (int)__ldar32((unsigned __int32 volatile *)obj); +#else +# error "no implementation of _Py_atomic_load_int_acquire" +#endif +} + +static inline void +_Py_atomic_store_uint32_release(uint32_t *obj, uint32_t value) +{ +#if defined(_M_X64) || defined(_M_IX86) + *(uint32_t volatile *)obj = value; +#elif defined(_M_ARM64) + _Py_atomic_ASSERT_ARG_TYPE(unsigned __int32); + __stlr32((unsigned __int32 volatile *)obj, (unsigned __int32)value); +#else +# error "no implementation of _Py_atomic_store_uint32_release" +#endif +} + +static inline void +_Py_atomic_store_uint64_release(uint64_t *obj, uint64_t value) +{ +#if defined(_M_X64) || defined(_M_IX86) + *(uint64_t volatile *)obj = value; +#elif defined(_M_ARM64) + _Py_atomic_ASSERT_ARG_TYPE(unsigned __int64); + __stlr64((unsigned __int64 volatile *)obj, (unsigned __int64)value); +#else +# error "no implementation of _Py_atomic_store_uint64_release" +#endif +} + +static inline uint64_t +_Py_atomic_load_uint64_acquire(const uint64_t *obj) +{ +#if defined(_M_X64) || defined(_M_IX86) + return *(uint64_t volatile *)obj; +#elif defined(_M_ARM64) + _Py_atomic_ASSERT_ARG_TYPE(__int64); + return (uint64_t)__ldar64((unsigned __int64 volatile *)obj); +#else +# error "no implementation of _Py_atomic_load_uint64_acquire" +#endif +} + +static inline uint32_t +_Py_atomic_load_uint32_acquire(const uint32_t *obj) +{ +#if defined(_M_X64) || defined(_M_IX86) + return *(uint32_t volatile *)obj; +#elif defined(_M_ARM64) + return (uint32_t)__ldar32((uint32_t volatile *)obj); +#else +# error "no implementation of _Py_atomic_load_uint32_acquire" +#endif +} + +static inline Py_ssize_t +_Py_atomic_load_ssize_acquire(const Py_ssize_t *obj) +{ +#if defined(_M_X64) || defined(_M_IX86) + return *(Py_ssize_t volatile *)obj; +#elif defined(_M_ARM64) + return (Py_ssize_t)__ldar64((unsigned __int64 volatile *)obj); +#else +# error "no implementation of _Py_atomic_load_ssize_acquire" +#endif +} + +// --- _Py_atomic_fence ------------------------------------------------------ + + static inline void +_Py_atomic_fence_seq_cst(void) +{ +#if defined(_M_ARM64) + __dmb(_ARM64_BARRIER_ISH); +#elif defined(_M_X64) + __faststorefence(); +#elif defined(_M_IX86) + _mm_mfence(); +#else +# error "no implementation of _Py_atomic_fence_seq_cst" +#endif +} + + static inline void +_Py_atomic_fence_acquire(void) +{ +#if defined(_M_ARM64) + __dmb(_ARM64_BARRIER_ISHLD); +#elif defined(_M_X64) || defined(_M_IX86) + _ReadBarrier(); +#else +# error "no implementation of _Py_atomic_fence_acquire" +#endif +} + + static inline void +_Py_atomic_fence_release(void) +{ +#if defined(_M_ARM64) + __dmb(_ARM64_BARRIER_ISH); +#elif defined(_M_X64) || defined(_M_IX86) + _ReadWriteBarrier(); +#else +# error "no implementation of _Py_atomic_fence_release" +#endif +} + +#undef _Py_atomic_ASSERT_ARG_TYPE diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyatomic_std.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyatomic_std.h new file mode 100644 index 0000000000000000000000000000000000000000..1a2ccd0cc12b4886fe708270e4d066f697d1cbaf --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyatomic_std.h @@ -0,0 +1,1112 @@ +// This is the implementation of Python atomic operations using C++11 or C11 +// atomics. Note that the pyatomic_gcc.h implementation is preferred for GCC +// compatible compilers, even if they support C++11 atomics. + +#ifndef Py_ATOMIC_STD_H +# error "this header file must not be included directly" +#endif + +#ifdef __cplusplus +extern "C++" { +# include +} +# define _Py_USING_STD using namespace std +# define _Atomic(tp) atomic +#else +# define _Py_USING_STD +# include +#endif + + +// --- _Py_atomic_add -------------------------------------------------------- + +static inline int +_Py_atomic_add_int(int *obj, int value) +{ + _Py_USING_STD; + return atomic_fetch_add((_Atomic(int)*)obj, value); +} + +static inline int8_t +_Py_atomic_add_int8(int8_t *obj, int8_t value) +{ + _Py_USING_STD; + return atomic_fetch_add((_Atomic(int8_t)*)obj, value); +} + +static inline int16_t +_Py_atomic_add_int16(int16_t *obj, int16_t value) +{ + _Py_USING_STD; + return atomic_fetch_add((_Atomic(int16_t)*)obj, value); +} + +static inline int32_t +_Py_atomic_add_int32(int32_t *obj, int32_t value) +{ + _Py_USING_STD; + return atomic_fetch_add((_Atomic(int32_t)*)obj, value); +} + +static inline int64_t +_Py_atomic_add_int64(int64_t *obj, int64_t value) +{ + _Py_USING_STD; + return atomic_fetch_add((_Atomic(int64_t)*)obj, value); +} + +static inline intptr_t +_Py_atomic_add_intptr(intptr_t *obj, intptr_t value) +{ + _Py_USING_STD; + return atomic_fetch_add((_Atomic(intptr_t)*)obj, value); +} + +static inline unsigned int +_Py_atomic_add_uint(unsigned int *obj, unsigned int value) +{ + _Py_USING_STD; + return atomic_fetch_add((_Atomic(unsigned int)*)obj, value); +} + +static inline uint8_t +_Py_atomic_add_uint8(uint8_t *obj, uint8_t value) +{ + _Py_USING_STD; + return atomic_fetch_add((_Atomic(uint8_t)*)obj, value); +} + +static inline uint16_t +_Py_atomic_add_uint16(uint16_t *obj, uint16_t value) +{ + _Py_USING_STD; + return atomic_fetch_add((_Atomic(uint16_t)*)obj, value); +} + +static inline uint32_t +_Py_atomic_add_uint32(uint32_t *obj, uint32_t value) +{ + _Py_USING_STD; + return atomic_fetch_add((_Atomic(uint32_t)*)obj, value); +} + +static inline uint64_t +_Py_atomic_add_uint64(uint64_t *obj, uint64_t value) +{ + _Py_USING_STD; + return atomic_fetch_add((_Atomic(uint64_t)*)obj, value); +} + +static inline uintptr_t +_Py_atomic_add_uintptr(uintptr_t *obj, uintptr_t value) +{ + _Py_USING_STD; + return atomic_fetch_add((_Atomic(uintptr_t)*)obj, value); +} + +static inline Py_ssize_t +_Py_atomic_add_ssize(Py_ssize_t *obj, Py_ssize_t value) +{ + _Py_USING_STD; + return atomic_fetch_add((_Atomic(Py_ssize_t)*)obj, value); +} + + +// --- _Py_atomic_compare_exchange ------------------------------------------- + +static inline int +_Py_atomic_compare_exchange_int(int *obj, int *expected, int desired) +{ + _Py_USING_STD; + return atomic_compare_exchange_strong((_Atomic(int)*)obj, + expected, desired); +} + +static inline int +_Py_atomic_compare_exchange_int8(int8_t *obj, int8_t *expected, int8_t desired) +{ + _Py_USING_STD; + return atomic_compare_exchange_strong((_Atomic(int8_t)*)obj, + expected, desired); +} + +static inline int +_Py_atomic_compare_exchange_int16(int16_t *obj, int16_t *expected, int16_t desired) +{ + _Py_USING_STD; + return atomic_compare_exchange_strong((_Atomic(int16_t)*)obj, + expected, desired); +} + +static inline int +_Py_atomic_compare_exchange_int32(int32_t *obj, int32_t *expected, int32_t desired) +{ + _Py_USING_STD; + return atomic_compare_exchange_strong((_Atomic(int32_t)*)obj, + expected, desired); +} + +static inline int +_Py_atomic_compare_exchange_int64(int64_t *obj, int64_t *expected, int64_t desired) +{ + _Py_USING_STD; + return atomic_compare_exchange_strong((_Atomic(int64_t)*)obj, + expected, desired); +} + +static inline int +_Py_atomic_compare_exchange_intptr(intptr_t *obj, intptr_t *expected, intptr_t desired) +{ + _Py_USING_STD; + return atomic_compare_exchange_strong((_Atomic(intptr_t)*)obj, + expected, desired); +} + +static inline int +_Py_atomic_compare_exchange_uint(unsigned int *obj, unsigned int *expected, unsigned int desired) +{ + _Py_USING_STD; + return atomic_compare_exchange_strong((_Atomic(unsigned int)*)obj, + expected, desired); +} + +static inline int +_Py_atomic_compare_exchange_uint8(uint8_t *obj, uint8_t *expected, uint8_t desired) +{ + _Py_USING_STD; + return atomic_compare_exchange_strong((_Atomic(uint8_t)*)obj, + expected, desired); +} + +static inline int +_Py_atomic_compare_exchange_uint16(uint16_t *obj, uint16_t *expected, uint16_t desired) +{ + _Py_USING_STD; + return atomic_compare_exchange_strong((_Atomic(uint16_t)*)obj, + expected, desired); +} + +static inline int +_Py_atomic_compare_exchange_uint32(uint32_t *obj, uint32_t *expected, uint32_t desired) +{ + _Py_USING_STD; + return atomic_compare_exchange_strong((_Atomic(uint32_t)*)obj, + expected, desired); +} + +static inline int +_Py_atomic_compare_exchange_uint64(uint64_t *obj, uint64_t *expected, uint64_t desired) +{ + _Py_USING_STD; + return atomic_compare_exchange_strong((_Atomic(uint64_t)*)obj, + expected, desired); +} + +static inline int +_Py_atomic_compare_exchange_uintptr(uintptr_t *obj, uintptr_t *expected, uintptr_t desired) +{ + _Py_USING_STD; + return atomic_compare_exchange_strong((_Atomic(uintptr_t)*)obj, + expected, desired); +} + +static inline int +_Py_atomic_compare_exchange_ssize(Py_ssize_t *obj, Py_ssize_t *expected, Py_ssize_t desired) +{ + _Py_USING_STD; + return atomic_compare_exchange_strong((_Atomic(Py_ssize_t)*)obj, + expected, desired); +} + +static inline int +_Py_atomic_compare_exchange_ptr(void *obj, void *expected, void *desired) +{ + _Py_USING_STD; + return atomic_compare_exchange_strong((_Atomic(void *)*)obj, + (void **)expected, desired); +} + + +// --- _Py_atomic_exchange --------------------------------------------------- + +static inline int +_Py_atomic_exchange_int(int *obj, int value) +{ + _Py_USING_STD; + return atomic_exchange((_Atomic(int)*)obj, value); +} + +static inline int8_t +_Py_atomic_exchange_int8(int8_t *obj, int8_t value) +{ + _Py_USING_STD; + return atomic_exchange((_Atomic(int8_t)*)obj, value); +} + +static inline int16_t +_Py_atomic_exchange_int16(int16_t *obj, int16_t value) +{ + _Py_USING_STD; + return atomic_exchange((_Atomic(int16_t)*)obj, value); +} + +static inline int32_t +_Py_atomic_exchange_int32(int32_t *obj, int32_t value) +{ + _Py_USING_STD; + return atomic_exchange((_Atomic(int32_t)*)obj, value); +} + +static inline int64_t +_Py_atomic_exchange_int64(int64_t *obj, int64_t value) +{ + _Py_USING_STD; + return atomic_exchange((_Atomic(int64_t)*)obj, value); +} + +static inline intptr_t +_Py_atomic_exchange_intptr(intptr_t *obj, intptr_t value) +{ + _Py_USING_STD; + return atomic_exchange((_Atomic(intptr_t)*)obj, value); +} + +static inline unsigned int +_Py_atomic_exchange_uint(unsigned int *obj, unsigned int value) +{ + _Py_USING_STD; + return atomic_exchange((_Atomic(unsigned int)*)obj, value); +} + +static inline uint8_t +_Py_atomic_exchange_uint8(uint8_t *obj, uint8_t value) +{ + _Py_USING_STD; + return atomic_exchange((_Atomic(uint8_t)*)obj, value); +} + +static inline uint16_t +_Py_atomic_exchange_uint16(uint16_t *obj, uint16_t value) +{ + _Py_USING_STD; + return atomic_exchange((_Atomic(uint16_t)*)obj, value); +} + +static inline uint32_t +_Py_atomic_exchange_uint32(uint32_t *obj, uint32_t value) +{ + _Py_USING_STD; + return atomic_exchange((_Atomic(uint32_t)*)obj, value); +} + +static inline uint64_t +_Py_atomic_exchange_uint64(uint64_t *obj, uint64_t value) +{ + _Py_USING_STD; + return atomic_exchange((_Atomic(uint64_t)*)obj, value); +} + +static inline uintptr_t +_Py_atomic_exchange_uintptr(uintptr_t *obj, uintptr_t value) +{ + _Py_USING_STD; + return atomic_exchange((_Atomic(uintptr_t)*)obj, value); +} + +static inline Py_ssize_t +_Py_atomic_exchange_ssize(Py_ssize_t *obj, Py_ssize_t value) +{ + _Py_USING_STD; + return atomic_exchange((_Atomic(Py_ssize_t)*)obj, value); +} + +static inline void* +_Py_atomic_exchange_ptr(void *obj, void *value) +{ + _Py_USING_STD; + return atomic_exchange((_Atomic(void *)*)obj, value); +} + + +// --- _Py_atomic_and -------------------------------------------------------- + +static inline uint8_t +_Py_atomic_and_uint8(uint8_t *obj, uint8_t value) +{ + _Py_USING_STD; + return atomic_fetch_and((_Atomic(uint8_t)*)obj, value); +} + +static inline uint16_t +_Py_atomic_and_uint16(uint16_t *obj, uint16_t value) +{ + _Py_USING_STD; + return atomic_fetch_and((_Atomic(uint16_t)*)obj, value); +} + +static inline uint32_t +_Py_atomic_and_uint32(uint32_t *obj, uint32_t value) +{ + _Py_USING_STD; + return atomic_fetch_and((_Atomic(uint32_t)*)obj, value); +} + +static inline uint64_t +_Py_atomic_and_uint64(uint64_t *obj, uint64_t value) +{ + _Py_USING_STD; + return atomic_fetch_and((_Atomic(uint64_t)*)obj, value); +} + +static inline uintptr_t +_Py_atomic_and_uintptr(uintptr_t *obj, uintptr_t value) +{ + _Py_USING_STD; + return atomic_fetch_and((_Atomic(uintptr_t)*)obj, value); +} + + +// --- _Py_atomic_or --------------------------------------------------------- + +static inline uint8_t +_Py_atomic_or_uint8(uint8_t *obj, uint8_t value) +{ + _Py_USING_STD; + return atomic_fetch_or((_Atomic(uint8_t)*)obj, value); +} + +static inline uint16_t +_Py_atomic_or_uint16(uint16_t *obj, uint16_t value) +{ + _Py_USING_STD; + return atomic_fetch_or((_Atomic(uint16_t)*)obj, value); +} + +static inline uint32_t +_Py_atomic_or_uint32(uint32_t *obj, uint32_t value) +{ + _Py_USING_STD; + return atomic_fetch_or((_Atomic(uint32_t)*)obj, value); +} + +static inline uint64_t +_Py_atomic_or_uint64(uint64_t *obj, uint64_t value) +{ + _Py_USING_STD; + return atomic_fetch_or((_Atomic(uint64_t)*)obj, value); +} + +static inline uintptr_t +_Py_atomic_or_uintptr(uintptr_t *obj, uintptr_t value) +{ + _Py_USING_STD; + return atomic_fetch_or((_Atomic(uintptr_t)*)obj, value); +} + + +// --- _Py_atomic_load ------------------------------------------------------- + +static inline int +_Py_atomic_load_int(const int *obj) +{ + _Py_USING_STD; + return atomic_load((const _Atomic(int)*)obj); +} + +static inline int8_t +_Py_atomic_load_int8(const int8_t *obj) +{ + _Py_USING_STD; + return atomic_load((const _Atomic(int8_t)*)obj); +} + +static inline int16_t +_Py_atomic_load_int16(const int16_t *obj) +{ + _Py_USING_STD; + return atomic_load((const _Atomic(int16_t)*)obj); +} + +static inline int32_t +_Py_atomic_load_int32(const int32_t *obj) +{ + _Py_USING_STD; + return atomic_load((const _Atomic(int32_t)*)obj); +} + +static inline int64_t +_Py_atomic_load_int64(const int64_t *obj) +{ + _Py_USING_STD; + return atomic_load((const _Atomic(int64_t)*)obj); +} + +static inline intptr_t +_Py_atomic_load_intptr(const intptr_t *obj) +{ + _Py_USING_STD; + return atomic_load((const _Atomic(intptr_t)*)obj); +} + +static inline uint8_t +_Py_atomic_load_uint8(const uint8_t *obj) +{ + _Py_USING_STD; + return atomic_load((const _Atomic(uint8_t)*)obj); +} + +static inline uint16_t +_Py_atomic_load_uint16(const uint16_t *obj) +{ + _Py_USING_STD; + return atomic_load((const _Atomic(uint16_t)*)obj); +} + +static inline uint32_t +_Py_atomic_load_uint32(const uint32_t *obj) +{ + _Py_USING_STD; + return atomic_load((const _Atomic(uint32_t)*)obj); +} + +static inline uint64_t +_Py_atomic_load_uint64(const uint64_t *obj) +{ + _Py_USING_STD; + return atomic_load((const _Atomic(uint64_t)*)obj); +} + +static inline uintptr_t +_Py_atomic_load_uintptr(const uintptr_t *obj) +{ + _Py_USING_STD; + return atomic_load((const _Atomic(uintptr_t)*)obj); +} + +static inline unsigned int +_Py_atomic_load_uint(const unsigned int *obj) +{ + _Py_USING_STD; + return atomic_load((const _Atomic(unsigned int)*)obj); +} + +static inline Py_ssize_t +_Py_atomic_load_ssize(const Py_ssize_t *obj) +{ + _Py_USING_STD; + return atomic_load((const _Atomic(Py_ssize_t)*)obj); +} + +static inline void* +_Py_atomic_load_ptr(const void *obj) +{ + _Py_USING_STD; + return atomic_load((const _Atomic(void*)*)obj); +} + + +// --- _Py_atomic_load_relaxed ----------------------------------------------- + +static inline int +_Py_atomic_load_int_relaxed(const int *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(int)*)obj, + memory_order_relaxed); +} + +static inline char +_Py_atomic_load_char_relaxed(const char *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(char)*)obj, + memory_order_relaxed); +} + +static inline unsigned char +_Py_atomic_load_uchar_relaxed(const unsigned char *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(unsigned char)*)obj, + memory_order_relaxed); +} + +static inline short +_Py_atomic_load_short_relaxed(const short *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(short)*)obj, + memory_order_relaxed); +} + +static inline unsigned short +_Py_atomic_load_ushort_relaxed(const unsigned short *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(unsigned short)*)obj, + memory_order_relaxed); +} + +static inline long +_Py_atomic_load_long_relaxed(const long *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(long)*)obj, + memory_order_relaxed); +} + +static inline float +_Py_atomic_load_float_relaxed(const float *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(float)*)obj, + memory_order_relaxed); +} + +static inline double +_Py_atomic_load_double_relaxed(const double *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(double)*)obj, + memory_order_relaxed); +} + +static inline int8_t +_Py_atomic_load_int8_relaxed(const int8_t *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(int8_t)*)obj, + memory_order_relaxed); +} + +static inline int16_t +_Py_atomic_load_int16_relaxed(const int16_t *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(int16_t)*)obj, + memory_order_relaxed); +} + +static inline int32_t +_Py_atomic_load_int32_relaxed(const int32_t *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(int32_t)*)obj, + memory_order_relaxed); +} + +static inline int64_t +_Py_atomic_load_int64_relaxed(const int64_t *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(int64_t)*)obj, + memory_order_relaxed); +} + +static inline intptr_t +_Py_atomic_load_intptr_relaxed(const intptr_t *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(intptr_t)*)obj, + memory_order_relaxed); +} + +static inline uint8_t +_Py_atomic_load_uint8_relaxed(const uint8_t *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(uint8_t)*)obj, + memory_order_relaxed); +} + +static inline uint16_t +_Py_atomic_load_uint16_relaxed(const uint16_t *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(uint16_t)*)obj, + memory_order_relaxed); +} + +static inline uint32_t +_Py_atomic_load_uint32_relaxed(const uint32_t *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(uint32_t)*)obj, + memory_order_relaxed); +} + +static inline uint64_t +_Py_atomic_load_uint64_relaxed(const uint64_t *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(uint64_t)*)obj, + memory_order_relaxed); +} + +static inline uintptr_t +_Py_atomic_load_uintptr_relaxed(const uintptr_t *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(uintptr_t)*)obj, + memory_order_relaxed); +} + +static inline unsigned int +_Py_atomic_load_uint_relaxed(const unsigned int *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(unsigned int)*)obj, + memory_order_relaxed); +} + +static inline Py_ssize_t +_Py_atomic_load_ssize_relaxed(const Py_ssize_t *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(Py_ssize_t)*)obj, + memory_order_relaxed); +} + +static inline void* +_Py_atomic_load_ptr_relaxed(const void *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(void*)*)obj, + memory_order_relaxed); +} + +static inline unsigned long long +_Py_atomic_load_ullong_relaxed(const unsigned long long *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(unsigned long long)*)obj, + memory_order_relaxed); +} + +static inline long long +_Py_atomic_load_llong_relaxed(const long long *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(long long)*)obj, + memory_order_relaxed); +} + + +// --- _Py_atomic_store ------------------------------------------------------ + +static inline void +_Py_atomic_store_int(int *obj, int value) +{ + _Py_USING_STD; + atomic_store((_Atomic(int)*)obj, value); +} + +static inline void +_Py_atomic_store_int8(int8_t *obj, int8_t value) +{ + _Py_USING_STD; + atomic_store((_Atomic(int8_t)*)obj, value); +} + +static inline void +_Py_atomic_store_int16(int16_t *obj, int16_t value) +{ + _Py_USING_STD; + atomic_store((_Atomic(int16_t)*)obj, value); +} + +static inline void +_Py_atomic_store_int32(int32_t *obj, int32_t value) +{ + _Py_USING_STD; + atomic_store((_Atomic(int32_t)*)obj, value); +} + +static inline void +_Py_atomic_store_int64(int64_t *obj, int64_t value) +{ + _Py_USING_STD; + atomic_store((_Atomic(int64_t)*)obj, value); +} + +static inline void +_Py_atomic_store_intptr(intptr_t *obj, intptr_t value) +{ + _Py_USING_STD; + atomic_store((_Atomic(intptr_t)*)obj, value); +} + +static inline void +_Py_atomic_store_uint8(uint8_t *obj, uint8_t value) +{ + _Py_USING_STD; + atomic_store((_Atomic(uint8_t)*)obj, value); +} + +static inline void +_Py_atomic_store_uint16(uint16_t *obj, uint16_t value) +{ + _Py_USING_STD; + atomic_store((_Atomic(uint16_t)*)obj, value); +} + +static inline void +_Py_atomic_store_uint32(uint32_t *obj, uint32_t value) +{ + _Py_USING_STD; + atomic_store((_Atomic(uint32_t)*)obj, value); +} + +static inline void +_Py_atomic_store_uint64(uint64_t *obj, uint64_t value) +{ + _Py_USING_STD; + atomic_store((_Atomic(uint64_t)*)obj, value); +} + +static inline void +_Py_atomic_store_uintptr(uintptr_t *obj, uintptr_t value) +{ + _Py_USING_STD; + atomic_store((_Atomic(uintptr_t)*)obj, value); +} + +static inline void +_Py_atomic_store_uint(unsigned int *obj, unsigned int value) +{ + _Py_USING_STD; + atomic_store((_Atomic(unsigned int)*)obj, value); +} + +static inline void +_Py_atomic_store_ptr(void *obj, void *value) +{ + _Py_USING_STD; + atomic_store((_Atomic(void*)*)obj, value); +} + +static inline void +_Py_atomic_store_ssize(Py_ssize_t *obj, Py_ssize_t value) +{ + _Py_USING_STD; + atomic_store((_Atomic(Py_ssize_t)*)obj, value); +} + + +// --- _Py_atomic_store_relaxed ---------------------------------------------- + +static inline void +_Py_atomic_store_int_relaxed(int *obj, int value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(int)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_int8_relaxed(int8_t *obj, int8_t value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(int8_t)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_int16_relaxed(int16_t *obj, int16_t value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(int16_t)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_int32_relaxed(int32_t *obj, int32_t value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(int32_t)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_int64_relaxed(int64_t *obj, int64_t value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(int64_t)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_intptr_relaxed(intptr_t *obj, intptr_t value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(intptr_t)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_uint8_relaxed(uint8_t *obj, uint8_t value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(uint8_t)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_uint16_relaxed(uint16_t *obj, uint16_t value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(uint16_t)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_uint32_relaxed(uint32_t *obj, uint32_t value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(uint32_t)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_uint64_relaxed(uint64_t *obj, uint64_t value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(uint64_t)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_uintptr_relaxed(uintptr_t *obj, uintptr_t value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(uintptr_t)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_uint_relaxed(unsigned int *obj, unsigned int value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(unsigned int)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_ptr_relaxed(void *obj, void *value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(void*)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_ssize_relaxed(Py_ssize_t *obj, Py_ssize_t value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(Py_ssize_t)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_ullong_relaxed(unsigned long long *obj, + unsigned long long value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(unsigned long long)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_char_relaxed(char *obj, char value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(char)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_uchar_relaxed(unsigned char *obj, unsigned char value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(unsigned char)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_short_relaxed(short *obj, short value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(short)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_ushort_relaxed(unsigned short *obj, unsigned short value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(unsigned short)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_long_relaxed(long *obj, long value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(long)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_float_relaxed(float *obj, float value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(float)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_double_relaxed(double *obj, double value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(double)*)obj, value, + memory_order_relaxed); +} + +static inline void +_Py_atomic_store_llong_relaxed(long long *obj, long long value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(long long)*)obj, value, + memory_order_relaxed); +} + + +// --- _Py_atomic_load_ptr_acquire / _Py_atomic_store_ptr_release ------------ + +static inline void * +_Py_atomic_load_ptr_acquire(const void *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(void*)*)obj, + memory_order_acquire); +} + +static inline uintptr_t +_Py_atomic_load_uintptr_acquire(const uintptr_t *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(uintptr_t)*)obj, + memory_order_acquire); +} + +static inline void +_Py_atomic_store_ptr_release(void *obj, void *value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(void*)*)obj, value, + memory_order_release); +} + +static inline void +_Py_atomic_store_uintptr_release(uintptr_t *obj, uintptr_t value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(uintptr_t)*)obj, value, + memory_order_release); +} + +static inline void +_Py_atomic_store_int_release(int *obj, int value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(int)*)obj, value, + memory_order_release); +} + +static inline void +_Py_atomic_store_uint_release(unsigned int *obj, unsigned int value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(unsigned int)*)obj, value, + memory_order_release); +} + +static inline void +_Py_atomic_store_ssize_release(Py_ssize_t *obj, Py_ssize_t value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(Py_ssize_t)*)obj, value, + memory_order_release); +} + +static inline int +_Py_atomic_load_int_acquire(const int *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(int)*)obj, + memory_order_acquire); +} + +static inline void +_Py_atomic_store_uint32_release(uint32_t *obj, uint32_t value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(uint32_t)*)obj, value, + memory_order_release); +} + +static inline void +_Py_atomic_store_uint64_release(uint64_t *obj, uint64_t value) +{ + _Py_USING_STD; + atomic_store_explicit((_Atomic(uint64_t)*)obj, value, + memory_order_release); +} + +static inline uint64_t +_Py_atomic_load_uint64_acquire(const uint64_t *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(uint64_t)*)obj, + memory_order_acquire); +} + +static inline uint32_t +_Py_atomic_load_uint32_acquire(const uint32_t *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(uint32_t)*)obj, + memory_order_acquire); +} + +static inline Py_ssize_t +_Py_atomic_load_ssize_acquire(const Py_ssize_t *obj) +{ + _Py_USING_STD; + return atomic_load_explicit((const _Atomic(Py_ssize_t)*)obj, + memory_order_acquire); +} + + +// --- _Py_atomic_fence ------------------------------------------------------ + + static inline void +_Py_atomic_fence_seq_cst(void) +{ + _Py_USING_STD; + atomic_thread_fence(memory_order_seq_cst); +} + + static inline void +_Py_atomic_fence_acquire(void) +{ + _Py_USING_STD; + atomic_thread_fence(memory_order_acquire); +} + + static inline void +_Py_atomic_fence_release(void) +{ + _Py_USING_STD; + atomic_thread_fence(memory_order_release); +} diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyctype.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyctype.h new file mode 100644 index 0000000000000000000000000000000000000000..729d93275e6c5365fb26fd521b1ff58de22b5fdb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyctype.h @@ -0,0 +1,39 @@ +#ifndef Py_LIMITED_API +#ifndef PYCTYPE_H +#define PYCTYPE_H +#ifdef __cplusplus +extern "C" { +#endif + +#define PY_CTF_LOWER 0x01 +#define PY_CTF_UPPER 0x02 +#define PY_CTF_ALPHA (PY_CTF_LOWER|PY_CTF_UPPER) +#define PY_CTF_DIGIT 0x04 +#define PY_CTF_ALNUM (PY_CTF_ALPHA|PY_CTF_DIGIT) +#define PY_CTF_SPACE 0x08 +#define PY_CTF_XDIGIT 0x10 + +PyAPI_DATA(const unsigned int) _Py_ctype_table[256]; + +/* Unlike their C counterparts, the following macros are not meant to + * handle an int with any of the values [EOF, 0-UCHAR_MAX]. The argument + * must be a signed/unsigned char. */ +#define Py_ISLOWER(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_LOWER) +#define Py_ISUPPER(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_UPPER) +#define Py_ISALPHA(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_ALPHA) +#define Py_ISDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_DIGIT) +#define Py_ISXDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_XDIGIT) +#define Py_ISALNUM(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_ALNUM) +#define Py_ISSPACE(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_SPACE) + +PyAPI_DATA(const unsigned char) _Py_ctype_tolower[256]; +PyAPI_DATA(const unsigned char) _Py_ctype_toupper[256]; + +#define Py_TOLOWER(c) (_Py_ctype_tolower[Py_CHARMASK(c)]) +#define Py_TOUPPER(c) (_Py_ctype_toupper[Py_CHARMASK(c)]) + +#ifdef __cplusplus +} +#endif +#endif /* !PYCTYPE_H */ +#endif /* !Py_LIMITED_API */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pydebug.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pydebug.h new file mode 100644 index 0000000000000000000000000000000000000000..f6ebd99ed7e2ff2755d7fdd1d11fa77ff374088b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pydebug.h @@ -0,0 +1,38 @@ +#ifndef Py_LIMITED_API +#ifndef Py_PYDEBUG_H +#define Py_PYDEBUG_H +#ifdef __cplusplus +extern "C" { +#endif + +Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_DebugFlag; +Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_VerboseFlag; +Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_QuietFlag; +Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_InteractiveFlag; +Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_InspectFlag; +Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_OptimizeFlag; +Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_NoSiteFlag; +Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_BytesWarningFlag; +Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_FrozenFlag; +Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_IgnoreEnvironmentFlag; +Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_DontWriteBytecodeFlag; +Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_NoUserSiteDirectory; +Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_UnbufferedStdioFlag; +Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_HashRandomizationFlag; +Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_IsolatedFlag; + +#ifdef MS_WINDOWS +Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_LegacyWindowsFSEncodingFlag; +Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_LegacyWindowsStdioFlag; +#endif + +/* this is a wrapper around getenv() that pays attention to + Py_IgnoreEnvironmentFlag. It should be used for getting variables like + PYTHONPATH and PYTHONHOME from the environment */ +PyAPI_FUNC(char*) Py_GETENV(const char *name); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_PYDEBUG_H */ +#endif /* Py_LIMITED_API */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyerrors.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyerrors.h new file mode 100644 index 0000000000000000000000000000000000000000..be2e3b641c25cb67dc6b61eac74cf3139d6e328a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyerrors.h @@ -0,0 +1,133 @@ +#ifndef Py_CPYTHON_ERRORS_H +# error "this header file must not be included directly" +#endif + +/* Error objects */ + +/* PyException_HEAD defines the initial segment of every exception class. */ +#define PyException_HEAD PyObject_HEAD PyObject *dict;\ + PyObject *args; PyObject *notes; PyObject *traceback;\ + PyObject *context; PyObject *cause;\ + char suppress_context; + +typedef struct { + PyException_HEAD +} PyBaseExceptionObject; + +typedef struct { + PyException_HEAD + PyObject *msg; + PyObject *excs; + PyObject *excs_str; +} PyBaseExceptionGroupObject; + +typedef struct { + PyException_HEAD + PyObject *msg; + PyObject *filename; + PyObject *lineno; + PyObject *offset; + PyObject *end_lineno; + PyObject *end_offset; + PyObject *text; + PyObject *print_file_and_line; + PyObject *metadata; +} PySyntaxErrorObject; + +typedef struct { + PyException_HEAD + PyObject *msg; + PyObject *name; + PyObject *path; + PyObject *name_from; +} PyImportErrorObject; + +typedef struct { + PyException_HEAD + PyObject *encoding; + PyObject *object; + Py_ssize_t start; + Py_ssize_t end; + PyObject *reason; +} PyUnicodeErrorObject; + +typedef struct { + PyException_HEAD + PyObject *code; +} PySystemExitObject; + +typedef struct { + PyException_HEAD + PyObject *myerrno; + PyObject *strerror; + PyObject *filename; + PyObject *filename2; +#ifdef MS_WINDOWS + PyObject *winerror; +#endif + Py_ssize_t written; /* only for BlockingIOError, -1 otherwise */ +} PyOSErrorObject; + +typedef struct { + PyException_HEAD + PyObject *value; +} PyStopIterationObject; + +typedef struct { + PyException_HEAD + PyObject *name; +} PyNameErrorObject; + +typedef struct { + PyException_HEAD + PyObject *obj; + PyObject *name; +} PyAttributeErrorObject; + +/* Compatibility typedefs */ +typedef PyOSErrorObject PyEnvironmentErrorObject; +#ifdef MS_WINDOWS +typedef PyOSErrorObject PyWindowsErrorObject; +#endif + +/* Context manipulation (PEP 3134) */ + +PyAPI_FUNC(void) _PyErr_ChainExceptions1(PyObject *); + +/* In exceptions.c */ + +PyAPI_FUNC(PyObject*) PyUnstable_Exc_PrepReraiseStar( + PyObject *orig, + PyObject *excs); + +/* In signalmodule.c */ + +PyAPI_FUNC(int) PySignal_SetWakeupFd(int fd); + +/* Support for adding program text to SyntaxErrors */ + +PyAPI_FUNC(void) PyErr_SyntaxLocationObject( + PyObject *filename, + int lineno, + int col_offset); + +PyAPI_FUNC(void) PyErr_RangedSyntaxLocationObject( + PyObject *filename, + int lineno, + int col_offset, + int end_lineno, + int end_col_offset); + +PyAPI_FUNC(PyObject *) PyErr_ProgramTextObject( + PyObject *filename, + int lineno); + +PyAPI_FUNC(void) _Py_NO_RETURN _Py_FatalErrorFunc( + const char *func, + const char *message); + +PyAPI_FUNC(void) PyErr_FormatUnraisable(const char *, ...); + +PyAPI_DATA(PyObject *) PyExc_PythonFinalizationError; + +#define Py_FatalError(message) _Py_FatalErrorFunc(__func__, (message)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyfpe.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyfpe.h new file mode 100644 index 0000000000000000000000000000000000000000..cc2def63aa5527f4ac192aa663a14353a88e1774 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyfpe.h @@ -0,0 +1,15 @@ +#ifndef Py_PYFPE_H +#define Py_PYFPE_H +/* Header excluded from the stable API */ +#ifndef Py_LIMITED_API + +/* These macros used to do something when Python was built with --with-fpectl, + * but support for that was dropped in 3.7. We continue to define them though, + * to avoid breaking API users. + */ + +#define PyFPE_START_PROTECT(err_string, leave_stmt) +#define PyFPE_END_PROTECT(v) + +#endif /* !defined(Py_LIMITED_API) */ +#endif /* !Py_PYFPE_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyframe.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyframe.h new file mode 100644 index 0000000000000000000000000000000000000000..51529763923ec3a48662219f08928b6b79ddd5fb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyframe.h @@ -0,0 +1,45 @@ +#ifndef Py_CPYTHON_PYFRAME_H +# error "this header file must not be included directly" +#endif + +PyAPI_DATA(PyTypeObject) PyFrame_Type; +PyAPI_DATA(PyTypeObject) PyFrameLocalsProxy_Type; + +#define PyFrame_Check(op) Py_IS_TYPE((op), &PyFrame_Type) +#define PyFrameLocalsProxy_Check(op) Py_IS_TYPE((op), &PyFrameLocalsProxy_Type) + +PyAPI_FUNC(PyFrameObject *) PyFrame_GetBack(PyFrameObject *frame); +PyAPI_FUNC(PyObject *) PyFrame_GetLocals(PyFrameObject *frame); + +PyAPI_FUNC(PyObject *) PyFrame_GetGlobals(PyFrameObject *frame); +PyAPI_FUNC(PyObject *) PyFrame_GetBuiltins(PyFrameObject *frame); + +PyAPI_FUNC(PyObject *) PyFrame_GetGenerator(PyFrameObject *frame); +PyAPI_FUNC(int) PyFrame_GetLasti(PyFrameObject *frame); +PyAPI_FUNC(PyObject*) PyFrame_GetVar(PyFrameObject *frame, PyObject *name); +PyAPI_FUNC(PyObject*) PyFrame_GetVarString(PyFrameObject *frame, const char *name); + +/* The following functions are for use by debuggers and other tools + * implementing custom frame evaluators with PEP 523. */ + +struct _PyInterpreterFrame; + +/* Returns the code object of the frame (strong reference). + * Does not raise an exception. */ +PyAPI_FUNC(PyObject *) PyUnstable_InterpreterFrame_GetCode(struct _PyInterpreterFrame *frame); + +/* Returns a byte offset into the last executed instruction. + * Does not raise an exception. */ +PyAPI_FUNC(int) PyUnstable_InterpreterFrame_GetLasti(struct _PyInterpreterFrame *frame); + +/* Returns the currently executing line number, or -1 if there is no line number. + * Does not raise an exception. */ +PyAPI_FUNC(int) PyUnstable_InterpreterFrame_GetLine(struct _PyInterpreterFrame *frame); + +#define PyUnstable_EXECUTABLE_KIND_SKIP 0 +#define PyUnstable_EXECUTABLE_KIND_PY_FUNCTION 1 +#define PyUnstable_EXECUTABLE_KIND_BUILTIN_FUNCTION 3 +#define PyUnstable_EXECUTABLE_KIND_METHOD_DESCRIPTOR 4 +#define PyUnstable_EXECUTABLE_KINDS 5 + +PyAPI_DATA(const PyTypeObject *) const PyUnstable_ExecutableKinds[PyUnstable_EXECUTABLE_KINDS+1]; diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyhash.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyhash.h new file mode 100644 index 0000000000000000000000000000000000000000..a33ba10b8d3a37c2d9d2a0005a6c976084bd185a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pyhash.h @@ -0,0 +1,54 @@ +#ifndef Py_CPYTHON_HASH_H +# error "this header file must not be included directly" +#endif + +/* Prime multiplier used in string and various other hashes. */ +#define PyHASH_MULTIPLIER 1000003UL /* 0xf4243 */ + +/* Parameters used for the numeric hash implementation. See notes for + _Py_HashDouble in Python/pyhash.c. Numeric hashes are based on + reduction modulo the prime 2**_PyHASH_BITS - 1. */ + +#if SIZEOF_VOID_P >= 8 +# define PyHASH_BITS 61 +#else +# define PyHASH_BITS 31 +#endif + +#define PyHASH_MODULUS (((size_t)1 << _PyHASH_BITS) - 1) +#define PyHASH_INF 314159 +#define PyHASH_IMAG PyHASH_MULTIPLIER + +/* Aliases kept for backward compatibility with Python 3.12 */ +#define _PyHASH_MULTIPLIER PyHASH_MULTIPLIER +#define _PyHASH_BITS PyHASH_BITS +#define _PyHASH_MODULUS PyHASH_MODULUS +#define _PyHASH_INF PyHASH_INF +#define _PyHASH_IMAG PyHASH_IMAG + +/* Helpers for hash functions */ +PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double); + + +/* hash function definition */ +typedef struct { + Py_hash_t (*const hash)(const void *, Py_ssize_t); + const char *name; + const int hash_bits; + const int seed_bits; +} PyHash_FuncDef; + +PyAPI_FUNC(PyHash_FuncDef*) PyHash_GetFuncDef(void); + +PyAPI_FUNC(Py_hash_t) Py_HashPointer(const void *ptr); + +// Deprecated alias kept for backward compatibility +Py_DEPRECATED(3.14) static inline Py_hash_t +_Py_HashPointer(const void *ptr) +{ + return Py_HashPointer(ptr); +} + +PyAPI_FUNC(Py_hash_t) PyObject_GenericHash(PyObject *); + +PyAPI_FUNC(Py_hash_t) Py_HashBuffer(const void *ptr, Py_ssize_t len); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pylifecycle.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pylifecycle.h new file mode 100644 index 0000000000000000000000000000000000000000..86ce6e6f79824a76aeb0d8c0903d379757c09ece --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pylifecycle.h @@ -0,0 +1,89 @@ +#ifndef Py_CPYTHON_PYLIFECYCLE_H +# error "this header file must not be included directly" +#endif + +/* Py_FrozenMain is kept out of the Limited API until documented and present + in all builds of Python */ +PyAPI_FUNC(int) Py_FrozenMain(int argc, char **argv); + +/* PEP 432 Multi-phase initialization API (Private while provisional!) */ + +PyAPI_FUNC(PyStatus) Py_PreInitialize( + const PyPreConfig *src_config); +PyAPI_FUNC(PyStatus) Py_PreInitializeFromBytesArgs( + const PyPreConfig *src_config, + Py_ssize_t argc, + char **argv); +PyAPI_FUNC(PyStatus) Py_PreInitializeFromArgs( + const PyPreConfig *src_config, + Py_ssize_t argc, + wchar_t **argv); + + +/* Initialization and finalization */ + +PyAPI_FUNC(PyStatus) Py_InitializeFromConfig( + const PyConfig *config); + +PyAPI_FUNC(int) Py_RunMain(void); + + +PyAPI_FUNC(void) _Py_NO_RETURN Py_ExitStatusException(PyStatus err); + +PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *); + +/* --- PyInterpreterConfig ------------------------------------ */ + +#define PyInterpreterConfig_DEFAULT_GIL (0) +#define PyInterpreterConfig_SHARED_GIL (1) +#define PyInterpreterConfig_OWN_GIL (2) + +typedef struct { + // XXX "allow_object_sharing"? "own_objects"? + int use_main_obmalloc; + int allow_fork; + int allow_exec; + int allow_threads; + int allow_daemon_threads; + int check_multi_interp_extensions; + int gil; +} PyInterpreterConfig; + +#define _PyInterpreterConfig_INIT \ + { \ + .use_main_obmalloc = 0, \ + .allow_fork = 0, \ + .allow_exec = 0, \ + .allow_threads = 1, \ + .allow_daemon_threads = 0, \ + .check_multi_interp_extensions = 1, \ + .gil = PyInterpreterConfig_OWN_GIL, \ + } + +// gh-117649: The free-threaded build does not currently support single-phase +// init extensions in subinterpreters. For now, we ensure that +// `check_multi_interp_extensions` is always `1`, even in the legacy config. +#ifdef Py_GIL_DISABLED +# define _PyInterpreterConfig_LEGACY_CHECK_MULTI_INTERP_EXTENSIONS 1 +#else +# define _PyInterpreterConfig_LEGACY_CHECK_MULTI_INTERP_EXTENSIONS 0 +#endif + +#define _PyInterpreterConfig_LEGACY_INIT \ + { \ + .use_main_obmalloc = 1, \ + .allow_fork = 1, \ + .allow_exec = 1, \ + .allow_threads = 1, \ + .allow_daemon_threads = 1, \ + .check_multi_interp_extensions = _PyInterpreterConfig_LEGACY_CHECK_MULTI_INTERP_EXTENSIONS, \ + .gil = PyInterpreterConfig_SHARED_GIL, \ + } + +PyAPI_FUNC(PyStatus) Py_NewInterpreterFromConfig( + PyThreadState **tstate_p, + const PyInterpreterConfig *config); + +typedef void (*atexit_datacallbackfunc)(void *); +PyAPI_FUNC(int) PyUnstable_AtExit( + PyInterpreterState *, atexit_datacallbackfunc, void *); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pymem.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pymem.h new file mode 100644 index 0000000000000000000000000000000000000000..76b3221f7b9f39f50fa60ef6b5777eed5e00dc04 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pymem.h @@ -0,0 +1,84 @@ +#ifndef Py_CPYTHON_PYMEM_H +# error "this header file must not be included directly" +#endif + +typedef enum { + /* PyMem_RawMalloc(), PyMem_RawRealloc() and PyMem_RawFree() */ + PYMEM_DOMAIN_RAW, + + /* PyMem_Malloc(), PyMem_Realloc() and PyMem_Free() */ + PYMEM_DOMAIN_MEM, + + /* PyObject_Malloc(), PyObject_Realloc() and PyObject_Free() */ + PYMEM_DOMAIN_OBJ +} PyMemAllocatorDomain; + +typedef enum { + PYMEM_ALLOCATOR_NOT_SET = 0, + PYMEM_ALLOCATOR_DEFAULT = 1, + PYMEM_ALLOCATOR_DEBUG = 2, + PYMEM_ALLOCATOR_MALLOC = 3, + PYMEM_ALLOCATOR_MALLOC_DEBUG = 4, +#ifdef WITH_PYMALLOC + PYMEM_ALLOCATOR_PYMALLOC = 5, + PYMEM_ALLOCATOR_PYMALLOC_DEBUG = 6, +#endif +#ifdef WITH_MIMALLOC + PYMEM_ALLOCATOR_MIMALLOC = 7, + PYMEM_ALLOCATOR_MIMALLOC_DEBUG = 8, +#endif +} PyMemAllocatorName; + + +typedef struct { + /* user context passed as the first argument to the 4 functions */ + void *ctx; + + /* allocate a memory block */ + void* (*malloc) (void *ctx, size_t size); + + /* allocate a memory block initialized by zeros */ + void* (*calloc) (void *ctx, size_t nelem, size_t elsize); + + /* allocate or resize a memory block */ + void* (*realloc) (void *ctx, void *ptr, size_t new_size); + + /* release a memory block */ + void (*free) (void *ctx, void *ptr); +} PyMemAllocatorEx; + +/* Get the memory block allocator of the specified domain. */ +PyAPI_FUNC(void) PyMem_GetAllocator(PyMemAllocatorDomain domain, + PyMemAllocatorEx *allocator); + +/* Set the memory block allocator of the specified domain. + + The new allocator must return a distinct non-NULL pointer when requesting + zero bytes. + + For the PYMEM_DOMAIN_RAW domain, the allocator must be thread-safe: the GIL + is not held when the allocator is called. + + If the new allocator is not a hook (don't call the previous allocator), the + PyMem_SetupDebugHooks() function must be called to reinstall the debug hooks + on top on the new allocator. */ +PyAPI_FUNC(void) PyMem_SetAllocator(PyMemAllocatorDomain domain, + PyMemAllocatorEx *allocator); + +/* Setup hooks to detect bugs in the following Python memory allocator + functions: + + - PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree() + - PyMem_Malloc(), PyMem_Realloc(), PyMem_Free() + - PyObject_Malloc(), PyObject_Realloc() and PyObject_Free() + + Newly allocated memory is filled with the byte 0xCB, freed memory is filled + with the byte 0xDB. Additional checks: + + - detect API violations, ex: PyObject_Free() called on a buffer allocated + by PyMem_Malloc() + - detect write before the start of the buffer (buffer underflow) + - detect write after the end of the buffer (buffer overflow) + + The function does nothing if Python is not compiled is debug mode. */ +PyAPI_FUNC(void) PyMem_SetupDebugHooks(void); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pystate.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pystate.h new file mode 100644 index 0000000000000000000000000000000000000000..c1b97d428e2e9b67482183640344dfcb297e27c9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pystate.h @@ -0,0 +1,277 @@ +#ifndef Py_CPYTHON_PYSTATE_H +# error "this header file must not be included directly" +#endif + + +/* private interpreter helpers */ + +PyAPI_FUNC(int) _PyInterpreterState_RequiresIDRef(PyInterpreterState *); +PyAPI_FUNC(void) _PyInterpreterState_RequireIDRef(PyInterpreterState *, int); + +/* State unique per thread */ + +/* Py_tracefunc return -1 when raising an exception, or 0 for success. */ +typedef int (*Py_tracefunc)(PyObject *, PyFrameObject *, int, PyObject *); + +/* The following values are used for 'what' for tracefunc functions + * + * To add a new kind of trace event, also update "trace_init" in + * Python/sysmodule.c to define the Python level event name + */ +#define PyTrace_CALL 0 +#define PyTrace_EXCEPTION 1 +#define PyTrace_LINE 2 +#define PyTrace_RETURN 3 +#define PyTrace_C_CALL 4 +#define PyTrace_C_EXCEPTION 5 +#define PyTrace_C_RETURN 6 +#define PyTrace_OPCODE 7 + +/* Remote debugger support */ +#define _Py_MAX_SCRIPT_PATH_SIZE 512 +typedef struct { + int32_t debugger_pending_call; + char debugger_script_path[_Py_MAX_SCRIPT_PATH_SIZE]; +} _PyRemoteDebuggerSupport; + +typedef struct _err_stackitem { + /* This struct represents a single execution context where we might + * be currently handling an exception. It is a per-coroutine state + * (coroutine in the computer science sense, including the thread + * and generators). + * + * This is used as an entry on the exception stack, where each + * entry indicates if it is currently handling an exception. + * This ensures that the exception state is not impacted + * by "yields" from an except handler. The thread + * always has an entry (the bottom-most one). + */ + + /* The exception currently being handled in this context, if any. */ + PyObject *exc_value; + + struct _err_stackitem *previous_item; + +} _PyErr_StackItem; + +typedef struct _stack_chunk { + struct _stack_chunk *previous; + size_t size; + size_t top; + PyObject * data[1]; /* Variable sized */ +} _PyStackChunk; + +/* Minimum size of data stack chunk */ +#define _PY_DATA_STACK_CHUNK_SIZE (16*1024) +struct _ts { + /* See Python/ceval.c for comments explaining most fields */ + + PyThreadState *prev; + PyThreadState *next; + PyInterpreterState *interp; + + /* The global instrumentation version in high bits, plus flags indicating + when to break out of the interpreter loop in lower bits. See details in + pycore_ceval.h. */ + uintptr_t eval_breaker; + + struct { + /* Has been initialized to a safe state. + + In order to be effective, this must be set to 0 during or right + after allocation. */ + unsigned int initialized:1; + + /* Has been bound to an OS thread. */ + unsigned int bound:1; + /* Has been unbound from its OS thread. */ + unsigned int unbound:1; + /* Has been bound aa current for the GILState API. */ + unsigned int bound_gilstate:1; + /* Currently in use (maybe holds the GIL). */ + unsigned int active:1; + + /* various stages of finalization */ + unsigned int finalizing:1; + unsigned int cleared:1; + unsigned int finalized:1; + + /* padding to align to 4 bytes */ + unsigned int :24; + } _status; +#ifdef Py_BUILD_CORE +# define _PyThreadState_WHENCE_NOTSET -1 +# define _PyThreadState_WHENCE_UNKNOWN 0 +# define _PyThreadState_WHENCE_INIT 1 +# define _PyThreadState_WHENCE_FINI 2 +# define _PyThreadState_WHENCE_THREADING 3 +# define _PyThreadState_WHENCE_GILSTATE 4 +# define _PyThreadState_WHENCE_EXEC 5 +#endif + + /* Currently holds the GIL. Must be its own field to avoid data races */ + int holds_gil; + + int _whence; + + /* Thread state (_Py_THREAD_ATTACHED, _Py_THREAD_DETACHED, _Py_THREAD_SUSPENDED). + See Include/internal/pycore_pystate.h for more details. */ + int state; + + int py_recursion_remaining; + int py_recursion_limit; + int recursion_headroom; /* Allow 50 more calls to handle any errors. */ + + /* 'tracing' keeps track of the execution depth when tracing/profiling. + This is to prevent the actual trace/profile code from being recorded in + the trace/profile. */ + int tracing; + int what_event; /* The event currently being monitored, if any. */ + + /* Pointer to currently executing frame. */ + struct _PyInterpreterFrame *current_frame; + + Py_tracefunc c_profilefunc; + Py_tracefunc c_tracefunc; + PyObject *c_profileobj; + PyObject *c_traceobj; + + /* The exception currently being raised */ + PyObject *current_exception; + + /* Pointer to the top of the exception stack for the exceptions + * we may be currently handling. (See _PyErr_StackItem above.) + * This is never NULL. */ + _PyErr_StackItem *exc_info; + + PyObject *dict; /* Stores per-thread state */ + + int gilstate_counter; + + PyObject *async_exc; /* Asynchronous exception to raise */ + unsigned long thread_id; /* Thread id where this tstate was created */ + + /* Native thread id where this tstate was created. This will be 0 except on + * those platforms that have the notion of native thread id, for which the + * macro PY_HAVE_THREAD_NATIVE_ID is then defined. + */ + unsigned long native_thread_id; + + PyObject *delete_later; + + /* Tagged pointer to top-most critical section, or zero if there is no + * active critical section. Critical sections are only used in + * `--disable-gil` builds (i.e., when Py_GIL_DISABLED is defined to 1). In the + * default build, this field is always zero. + */ + uintptr_t critical_section; + + int coroutine_origin_tracking_depth; + + PyObject *async_gen_firstiter; + PyObject *async_gen_finalizer; + + PyObject *context; + uint64_t context_ver; + + /* Unique thread state id. */ + uint64_t id; + + _PyStackChunk *datastack_chunk; + PyObject **datastack_top; + PyObject **datastack_limit; + /* XXX signal handlers should also be here */ + + /* The following fields are here to avoid allocation during init. + The data is exposed through PyThreadState pointer fields. + These fields should not be accessed directly outside of init. + This is indicated by an underscore prefix on the field names. + + All other PyInterpreterState pointer fields are populated when + needed and default to NULL. + */ + // Note some fields do not have a leading underscore for backward + // compatibility. See https://bugs.python.org/issue45953#msg412046. + + /* The thread's exception stack entry. (Always the last entry.) */ + _PyErr_StackItem exc_state; + + PyObject *current_executor; + + uint64_t dict_global_version; + + /* Used to store/retrieve `threading.local` keys/values for this thread */ + PyObject *threading_local_key; + + /* Used by `threading.local`s to be remove keys/values for dying threads. + The PyThreadObject must hold the only reference to this value. + */ + PyObject *threading_local_sentinel; + _PyRemoteDebuggerSupport remote_debugger_support; + + _PyStackChunk *datastack_cached_chunk; +}; + +/* other API */ + +/* Similar to PyThreadState_Get(), but don't issue a fatal error + * if it is NULL. */ +PyAPI_FUNC(PyThreadState *) PyThreadState_GetUnchecked(void); + +// Deprecated alias kept for backward compatibility +Py_DEPRECATED(3.14) static inline PyThreadState* +_PyThreadState_UncheckedGet(void) +{ + return PyThreadState_GetUnchecked(); +} + +// Disable tracing and profiling. +PyAPI_FUNC(void) PyThreadState_EnterTracing(PyThreadState *tstate); + +// Reset tracing and profiling: enable them if a trace function or a profile +// function is set, otherwise disable them. +PyAPI_FUNC(void) PyThreadState_LeaveTracing(PyThreadState *tstate); + +/* PyGILState */ + +/* Helper/diagnostic function - return 1 if the current thread + currently holds the GIL, 0 otherwise. + + The function returns 1 if _PyGILState_check_enabled is non-zero. */ +PyAPI_FUNC(int) PyGILState_Check(void); + +/* The implementation of sys._current_frames() Returns a dict mapping + thread id to that thread's current frame. +*/ +PyAPI_FUNC(PyObject*) _PyThread_CurrentFrames(void); + +// Set the stack protection start address and stack protection size +// of a Python thread state +PyAPI_FUNC(int) PyUnstable_ThreadState_SetStackProtection( + PyThreadState *tstate, + void *stack_start_addr, // Stack start address + size_t stack_size); // Stack size (in bytes) + +// Reset the stack protection start address and stack protection size +// of a Python thread state +PyAPI_FUNC(void) PyUnstable_ThreadState_ResetStackProtection( + PyThreadState *tstate); + +/* Routines for advanced debuggers, requested by David Beazley. + Don't use unless you know what you are doing! */ +PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Main(void); +PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Head(void); +PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Next(PyInterpreterState *); +PyAPI_FUNC(PyThreadState *) PyInterpreterState_ThreadHead(PyInterpreterState *); +PyAPI_FUNC(PyThreadState *) PyThreadState_Next(PyThreadState *); +PyAPI_FUNC(void) PyThreadState_DeleteCurrent(void); + +/* Frame evaluation API */ + +typedef PyObject* (*_PyFrameEvalFunction)(PyThreadState *tstate, struct _PyInterpreterFrame *, int); + +PyAPI_FUNC(_PyFrameEvalFunction) _PyInterpreterState_GetEvalFrameFunc( + PyInterpreterState *interp); +PyAPI_FUNC(void) _PyInterpreterState_SetEvalFrameFunc( + PyInterpreterState *interp, + _PyFrameEvalFunction eval_frame); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pystats.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pystats.h new file mode 100644 index 0000000000000000000000000000000000000000..cf830b6066f4abac07e395fb8a0c67f64ebbcf98 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pystats.h @@ -0,0 +1,194 @@ +// Statistics on Python performance. +// +// API: +// +// - _Py_INCREF_STAT_INC() and _Py_DECREF_STAT_INC() used by Py_INCREF() +// and Py_DECREF(). +// - _Py_stats variable +// +// Functions of the sys module: +// +// - sys._stats_on() +// - sys._stats_off() +// - sys._stats_clear() +// - sys._stats_dump() +// +// Python must be built with ./configure --enable-pystats to define the +// Py_STATS macro. +// +// Define _PY_INTERPRETER macro to increment interpreter_increfs and +// interpreter_decrefs. Otherwise, increment increfs and decrefs. +// +// The number of incref operations counted by `incref` and +// `interpreter_incref` is the number of increment operations, which is +// not equal to the total of all reference counts. A single increment +// operation may increase the reference count of an object by more than +// one. For example, see `_Py_RefcntAdd`. + +#ifndef Py_CPYTHON_PYSTATS_H +# error "this header file must not be included directly" +#endif + +#define PYSTATS_MAX_UOP_ID 1024 + +#define SPECIALIZATION_FAILURE_KINDS 60 + +/* Stats for determining who is calling PyEval_EvalFrame */ +#define EVAL_CALL_TOTAL 0 +#define EVAL_CALL_VECTOR 1 +#define EVAL_CALL_GENERATOR 2 +#define EVAL_CALL_LEGACY 3 +#define EVAL_CALL_FUNCTION_VECTORCALL 4 +#define EVAL_CALL_BUILD_CLASS 5 +#define EVAL_CALL_SLOT 6 +#define EVAL_CALL_FUNCTION_EX 7 +#define EVAL_CALL_API 8 +#define EVAL_CALL_METHOD 9 + +#define EVAL_CALL_KINDS 10 + +typedef struct _specialization_stats { + uint64_t success; + uint64_t failure; + uint64_t hit; + uint64_t deferred; + uint64_t miss; + uint64_t deopt; + uint64_t failure_kinds[SPECIALIZATION_FAILURE_KINDS]; +} SpecializationStats; + +typedef struct _opcode_stats { + SpecializationStats specialization; + uint64_t execution_count; + uint64_t pair_count[256]; +} OpcodeStats; + +typedef struct _call_stats { + uint64_t inlined_py_calls; + uint64_t pyeval_calls; + uint64_t frames_pushed; + uint64_t frame_objects_created; + uint64_t eval_calls[EVAL_CALL_KINDS]; +} CallStats; + +typedef struct _object_stats { + uint64_t increfs; + uint64_t decrefs; + uint64_t interpreter_increfs; + uint64_t interpreter_decrefs; + uint64_t immortal_increfs; + uint64_t immortal_decrefs; + uint64_t interpreter_immortal_increfs; + uint64_t interpreter_immortal_decrefs; + uint64_t allocations; + uint64_t allocations512; + uint64_t allocations4k; + uint64_t allocations_big; + uint64_t frees; + uint64_t to_freelist; + uint64_t from_freelist; + uint64_t inline_values; + uint64_t dict_materialized_on_request; + uint64_t dict_materialized_new_key; + uint64_t dict_materialized_too_big; + uint64_t dict_materialized_str_subclass; + uint64_t type_cache_hits; + uint64_t type_cache_misses; + uint64_t type_cache_dunder_hits; + uint64_t type_cache_dunder_misses; + uint64_t type_cache_collisions; + /* Temporary value used during GC */ + uint64_t object_visits; +} ObjectStats; + +typedef struct _gc_stats { + uint64_t collections; + uint64_t object_visits; + uint64_t objects_collected; + uint64_t objects_transitively_reachable; + uint64_t objects_not_transitively_reachable; +} GCStats; + +typedef struct _uop_stats { + uint64_t execution_count; + uint64_t miss; + uint64_t pair_count[PYSTATS_MAX_UOP_ID + 1]; +} UOpStats; + +#define _Py_UOP_HIST_SIZE 32 + +typedef struct _optimization_stats { + uint64_t attempts; + uint64_t traces_created; + uint64_t traces_executed; + uint64_t uops_executed; + uint64_t trace_stack_overflow; + uint64_t trace_stack_underflow; + uint64_t trace_too_long; + uint64_t trace_too_short; + uint64_t inner_loop; + uint64_t recursive_call; + uint64_t low_confidence; + uint64_t unknown_callee; + uint64_t executors_invalidated; + UOpStats opcode[PYSTATS_MAX_UOP_ID + 1]; + uint64_t unsupported_opcode[256]; + uint64_t trace_length_hist[_Py_UOP_HIST_SIZE]; + uint64_t trace_run_length_hist[_Py_UOP_HIST_SIZE]; + uint64_t optimized_trace_length_hist[_Py_UOP_HIST_SIZE]; + uint64_t optimizer_attempts; + uint64_t optimizer_successes; + uint64_t optimizer_failure_reason_no_memory; + uint64_t remove_globals_builtins_changed; + uint64_t remove_globals_incorrect_keys; + uint64_t error_in_opcode[PYSTATS_MAX_UOP_ID + 1]; + // JIT memory stats + uint64_t jit_total_memory_size; + uint64_t jit_code_size; + uint64_t jit_trampoline_size; + uint64_t jit_data_size; + uint64_t jit_padding_size; + uint64_t jit_freed_memory_size; + uint64_t trace_total_memory_hist[_Py_UOP_HIST_SIZE]; +} OptimizationStats; + +typedef struct _rare_event_stats { + /* Setting an object's class, obj.__class__ = ... */ + uint64_t set_class; + /* Setting the bases of a class, cls.__bases__ = ... */ + uint64_t set_bases; + /* Setting the PEP 523 frame eval function, _PyInterpreterState_SetFrameEvalFunc() */ + uint64_t set_eval_frame_func; + /* Modifying the builtins, __builtins__.__dict__[var] = ... */ + uint64_t builtin_dict; + /* Modifying a function, e.g. func.__defaults__ = ..., etc. */ + uint64_t func_modification; + /* Modifying a dict that is being watched */ + uint64_t watched_dict_modification; + uint64_t watched_globals_modification; +} RareEventStats; + +typedef struct _stats { + OpcodeStats opcode_stats[256]; + CallStats call_stats; + ObjectStats object_stats; + OptimizationStats optimization_stats; + RareEventStats rare_event_stats; + GCStats *gc_stats; +} PyStats; + + +// Export for shared extensions like 'math' +PyAPI_DATA(PyStats*) _Py_stats; + +#ifdef _PY_INTERPRETER +# define _Py_INCREF_STAT_INC() do { if (_Py_stats) _Py_stats->object_stats.interpreter_increfs++; } while (0) +# define _Py_DECREF_STAT_INC() do { if (_Py_stats) _Py_stats->object_stats.interpreter_decrefs++; } while (0) +# define _Py_INCREF_IMMORTAL_STAT_INC() do { if (_Py_stats) _Py_stats->object_stats.interpreter_immortal_increfs++; } while (0) +# define _Py_DECREF_IMMORTAL_STAT_INC() do { if (_Py_stats) _Py_stats->object_stats.interpreter_immortal_decrefs++; } while (0) +#else +# define _Py_INCREF_STAT_INC() do { if (_Py_stats) _Py_stats->object_stats.increfs++; } while (0) +# define _Py_DECREF_STAT_INC() do { if (_Py_stats) _Py_stats->object_stats.decrefs++; } while (0) +# define _Py_INCREF_IMMORTAL_STAT_INC() do { if (_Py_stats) _Py_stats->object_stats.immortal_increfs++; } while (0) +# define _Py_DECREF_IMMORTAL_STAT_INC() do { if (_Py_stats) _Py_stats->object_stats.immortal_decrefs++; } while (0) +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pythonrun.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pythonrun.h new file mode 100644 index 0000000000000000000000000000000000000000..edc40952254029f8c8f2927f4e3324a14d40fba6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pythonrun.h @@ -0,0 +1,96 @@ +#ifndef Py_CPYTHON_PYTHONRUN_H +# error "this header file must not be included directly" +#endif + +PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *); +PyAPI_FUNC(int) PyRun_AnyFileExFlags( + FILE *fp, + const char *filename, /* decoded from the filesystem encoding */ + int closeit, + PyCompilerFlags *flags); +PyAPI_FUNC(int) PyRun_SimpleFileExFlags( + FILE *fp, + const char *filename, /* decoded from the filesystem encoding */ + int closeit, + PyCompilerFlags *flags); +PyAPI_FUNC(int) PyRun_InteractiveOneFlags( + FILE *fp, + const char *filename, /* decoded from the filesystem encoding */ + PyCompilerFlags *flags); +PyAPI_FUNC(int) PyRun_InteractiveOneObject( + FILE *fp, + PyObject *filename, + PyCompilerFlags *flags); +PyAPI_FUNC(int) PyRun_InteractiveLoopFlags( + FILE *fp, + const char *filename, /* decoded from the filesystem encoding */ + PyCompilerFlags *flags); + + +PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *, int, PyObject *, + PyObject *, PyCompilerFlags *); + +PyAPI_FUNC(PyObject *) PyRun_FileExFlags( + FILE *fp, + const char *filename, /* decoded from the filesystem encoding */ + int start, + PyObject *globals, + PyObject *locals, + int closeit, + PyCompilerFlags *flags); + + +PyAPI_FUNC(PyObject *) Py_CompileStringExFlags( + const char *str, + const char *filename, /* decoded from the filesystem encoding */ + int start, + PyCompilerFlags *flags, + int optimize); +PyAPI_FUNC(PyObject *) Py_CompileStringObject( + const char *str, + PyObject *filename, int start, + PyCompilerFlags *flags, + int optimize); + +#define Py_CompileString(str, p, s) Py_CompileStringExFlags((str), (p), (s), NULL, -1) +#define Py_CompileStringFlags(str, p, s, f) Py_CompileStringExFlags((str), (p), (s), (f), -1) + +/* A function flavor is also exported by libpython. It is required when + libpython is accessed directly rather than using header files which defines + macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to + export functions in pythonXX.dll. */ +PyAPI_FUNC(PyObject *) PyRun_String(const char *str, int s, PyObject *g, PyObject *l); +PyAPI_FUNC(int) PyRun_AnyFile(FILE *fp, const char *name); +PyAPI_FUNC(int) PyRun_AnyFileEx(FILE *fp, const char *name, int closeit); +PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *); +PyAPI_FUNC(int) PyRun_SimpleString(const char *s); +PyAPI_FUNC(int) PyRun_SimpleFile(FILE *f, const char *p); +PyAPI_FUNC(int) PyRun_SimpleFileEx(FILE *f, const char *p, int c); +PyAPI_FUNC(int) PyRun_InteractiveOne(FILE *f, const char *p); +PyAPI_FUNC(int) PyRun_InteractiveLoop(FILE *f, const char *p); +PyAPI_FUNC(PyObject *) PyRun_File(FILE *fp, const char *p, int s, PyObject *g, PyObject *l); +PyAPI_FUNC(PyObject *) PyRun_FileEx(FILE *fp, const char *p, int s, PyObject *g, PyObject *l, int c); +PyAPI_FUNC(PyObject *) PyRun_FileFlags(FILE *fp, const char *p, int s, PyObject *g, PyObject *l, PyCompilerFlags *flags); + +/* Use macros for a bunch of old variants */ +#define PyRun_String(str, s, g, l) PyRun_StringFlags((str), (s), (g), (l), NULL) +#define PyRun_AnyFile(fp, name) PyRun_AnyFileExFlags((fp), (name), 0, NULL) +#define PyRun_AnyFileEx(fp, name, closeit) \ + PyRun_AnyFileExFlags((fp), (name), (closeit), NULL) +#define PyRun_AnyFileFlags(fp, name, flags) \ + PyRun_AnyFileExFlags((fp), (name), 0, (flags)) +#define PyRun_SimpleString(s) PyRun_SimpleStringFlags((s), NULL) +#define PyRun_SimpleFile(f, p) PyRun_SimpleFileExFlags((f), (p), 0, NULL) +#define PyRun_SimpleFileEx(f, p, c) PyRun_SimpleFileExFlags((f), (p), (c), NULL) +#define PyRun_InteractiveOne(f, p) PyRun_InteractiveOneFlags((f), (p), NULL) +#define PyRun_InteractiveLoop(f, p) PyRun_InteractiveLoopFlags((f), (p), NULL) +#define PyRun_File(fp, p, s, g, l) \ + PyRun_FileExFlags((fp), (p), (s), (g), (l), 0, NULL) +#define PyRun_FileEx(fp, p, s, g, l, c) \ + PyRun_FileExFlags((fp), (p), (s), (g), (l), (c), NULL) +#define PyRun_FileFlags(fp, p, s, g, l, flags) \ + PyRun_FileExFlags((fp), (p), (s), (g), (l), 0, (flags)) + +/* Stuff with no proper home (yet) */ +PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, const char *); +PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pythread.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pythread.h new file mode 100644 index 0000000000000000000000000000000000000000..e658b35bd90700eb1dabad03497c2b52452db9ff --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pythread.h @@ -0,0 +1,43 @@ +#ifndef Py_CPYTHON_PYTHREAD_H +# error "this header file must not be included directly" +#endif + +// PY_TIMEOUT_MAX is the highest usable value (in microseconds) of PY_TIMEOUT_T +// type, and depends on the system threading API. +// +// NOTE: this isn't the same value as `_thread.TIMEOUT_MAX`. The _thread module +// exposes a higher-level API, with timeouts expressed in seconds and +// floating-point numbers allowed. +PyAPI_DATA(const long long) PY_TIMEOUT_MAX; + +#define PYTHREAD_INVALID_THREAD_ID ((unsigned long)-1) + +#ifdef HAVE_PTHREAD_H + /* Darwin needs pthread.h to know type name the pthread_key_t. */ +# include +# define NATIVE_TSS_KEY_T pthread_key_t +#elif defined(NT_THREADS) + /* In Windows, native TSS key type is DWORD, + but hardcode the unsigned long to avoid errors for include directive. + */ +# define NATIVE_TSS_KEY_T unsigned long +#elif defined(HAVE_PTHREAD_STUBS) +# include "pthread_stubs.h" +# define NATIVE_TSS_KEY_T pthread_key_t +#else +# error "Require native threads. See https://bugs.python.org/issue31370" +#endif + +/* When Py_LIMITED_API is not defined, the type layout of Py_tss_t is + exposed to allow static allocation in the API clients. Even in this case, + you must handle TSS keys through API functions due to compatibility. +*/ +struct _Py_tss_t { + int _is_initialized; + NATIVE_TSS_KEY_T _key; +}; + +#undef NATIVE_TSS_KEY_T + +/* When static allocation, you must initialize with Py_tss_NEEDS_INIT. */ +#define Py_tss_NEEDS_INIT {0} diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pytime.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pytime.h new file mode 100644 index 0000000000000000000000000000000000000000..5c68110aeedb867ba90c8cab047fed1489e083ff --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/pytime.h @@ -0,0 +1,27 @@ +// PyTime_t C API: see Doc/c-api/time.rst for the documentation. + +#ifndef Py_LIMITED_API +#ifndef Py_PYTIME_H +#define Py_PYTIME_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef int64_t PyTime_t; +#define PyTime_MIN INT64_MIN +#define PyTime_MAX INT64_MAX + +PyAPI_FUNC(double) PyTime_AsSecondsDouble(PyTime_t t); +PyAPI_FUNC(int) PyTime_Monotonic(PyTime_t *result); +PyAPI_FUNC(int) PyTime_PerfCounter(PyTime_t *result); +PyAPI_FUNC(int) PyTime_Time(PyTime_t *result); + +PyAPI_FUNC(int) PyTime_MonotonicRaw(PyTime_t *result); +PyAPI_FUNC(int) PyTime_PerfCounterRaw(PyTime_t *result); +PyAPI_FUNC(int) PyTime_TimeRaw(PyTime_t *result); + +#ifdef __cplusplus +} +#endif +#endif /* Py_PYTIME_H */ +#endif /* Py_LIMITED_API */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/setobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/setobject.h new file mode 100644 index 0000000000000000000000000000000000000000..89565cb29212fc172d82e2b5cf52295dcd3a6184 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/setobject.h @@ -0,0 +1,71 @@ +#ifndef Py_CPYTHON_SETOBJECT_H +# error "this header file must not be included directly" +#endif + +/* There are three kinds of entries in the table: + +1. Unused: key == NULL and hash == 0 +2. Dummy: key == dummy and hash == -1 +3. Active: key != NULL and key != dummy and hash != -1 + +The hash field of Unused slots is always zero. + +The hash field of Dummy slots are set to -1 +meaning that dummy entries can be detected by +either entry->key==dummy or by entry->hash==-1. +*/ + +#define PySet_MINSIZE 8 + +typedef struct { + PyObject *key; + Py_hash_t hash; /* Cached hash code of the key */ +} setentry; + +/* The SetObject data structure is shared by set and frozenset objects. + +Invariant for sets: + - hash is -1 + +Invariants for frozensets: + - data is immutable. + - hash is the hash of the frozenset or -1 if not computed yet. + +*/ + +typedef struct { + PyObject_HEAD + + Py_ssize_t fill; /* Number active and dummy entries*/ + Py_ssize_t used; /* Number active entries */ + + /* The table contains mask + 1 slots, and that's a power of 2. + * We store the mask instead of the size because the mask is more + * frequently needed. + */ + Py_ssize_t mask; + + /* The table points to a fixed-size smalltable for small tables + * or to additional malloc'ed memory for bigger tables. + * The table pointer is never NULL which saves us from repeated + * runtime null-tests. + */ + setentry *table; + Py_hash_t hash; /* Only used by frozenset objects */ + Py_ssize_t finger; /* Search finger for pop() */ + + setentry smalltable[PySet_MINSIZE]; + PyObject *weakreflist; /* List of weak references */ +} PySetObject; + +#define _PySet_CAST(so) \ + (assert(PyAnySet_Check(so)), _Py_CAST(PySetObject*, so)) + +static inline Py_ssize_t PySet_GET_SIZE(PyObject *so) { +#ifdef Py_GIL_DISABLED + return _Py_atomic_load_ssize_relaxed(&(_PySet_CAST(so)->used)); +#else + return _PySet_CAST(so)->used; +#endif +} +#define PySet_GET_SIZE(so) PySet_GET_SIZE(_PyObject_CAST(so)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/traceback.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/traceback.h new file mode 100644 index 0000000000000000000000000000000000000000..81c51944f136f29396699dbcf8a3ddbd5c21b75a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/traceback.h @@ -0,0 +1,13 @@ +#ifndef Py_CPYTHON_TRACEBACK_H +# error "this header file must not be included directly" +#endif + +typedef struct _traceback PyTracebackObject; + +struct _traceback { + PyObject_HEAD + PyTracebackObject *tb_next; + PyFrameObject *tb_frame; + int tb_lasti; + int tb_lineno; +}; diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/tracemalloc.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/tracemalloc.h new file mode 100644 index 0000000000000000000000000000000000000000..6d094291ae2e906451675b94836919b63a7c29f0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/tracemalloc.h @@ -0,0 +1,32 @@ +#ifndef Py_LIMITED_API +#ifndef Py_TRACEMALLOC_H +#define Py_TRACEMALLOC_H +#ifdef __cplusplus +extern "C" { +#endif + +/* Track an allocated memory block in the tracemalloc module. + Return 0 on success, return -1 on error (failed to allocate memory to store + the trace). + + Return -2 if tracemalloc is disabled. + + If memory block is already tracked, update the existing trace. */ +PyAPI_FUNC(int) PyTraceMalloc_Track( + unsigned int domain, + uintptr_t ptr, + size_t size); + +/* Untrack an allocated memory block in the tracemalloc module. + Do nothing if the block was not tracked. + + Return -2 if tracemalloc is disabled, otherwise return 0. */ +PyAPI_FUNC(int) PyTraceMalloc_Untrack( + unsigned int domain, + uintptr_t ptr); + +#ifdef __cplusplus +} +#endif +#endif // !Py_TRACEMALLOC_H +#endif // !Py_LIMITED_API diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/tupleobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/tupleobject.h new file mode 100644 index 0000000000000000000000000000000000000000..afb98ccbb81b2de63febb25bb19dce489191f2e2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/tupleobject.h @@ -0,0 +1,40 @@ +#ifndef Py_CPYTHON_TUPLEOBJECT_H +# error "this header file must not be included directly" +#endif + +typedef struct { + PyObject_VAR_HEAD + /* Cached hash. Initially set to -1. */ + Py_hash_t ob_hash; + /* ob_item contains space for 'ob_size' elements. + Items must normally not be NULL, except during construction when + the tuple is not yet visible outside the function that builds it. */ + PyObject *ob_item[1]; +} PyTupleObject; + +PyAPI_FUNC(int) _PyTuple_Resize(PyObject **, Py_ssize_t); + +/* Cast argument to PyTupleObject* type. */ +#define _PyTuple_CAST(op) \ + (assert(PyTuple_Check(op)), _Py_CAST(PyTupleObject*, (op))) + +// Macros and static inline functions, trading safety for speed + +static inline Py_ssize_t PyTuple_GET_SIZE(PyObject *op) { + PyTupleObject *tuple = _PyTuple_CAST(op); + return Py_SIZE(tuple); +} +#define PyTuple_GET_SIZE(op) PyTuple_GET_SIZE(_PyObject_CAST(op)) + +#define PyTuple_GET_ITEM(op, index) (_PyTuple_CAST(op)->ob_item[(index)]) + +/* Function *only* to be used to fill in brand new tuples */ +static inline void +PyTuple_SET_ITEM(PyObject *op, Py_ssize_t index, PyObject *value) { + PyTupleObject *tuple = _PyTuple_CAST(op); + assert(0 <= index); + assert(index < Py_SIZE(tuple)); + tuple->ob_item[index] = value; +} +#define PyTuple_SET_ITEM(op, index, value) \ + PyTuple_SET_ITEM(_PyObject_CAST(op), (index), _PyObject_CAST(value)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/unicodeobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/unicodeobject.h new file mode 100644 index 0000000000000000000000000000000000000000..3d0414f5291fe457929d73d1fa71196c334c740e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/unicodeobject.h @@ -0,0 +1,773 @@ +#ifndef Py_CPYTHON_UNICODEOBJECT_H +# error "this header file must not be included directly" +#endif + +/* Py_UNICODE was the native Unicode storage format (code unit) used by + Python and represents a single Unicode element in the Unicode type. + With PEP 393, Py_UNICODE is deprecated and replaced with a + typedef to wchar_t. */ +Py_DEPRECATED(3.13) typedef wchar_t PY_UNICODE_TYPE; +Py_DEPRECATED(3.13) typedef wchar_t Py_UNICODE; + + +/* --- Internal Unicode Operations ---------------------------------------- */ + +// Static inline functions to work with surrogates +static inline int Py_UNICODE_IS_SURROGATE(Py_UCS4 ch) { + return (0xD800 <= ch && ch <= 0xDFFF); +} +static inline int Py_UNICODE_IS_HIGH_SURROGATE(Py_UCS4 ch) { + return (0xD800 <= ch && ch <= 0xDBFF); +} +static inline int Py_UNICODE_IS_LOW_SURROGATE(Py_UCS4 ch) { + return (0xDC00 <= ch && ch <= 0xDFFF); +} + +// Join two surrogate characters and return a single Py_UCS4 value. +static inline Py_UCS4 Py_UNICODE_JOIN_SURROGATES(Py_UCS4 high, Py_UCS4 low) { + assert(Py_UNICODE_IS_HIGH_SURROGATE(high)); + assert(Py_UNICODE_IS_LOW_SURROGATE(low)); + return 0x10000 + (((high & 0x03FF) << 10) | (low & 0x03FF)); +} + +// High surrogate = top 10 bits added to 0xD800. +// The character must be in the range [U+10000; U+10ffff]. +static inline Py_UCS4 Py_UNICODE_HIGH_SURROGATE(Py_UCS4 ch) { + assert(0x10000 <= ch && ch <= 0x10ffff); + return (0xD800 - (0x10000 >> 10) + (ch >> 10)); +} + +// Low surrogate = bottom 10 bits added to 0xDC00. +// The character must be in the range [U+10000; U+10ffff]. +static inline Py_UCS4 Py_UNICODE_LOW_SURROGATE(Py_UCS4 ch) { + assert(0x10000 <= ch && ch <= 0x10ffff); + return (0xDC00 + (ch & 0x3FF)); +} + + +/* --- Unicode Type ------------------------------------------------------- */ + +/* ASCII-only strings created through PyUnicode_New use the PyASCIIObject + structure. state.ascii and state.compact are set, and the data + immediately follow the structure. utf8_length can be found + in the length field; the utf8 pointer is equal to the data pointer. */ +typedef struct { + /* There are 4 forms of Unicode strings: + + - compact ascii: + + * structure = PyASCIIObject + * test: PyUnicode_IS_COMPACT_ASCII(op) + * kind = PyUnicode_1BYTE_KIND + * compact = 1 + * ascii = 1 + * (length is the length of the utf8) + * (data starts just after the structure) + * (since ASCII is decoded from UTF-8, the utf8 string are the data) + + - compact: + + * structure = PyCompactUnicodeObject + * test: PyUnicode_IS_COMPACT(op) && !PyUnicode_IS_ASCII(op) + * kind = PyUnicode_1BYTE_KIND, PyUnicode_2BYTE_KIND or + PyUnicode_4BYTE_KIND + * compact = 1 + * ascii = 0 + * utf8 is not shared with data + * utf8_length = 0 if utf8 is NULL + * (data starts just after the structure) + + - legacy string: + + * structure = PyUnicodeObject structure + * test: !PyUnicode_IS_COMPACT(op) + * kind = PyUnicode_1BYTE_KIND, PyUnicode_2BYTE_KIND or + PyUnicode_4BYTE_KIND + * compact = 0 + * data.any is not NULL + * utf8 is shared and utf8_length = length with data.any if ascii = 1 + * utf8_length = 0 if utf8 is NULL + + Compact strings use only one memory block (structure + characters), + whereas legacy strings use one block for the structure and one block + for characters. + + Legacy strings are created by subclasses of Unicode. + + See also _PyUnicode_CheckConsistency(). + */ + PyObject_HEAD + Py_ssize_t length; /* Number of code points in the string */ + Py_hash_t hash; /* Hash value; -1 if not set */ +#ifdef Py_GIL_DISABLED + /* Ensure 4 byte alignment for PyUnicode_DATA(), see gh-63736 on m68k. + In the non-free-threaded build, we'll use explicit padding instead */ + _Py_ALIGN_AS(4) +#endif + struct { + /* If interned is non-zero, the two references from the + dictionary to this object are *not* counted in ob_refcnt. + The possible values here are: + 0: Not Interned + 1: Interned + 2: Interned and Immortal + 3: Interned, Immortal, and Static + This categorization allows the runtime to determine the right + cleanup mechanism at runtime shutdown. */ +#ifdef Py_GIL_DISABLED + // Needs to be accessed atomically, so can't be a bit field. + unsigned char interned; +#else + unsigned int interned:2; +#endif + /* Character size: + + - PyUnicode_1BYTE_KIND (1): + + * character type = Py_UCS1 (8 bits, unsigned) + * all characters are in the range U+0000-U+00FF (latin1) + * if ascii is set, all characters are in the range U+0000-U+007F + (ASCII), otherwise at least one character is in the range + U+0080-U+00FF + + - PyUnicode_2BYTE_KIND (2): + + * character type = Py_UCS2 (16 bits, unsigned) + * all characters are in the range U+0000-U+FFFF (BMP) + * at least one character is in the range U+0100-U+FFFF + + - PyUnicode_4BYTE_KIND (4): + + * character type = Py_UCS4 (32 bits, unsigned) + * all characters are in the range U+0000-U+10FFFF + * at least one character is in the range U+10000-U+10FFFF + */ + unsigned int kind:3; + /* Compact is with respect to the allocation scheme. Compact unicode + objects only require one memory block while non-compact objects use + one block for the PyUnicodeObject struct and another for its data + buffer. */ + unsigned int compact:1; + /* The string only contains characters in the range U+0000-U+007F (ASCII) + and the kind is PyUnicode_1BYTE_KIND. If ascii is set and compact is + set, use the PyASCIIObject structure. */ + unsigned int ascii:1; + /* The object is statically allocated. */ + unsigned int statically_allocated:1; +#ifndef Py_GIL_DISABLED + /* Padding to ensure that PyUnicode_DATA() is always aligned to + 4 bytes (see issue gh-63736 on m68k) */ + unsigned int :24; +#endif + } state; +} PyASCIIObject; + +/* Non-ASCII strings allocated through PyUnicode_New use the + PyCompactUnicodeObject structure. state.compact is set, and the data + immediately follow the structure. */ +typedef struct { + PyASCIIObject _base; + Py_ssize_t utf8_length; /* Number of bytes in utf8, excluding the + * terminating \0. */ + char *utf8; /* UTF-8 representation (null-terminated) */ +} PyCompactUnicodeObject; + +/* Object format for Unicode subclasses. */ +typedef struct { + PyCompactUnicodeObject _base; + union { + void *any; + Py_UCS1 *latin1; + Py_UCS2 *ucs2; + Py_UCS4 *ucs4; + } data; /* Canonical, smallest-form Unicode buffer */ +} PyUnicodeObject; + + +#define _PyASCIIObject_CAST(op) \ + (assert(PyUnicode_Check(op)), \ + _Py_CAST(PyASCIIObject*, (op))) +#define _PyCompactUnicodeObject_CAST(op) \ + (assert(PyUnicode_Check(op)), \ + _Py_CAST(PyCompactUnicodeObject*, (op))) +#define _PyUnicodeObject_CAST(op) \ + (assert(PyUnicode_Check(op)), \ + _Py_CAST(PyUnicodeObject*, (op))) + + +/* --- Flexible String Representation Helper Macros (PEP 393) -------------- */ + +/* Values for PyASCIIObject.state: */ + +/* Interning state. */ +#define SSTATE_NOT_INTERNED 0 +#define SSTATE_INTERNED_MORTAL 1 +#define SSTATE_INTERNED_IMMORTAL 2 +#define SSTATE_INTERNED_IMMORTAL_STATIC 3 + +/* Use only if you know it's a string */ +static inline unsigned int PyUnicode_CHECK_INTERNED(PyObject *op) { +#ifdef Py_GIL_DISABLED + return _Py_atomic_load_uint8_relaxed(&_PyASCIIObject_CAST(op)->state.interned); +#else + return _PyASCIIObject_CAST(op)->state.interned; +#endif +} +#define PyUnicode_CHECK_INTERNED(op) PyUnicode_CHECK_INTERNED(_PyObject_CAST(op)) + +/* For backward compatibility. Soft-deprecated. */ +static inline unsigned int PyUnicode_IS_READY(PyObject* Py_UNUSED(op)) { + return 1; +} +#define PyUnicode_IS_READY(op) PyUnicode_IS_READY(_PyObject_CAST(op)) + +/* Return true if the string contains only ASCII characters, or 0 if not. The + string may be compact (PyUnicode_IS_COMPACT_ASCII) or not. */ +static inline unsigned int PyUnicode_IS_ASCII(PyObject *op) { + return _PyASCIIObject_CAST(op)->state.ascii; +} +#define PyUnicode_IS_ASCII(op) PyUnicode_IS_ASCII(_PyObject_CAST(op)) + +/* Return true if the string is compact or 0 if not. + No type checks are performed. */ +static inline unsigned int PyUnicode_IS_COMPACT(PyObject *op) { + return _PyASCIIObject_CAST(op)->state.compact; +} +#define PyUnicode_IS_COMPACT(op) PyUnicode_IS_COMPACT(_PyObject_CAST(op)) + +/* Return true if the string is a compact ASCII string (use PyASCIIObject + structure), or 0 if not. No type checks are performed. */ +static inline int PyUnicode_IS_COMPACT_ASCII(PyObject *op) { + return (_PyASCIIObject_CAST(op)->state.ascii && PyUnicode_IS_COMPACT(op)); +} +#define PyUnicode_IS_COMPACT_ASCII(op) PyUnicode_IS_COMPACT_ASCII(_PyObject_CAST(op)) + +enum PyUnicode_Kind { +/* Return values of the PyUnicode_KIND() function: */ + PyUnicode_1BYTE_KIND = 1, + PyUnicode_2BYTE_KIND = 2, + PyUnicode_4BYTE_KIND = 4 +}; + +PyAPI_FUNC(int) PyUnicode_KIND(PyObject *op); + +// PyUnicode_KIND(): Return one of the PyUnicode_*_KIND values defined above. +// +// gh-89653: Converting this macro to a static inline function would introduce +// new compiler warnings on "kind < PyUnicode_KIND(str)" (compare signed and +// unsigned numbers) where kind type is an int or on +// "unsigned int kind = PyUnicode_KIND(str)" (cast signed to unsigned). +#define PyUnicode_KIND(op) _Py_RVALUE(_PyASCIIObject_CAST(op)->state.kind) + +/* Return a void pointer to the raw unicode buffer. */ +static inline void* _PyUnicode_COMPACT_DATA(PyObject *op) { + if (PyUnicode_IS_ASCII(op)) { + return _Py_STATIC_CAST(void*, (_PyASCIIObject_CAST(op) + 1)); + } + return _Py_STATIC_CAST(void*, (_PyCompactUnicodeObject_CAST(op) + 1)); +} + +static inline void* _PyUnicode_NONCOMPACT_DATA(PyObject *op) { + void *data; + assert(!PyUnicode_IS_COMPACT(op)); + data = _PyUnicodeObject_CAST(op)->data.any; + assert(data != NULL); + return data; +} + +PyAPI_FUNC(void*) PyUnicode_DATA(PyObject *op); + +static inline void* _PyUnicode_DATA(PyObject *op) { + if (PyUnicode_IS_COMPACT(op)) { + return _PyUnicode_COMPACT_DATA(op); + } + return _PyUnicode_NONCOMPACT_DATA(op); +} +#define PyUnicode_DATA(op) _PyUnicode_DATA(_PyObject_CAST(op)) + +/* Return pointers to the canonical representation cast to unsigned char, + Py_UCS2, or Py_UCS4 for direct character access. + No checks are performed, use PyUnicode_KIND() before to ensure + these will work correctly. */ + +#define PyUnicode_1BYTE_DATA(op) _Py_STATIC_CAST(Py_UCS1*, PyUnicode_DATA(op)) +#define PyUnicode_2BYTE_DATA(op) _Py_STATIC_CAST(Py_UCS2*, PyUnicode_DATA(op)) +#define PyUnicode_4BYTE_DATA(op) _Py_STATIC_CAST(Py_UCS4*, PyUnicode_DATA(op)) + +/* Returns the length of the unicode string. */ +static inline Py_ssize_t PyUnicode_GET_LENGTH(PyObject *op) { + return _PyASCIIObject_CAST(op)->length; +} +#define PyUnicode_GET_LENGTH(op) PyUnicode_GET_LENGTH(_PyObject_CAST(op)) + +/* Write into the canonical representation, this function does not do any sanity + checks and is intended for usage in loops. The caller should cache the + kind and data pointers obtained from other function calls. + index is the index in the string (starts at 0) and value is the new + code point value which should be written to that location. */ +static inline void PyUnicode_WRITE(int kind, void *data, + Py_ssize_t index, Py_UCS4 value) +{ + assert(index >= 0); + if (kind == PyUnicode_1BYTE_KIND) { + assert(value <= 0xffU); + _Py_STATIC_CAST(Py_UCS1*, data)[index] = _Py_STATIC_CAST(Py_UCS1, value); + } + else if (kind == PyUnicode_2BYTE_KIND) { + assert(value <= 0xffffU); + _Py_STATIC_CAST(Py_UCS2*, data)[index] = _Py_STATIC_CAST(Py_UCS2, value); + } + else { + assert(kind == PyUnicode_4BYTE_KIND); + assert(value <= 0x10ffffU); + _Py_STATIC_CAST(Py_UCS4*, data)[index] = value; + } +} +#define PyUnicode_WRITE(kind, data, index, value) \ + PyUnicode_WRITE(_Py_STATIC_CAST(int, kind), _Py_CAST(void*, data), \ + (index), _Py_STATIC_CAST(Py_UCS4, value)) + +/* Read a code point from the string's canonical representation. No checks + are performed. */ +static inline Py_UCS4 PyUnicode_READ(int kind, + const void *data, Py_ssize_t index) +{ + assert(index >= 0); + if (kind == PyUnicode_1BYTE_KIND) { + return _Py_STATIC_CAST(const Py_UCS1*, data)[index]; + } + if (kind == PyUnicode_2BYTE_KIND) { + return _Py_STATIC_CAST(const Py_UCS2*, data)[index]; + } + assert(kind == PyUnicode_4BYTE_KIND); + return _Py_STATIC_CAST(const Py_UCS4*, data)[index]; +} +#define PyUnicode_READ(kind, data, index) \ + PyUnicode_READ(_Py_STATIC_CAST(int, kind), \ + _Py_STATIC_CAST(const void*, data), \ + (index)) + +/* PyUnicode_READ_CHAR() is less efficient than PyUnicode_READ() because it + calls PyUnicode_KIND() and might call it twice. For single reads, use + PyUnicode_READ_CHAR, for multiple consecutive reads callers should + cache kind and use PyUnicode_READ instead. */ +static inline Py_UCS4 PyUnicode_READ_CHAR(PyObject *unicode, Py_ssize_t index) +{ + int kind; + + assert(index >= 0); + // Tolerate reading the NUL character at str[len(str)] + assert(index <= PyUnicode_GET_LENGTH(unicode)); + + kind = PyUnicode_KIND(unicode); + if (kind == PyUnicode_1BYTE_KIND) { + return PyUnicode_1BYTE_DATA(unicode)[index]; + } + if (kind == PyUnicode_2BYTE_KIND) { + return PyUnicode_2BYTE_DATA(unicode)[index]; + } + assert(kind == PyUnicode_4BYTE_KIND); + return PyUnicode_4BYTE_DATA(unicode)[index]; +} +#define PyUnicode_READ_CHAR(unicode, index) \ + PyUnicode_READ_CHAR(_PyObject_CAST(unicode), (index)) + +/* Return a maximum character value which is suitable for creating another + string based on op. This is always an approximation but more efficient + than iterating over the string. */ +static inline Py_UCS4 PyUnicode_MAX_CHAR_VALUE(PyObject *op) +{ + int kind; + + if (PyUnicode_IS_ASCII(op)) { + return 0x7fU; + } + + kind = PyUnicode_KIND(op); + if (kind == PyUnicode_1BYTE_KIND) { + return 0xffU; + } + if (kind == PyUnicode_2BYTE_KIND) { + return 0xffffU; + } + assert(kind == PyUnicode_4BYTE_KIND); + return 0x10ffffU; +} +#define PyUnicode_MAX_CHAR_VALUE(op) \ + PyUnicode_MAX_CHAR_VALUE(_PyObject_CAST(op)) + + +/* === Public API ========================================================= */ + +/* With PEP 393, this is the recommended way to allocate a new unicode object. + This function will allocate the object and its buffer in a single memory + block. Objects created using this function are not resizable. */ +PyAPI_FUNC(PyObject*) PyUnicode_New( + Py_ssize_t size, /* Number of code points in the new string */ + Py_UCS4 maxchar /* maximum code point value in the string */ + ); + +/* For backward compatibility. Soft-deprecated. */ +static inline int PyUnicode_READY(PyObject* Py_UNUSED(op)) +{ + return 0; +} +#define PyUnicode_READY(op) PyUnicode_READY(_PyObject_CAST(op)) + +/* Copy character from one unicode object into another, this function performs + character conversion when necessary and falls back to memcpy() if possible. + + Fail if to is too small (smaller than *how_many* or smaller than + len(from)-from_start), or if kind(from[from_start:from_start+how_many]) > + kind(to), or if *to* has more than 1 reference. + + Return the number of written character, or return -1 and raise an exception + on error. + + Pseudo-code: + + how_many = min(how_many, len(from) - from_start) + to[to_start:to_start+how_many] = from[from_start:from_start+how_many] + return how_many + + Note: The function doesn't write a terminating null character. + */ +PyAPI_FUNC(Py_ssize_t) PyUnicode_CopyCharacters( + PyObject *to, + Py_ssize_t to_start, + PyObject *from, + Py_ssize_t from_start, + Py_ssize_t how_many + ); + +/* Fill a string with a character: write fill_char into + unicode[start:start+length]. + + Fail if fill_char is bigger than the string maximum character, or if the + string has more than 1 reference. + + Return the number of written character, or return -1 and raise an exception + on error. */ +PyAPI_FUNC(Py_ssize_t) PyUnicode_Fill( + PyObject *unicode, + Py_ssize_t start, + Py_ssize_t length, + Py_UCS4 fill_char + ); + +/* Create a new string from a buffer of Py_UCS1, Py_UCS2 or Py_UCS4 characters. + Scan the string to find the maximum character. */ +PyAPI_FUNC(PyObject*) PyUnicode_FromKindAndData( + int kind, + const void *buffer, + Py_ssize_t size); + + +/* --- Public PyUnicodeWriter API ----------------------------------------- */ + +typedef struct PyUnicodeWriter PyUnicodeWriter; + +PyAPI_FUNC(PyUnicodeWriter*) PyUnicodeWriter_Create(Py_ssize_t length); +PyAPI_FUNC(void) PyUnicodeWriter_Discard(PyUnicodeWriter *writer); +PyAPI_FUNC(PyObject*) PyUnicodeWriter_Finish(PyUnicodeWriter *writer); + +PyAPI_FUNC(int) PyUnicodeWriter_WriteChar( + PyUnicodeWriter *writer, + Py_UCS4 ch); +PyAPI_FUNC(int) PyUnicodeWriter_WriteUTF8( + PyUnicodeWriter *writer, + const char *str, + Py_ssize_t size); +PyAPI_FUNC(int) PyUnicodeWriter_WriteASCII( + PyUnicodeWriter *writer, + const char *str, + Py_ssize_t size); +PyAPI_FUNC(int) PyUnicodeWriter_WriteWideChar( + PyUnicodeWriter *writer, + const wchar_t *str, + Py_ssize_t size); +PyAPI_FUNC(int) PyUnicodeWriter_WriteUCS4( + PyUnicodeWriter *writer, + Py_UCS4 *str, + Py_ssize_t size); + +PyAPI_FUNC(int) PyUnicodeWriter_WriteStr( + PyUnicodeWriter *writer, + PyObject *obj); +PyAPI_FUNC(int) PyUnicodeWriter_WriteRepr( + PyUnicodeWriter *writer, + PyObject *obj); +PyAPI_FUNC(int) PyUnicodeWriter_WriteSubstring( + PyUnicodeWriter *writer, + PyObject *str, + Py_ssize_t start, + Py_ssize_t end); +PyAPI_FUNC(int) PyUnicodeWriter_Format( + PyUnicodeWriter *writer, + const char *format, + ...); +PyAPI_FUNC(int) PyUnicodeWriter_DecodeUTF8Stateful( + PyUnicodeWriter *writer, + const char *string, /* UTF-8 encoded string */ + Py_ssize_t length, /* size of string */ + const char *errors, /* error handling */ + Py_ssize_t *consumed); /* bytes consumed */ + + +/* --- Private _PyUnicodeWriter API --------------------------------------- */ + +typedef struct { + PyObject *buffer; + void *data; + int kind; + Py_UCS4 maxchar; + Py_ssize_t size; + Py_ssize_t pos; + + /* minimum number of allocated characters (default: 0) */ + Py_ssize_t min_length; + + /* minimum character (default: 127, ASCII) */ + Py_UCS4 min_char; + + /* If non-zero, overallocate the buffer (default: 0). */ + unsigned char overallocate; + + /* If readonly is 1, buffer is a shared string (cannot be modified) + and size is set to 0. */ + unsigned char readonly; +} _PyUnicodeWriter; + +// Initialize a Unicode writer. +// +// By default, the minimum buffer size is 0 character and overallocation is +// disabled. Set min_length, min_char and overallocate attributes to control +// the allocation of the buffer. +_Py_DEPRECATED_EXTERNALLY(3.14) PyAPI_FUNC(void) _PyUnicodeWriter_Init( + _PyUnicodeWriter *writer); + +/* Prepare the buffer to write 'length' characters + with the specified maximum character. + + Return 0 on success, raise an exception and return -1 on error. */ +#define _PyUnicodeWriter_Prepare(WRITER, LENGTH, MAXCHAR) \ + (((MAXCHAR) <= (WRITER)->maxchar \ + && (LENGTH) <= (WRITER)->size - (WRITER)->pos) \ + ? 0 \ + : (((LENGTH) == 0) \ + ? 0 \ + : _PyUnicodeWriter_PrepareInternal((WRITER), (LENGTH), (MAXCHAR)))) + +/* Don't call this function directly, use the _PyUnicodeWriter_Prepare() macro + instead. */ +_Py_DEPRECATED_EXTERNALLY(3.14) PyAPI_FUNC(int) _PyUnicodeWriter_PrepareInternal( + _PyUnicodeWriter *writer, + Py_ssize_t length, + Py_UCS4 maxchar); + +/* Prepare the buffer to have at least the kind KIND. + For example, kind=PyUnicode_2BYTE_KIND ensures that the writer will + support characters in range U+000-U+FFFF. + + Return 0 on success, raise an exception and return -1 on error. */ +#define _PyUnicodeWriter_PrepareKind(WRITER, KIND) \ + ((KIND) <= (WRITER)->kind \ + ? 0 \ + : _PyUnicodeWriter_PrepareKindInternal((WRITER), (KIND))) + +/* Don't call this function directly, use the _PyUnicodeWriter_PrepareKind() + macro instead. */ +_Py_DEPRECATED_EXTERNALLY(3.14) PyAPI_FUNC(int) _PyUnicodeWriter_PrepareKindInternal( + _PyUnicodeWriter *writer, + int kind); + +/* Append a Unicode character. + Return 0 on success, raise an exception and return -1 on error. */ +_Py_DEPRECATED_EXTERNALLY(3.14) PyAPI_FUNC(int) _PyUnicodeWriter_WriteChar( + _PyUnicodeWriter *writer, + Py_UCS4 ch); + +/* Append a Unicode string. + Return 0 on success, raise an exception and return -1 on error. */ +_Py_DEPRECATED_EXTERNALLY(3.14) PyAPI_FUNC(int) _PyUnicodeWriter_WriteStr( + _PyUnicodeWriter *writer, + PyObject *str); /* Unicode string */ + +/* Append a substring of a Unicode string. + Return 0 on success, raise an exception and return -1 on error. */ +_Py_DEPRECATED_EXTERNALLY(3.14) PyAPI_FUNC(int) _PyUnicodeWriter_WriteSubstring( + _PyUnicodeWriter *writer, + PyObject *str, /* Unicode string */ + Py_ssize_t start, + Py_ssize_t end); + +/* Append an ASCII-encoded byte string. + Return 0 on success, raise an exception and return -1 on error. */ +_Py_DEPRECATED_EXTERNALLY(3.14) PyAPI_FUNC(int) _PyUnicodeWriter_WriteASCIIString( + _PyUnicodeWriter *writer, + const char *str, /* ASCII-encoded byte string */ + Py_ssize_t len); /* number of bytes, or -1 if unknown */ + +/* Append a latin1-encoded byte string. + Return 0 on success, raise an exception and return -1 on error. */ +_Py_DEPRECATED_EXTERNALLY(3.14) PyAPI_FUNC(int) _PyUnicodeWriter_WriteLatin1String( + _PyUnicodeWriter *writer, + const char *str, /* latin1-encoded byte string */ + Py_ssize_t len); /* length in bytes */ + +/* Get the value of the writer as a Unicode string. Clear the + buffer of the writer. Raise an exception and return NULL + on error. */ +_Py_DEPRECATED_EXTERNALLY(3.14) PyAPI_FUNC(PyObject *) _PyUnicodeWriter_Finish( + _PyUnicodeWriter *writer); + +/* Deallocate memory of a writer (clear its internal buffer). */ +_Py_DEPRECATED_EXTERNALLY(3.14) PyAPI_FUNC(void) _PyUnicodeWriter_Dealloc( + _PyUnicodeWriter *writer); + + +/* --- Manage the default encoding ---------------------------------------- */ + +/* Returns a pointer to the default encoding (UTF-8) of the + Unicode object unicode. + + Like PyUnicode_AsUTF8AndSize(), this also caches the UTF-8 representation + in the unicodeobject. + + _PyUnicode_AsString is a #define for PyUnicode_AsUTF8 to + support the previous internal function with the same behaviour. + + Use of this API is DEPRECATED since no size information can be + extracted from the returned data. +*/ + +PyAPI_FUNC(const char *) PyUnicode_AsUTF8(PyObject *unicode); + +// Deprecated alias kept for backward compatibility +Py_DEPRECATED(3.14) static inline const char* +_PyUnicode_AsString(PyObject *unicode) +{ + return PyUnicode_AsUTF8(unicode); +} + + +/* === Characters Type APIs =============================================== */ + +/* These should not be used directly. Use the Py_UNICODE_IS* and + Py_UNICODE_TO* macros instead. + + These APIs are implemented in Objects/unicodectype.c. + +*/ + +PyAPI_FUNC(int) _PyUnicode_IsLowercase( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsUppercase( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsTitlecase( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsWhitespace( + const Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsLinebreak( + const Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(Py_UCS4) _PyUnicode_ToLowercase( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(Py_UCS4) _PyUnicode_ToUppercase( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(Py_UCS4) _PyUnicode_ToTitlecase( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_ToDecimalDigit( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_ToDigit( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(double) _PyUnicode_ToNumeric( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsDecimalDigit( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsDigit( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsNumeric( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsPrintable( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsAlpha( + Py_UCS4 ch /* Unicode character */ + ); + +// Helper array used by Py_UNICODE_ISSPACE(). +PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[]; + +// Since splitting on whitespace is an important use case, and +// whitespace in most situations is solely ASCII whitespace, we +// optimize for the common case by using a quick look-up table +// _Py_ascii_whitespace (see below) with an inlined check. +static inline int Py_UNICODE_ISSPACE(Py_UCS4 ch) { + if (ch < 128) { + return _Py_ascii_whitespace[ch]; + } + return _PyUnicode_IsWhitespace(ch); +} + +#define Py_UNICODE_ISLOWER(ch) _PyUnicode_IsLowercase(ch) +#define Py_UNICODE_ISUPPER(ch) _PyUnicode_IsUppercase(ch) +#define Py_UNICODE_ISTITLE(ch) _PyUnicode_IsTitlecase(ch) +#define Py_UNICODE_ISLINEBREAK(ch) _PyUnicode_IsLinebreak(ch) + +#define Py_UNICODE_TOLOWER(ch) _PyUnicode_ToLowercase(ch) +#define Py_UNICODE_TOUPPER(ch) _PyUnicode_ToUppercase(ch) +#define Py_UNICODE_TOTITLE(ch) _PyUnicode_ToTitlecase(ch) + +#define Py_UNICODE_ISDECIMAL(ch) _PyUnicode_IsDecimalDigit(ch) +#define Py_UNICODE_ISDIGIT(ch) _PyUnicode_IsDigit(ch) +#define Py_UNICODE_ISNUMERIC(ch) _PyUnicode_IsNumeric(ch) +#define Py_UNICODE_ISPRINTABLE(ch) _PyUnicode_IsPrintable(ch) + +#define Py_UNICODE_TODECIMAL(ch) _PyUnicode_ToDecimalDigit(ch) +#define Py_UNICODE_TODIGIT(ch) _PyUnicode_ToDigit(ch) +#define Py_UNICODE_TONUMERIC(ch) _PyUnicode_ToNumeric(ch) + +#define Py_UNICODE_ISALPHA(ch) _PyUnicode_IsAlpha(ch) + +static inline int Py_UNICODE_ISALNUM(Py_UCS4 ch) { + return (Py_UNICODE_ISALPHA(ch) + || Py_UNICODE_ISDECIMAL(ch) + || Py_UNICODE_ISDIGIT(ch) + || Py_UNICODE_ISNUMERIC(ch)); +} + + +/* === Misc functions ===================================================== */ + +// Return an interned Unicode object for an Identifier; may fail if there is no +// memory. +PyAPI_FUNC(PyObject*) _PyUnicode_FromId(_Py_Identifier*); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/warnings.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/warnings.h new file mode 100644 index 0000000000000000000000000000000000000000..4e3eb88e8ff4472b37f1903184097757271d6c5b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/warnings.h @@ -0,0 +1,20 @@ +#ifndef Py_CPYTHON_WARNINGS_H +# error "this header file must not be included directly" +#endif + +PyAPI_FUNC(int) PyErr_WarnExplicitObject( + PyObject *category, + PyObject *message, + PyObject *filename, + int lineno, + PyObject *module, + PyObject *registry); + +PyAPI_FUNC(int) PyErr_WarnExplicitFormat( + PyObject *category, + const char *filename, int lineno, + const char *module, PyObject *registry, + const char *format, ...); + +// DEPRECATED: Use PyErr_WarnEx() instead. +#define PyErr_Warn(category, msg) PyErr_WarnEx((category), (msg), 1) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/weakrefobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/weakrefobject.h new file mode 100644 index 0000000000000000000000000000000000000000..da8e77cddaca63823c65e577b0b23f664bf4a32a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/cpython/weakrefobject.h @@ -0,0 +1,66 @@ +#ifndef Py_CPYTHON_WEAKREFOBJECT_H +# error "this header file must not be included directly" +#endif + +/* PyWeakReference is the base struct for the Python ReferenceType, ProxyType, + * and CallableProxyType. + */ +struct _PyWeakReference { + PyObject_HEAD + + /* The object to which this is a weak reference, or Py_None if none. + * Note that this is a stealth reference: wr_object's refcount is + * not incremented to reflect this pointer. + */ + PyObject *wr_object; + + /* A callable to invoke when wr_object dies, or NULL if none. */ + PyObject *wr_callback; + + /* A cache for wr_object's hash code. As usual for hashes, this is -1 + * if the hash code isn't known yet. + */ + Py_hash_t hash; + + /* If wr_object is weakly referenced, wr_object has a doubly-linked NULL- + * terminated list of weak references to it. These are the list pointers. + * If wr_object goes away, wr_object is set to Py_None, and these pointers + * have no meaning then. + */ + PyWeakReference *wr_prev; + PyWeakReference *wr_next; + vectorcallfunc vectorcall; + +#ifdef Py_GIL_DISABLED + /* Pointer to the lock used when clearing in free-threaded builds. + * Normally this can be derived from wr_object, but in some cases we need + * to lock after wr_object has been set to Py_None. + */ + PyMutex *weakrefs_lock; +#endif +}; + +PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self); + +#define _PyWeakref_CAST(op) \ + (assert(PyWeakref_Check(op)), _Py_CAST(PyWeakReference*, (op))) + +// Test if a weak reference is dead. +PyAPI_FUNC(int) PyWeakref_IsDead(PyObject *ref); + +Py_DEPRECATED(3.13) static inline PyObject* PyWeakref_GET_OBJECT(PyObject *ref_obj) +{ + PyWeakReference *ref = _PyWeakref_CAST(ref_obj); + PyObject *obj = ref->wr_object; + // Explanation for the Py_REFCNT() check: when a weakref's target is part + // of a long chain of deallocations which triggers the trashcan mechanism, + // clearing the weakrefs can be delayed long after the target's refcount + // has dropped to zero. In the meantime, code accessing the weakref will + // be able to "see" the target object even though it is supposed to be + // unreachable. See issue gh-60806. + if (Py_REFCNT(obj) > 0) { + return obj; + } + return Py_None; +} +#define PyWeakref_GET_OBJECT(ref) PyWeakref_GET_OBJECT(_PyObject_CAST(ref)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_abstract.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_abstract.h new file mode 100644 index 0000000000000000000000000000000000000000..3cc0afac4bd5b45490d3edd8e92062bec837da8a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_abstract.h @@ -0,0 +1,61 @@ +#ifndef Py_INTERNAL_ABSTRACT_H +#define Py_INTERNAL_ABSTRACT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +// Fast inlined version of PyIndex_Check() +static inline int +_PyIndex_Check(PyObject *obj) +{ + PyNumberMethods *tp_as_number = Py_TYPE(obj)->tp_as_number; + return (tp_as_number != NULL && tp_as_number->nb_index != NULL); +} + +PyObject *_PyNumber_PowerNoMod(PyObject *lhs, PyObject *rhs); +PyObject *_PyNumber_InPlacePowerNoMod(PyObject *lhs, PyObject *rhs); + +extern int _PyObject_HasLen(PyObject *o); + +/* === Sequence protocol ================================================ */ + +#define PY_ITERSEARCH_COUNT 1 +#define PY_ITERSEARCH_INDEX 2 +#define PY_ITERSEARCH_CONTAINS 3 + +/* Iterate over seq. + + Result depends on the operation: + + PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if + error. + PY_ITERSEARCH_INDEX: return 0-based index of first occurrence of + obj in seq; set ValueError and return -1 if none found; + also return -1 on error. + PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on + error. */ +extern Py_ssize_t _PySequence_IterSearch(PyObject *seq, + PyObject *obj, int operation); + +/* === Mapping protocol ================================================= */ + +extern int _PyObject_RealIsInstance(PyObject *inst, PyObject *cls); + +extern int _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls); + +// Convert Python int to Py_ssize_t. Do nothing if the argument is None. +// Export for '_bisect' shared extension. +PyAPI_FUNC(int) _Py_convert_optional_to_ssize_t(PyObject *, void *); + +// Same as PyNumber_Index() but can return an instance of a subclass of int. +// Export for 'math' shared extension. +PyAPI_FUNC(PyObject*) _PyNumber_Index(PyObject *o); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_ABSTRACT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_asdl.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_asdl.h new file mode 100644 index 0000000000000000000000000000000000000000..afeada88d13e24ceb69ebc07456964b26ba8e3c1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_asdl.h @@ -0,0 +1,112 @@ +#ifndef Py_INTERNAL_ASDL_H +#define Py_INTERNAL_ASDL_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_pyarena.h" // _PyArena_Malloc() + +typedef PyObject * identifier; +typedef PyObject * string; +typedef PyObject * object; +typedef PyObject * constant; + +/* It would be nice if the code generated by asdl_c.py was completely + independent of Python, but it is a goal the requires too much work + at this stage. So, for example, I'll represent identifiers as + interned Python strings. +*/ + +#define _ASDL_SEQ_HEAD \ + Py_ssize_t size; \ + void **elements; + +typedef struct { + _ASDL_SEQ_HEAD +} asdl_seq; + +typedef struct { + _ASDL_SEQ_HEAD + void *typed_elements[1]; +} asdl_generic_seq; + +typedef struct { + _ASDL_SEQ_HEAD + PyObject *typed_elements[1]; +} asdl_identifier_seq; + +typedef struct { + _ASDL_SEQ_HEAD + int typed_elements[1]; +} asdl_int_seq; + +asdl_generic_seq *_Py_asdl_generic_seq_new(Py_ssize_t size, PyArena *arena); +asdl_identifier_seq *_Py_asdl_identifier_seq_new(Py_ssize_t size, PyArena *arena); +asdl_int_seq *_Py_asdl_int_seq_new(Py_ssize_t size, PyArena *arena); + + +#define GENERATE_ASDL_SEQ_CONSTRUCTOR(NAME, TYPE) \ +asdl_ ## NAME ## _seq *_Py_asdl_ ## NAME ## _seq_new(Py_ssize_t size, PyArena *arena) \ +{ \ + asdl_ ## NAME ## _seq *seq = NULL; \ + size_t n; \ + /* check size is sane */ \ + if (size < 0 || \ + (size && (((size_t)size - 1) > (SIZE_MAX / sizeof(void *))))) { \ + PyErr_NoMemory(); \ + return NULL; \ + } \ + n = (size ? (sizeof(TYPE *) * (size - 1)) : 0); \ + /* check if size can be added safely */ \ + if (n > SIZE_MAX - sizeof(asdl_ ## NAME ## _seq)) { \ + PyErr_NoMemory(); \ + return NULL; \ + } \ + n += sizeof(asdl_ ## NAME ## _seq); \ + seq = (asdl_ ## NAME ## _seq *)_PyArena_Malloc(arena, n); \ + if (!seq) { \ + PyErr_NoMemory(); \ + return NULL; \ + } \ + memset(seq, 0, n); \ + seq->size = size; \ + seq->elements = (void**)seq->typed_elements; \ + return seq; \ +} + +#define asdl_seq_GET_UNTYPED(S, I) _Py_RVALUE((S)->elements[(I)]) +#define asdl_seq_GET(S, I) _Py_RVALUE((S)->typed_elements[(I)]) +#define asdl_seq_LEN(S) _Py_RVALUE(((S) == NULL ? 0 : (S)->size)) + +#ifdef Py_DEBUG +# define asdl_seq_SET(S, I, V) \ + do { \ + Py_ssize_t _asdl_i = (I); \ + assert((S) != NULL); \ + assert(0 <= _asdl_i && _asdl_i < (S)->size); \ + (S)->typed_elements[_asdl_i] = (V); \ + } while (0) +#else +# define asdl_seq_SET(S, I, V) _Py_RVALUE((S)->typed_elements[(I)] = (V)) +#endif + +#ifdef Py_DEBUG +# define asdl_seq_SET_UNTYPED(S, I, V) \ + do { \ + Py_ssize_t _asdl_i = (I); \ + assert((S) != NULL); \ + assert(0 <= _asdl_i && _asdl_i < (S)->size); \ + (S)->elements[_asdl_i] = (V); \ + } while (0) +#else +# define asdl_seq_SET_UNTYPED(S, I, V) _Py_RVALUE((S)->elements[(I)] = (V)) +#endif + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_ASDL_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_ast.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_ast.h new file mode 100644 index 0000000000000000000000000000000000000000..60367202bab6370a027998275208863939fad654 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_ast.h @@ -0,0 +1,945 @@ +// File automatically generated by Parser/asdl_c.py. + +#ifndef Py_INTERNAL_AST_H +#define Py_INTERNAL_AST_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_asdl.h" // _ASDL_SEQ_HEAD + +typedef struct _mod *mod_ty; + +typedef struct _stmt *stmt_ty; + +typedef struct _expr *expr_ty; + +typedef enum _expr_context { Load=1, Store=2, Del=3 } expr_context_ty; + +typedef enum _boolop { And=1, Or=2 } boolop_ty; + +typedef enum _operator { Add=1, Sub=2, Mult=3, MatMult=4, Div=5, Mod=6, Pow=7, + LShift=8, RShift=9, BitOr=10, BitXor=11, BitAnd=12, + FloorDiv=13 } operator_ty; + +typedef enum _unaryop { Invert=1, Not=2, UAdd=3, USub=4 } unaryop_ty; + +typedef enum _cmpop { Eq=1, NotEq=2, Lt=3, LtE=4, Gt=5, GtE=6, Is=7, IsNot=8, + In=9, NotIn=10 } cmpop_ty; + +typedef struct _comprehension *comprehension_ty; + +typedef struct _excepthandler *excepthandler_ty; + +typedef struct _arguments *arguments_ty; + +typedef struct _arg *arg_ty; + +typedef struct _keyword *keyword_ty; + +typedef struct _alias *alias_ty; + +typedef struct _withitem *withitem_ty; + +typedef struct _match_case *match_case_ty; + +typedef struct _pattern *pattern_ty; + +typedef struct _type_ignore *type_ignore_ty; + +typedef struct _type_param *type_param_ty; + + +typedef struct { + _ASDL_SEQ_HEAD + mod_ty typed_elements[1]; +} asdl_mod_seq; + +asdl_mod_seq *_Py_asdl_mod_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + stmt_ty typed_elements[1]; +} asdl_stmt_seq; + +asdl_stmt_seq *_Py_asdl_stmt_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + expr_ty typed_elements[1]; +} asdl_expr_seq; + +asdl_expr_seq *_Py_asdl_expr_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + comprehension_ty typed_elements[1]; +} asdl_comprehension_seq; + +asdl_comprehension_seq *_Py_asdl_comprehension_seq_new(Py_ssize_t size, PyArena + *arena); + +typedef struct { + _ASDL_SEQ_HEAD + excepthandler_ty typed_elements[1]; +} asdl_excepthandler_seq; + +asdl_excepthandler_seq *_Py_asdl_excepthandler_seq_new(Py_ssize_t size, PyArena + *arena); + +typedef struct { + _ASDL_SEQ_HEAD + arguments_ty typed_elements[1]; +} asdl_arguments_seq; + +asdl_arguments_seq *_Py_asdl_arguments_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + arg_ty typed_elements[1]; +} asdl_arg_seq; + +asdl_arg_seq *_Py_asdl_arg_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + keyword_ty typed_elements[1]; +} asdl_keyword_seq; + +asdl_keyword_seq *_Py_asdl_keyword_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + alias_ty typed_elements[1]; +} asdl_alias_seq; + +asdl_alias_seq *_Py_asdl_alias_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + withitem_ty typed_elements[1]; +} asdl_withitem_seq; + +asdl_withitem_seq *_Py_asdl_withitem_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + match_case_ty typed_elements[1]; +} asdl_match_case_seq; + +asdl_match_case_seq *_Py_asdl_match_case_seq_new(Py_ssize_t size, PyArena + *arena); + +typedef struct { + _ASDL_SEQ_HEAD + pattern_ty typed_elements[1]; +} asdl_pattern_seq; + +asdl_pattern_seq *_Py_asdl_pattern_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + type_ignore_ty typed_elements[1]; +} asdl_type_ignore_seq; + +asdl_type_ignore_seq *_Py_asdl_type_ignore_seq_new(Py_ssize_t size, PyArena + *arena); + +typedef struct { + _ASDL_SEQ_HEAD + type_param_ty typed_elements[1]; +} asdl_type_param_seq; + +asdl_type_param_seq *_Py_asdl_type_param_seq_new(Py_ssize_t size, PyArena + *arena); + + +enum _mod_kind {Module_kind=1, Interactive_kind=2, Expression_kind=3, + FunctionType_kind=4}; +struct _mod { + enum _mod_kind kind; + union { + struct { + asdl_stmt_seq *body; + asdl_type_ignore_seq *type_ignores; + } Module; + + struct { + asdl_stmt_seq *body; + } Interactive; + + struct { + expr_ty body; + } Expression; + + struct { + asdl_expr_seq *argtypes; + expr_ty returns; + } FunctionType; + + } v; +}; + +enum _stmt_kind {FunctionDef_kind=1, AsyncFunctionDef_kind=2, ClassDef_kind=3, + Return_kind=4, Delete_kind=5, Assign_kind=6, + TypeAlias_kind=7, AugAssign_kind=8, AnnAssign_kind=9, + For_kind=10, AsyncFor_kind=11, While_kind=12, If_kind=13, + With_kind=14, AsyncWith_kind=15, Match_kind=16, + Raise_kind=17, Try_kind=18, TryStar_kind=19, Assert_kind=20, + Import_kind=21, ImportFrom_kind=22, Global_kind=23, + Nonlocal_kind=24, Expr_kind=25, Pass_kind=26, Break_kind=27, + Continue_kind=28}; +struct _stmt { + enum _stmt_kind kind; + union { + struct { + identifier name; + arguments_ty args; + asdl_stmt_seq *body; + asdl_expr_seq *decorator_list; + expr_ty returns; + string type_comment; + asdl_type_param_seq *type_params; + } FunctionDef; + + struct { + identifier name; + arguments_ty args; + asdl_stmt_seq *body; + asdl_expr_seq *decorator_list; + expr_ty returns; + string type_comment; + asdl_type_param_seq *type_params; + } AsyncFunctionDef; + + struct { + identifier name; + asdl_expr_seq *bases; + asdl_keyword_seq *keywords; + asdl_stmt_seq *body; + asdl_expr_seq *decorator_list; + asdl_type_param_seq *type_params; + } ClassDef; + + struct { + expr_ty value; + } Return; + + struct { + asdl_expr_seq *targets; + } Delete; + + struct { + asdl_expr_seq *targets; + expr_ty value; + string type_comment; + } Assign; + + struct { + expr_ty name; + asdl_type_param_seq *type_params; + expr_ty value; + } TypeAlias; + + struct { + expr_ty target; + operator_ty op; + expr_ty value; + } AugAssign; + + struct { + expr_ty target; + expr_ty annotation; + expr_ty value; + int simple; + } AnnAssign; + + struct { + expr_ty target; + expr_ty iter; + asdl_stmt_seq *body; + asdl_stmt_seq *orelse; + string type_comment; + } For; + + struct { + expr_ty target; + expr_ty iter; + asdl_stmt_seq *body; + asdl_stmt_seq *orelse; + string type_comment; + } AsyncFor; + + struct { + expr_ty test; + asdl_stmt_seq *body; + asdl_stmt_seq *orelse; + } While; + + struct { + expr_ty test; + asdl_stmt_seq *body; + asdl_stmt_seq *orelse; + } If; + + struct { + asdl_withitem_seq *items; + asdl_stmt_seq *body; + string type_comment; + } With; + + struct { + asdl_withitem_seq *items; + asdl_stmt_seq *body; + string type_comment; + } AsyncWith; + + struct { + expr_ty subject; + asdl_match_case_seq *cases; + } Match; + + struct { + expr_ty exc; + expr_ty cause; + } Raise; + + struct { + asdl_stmt_seq *body; + asdl_excepthandler_seq *handlers; + asdl_stmt_seq *orelse; + asdl_stmt_seq *finalbody; + } Try; + + struct { + asdl_stmt_seq *body; + asdl_excepthandler_seq *handlers; + asdl_stmt_seq *orelse; + asdl_stmt_seq *finalbody; + } TryStar; + + struct { + expr_ty test; + expr_ty msg; + } Assert; + + struct { + asdl_alias_seq *names; + } Import; + + struct { + identifier module; + asdl_alias_seq *names; + int level; + } ImportFrom; + + struct { + asdl_identifier_seq *names; + } Global; + + struct { + asdl_identifier_seq *names; + } Nonlocal; + + struct { + expr_ty value; + } Expr; + + } v; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +enum _expr_kind {BoolOp_kind=1, NamedExpr_kind=2, BinOp_kind=3, UnaryOp_kind=4, + Lambda_kind=5, IfExp_kind=6, Dict_kind=7, Set_kind=8, + ListComp_kind=9, SetComp_kind=10, DictComp_kind=11, + GeneratorExp_kind=12, Await_kind=13, Yield_kind=14, + YieldFrom_kind=15, Compare_kind=16, Call_kind=17, + FormattedValue_kind=18, Interpolation_kind=19, + JoinedStr_kind=20, TemplateStr_kind=21, Constant_kind=22, + Attribute_kind=23, Subscript_kind=24, Starred_kind=25, + Name_kind=26, List_kind=27, Tuple_kind=28, Slice_kind=29}; +struct _expr { + enum _expr_kind kind; + union { + struct { + boolop_ty op; + asdl_expr_seq *values; + } BoolOp; + + struct { + expr_ty target; + expr_ty value; + } NamedExpr; + + struct { + expr_ty left; + operator_ty op; + expr_ty right; + } BinOp; + + struct { + unaryop_ty op; + expr_ty operand; + } UnaryOp; + + struct { + arguments_ty args; + expr_ty body; + } Lambda; + + struct { + expr_ty test; + expr_ty body; + expr_ty orelse; + } IfExp; + + struct { + asdl_expr_seq *keys; + asdl_expr_seq *values; + } Dict; + + struct { + asdl_expr_seq *elts; + } Set; + + struct { + expr_ty elt; + asdl_comprehension_seq *generators; + } ListComp; + + struct { + expr_ty elt; + asdl_comprehension_seq *generators; + } SetComp; + + struct { + expr_ty key; + expr_ty value; + asdl_comprehension_seq *generators; + } DictComp; + + struct { + expr_ty elt; + asdl_comprehension_seq *generators; + } GeneratorExp; + + struct { + expr_ty value; + } Await; + + struct { + expr_ty value; + } Yield; + + struct { + expr_ty value; + } YieldFrom; + + struct { + expr_ty left; + asdl_int_seq *ops; + asdl_expr_seq *comparators; + } Compare; + + struct { + expr_ty func; + asdl_expr_seq *args; + asdl_keyword_seq *keywords; + } Call; + + struct { + expr_ty value; + int conversion; + expr_ty format_spec; + } FormattedValue; + + struct { + expr_ty value; + constant str; + int conversion; + expr_ty format_spec; + } Interpolation; + + struct { + asdl_expr_seq *values; + } JoinedStr; + + struct { + asdl_expr_seq *values; + } TemplateStr; + + struct { + constant value; + string kind; + } Constant; + + struct { + expr_ty value; + identifier attr; + expr_context_ty ctx; + } Attribute; + + struct { + expr_ty value; + expr_ty slice; + expr_context_ty ctx; + } Subscript; + + struct { + expr_ty value; + expr_context_ty ctx; + } Starred; + + struct { + identifier id; + expr_context_ty ctx; + } Name; + + struct { + asdl_expr_seq *elts; + expr_context_ty ctx; + } List; + + struct { + asdl_expr_seq *elts; + expr_context_ty ctx; + } Tuple; + + struct { + expr_ty lower; + expr_ty upper; + expr_ty step; + } Slice; + + } v; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +struct _comprehension { + expr_ty target; + expr_ty iter; + asdl_expr_seq *ifs; + int is_async; +}; + +enum _excepthandler_kind {ExceptHandler_kind=1}; +struct _excepthandler { + enum _excepthandler_kind kind; + union { + struct { + expr_ty type; + identifier name; + asdl_stmt_seq *body; + } ExceptHandler; + + } v; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +struct _arguments { + asdl_arg_seq *posonlyargs; + asdl_arg_seq *args; + arg_ty vararg; + asdl_arg_seq *kwonlyargs; + asdl_expr_seq *kw_defaults; + arg_ty kwarg; + asdl_expr_seq *defaults; +}; + +struct _arg { + identifier arg; + expr_ty annotation; + string type_comment; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +struct _keyword { + identifier arg; + expr_ty value; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +struct _alias { + identifier name; + identifier asname; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +struct _withitem { + expr_ty context_expr; + expr_ty optional_vars; +}; + +struct _match_case { + pattern_ty pattern; + expr_ty guard; + asdl_stmt_seq *body; +}; + +enum _pattern_kind {MatchValue_kind=1, MatchSingleton_kind=2, + MatchSequence_kind=3, MatchMapping_kind=4, + MatchClass_kind=5, MatchStar_kind=6, MatchAs_kind=7, + MatchOr_kind=8}; +struct _pattern { + enum _pattern_kind kind; + union { + struct { + expr_ty value; + } MatchValue; + + struct { + constant value; + } MatchSingleton; + + struct { + asdl_pattern_seq *patterns; + } MatchSequence; + + struct { + asdl_expr_seq *keys; + asdl_pattern_seq *patterns; + identifier rest; + } MatchMapping; + + struct { + expr_ty cls; + asdl_pattern_seq *patterns; + asdl_identifier_seq *kwd_attrs; + asdl_pattern_seq *kwd_patterns; + } MatchClass; + + struct { + identifier name; + } MatchStar; + + struct { + pattern_ty pattern; + identifier name; + } MatchAs; + + struct { + asdl_pattern_seq *patterns; + } MatchOr; + + } v; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +enum _type_ignore_kind {TypeIgnore_kind=1}; +struct _type_ignore { + enum _type_ignore_kind kind; + union { + struct { + int lineno; + string tag; + } TypeIgnore; + + } v; +}; + +enum _type_param_kind {TypeVar_kind=1, ParamSpec_kind=2, TypeVarTuple_kind=3}; +struct _type_param { + enum _type_param_kind kind; + union { + struct { + identifier name; + expr_ty bound; + expr_ty default_value; + } TypeVar; + + struct { + identifier name; + expr_ty default_value; + } ParamSpec; + + struct { + identifier name; + expr_ty default_value; + } TypeVarTuple; + + } v; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + + +// Note: these macros affect function definitions, not only call sites. +mod_ty _PyAST_Module(asdl_stmt_seq * body, asdl_type_ignore_seq * type_ignores, + PyArena *arena); +mod_ty _PyAST_Interactive(asdl_stmt_seq * body, PyArena *arena); +mod_ty _PyAST_Expression(expr_ty body, PyArena *arena); +mod_ty _PyAST_FunctionType(asdl_expr_seq * argtypes, expr_ty returns, PyArena + *arena); +stmt_ty _PyAST_FunctionDef(identifier name, arguments_ty args, asdl_stmt_seq * + body, asdl_expr_seq * decorator_list, expr_ty + returns, string type_comment, asdl_type_param_seq * + type_params, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_AsyncFunctionDef(identifier name, arguments_ty args, + asdl_stmt_seq * body, asdl_expr_seq * + decorator_list, expr_ty returns, string + type_comment, asdl_type_param_seq * + type_params, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_ClassDef(identifier name, asdl_expr_seq * bases, + asdl_keyword_seq * keywords, asdl_stmt_seq * body, + asdl_expr_seq * decorator_list, asdl_type_param_seq * + type_params, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Return(expr_ty value, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Delete(asdl_expr_seq * targets, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Assign(asdl_expr_seq * targets, expr_ty value, string + type_comment, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +stmt_ty _PyAST_TypeAlias(expr_ty name, asdl_type_param_seq * type_params, + expr_ty value, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_AugAssign(expr_ty target, operator_ty op, expr_ty value, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_AnnAssign(expr_ty target, expr_ty annotation, expr_ty value, int + simple, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +stmt_ty _PyAST_For(expr_ty target, expr_ty iter, asdl_stmt_seq * body, + asdl_stmt_seq * orelse, string type_comment, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +stmt_ty _PyAST_AsyncFor(expr_ty target, expr_ty iter, asdl_stmt_seq * body, + asdl_stmt_seq * orelse, string type_comment, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_While(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * + orelse, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_If(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * orelse, + int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_With(asdl_withitem_seq * items, asdl_stmt_seq * body, string + type_comment, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +stmt_ty _PyAST_AsyncWith(asdl_withitem_seq * items, asdl_stmt_seq * body, + string type_comment, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Match(expr_ty subject, asdl_match_case_seq * cases, int lineno, + int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +stmt_ty _PyAST_Raise(expr_ty exc, expr_ty cause, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Try(asdl_stmt_seq * body, asdl_excepthandler_seq * handlers, + asdl_stmt_seq * orelse, asdl_stmt_seq * finalbody, int + lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +stmt_ty _PyAST_TryStar(asdl_stmt_seq * body, asdl_excepthandler_seq * handlers, + asdl_stmt_seq * orelse, asdl_stmt_seq * finalbody, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_Assert(expr_ty test, expr_ty msg, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Import(asdl_alias_seq * names, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_ImportFrom(identifier module, asdl_alias_seq * names, int level, + int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_Global(asdl_identifier_seq * names, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Nonlocal(asdl_identifier_seq * names, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +stmt_ty _PyAST_Expr(expr_ty value, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Pass(int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_Break(int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_Continue(int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_BoolOp(boolop_ty op, asdl_expr_seq * values, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_NamedExpr(expr_ty target, expr_ty value, int lineno, int + col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +expr_ty _PyAST_BinOp(expr_ty left, operator_ty op, expr_ty right, int lineno, + int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +expr_ty _PyAST_UnaryOp(unaryop_ty op, expr_ty operand, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_Lambda(arguments_ty args, expr_ty body, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, + int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +expr_ty _PyAST_Dict(asdl_expr_seq * keys, asdl_expr_seq * values, int lineno, + int col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_Set(asdl_expr_seq * elts, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +expr_ty _PyAST_ListComp(expr_ty elt, asdl_comprehension_seq * generators, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_SetComp(expr_ty elt, asdl_comprehension_seq * generators, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_DictComp(expr_ty key, expr_ty value, asdl_comprehension_seq * + generators, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +expr_ty _PyAST_GeneratorExp(expr_ty elt, asdl_comprehension_seq * generators, + int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_Await(expr_ty value, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +expr_ty _PyAST_Yield(expr_ty value, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +expr_ty _PyAST_YieldFrom(expr_ty value, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +expr_ty _PyAST_Compare(expr_ty left, asdl_int_seq * ops, asdl_expr_seq * + comparators, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +expr_ty _PyAST_Call(expr_ty func, asdl_expr_seq * args, asdl_keyword_seq * + keywords, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_FormattedValue(expr_ty value, int conversion, expr_ty + format_spec, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +expr_ty _PyAST_Interpolation(expr_ty value, constant str, int conversion, + expr_ty format_spec, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_JoinedStr(asdl_expr_seq * values, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena); +expr_ty _PyAST_TemplateStr(asdl_expr_seq * values, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena); +expr_ty _PyAST_Constant(constant value, string kind, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_Attribute(expr_ty value, identifier attr, expr_context_ty ctx, + int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_Subscript(expr_ty value, expr_ty slice, expr_context_ty ctx, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_Starred(expr_ty value, expr_context_ty ctx, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_Name(identifier id, expr_context_ty ctx, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_List(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_Tuple(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_Slice(expr_ty lower, expr_ty upper, expr_ty step, int lineno, + int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +comprehension_ty _PyAST_comprehension(expr_ty target, expr_ty iter, + asdl_expr_seq * ifs, int is_async, + PyArena *arena); +excepthandler_ty _PyAST_ExceptHandler(expr_ty type, identifier name, + asdl_stmt_seq * body, int lineno, int + col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +arguments_ty _PyAST_arguments(asdl_arg_seq * posonlyargs, asdl_arg_seq * args, + arg_ty vararg, asdl_arg_seq * kwonlyargs, + asdl_expr_seq * kw_defaults, arg_ty kwarg, + asdl_expr_seq * defaults, PyArena *arena); +arg_ty _PyAST_arg(identifier arg, expr_ty annotation, string type_comment, int + lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +keyword_ty _PyAST_keyword(identifier arg, expr_ty value, int lineno, int + col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +alias_ty _PyAST_alias(identifier name, identifier asname, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +withitem_ty _PyAST_withitem(expr_ty context_expr, expr_ty optional_vars, + PyArena *arena); +match_case_ty _PyAST_match_case(pattern_ty pattern, expr_ty guard, + asdl_stmt_seq * body, PyArena *arena); +pattern_ty _PyAST_MatchValue(expr_ty value, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +pattern_ty _PyAST_MatchSingleton(constant value, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena + *arena); +pattern_ty _PyAST_MatchSequence(asdl_pattern_seq * patterns, int lineno, int + col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +pattern_ty _PyAST_MatchMapping(asdl_expr_seq * keys, asdl_pattern_seq * + patterns, identifier rest, int lineno, int + col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +pattern_ty _PyAST_MatchClass(expr_ty cls, asdl_pattern_seq * patterns, + asdl_identifier_seq * kwd_attrs, asdl_pattern_seq + * kwd_patterns, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +pattern_ty _PyAST_MatchStar(identifier name, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +pattern_ty _PyAST_MatchAs(pattern_ty pattern, identifier name, int lineno, int + col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +pattern_ty _PyAST_MatchOr(asdl_pattern_seq * patterns, int lineno, int + col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +type_ignore_ty _PyAST_TypeIgnore(int lineno, string tag, PyArena *arena); +type_param_ty _PyAST_TypeVar(identifier name, expr_ty bound, expr_ty + default_value, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +type_param_ty _PyAST_ParamSpec(identifier name, expr_ty default_value, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +type_param_ty _PyAST_TypeVarTuple(identifier name, expr_ty default_value, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); + + +PyObject* PyAST_mod2obj(mod_ty t); +int PyAst_CheckMode(PyObject *ast, int mode); +mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode); +int PyAST_Check(PyObject* obj); + +extern int _PyAST_Validate(mod_ty); + +/* _PyAST_ExprAsUnicode is defined in ast_unparse.c */ +extern PyObject* _PyAST_ExprAsUnicode(expr_ty); + +/* Return the borrowed reference to the first literal string in the + sequence of statements or NULL if it doesn't start from a literal string. + Doesn't set exception. */ +extern PyObject* _PyAST_GetDocString(asdl_stmt_seq *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_AST_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_ast_state.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_ast_state.h new file mode 100644 index 0000000000000000000000000000000000000000..d4ac419f51d6b2d2c46de6f7b6aa89a8027a9f09 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_ast_state.h @@ -0,0 +1,271 @@ +// File automatically generated by Parser/asdl_c.py. + +#ifndef Py_INTERNAL_AST_STATE_H +#define Py_INTERNAL_AST_STATE_H + +#include "pycore_lock.h" // _PyOnceFlag + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +struct ast_state { + _PyOnceFlag once; + int finalized; + PyObject *AST_type; + PyObject *Add_singleton; + PyObject *Add_type; + PyObject *And_singleton; + PyObject *And_type; + PyObject *AnnAssign_type; + PyObject *Assert_type; + PyObject *Assign_type; + PyObject *AsyncFor_type; + PyObject *AsyncFunctionDef_type; + PyObject *AsyncWith_type; + PyObject *Attribute_type; + PyObject *AugAssign_type; + PyObject *Await_type; + PyObject *BinOp_type; + PyObject *BitAnd_singleton; + PyObject *BitAnd_type; + PyObject *BitOr_singleton; + PyObject *BitOr_type; + PyObject *BitXor_singleton; + PyObject *BitXor_type; + PyObject *BoolOp_type; + PyObject *Break_type; + PyObject *Call_type; + PyObject *ClassDef_type; + PyObject *Compare_type; + PyObject *Constant_type; + PyObject *Continue_type; + PyObject *Del_singleton; + PyObject *Del_type; + PyObject *Delete_type; + PyObject *DictComp_type; + PyObject *Dict_type; + PyObject *Div_singleton; + PyObject *Div_type; + PyObject *Eq_singleton; + PyObject *Eq_type; + PyObject *ExceptHandler_type; + PyObject *Expr_type; + PyObject *Expression_type; + PyObject *FloorDiv_singleton; + PyObject *FloorDiv_type; + PyObject *For_type; + PyObject *FormattedValue_type; + PyObject *FunctionDef_type; + PyObject *FunctionType_type; + PyObject *GeneratorExp_type; + PyObject *Global_type; + PyObject *GtE_singleton; + PyObject *GtE_type; + PyObject *Gt_singleton; + PyObject *Gt_type; + PyObject *IfExp_type; + PyObject *If_type; + PyObject *ImportFrom_type; + PyObject *Import_type; + PyObject *In_singleton; + PyObject *In_type; + PyObject *Interactive_type; + PyObject *Interpolation_type; + PyObject *Invert_singleton; + PyObject *Invert_type; + PyObject *IsNot_singleton; + PyObject *IsNot_type; + PyObject *Is_singleton; + PyObject *Is_type; + PyObject *JoinedStr_type; + PyObject *LShift_singleton; + PyObject *LShift_type; + PyObject *Lambda_type; + PyObject *ListComp_type; + PyObject *List_type; + PyObject *Load_singleton; + PyObject *Load_type; + PyObject *LtE_singleton; + PyObject *LtE_type; + PyObject *Lt_singleton; + PyObject *Lt_type; + PyObject *MatMult_singleton; + PyObject *MatMult_type; + PyObject *MatchAs_type; + PyObject *MatchClass_type; + PyObject *MatchMapping_type; + PyObject *MatchOr_type; + PyObject *MatchSequence_type; + PyObject *MatchSingleton_type; + PyObject *MatchStar_type; + PyObject *MatchValue_type; + PyObject *Match_type; + PyObject *Mod_singleton; + PyObject *Mod_type; + PyObject *Module_type; + PyObject *Mult_singleton; + PyObject *Mult_type; + PyObject *Name_type; + PyObject *NamedExpr_type; + PyObject *Nonlocal_type; + PyObject *NotEq_singleton; + PyObject *NotEq_type; + PyObject *NotIn_singleton; + PyObject *NotIn_type; + PyObject *Not_singleton; + PyObject *Not_type; + PyObject *Or_singleton; + PyObject *Or_type; + PyObject *ParamSpec_type; + PyObject *Pass_type; + PyObject *Pow_singleton; + PyObject *Pow_type; + PyObject *RShift_singleton; + PyObject *RShift_type; + PyObject *Raise_type; + PyObject *Return_type; + PyObject *SetComp_type; + PyObject *Set_type; + PyObject *Slice_type; + PyObject *Starred_type; + PyObject *Store_singleton; + PyObject *Store_type; + PyObject *Sub_singleton; + PyObject *Sub_type; + PyObject *Subscript_type; + PyObject *TemplateStr_type; + PyObject *TryStar_type; + PyObject *Try_type; + PyObject *Tuple_type; + PyObject *TypeAlias_type; + PyObject *TypeIgnore_type; + PyObject *TypeVarTuple_type; + PyObject *TypeVar_type; + PyObject *UAdd_singleton; + PyObject *UAdd_type; + PyObject *USub_singleton; + PyObject *USub_type; + PyObject *UnaryOp_type; + PyObject *While_type; + PyObject *With_type; + PyObject *YieldFrom_type; + PyObject *Yield_type; + PyObject *__dict__; + PyObject *__doc__; + PyObject *__match_args__; + PyObject *__module__; + PyObject *_attributes; + PyObject *_fields; + PyObject *alias_type; + PyObject *annotation; + PyObject *arg; + PyObject *arg_type; + PyObject *args; + PyObject *argtypes; + PyObject *arguments_type; + PyObject *asname; + PyObject *ast; + PyObject *attr; + PyObject *bases; + PyObject *body; + PyObject *boolop_type; + PyObject *bound; + PyObject *cases; + PyObject *cause; + PyObject *cls; + PyObject *cmpop_type; + PyObject *col_offset; + PyObject *comparators; + PyObject *comprehension_type; + PyObject *context_expr; + PyObject *conversion; + PyObject *ctx; + PyObject *decorator_list; + PyObject *default_value; + PyObject *defaults; + PyObject *elt; + PyObject *elts; + PyObject *end_col_offset; + PyObject *end_lineno; + PyObject *exc; + PyObject *excepthandler_type; + PyObject *expr_context_type; + PyObject *expr_type; + PyObject *finalbody; + PyObject *format_spec; + PyObject *func; + PyObject *generators; + PyObject *guard; + PyObject *handlers; + PyObject *id; + PyObject *ifs; + PyObject *is_async; + PyObject *items; + PyObject *iter; + PyObject *key; + PyObject *keys; + PyObject *keyword_type; + PyObject *keywords; + PyObject *kind; + PyObject *kw_defaults; + PyObject *kwarg; + PyObject *kwd_attrs; + PyObject *kwd_patterns; + PyObject *kwonlyargs; + PyObject *left; + PyObject *level; + PyObject *lineno; + PyObject *lower; + PyObject *match_case_type; + PyObject *mod_type; + PyObject *module; + PyObject *msg; + PyObject *name; + PyObject *names; + PyObject *op; + PyObject *operand; + PyObject *operator_type; + PyObject *ops; + PyObject *optional_vars; + PyObject *orelse; + PyObject *pattern; + PyObject *pattern_type; + PyObject *patterns; + PyObject *posonlyargs; + PyObject *rest; + PyObject *returns; + PyObject *right; + PyObject *simple; + PyObject *slice; + PyObject *step; + PyObject *stmt_type; + PyObject *str; + PyObject *subject; + PyObject *tag; + PyObject *target; + PyObject *targets; + PyObject *test; + PyObject *type; + PyObject *type_comment; + PyObject *type_ignore_type; + PyObject *type_ignores; + PyObject *type_param_type; + PyObject *type_params; + PyObject *unaryop_type; + PyObject *upper; + PyObject *value; + PyObject *values; + PyObject *vararg; + PyObject *withitem_type; +}; + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_AST_STATE_H */ + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_atexit.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_atexit.h new file mode 100644 index 0000000000000000000000000000000000000000..1199b00ead3769c43457ff2e0adc2c8ec0b75103 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_atexit.h @@ -0,0 +1,31 @@ +#ifndef Py_INTERNAL_ATEXIT_H +#define Py_INTERNAL_ATEXIT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + + + +#ifdef Py_GIL_DISABLED +# define _PyAtExit_LockCallbacks(state) PyMutex_Lock(&state->ll_callbacks_lock); +# define _PyAtExit_UnlockCallbacks(state) PyMutex_Unlock(&state->ll_callbacks_lock); +#else +# define _PyAtExit_LockCallbacks(state) +# define _PyAtExit_UnlockCallbacks(state) +#endif + +// Export for '_interpchannels' shared extension +PyAPI_FUNC(int) _Py_AtExit( + PyInterpreterState *interp, + atexit_datacallbackfunc func, + void *data); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_ATEXIT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_audit.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_audit.h new file mode 100644 index 0000000000000000000000000000000000000000..2811aaa6236123c0812ae065829c5e4bfa59c9a9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_audit.h @@ -0,0 +1,35 @@ +#ifndef Py_INTERNAL_AUDIT_H +#define Py_INTERNAL_AUDIT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + + +/* Runtime audit hook state */ + +typedef struct _Py_AuditHookEntry { + struct _Py_AuditHookEntry *next; + Py_AuditHookFunction hookCFunction; + void *userData; +} _Py_AuditHookEntry; + + +extern int _PySys_Audit( + PyThreadState *tstate, + const char *event, + const char *argFormat, + ...); + +// _PySys_ClearAuditHooks() must not be exported: use extern rather than +// PyAPI_FUNC(). We want minimal exposure of this function. +extern void _PySys_ClearAuditHooks(PyThreadState *tstate); + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_AUDIT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_backoff.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_backoff.h new file mode 100644 index 0000000000000000000000000000000000000000..942d8b107a7dafb37c3483f4877e9e61d42cf629 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_backoff.h @@ -0,0 +1,133 @@ + +#ifndef Py_INTERNAL_BACKOFF_H +#define Py_INTERNAL_BACKOFF_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include +#include +#include "pycore_structs.h" // _Py_BackoffCounter + +/* 16-bit countdown counters using exponential backoff. + + These are used by the adaptive specializer to count down until + it is time to specialize an instruction. If specialization fails + the counter is reset using exponential backoff. + + Another use is for the Tier 2 optimizer to decide when to create + a new Tier 2 trace (executor). Again, exponential backoff is used. + + The 16-bit counter is structured as a 12-bit unsigned 'value' + and a 4-bit 'backoff' field. When resetting the counter, the + backoff field is incremented (until it reaches a limit) and the + value is set to a bit mask representing the value 2**backoff - 1. + The maximum backoff is 12 (the number of bits in the value). + + There is an exceptional value which must not be updated, 0xFFFF. +*/ + +#define BACKOFF_BITS 4 +#define MAX_BACKOFF 12 +#define UNREACHABLE_BACKOFF 15 + +static inline bool +is_unreachable_backoff_counter(_Py_BackoffCounter counter) +{ + return counter.value_and_backoff == UNREACHABLE_BACKOFF; +} + +static inline _Py_BackoffCounter +make_backoff_counter(uint16_t value, uint16_t backoff) +{ + assert(backoff <= 15); + assert(value <= 0xFFF); + _Py_BackoffCounter result; + result.value_and_backoff = (value << BACKOFF_BITS) | backoff; + return result; +} + +static inline _Py_BackoffCounter +forge_backoff_counter(uint16_t counter) +{ + _Py_BackoffCounter result; + result.value_and_backoff = counter; + return result; +} + +static inline _Py_BackoffCounter +restart_backoff_counter(_Py_BackoffCounter counter) +{ + assert(!is_unreachable_backoff_counter(counter)); + int backoff = counter.value_and_backoff & 15; + if (backoff < MAX_BACKOFF) { + return make_backoff_counter((1 << (backoff + 1)) - 1, backoff + 1); + } + else { + return make_backoff_counter((1 << MAX_BACKOFF) - 1, MAX_BACKOFF); + } +} + +static inline _Py_BackoffCounter +pause_backoff_counter(_Py_BackoffCounter counter) +{ + _Py_BackoffCounter result; + result.value_and_backoff = counter.value_and_backoff | (1 << BACKOFF_BITS); + return result; +} + +static inline _Py_BackoffCounter +advance_backoff_counter(_Py_BackoffCounter counter) +{ + _Py_BackoffCounter result; + result.value_and_backoff = counter.value_and_backoff - (1 << BACKOFF_BITS); + return result; +} + +static inline bool +backoff_counter_triggers(_Py_BackoffCounter counter) +{ + /* Test whether the value is zero and the backoff is not UNREACHABLE_BACKOFF */ + return counter.value_and_backoff < UNREACHABLE_BACKOFF; +} + +/* Initial JUMP_BACKWARD counter. + * This determines when we create a trace for a loop. */ +#define JUMP_BACKWARD_INITIAL_VALUE 4095 +#define JUMP_BACKWARD_INITIAL_BACKOFF 12 +static inline _Py_BackoffCounter +initial_jump_backoff_counter(void) +{ + return make_backoff_counter(JUMP_BACKWARD_INITIAL_VALUE, + JUMP_BACKWARD_INITIAL_BACKOFF); +} + +/* Initial exit temperature. + * Must be larger than ADAPTIVE_COOLDOWN_VALUE, + * otherwise when a side exit warms up we may construct + * a new trace before the Tier 1 code has properly re-specialized. */ +#define SIDE_EXIT_INITIAL_VALUE 4095 +#define SIDE_EXIT_INITIAL_BACKOFF 12 + +static inline _Py_BackoffCounter +initial_temperature_backoff_counter(void) +{ + return make_backoff_counter(SIDE_EXIT_INITIAL_VALUE, + SIDE_EXIT_INITIAL_BACKOFF); +} + +/* Unreachable backoff counter. */ +static inline _Py_BackoffCounter +initial_unreachable_backoff_counter(void) +{ + return make_backoff_counter(0, UNREACHABLE_BACKOFF); +} + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_BACKOFF_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_bitutils.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_bitutils.h new file mode 100644 index 0000000000000000000000000000000000000000..50f69377523818ff1177b648a6efb6427b51ff98 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_bitutils.h @@ -0,0 +1,186 @@ +/* Bit and bytes utilities. + + Bytes swap functions, reverse order of bytes: + + - _Py_bswap16(uint16_t) + - _Py_bswap32(uint32_t) + - _Py_bswap64(uint64_t) +*/ + +#ifndef Py_INTERNAL_BITUTILS_H +#define Py_INTERNAL_BITUTILS_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#if defined(__GNUC__) \ + && ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) + /* __builtin_bswap16() is available since GCC 4.8, + __builtin_bswap32() is available since GCC 4.3, + __builtin_bswap64() is available since GCC 4.3. */ +# define _PY_HAVE_BUILTIN_BSWAP +#endif + +#ifdef _MSC_VER +# include // _byteswap_uint64() +#endif + + +static inline uint16_t +_Py_bswap16(uint16_t word) +{ +#if defined(_PY_HAVE_BUILTIN_BSWAP) || _Py__has_builtin(__builtin_bswap16) + return __builtin_bswap16(word); +#elif defined(_MSC_VER) + Py_BUILD_ASSERT(sizeof(word) == sizeof(unsigned short)); + return _byteswap_ushort(word); +#else + // Portable implementation which doesn't rely on circular bit shift + return ( ((word & UINT16_C(0x00FF)) << 8) + | ((word & UINT16_C(0xFF00)) >> 8)); +#endif +} + +static inline uint32_t +_Py_bswap32(uint32_t word) +{ +#if defined(_PY_HAVE_BUILTIN_BSWAP) || _Py__has_builtin(__builtin_bswap32) + return __builtin_bswap32(word); +#elif defined(_MSC_VER) + Py_BUILD_ASSERT(sizeof(word) == sizeof(unsigned long)); + return _byteswap_ulong(word); +#else + // Portable implementation which doesn't rely on circular bit shift + return ( ((word & UINT32_C(0x000000FF)) << 24) + | ((word & UINT32_C(0x0000FF00)) << 8) + | ((word & UINT32_C(0x00FF0000)) >> 8) + | ((word & UINT32_C(0xFF000000)) >> 24)); +#endif +} + +static inline uint64_t +_Py_bswap64(uint64_t word) +{ +#if defined(_PY_HAVE_BUILTIN_BSWAP) || _Py__has_builtin(__builtin_bswap64) + return __builtin_bswap64(word); +#elif defined(_MSC_VER) + return _byteswap_uint64(word); +#else + // Portable implementation which doesn't rely on circular bit shift + return ( ((word & UINT64_C(0x00000000000000FF)) << 56) + | ((word & UINT64_C(0x000000000000FF00)) << 40) + | ((word & UINT64_C(0x0000000000FF0000)) << 24) + | ((word & UINT64_C(0x00000000FF000000)) << 8) + | ((word & UINT64_C(0x000000FF00000000)) >> 8) + | ((word & UINT64_C(0x0000FF0000000000)) >> 24) + | ((word & UINT64_C(0x00FF000000000000)) >> 40) + | ((word & UINT64_C(0xFF00000000000000)) >> 56)); +#endif +} + + +// Population count: count the number of 1's in 'x' +// (number of bits set to 1), also known as the hamming weight. +// +// Implementation note. CPUID is not used, to test if x86 POPCNT instruction +// can be used, to keep the implementation simple. For example, Visual Studio +// __popcnt() is not used this reason. The clang and GCC builtin function can +// use the x86 POPCNT instruction if the target architecture has SSE4a or +// newer. +static inline int +_Py_popcount32(uint32_t x) +{ +#if (defined(__clang__) || defined(__GNUC__)) + +#if SIZEOF_INT >= 4 + Py_BUILD_ASSERT(sizeof(x) <= sizeof(unsigned int)); + return __builtin_popcount(x); +#else + // The C standard guarantees that unsigned long will always be big enough + // to hold a uint32_t value without losing information. + Py_BUILD_ASSERT(sizeof(x) <= sizeof(unsigned long)); + return __builtin_popcountl(x); +#endif + +#else + // 32-bit SWAR (SIMD Within A Register) popcount + + // Binary: 0 1 0 1 ... + const uint32_t M1 = 0x55555555; + // Binary: 00 11 00 11. .. + const uint32_t M2 = 0x33333333; + // Binary: 0000 1111 0000 1111 ... + const uint32_t M4 = 0x0F0F0F0F; + + // Put count of each 2 bits into those 2 bits + x = x - ((x >> 1) & M1); + // Put count of each 4 bits into those 4 bits + x = (x & M2) + ((x >> 2) & M2); + // Put count of each 8 bits into those 8 bits + x = (x + (x >> 4)) & M4; + // Sum of the 4 byte counts. + // Take care when considering changes to the next line. Portability and + // correctness are delicate here, thanks to C's "integer promotions" (C99 + // §6.3.1.1p2). On machines where the `int` type has width greater than 32 + // bits, `x` will be promoted to an `int`, and following C's "usual + // arithmetic conversions" (C99 §6.3.1.8), the multiplication will be + // performed as a multiplication of two `unsigned int` operands. In this + // case it's critical that we cast back to `uint32_t` in order to keep only + // the least significant 32 bits. On machines where the `int` type has + // width no greater than 32, the multiplication is of two 32-bit unsigned + // integer types, and the (uint32_t) cast is a no-op. In both cases, we + // avoid the risk of undefined behaviour due to overflow of a + // multiplication of signed integer types. + return (uint32_t)(x * 0x01010101U) >> 24; +#endif +} + + +// Return the index of the most significant 1 bit in 'x'. This is the smallest +// integer k such that x < 2**k. Equivalent to floor(log2(x)) + 1 for x != 0. +static inline int +_Py_bit_length(unsigned long x) +{ +#if (defined(__clang__) || defined(__GNUC__)) + if (x != 0) { + // __builtin_clzl() is available since GCC 3.4. + // Undefined behavior for x == 0. + return (int)sizeof(unsigned long) * 8 - __builtin_clzl(x); + } + else { + return 0; + } +#elif defined(_MSC_VER) + // _BitScanReverse() is documented to search 32 bits. + Py_BUILD_ASSERT(sizeof(unsigned long) <= 4); + unsigned long msb; + if (_BitScanReverse(&msb, x)) { + return (int)msb + 1; + } + else { + return 0; + } +#else + const int BIT_LENGTH_TABLE[32] = { + 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 + }; + int msb = 0; + while (x >= 32) { + msb += 6; + x >>= 6; + } + msb += BIT_LENGTH_TABLE[x]; + return msb; +#endif +} + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_BITUTILS_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_blocks_output_buffer.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_blocks_output_buffer.h new file mode 100644 index 0000000000000000000000000000000000000000..573e10359b7bd271c2da4c9674a643b8e738ae41 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_blocks_output_buffer.h @@ -0,0 +1,321 @@ +/* + _BlocksOutputBuffer is used to maintain an output buffer + that has unpredictable size. Suitable for compression/decompression + API (bz2/lzma/zlib) that has stream->next_out and stream->avail_out: + + stream->next_out: point to the next output position. + stream->avail_out: the number of available bytes left in the buffer. + + It maintains a list of bytes object, so there is no overhead of resizing + the buffer. + + Usage: + + 1, Initialize the struct instance like this: + _BlocksOutputBuffer buffer = {.list = NULL}; + Set .list to NULL for _BlocksOutputBuffer_OnError() + + 2, Initialize the buffer use one of these functions: + _BlocksOutputBuffer_InitAndGrow() + _BlocksOutputBuffer_InitWithSize() + + 3, If (avail_out == 0), grow the buffer: + _BlocksOutputBuffer_Grow() + + 4, Get the current outputted data size: + _BlocksOutputBuffer_GetDataSize() + + 5, Finish the buffer, and return a bytes object: + _BlocksOutputBuffer_Finish() + + 6, Clean up the buffer when an error occurred: + _BlocksOutputBuffer_OnError() +*/ + +#ifndef Py_INTERNAL_BLOCKS_OUTPUT_BUFFER_H +#define Py_INTERNAL_BLOCKS_OUTPUT_BUFFER_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "Python.h" + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +typedef struct { + // List of bytes objects + PyObject *list; + // Number of whole allocated size + Py_ssize_t allocated; + // Max length of the buffer, negative number means unlimited length. + Py_ssize_t max_length; +} _BlocksOutputBuffer; + +static const char unable_allocate_msg[] = "Unable to allocate output buffer."; + +/* In 32-bit build, the max block size should <= INT32_MAX. */ +#define OUTPUT_BUFFER_MAX_BLOCK_SIZE (256*1024*1024) + +/* Block size sequence */ +#define KB (1024) +#define MB (1024*1024) +static const Py_ssize_t BUFFER_BLOCK_SIZE[] = + { 32*KB, 64*KB, 256*KB, 1*MB, 4*MB, 8*MB, 16*MB, 16*MB, + 32*MB, 32*MB, 32*MB, 32*MB, 64*MB, 64*MB, 128*MB, 128*MB, + OUTPUT_BUFFER_MAX_BLOCK_SIZE }; +#undef KB +#undef MB + +/* According to the block sizes defined by BUFFER_BLOCK_SIZE, the whole + allocated size growth step is: + 1 32 KB +32 KB + 2 96 KB +64 KB + 3 352 KB +256 KB + 4 1.34 MB +1 MB + 5 5.34 MB +4 MB + 6 13.34 MB +8 MB + 7 29.34 MB +16 MB + 8 45.34 MB +16 MB + 9 77.34 MB +32 MB + 10 109.34 MB +32 MB + 11 141.34 MB +32 MB + 12 173.34 MB +32 MB + 13 237.34 MB +64 MB + 14 301.34 MB +64 MB + 15 429.34 MB +128 MB + 16 557.34 MB +128 MB + 17 813.34 MB +256 MB + 18 1069.34 MB +256 MB + 19 1325.34 MB +256 MB + 20 1581.34 MB +256 MB + 21 1837.34 MB +256 MB + 22 2093.34 MB +256 MB + ... +*/ + +/* Initialize the buffer, and grow the buffer. + + max_length: Max length of the buffer, -1 for unlimited length. + + On success, return allocated size (>=0) + On failure, return -1 +*/ +static inline Py_ssize_t +_BlocksOutputBuffer_InitAndGrow(_BlocksOutputBuffer *buffer, + const Py_ssize_t max_length, + void **next_out) +{ + PyObject *b; + Py_ssize_t block_size; + + // ensure .list was set to NULL + assert(buffer->list == NULL); + + // get block size + if (0 <= max_length && max_length < BUFFER_BLOCK_SIZE[0]) { + block_size = max_length; + } else { + block_size = BUFFER_BLOCK_SIZE[0]; + } + + // the first block + b = PyBytes_FromStringAndSize(NULL, block_size); + if (b == NULL) { + return -1; + } + + // create the list + buffer->list = PyList_New(1); + if (buffer->list == NULL) { + Py_DECREF(b); + return -1; + } + PyList_SET_ITEM(buffer->list, 0, b); + + // set variables + buffer->allocated = block_size; + buffer->max_length = max_length; + + *next_out = PyBytes_AS_STRING(b); + return block_size; +} + +/* Initialize the buffer, with an initial size. + + Check block size limit in the outer wrapper function. For example, some libs + accept UINT32_MAX as the maximum block size, then init_size should <= it. + + On success, return allocated size (>=0) + On failure, return -1 +*/ +static inline Py_ssize_t +_BlocksOutputBuffer_InitWithSize(_BlocksOutputBuffer *buffer, + const Py_ssize_t init_size, + void **next_out) +{ + PyObject *b; + + // ensure .list was set to NULL + assert(buffer->list == NULL); + + // the first block + b = PyBytes_FromStringAndSize(NULL, init_size); + if (b == NULL) { + PyErr_SetString(PyExc_MemoryError, unable_allocate_msg); + return -1; + } + + // create the list + buffer->list = PyList_New(1); + if (buffer->list == NULL) { + Py_DECREF(b); + return -1; + } + PyList_SET_ITEM(buffer->list, 0, b); + + // set variables + buffer->allocated = init_size; + buffer->max_length = -1; + + *next_out = PyBytes_AS_STRING(b); + return init_size; +} + +/* Grow the buffer. The avail_out must be 0, please check it before calling. + + On success, return allocated size (>=0) + On failure, return -1 +*/ +static inline Py_ssize_t +_BlocksOutputBuffer_Grow(_BlocksOutputBuffer *buffer, + void **next_out, + const Py_ssize_t avail_out) +{ + PyObject *b; + const Py_ssize_t list_len = Py_SIZE(buffer->list); + Py_ssize_t block_size; + + // ensure no gaps in the data + if (avail_out != 0) { + PyErr_SetString(PyExc_SystemError, + "avail_out is non-zero in _BlocksOutputBuffer_Grow()."); + return -1; + } + + // get block size + if (list_len < (Py_ssize_t) Py_ARRAY_LENGTH(BUFFER_BLOCK_SIZE)) { + block_size = BUFFER_BLOCK_SIZE[list_len]; + } else { + block_size = BUFFER_BLOCK_SIZE[Py_ARRAY_LENGTH(BUFFER_BLOCK_SIZE) - 1]; + } + + // check max_length + if (buffer->max_length >= 0) { + // if (rest == 0), should not grow the buffer. + Py_ssize_t rest = buffer->max_length - buffer->allocated; + assert(rest > 0); + + // block_size of the last block + if (block_size > rest) { + block_size = rest; + } + } + + // check buffer->allocated overflow + if (block_size > PY_SSIZE_T_MAX - buffer->allocated) { + PyErr_SetString(PyExc_MemoryError, unable_allocate_msg); + return -1; + } + + // create the block + b = PyBytes_FromStringAndSize(NULL, block_size); + if (b == NULL) { + PyErr_SetString(PyExc_MemoryError, unable_allocate_msg); + return -1; + } + if (PyList_Append(buffer->list, b) < 0) { + Py_DECREF(b); + return -1; + } + Py_DECREF(b); + + // set variables + buffer->allocated += block_size; + + *next_out = PyBytes_AS_STRING(b); + return block_size; +} + +/* Return the current outputted data size. */ +static inline Py_ssize_t +_BlocksOutputBuffer_GetDataSize(_BlocksOutputBuffer *buffer, + const Py_ssize_t avail_out) +{ + return buffer->allocated - avail_out; +} + +/* Finish the buffer. + + Return a bytes object on success + Return NULL on failure +*/ +static inline PyObject * +_BlocksOutputBuffer_Finish(_BlocksOutputBuffer *buffer, + const Py_ssize_t avail_out) +{ + PyObject *result, *block; + const Py_ssize_t list_len = Py_SIZE(buffer->list); + + // fast path for single block + if ((list_len == 1 && avail_out == 0) || + (list_len == 2 && Py_SIZE(PyList_GET_ITEM(buffer->list, 1)) == avail_out)) + { + block = PyList_GET_ITEM(buffer->list, 0); + Py_INCREF(block); + + Py_CLEAR(buffer->list); + return block; + } + + // final bytes object + result = PyBytes_FromStringAndSize(NULL, buffer->allocated - avail_out); + if (result == NULL) { + PyErr_SetString(PyExc_MemoryError, unable_allocate_msg); + return NULL; + } + + // memory copy + if (list_len > 0) { + char *posi = PyBytes_AS_STRING(result); + + // blocks except the last one + Py_ssize_t i = 0; + for (; i < list_len-1; i++) { + block = PyList_GET_ITEM(buffer->list, i); + memcpy(posi, PyBytes_AS_STRING(block), Py_SIZE(block)); + posi += Py_SIZE(block); + } + // the last block + block = PyList_GET_ITEM(buffer->list, i); + memcpy(posi, PyBytes_AS_STRING(block), Py_SIZE(block) - avail_out); + } else { + assert(Py_SIZE(result) == 0); + } + + Py_CLEAR(buffer->list); + return result; +} + +/* Clean up the buffer when an error occurred. */ +static inline void +_BlocksOutputBuffer_OnError(_BlocksOutputBuffer *buffer) +{ + Py_CLEAR(buffer->list); +} + +#ifdef __cplusplus +} +#endif +#endif /* Py_INTERNAL_BLOCKS_OUTPUT_BUFFER_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_brc.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_brc.h new file mode 100644 index 0000000000000000000000000000000000000000..cd3c9ac26b5a66d92a46d00df5bfd195e123a803 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_brc.h @@ -0,0 +1,73 @@ +#ifndef Py_INTERNAL_BRC_H +#define Py_INTERNAL_BRC_H + +#include +#include "pycore_llist.h" // struct llist_node +#include "pycore_object_stack.h" // _PyObjectStack + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#ifdef Py_GIL_DISABLED + +// Prime number to avoid correlations with memory addresses. +#define _Py_BRC_NUM_BUCKETS 257 + +// Hash table bucket +struct _brc_bucket { + // Mutex protects both the bucket and thread state queues in this bucket. + PyMutex mutex; + + // Linked list of _PyThreadStateImpl objects hashed to this bucket. + struct llist_node root; +}; + +// Per-interpreter biased reference counting state +struct _brc_state { + // Hash table of thread states by thread-id. Thread states within a bucket + // are chained using a doubly-linked list. + struct _brc_bucket table[_Py_BRC_NUM_BUCKETS]; +}; + +// Per-thread biased reference counting state +struct _brc_thread_state { + // Linked-list of thread states per hash bucket + struct llist_node bucket_node; + + // Thread-id as determined by _PyThread_Id() + uintptr_t tid; + + // Objects with refcounts to be merged (protected by bucket mutex) + _PyObjectStack objects_to_merge; + + // Local stack of objects to be merged (not accessed by other threads) + _PyObjectStack local_objects_to_merge; +}; + +// Initialize/finalize the per-thread biased reference counting state +void _Py_brc_init_thread(PyThreadState *tstate); +void _Py_brc_remove_thread(PyThreadState *tstate); + +// Initialize per-interpreter state +void _Py_brc_init_state(PyInterpreterState *interp); + +void _Py_brc_after_fork(PyInterpreterState *interp); + +// Enqueues an object to be merged by it's owning thread (tid). This +// steals a reference to the object. +void _Py_brc_queue_object(PyObject *ob); + +// Merge the refcounts of queued objects for the current thread. +void _Py_brc_merge_refcounts(PyThreadState *tstate); + +#endif /* Py_GIL_DISABLED */ + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_BRC_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_bytes_methods.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_bytes_methods.h new file mode 100644 index 0000000000000000000000000000000000000000..059dc2599bbd77e861dbf0649372281e306de75e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_bytes_methods.h @@ -0,0 +1,82 @@ +#ifndef Py_LIMITED_API +#ifndef Py_BYTES_CTYPE_H +#define Py_BYTES_CTYPE_H + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +/* + * The internal implementation behind PyBytes (bytes) and PyByteArray (bytearray) + * methods of the given names, they operate on ASCII byte strings. + */ +extern PyObject* _Py_bytes_isspace(const char *cptr, Py_ssize_t len); +extern PyObject* _Py_bytes_isalpha(const char *cptr, Py_ssize_t len); +extern PyObject* _Py_bytes_isalnum(const char *cptr, Py_ssize_t len); +extern PyObject* _Py_bytes_isascii(const char *cptr, Py_ssize_t len); +extern PyObject* _Py_bytes_isdigit(const char *cptr, Py_ssize_t len); +extern PyObject* _Py_bytes_islower(const char *cptr, Py_ssize_t len); +extern PyObject* _Py_bytes_isupper(const char *cptr, Py_ssize_t len); +extern PyObject* _Py_bytes_istitle(const char *cptr, Py_ssize_t len); + +/* These store their len sized answer in the given preallocated *result arg. */ +extern void _Py_bytes_lower(char *result, const char *cptr, Py_ssize_t len); +extern void _Py_bytes_upper(char *result, const char *cptr, Py_ssize_t len); +extern void _Py_bytes_title(char *result, const char *s, Py_ssize_t len); +extern void _Py_bytes_capitalize(char *result, const char *s, Py_ssize_t len); +extern void _Py_bytes_swapcase(char *result, const char *s, Py_ssize_t len); + +extern PyObject *_Py_bytes_find(const char *str, Py_ssize_t len, PyObject *sub, + Py_ssize_t start, Py_ssize_t end); +extern PyObject *_Py_bytes_index(const char *str, Py_ssize_t len, PyObject *sub, + Py_ssize_t start, Py_ssize_t end); +extern PyObject *_Py_bytes_rfind(const char *str, Py_ssize_t len, PyObject *sub, + Py_ssize_t start, Py_ssize_t end); +extern PyObject *_Py_bytes_rindex(const char *str, Py_ssize_t len, PyObject *sub, + Py_ssize_t start, Py_ssize_t end); +extern PyObject *_Py_bytes_count(const char *str, Py_ssize_t len, PyObject *sub, + Py_ssize_t start, Py_ssize_t end); +extern int _Py_bytes_contains(const char *str, Py_ssize_t len, PyObject *arg); +extern PyObject *_Py_bytes_startswith(const char *str, Py_ssize_t len, + PyObject *subobj, Py_ssize_t start, + Py_ssize_t end); +extern PyObject *_Py_bytes_endswith(const char *str, Py_ssize_t len, + PyObject *subobj, Py_ssize_t start, + Py_ssize_t end); + +/* The maketrans() static method. */ +extern PyObject* _Py_bytes_maketrans(Py_buffer *frm, Py_buffer *to); + +/* Shared __doc__ strings. */ +extern const char _Py_isspace__doc__[]; +extern const char _Py_isalpha__doc__[]; +extern const char _Py_isalnum__doc__[]; +extern const char _Py_isascii__doc__[]; +extern const char _Py_isdigit__doc__[]; +extern const char _Py_islower__doc__[]; +extern const char _Py_isupper__doc__[]; +extern const char _Py_istitle__doc__[]; +extern const char _Py_lower__doc__[]; +extern const char _Py_upper__doc__[]; +extern const char _Py_title__doc__[]; +extern const char _Py_capitalize__doc__[]; +extern const char _Py_swapcase__doc__[]; +extern const char _Py_count__doc__[]; +extern const char _Py_find__doc__[]; +extern const char _Py_index__doc__[]; +extern const char _Py_rfind__doc__[]; +extern const char _Py_rindex__doc__[]; +extern const char _Py_startswith__doc__[]; +extern const char _Py_endswith__doc__[]; +extern const char _Py_maketrans__doc__[]; +extern const char _Py_expandtabs__doc__[]; +extern const char _Py_ljust__doc__[]; +extern const char _Py_rjust__doc__[]; +extern const char _Py_center__doc__[]; +extern const char _Py_zfill__doc__[]; + +/* this is needed because some docs are shared from the .o, not static */ +#define PyDoc_STRVAR_shared(name,str) const char name[] = PyDoc_STR(str) + +#endif /* !Py_BYTES_CTYPE_H */ +#endif /* !Py_LIMITED_API */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_bytesobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_bytesobject.h new file mode 100644 index 0000000000000000000000000000000000000000..8ea9b3ebb8845413d82b568abbea3a0acc4d56f8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_bytesobject.h @@ -0,0 +1,149 @@ +#ifndef Py_INTERNAL_BYTESOBJECT_H +#define Py_INTERNAL_BYTESOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +extern PyObject* _PyBytes_FormatEx( + const char *format, + Py_ssize_t format_len, + PyObject *args, + int use_bytearray); + +extern PyObject* _PyBytes_FromHex( + PyObject *string, + int use_bytearray); + +// Helper for PyBytes_DecodeEscape that detects invalid escape chars. +// Export for test_peg_generator. +PyAPI_FUNC(PyObject*) _PyBytes_DecodeEscape2(const char *, Py_ssize_t, + const char *, + int *, const char **); + + +// Substring Search. +// +// Returns the index of the first occurrence of +// a substring ("needle") in a larger text ("haystack"). +// If the needle is not found, return -1. +// If the needle is found, add offset to the index. +// +// Export for 'mmap' shared extension. +PyAPI_FUNC(Py_ssize_t) +_PyBytes_Find(const char *haystack, Py_ssize_t len_haystack, + const char *needle, Py_ssize_t len_needle, + Py_ssize_t offset); + +// Same as above, but search right-to-left. +// Export for 'mmap' shared extension. +PyAPI_FUNC(Py_ssize_t) +_PyBytes_ReverseFind(const char *haystack, Py_ssize_t len_haystack, + const char *needle, Py_ssize_t len_needle, + Py_ssize_t offset); + + +// Helper function to implement the repeat and inplace repeat methods on a +// buffer. +// +// len_dest is assumed to be an integer multiple of len_src. +// If src equals dest, then assume the operation is inplace. +// +// This method repeately doubles the number of bytes copied to reduce +// the number of invocations of memcpy. +// +// Export for 'array' shared extension. +PyAPI_FUNC(void) +_PyBytes_Repeat(char* dest, Py_ssize_t len_dest, + const char* src, Py_ssize_t len_src); + +/* --- _PyBytesWriter ----------------------------------------------------- */ + +/* The _PyBytesWriter structure is big: it contains an embedded "stack buffer". + A _PyBytesWriter variable must be declared at the end of variables in a + function to optimize the memory allocation on the stack. */ +typedef struct { + /* bytes, bytearray or NULL (when the small buffer is used) */ + PyObject *buffer; + + /* Number of allocated size. */ + Py_ssize_t allocated; + + /* Minimum number of allocated bytes, + incremented by _PyBytesWriter_Prepare() */ + Py_ssize_t min_size; + + /* If non-zero, use a bytearray instead of a bytes object for buffer. */ + int use_bytearray; + + /* If non-zero, overallocate the buffer (default: 0). + This flag must be zero if use_bytearray is non-zero. */ + int overallocate; + + /* Stack buffer */ + int use_small_buffer; + char small_buffer[512]; +} _PyBytesWriter; + +/* Initialize a bytes writer + + By default, the overallocation is disabled. Set the overallocate attribute + to control the allocation of the buffer. + + Export _PyBytesWriter API for '_pickle' shared extension. */ +PyAPI_FUNC(void) _PyBytesWriter_Init(_PyBytesWriter *writer); + +/* Get the buffer content and reset the writer. + Return a bytes object, or a bytearray object if use_bytearray is non-zero. + Raise an exception and return NULL on error. */ +PyAPI_FUNC(PyObject *) _PyBytesWriter_Finish(_PyBytesWriter *writer, + void *str); + +/* Deallocate memory of a writer (clear its internal buffer). */ +PyAPI_FUNC(void) _PyBytesWriter_Dealloc(_PyBytesWriter *writer); + +/* Allocate the buffer to write size bytes. + Return the pointer to the beginning of buffer data. + Raise an exception and return NULL on error. */ +PyAPI_FUNC(void*) _PyBytesWriter_Alloc(_PyBytesWriter *writer, + Py_ssize_t size); + +/* Ensure that the buffer is large enough to write *size* bytes. + Add size to the writer minimum size (min_size attribute). + + str is the current pointer inside the buffer. + Return the updated current pointer inside the buffer. + Raise an exception and return NULL on error. */ +PyAPI_FUNC(void*) _PyBytesWriter_Prepare(_PyBytesWriter *writer, + void *str, + Py_ssize_t size); + +/* Resize the buffer to make it larger. + The new buffer may be larger than size bytes because of overallocation. + Return the updated current pointer inside the buffer. + Raise an exception and return NULL on error. + + Note: size must be greater than the number of allocated bytes in the writer. + + This function doesn't use the writer minimum size (min_size attribute). + + See also _PyBytesWriter_Prepare(). + */ +PyAPI_FUNC(void*) _PyBytesWriter_Resize(_PyBytesWriter *writer, + void *str, + Py_ssize_t size); + +/* Write bytes. + Raise an exception and return NULL on error. */ +PyAPI_FUNC(void*) _PyBytesWriter_WriteBytes(_PyBytesWriter *writer, + void *str, + const void *bytes, + Py_ssize_t size); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_BYTESOBJECT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_c_array.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_c_array.h new file mode 100644 index 0000000000000000000000000000000000000000..7a10fc866c88f185e3afe71832b8d82ed70b2afa --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_c_array.h @@ -0,0 +1,39 @@ +#ifndef Py_INTERNAL_C_ARRAY_H +#define Py_INTERNAL_C_ARRAY_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + + +/* Utility for a number of growing arrays */ + +typedef struct { + void *array; /* pointer to the array */ + int allocated_entries; /* pointer to the capacity of the array */ + size_t item_size; /* size of each element */ + int initial_num_entries; /* initial allocation size */ +} _Py_c_array_t; + + +int _Py_CArray_Init(_Py_c_array_t* array, int item_size, int initial_num_entries); +void _Py_CArray_Fini(_Py_c_array_t* array); + +/* If idx is out of bounds: + * If arr->array is NULL, allocate arr->initial_num_entries slots. + * Otherwise, double its size. + * + * Return 0 if successful and -1 (with exception set) otherwise. + */ +int _Py_CArray_EnsureCapacity(_Py_c_array_t *c_array, int idx); + + +#ifdef __cplusplus +} +#endif + +#endif /* !Py_INTERNAL_C_ARRAY_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_call.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_call.h new file mode 100644 index 0000000000000000000000000000000000000000..05b58b2ba54a104509ec2e2a8d5eb38534fa2f2f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_call.h @@ -0,0 +1,214 @@ +#ifndef Py_INTERNAL_CALL_H +#define Py_INTERNAL_CALL_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_code.h" // EVAL_CALL_STAT_INC_IF_FUNCTION() +#include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_stats.h" + +/* Suggested size (number of positional arguments) for arrays of PyObject* + allocated on a C stack to avoid allocating memory on the heap memory. Such + array is used to pass positional arguments to call functions of the + PyObject_Vectorcall() family. + + The size is chosen to not abuse the C stack and so limit the risk of stack + overflow. The size is also chosen to allow using the small stack for most + function calls of the Python standard library. On 64-bit CPU, it allocates + 40 bytes on the stack. */ +#define _PY_FASTCALL_SMALL_STACK 5 + + +// Export for 'math' shared extension, used via _PyObject_VectorcallTstate() +// static inline function. +PyAPI_FUNC(PyObject*) _Py_CheckFunctionResult( + PyThreadState *tstate, + PyObject *callable, + PyObject *result, + const char *where); + +extern PyObject* _PyObject_Call_Prepend( + PyThreadState *tstate, + PyObject *callable, + PyObject *obj, + PyObject *args, + PyObject *kwargs); + +extern PyObject* _PyObject_VectorcallDictTstate( + PyThreadState *tstate, + PyObject *callable, + PyObject *const *args, + size_t nargsf, + PyObject *kwargs); + +extern PyObject* _PyObject_Call( + PyThreadState *tstate, + PyObject *callable, + PyObject *args, + PyObject *kwargs); + +extern PyObject * _PyObject_CallMethodFormat( + PyThreadState *tstate, + PyObject *callable, + const char *format, + ...); + +// Export for 'array' shared extension +PyAPI_FUNC(PyObject*) _PyObject_CallMethod( + PyObject *obj, + PyObject *name, + const char *format, ...); + +extern PyObject* _PyObject_CallMethodIdObjArgs( + PyObject *obj, + _Py_Identifier *name, + ...); + +static inline PyObject * +_PyObject_VectorcallMethodId( + _Py_Identifier *name, PyObject *const *args, + size_t nargsf, PyObject *kwnames) +{ + PyObject *oname = _PyUnicode_FromId(name); /* borrowed */ + if (!oname) { + return _Py_NULL; + } + return PyObject_VectorcallMethod(oname, args, nargsf, kwnames); +} + +static inline PyObject * +_PyObject_CallMethodIdNoArgs(PyObject *self, _Py_Identifier *name) +{ + size_t nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET; + return _PyObject_VectorcallMethodId(name, &self, nargsf, _Py_NULL); +} + +static inline PyObject * +_PyObject_CallMethodIdOneArg(PyObject *self, _Py_Identifier *name, PyObject *arg) +{ + PyObject *args[2] = {self, arg}; + size_t nargsf = 2 | PY_VECTORCALL_ARGUMENTS_OFFSET; + assert(arg != NULL); + return _PyObject_VectorcallMethodId(name, args, nargsf, _Py_NULL); +} + + +extern PyObject *_PyObject_VectorcallPrepend( + PyThreadState *tstate, + PyObject *callable, + PyObject *arg, + PyObject *const *args, + size_t nargsf, + PyObject *kwnames); + +/* === Vectorcall protocol (PEP 590) ============================= */ + +// Call callable using tp_call. Arguments are like PyObject_Vectorcall(), +// except that nargs is plainly the number of arguments without flags. +// +// Export for 'math' shared extension, used via _PyObject_VectorcallTstate() +// static inline function. +PyAPI_FUNC(PyObject*) _PyObject_MakeTpCall( + PyThreadState *tstate, + PyObject *callable, + PyObject *const *args, Py_ssize_t nargs, + PyObject *keywords); + +// Static inline variant of public PyVectorcall_Function(). +static inline vectorcallfunc +_PyVectorcall_FunctionInline(PyObject *callable) +{ + assert(callable != NULL); + + PyTypeObject *tp = Py_TYPE(callable); + if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) { + return NULL; + } + assert(PyCallable_Check(callable)); + + Py_ssize_t offset = tp->tp_vectorcall_offset; + assert(offset > 0); + + vectorcallfunc ptr; + memcpy(&ptr, (char *) callable + offset, sizeof(ptr)); + return ptr; +} + + +/* Call the callable object 'callable' with the "vectorcall" calling + convention. + + args is a C array for positional arguments. + + nargsf is the number of positional arguments plus optionally the flag + PY_VECTORCALL_ARGUMENTS_OFFSET which means that the caller is allowed to + modify args[-1]. + + kwnames is a tuple of keyword names. The values of the keyword arguments + are stored in "args" after the positional arguments (note that the number + of keyword arguments does not change nargsf). kwnames can also be NULL if + there are no keyword arguments. + + keywords must only contain strings and all keys must be unique. + + Return the result on success. Raise an exception and return NULL on + error. */ +static inline PyObject * +_PyObject_VectorcallTstate(PyThreadState *tstate, PyObject *callable, + PyObject *const *args, size_t nargsf, + PyObject *kwnames) +{ + vectorcallfunc func; + PyObject *res; + + assert(kwnames == NULL || PyTuple_Check(kwnames)); + assert(args != NULL || PyVectorcall_NARGS(nargsf) == 0); + + func = _PyVectorcall_FunctionInline(callable); + if (func == NULL) { + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); + return _PyObject_MakeTpCall(tstate, callable, args, nargs, kwnames); + } + res = func(callable, args, nargsf, kwnames); + return _Py_CheckFunctionResult(tstate, callable, res, NULL); +} + + +static inline PyObject * +_PyObject_CallNoArgsTstate(PyThreadState *tstate, PyObject *func) { + return _PyObject_VectorcallTstate(tstate, func, NULL, 0, NULL); +} + + +// Private static inline function variant of public PyObject_CallNoArgs() +static inline PyObject * +_PyObject_CallNoArgs(PyObject *func) { + EVAL_CALL_STAT_INC_IF_FUNCTION(EVAL_CALL_API, func); + PyThreadState *tstate = _PyThreadState_GET(); + return _PyObject_VectorcallTstate(tstate, func, NULL, 0, NULL); +} + + +extern PyObject *const * +_PyStack_UnpackDict(PyThreadState *tstate, + PyObject *const *args, Py_ssize_t nargs, + PyObject *kwargs, PyObject **p_kwnames); + +extern void _PyStack_UnpackDict_Free( + PyObject *const *stack, + Py_ssize_t nargs, + PyObject *kwnames); + +extern void _PyStack_UnpackDict_FreeNoDecRef( + PyObject *const *stack, + PyObject *kwnames); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_CALL_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_capsule.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_capsule.h new file mode 100644 index 0000000000000000000000000000000000000000..aa2c67f3a8f002ccef0e9b32fe4ac0cf8271164a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_capsule.h @@ -0,0 +1,17 @@ +#ifndef Py_INTERNAL_PYCAPSULE_H +#define Py_INTERNAL_PYCAPSULE_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +// Export for '_socket' shared extension +PyAPI_FUNC(int) _PyCapsule_SetTraverse(PyObject *op, traverseproc traverse_func, inquiry clear_func); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_PYCAPSULE_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_cell.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_cell.h new file mode 100644 index 0000000000000000000000000000000000000000..d0d45a2343654fa93fc764168c7a82cc981baaeb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_cell.h @@ -0,0 +1,75 @@ +#ifndef Py_INTERNAL_CELL_H +#define Py_INTERNAL_CELL_H + +#include "pycore_critical_section.h" +#include "pycore_object.h" +#include "pycore_stackref.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +// Sets the cell contents to `value` and return previous contents. Steals a +// reference to `value`. +static inline PyObject * +PyCell_SwapTakeRef(PyCellObject *cell, PyObject *value) +{ + PyObject *old_value; + Py_BEGIN_CRITICAL_SECTION(cell); + old_value = cell->ob_ref; + FT_ATOMIC_STORE_PTR_RELEASE(cell->ob_ref, value); + Py_END_CRITICAL_SECTION(); + return old_value; +} + +static inline void +PyCell_SetTakeRef(PyCellObject *cell, PyObject *value) +{ + PyObject *old_value = PyCell_SwapTakeRef(cell, value); + Py_XDECREF(old_value); +} + +// Gets the cell contents. Returns a new reference. +static inline PyObject * +PyCell_GetRef(PyCellObject *cell) +{ + PyObject *res; + Py_BEGIN_CRITICAL_SECTION(cell); +#ifdef Py_GIL_DISABLED + res = _Py_XNewRefWithLock(cell->ob_ref); +#else + res = Py_XNewRef(cell->ob_ref); +#endif + Py_END_CRITICAL_SECTION(); + return res; +} + +static inline _PyStackRef +_PyCell_GetStackRef(PyCellObject *cell) +{ + PyObject *value; +#ifdef Py_GIL_DISABLED + value = _PyObject_CAST(_Py_atomic_load_ptr(&cell->ob_ref)); + if (value == NULL) { + return PyStackRef_NULL; + } + _PyStackRef ref; + if (_Py_TryIncrefCompareStackRef(&cell->ob_ref, value, &ref)) { + return ref; + } +#endif + value = PyCell_GetRef(cell); + if (value == NULL) { + return PyStackRef_NULL; + } + return PyStackRef_FromPyObjectSteal(value); +} + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_CELL_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_ceval.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_ceval.h new file mode 100644 index 0000000000000000000000000000000000000000..e3fa8e10eb447ee9aa518534e2b26619ec485417 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_ceval.h @@ -0,0 +1,394 @@ +#ifndef Py_INTERNAL_CEVAL_H +#define Py_INTERNAL_CEVAL_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "dynamic_annotations.h" // _Py_ANNOTATE_RWLOCK_CREATE + +#include "pycore_code.h" // _PyCode_GetTLBCFast() +#include "pycore_interp.h" // PyInterpreterState.eval_frame +#include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_stats.h" // EVAL_CALL_STAT_INC() +#include "pycore_typedefs.h" // _PyInterpreterFrame + + +/* Forward declarations */ +struct _ceval_runtime_state; + +// Export for '_lsprof' shared extension +PyAPI_FUNC(int) _PyEval_SetProfile(PyThreadState *tstate, Py_tracefunc func, PyObject *arg); +extern int _PyEval_SetProfileAllThreads(PyInterpreterState *interp, Py_tracefunc func, PyObject *arg); + +extern int _PyEval_SetTrace(PyThreadState *tstate, Py_tracefunc func, PyObject *arg); +extern int _PyEval_SetTraceAllThreads(PyInterpreterState *interp, Py_tracefunc func, PyObject *arg); + +extern int _PyEval_SetOpcodeTrace(PyFrameObject *f, bool enable); + +// Helper to look up a builtin object +// Export for 'array' shared extension +PyAPI_FUNC(PyObject*) _PyEval_GetBuiltin(PyObject *); + +extern PyObject* _PyEval_GetBuiltinId(_Py_Identifier *); + +extern void _PyEval_SetSwitchInterval(unsigned long microseconds); +extern unsigned long _PyEval_GetSwitchInterval(void); + +// Export for '_queue' shared extension +PyAPI_FUNC(int) _PyEval_MakePendingCalls(PyThreadState *); + +#ifndef Py_DEFAULT_RECURSION_LIMIT +# define Py_DEFAULT_RECURSION_LIMIT 1000 +#endif + +extern void _Py_FinishPendingCalls(PyThreadState *tstate); +extern void _PyEval_InitState(PyInterpreterState *); +extern void _PyEval_SignalReceived(void); + +// bitwise flags: +#define _Py_PENDING_MAINTHREADONLY 1 +#define _Py_PENDING_RAWFREE 2 + +typedef int _Py_add_pending_call_result; +#define _Py_ADD_PENDING_SUCCESS 0 +#define _Py_ADD_PENDING_FULL -1 + +// Export for '_testinternalcapi' shared extension +PyAPI_FUNC(_Py_add_pending_call_result) _PyEval_AddPendingCall( + PyInterpreterState *interp, + _Py_pending_call_func func, + void *arg, + int flags); + +#ifdef HAVE_FORK +extern PyStatus _PyEval_ReInitThreads(PyThreadState *tstate); +#endif + +// Used by sys.call_tracing() +extern PyObject* _PyEval_CallTracing(PyObject *func, PyObject *args); + +// Used by sys.get_asyncgen_hooks() +extern PyObject* _PyEval_GetAsyncGenFirstiter(void); +extern PyObject* _PyEval_GetAsyncGenFinalizer(void); + +// Used by sys.set_asyncgen_hooks() +extern int _PyEval_SetAsyncGenFirstiter(PyObject *); +extern int _PyEval_SetAsyncGenFinalizer(PyObject *); + +// Used by sys.get_coroutine_origin_tracking_depth() +// and sys.set_coroutine_origin_tracking_depth() +extern int _PyEval_GetCoroutineOriginTrackingDepth(void); +extern int _PyEval_SetCoroutineOriginTrackingDepth(int depth); + +extern void _PyEval_Fini(void); + + +extern PyObject* _PyEval_GetBuiltins(PyThreadState *tstate); + +// Trampoline API + +typedef struct { + // Callback to initialize the trampoline state + void* (*init_state)(void); + // Callback to register every trampoline being created + void (*write_state)(void* state, const void *code_addr, + unsigned int code_size, PyCodeObject* code); + // Callback to free the trampoline state + int (*free_state)(void* state); +} _PyPerf_Callbacks; + +extern int _PyPerfTrampoline_SetCallbacks(_PyPerf_Callbacks *); +extern void _PyPerfTrampoline_GetCallbacks(_PyPerf_Callbacks *); +extern int _PyPerfTrampoline_Init(int activate); +extern int _PyPerfTrampoline_Fini(void); +extern int _PyIsPerfTrampolineActive(void); +extern PyStatus _PyPerfTrampoline_AfterFork_Child(void); +#ifdef PY_HAVE_PERF_TRAMPOLINE +extern _PyPerf_Callbacks _Py_perfmap_callbacks; +extern _PyPerf_Callbacks _Py_perfmap_jit_callbacks; +#endif + +static inline PyObject* +_PyEval_EvalFrame(PyThreadState *tstate, _PyInterpreterFrame *frame, int throwflag) +{ + EVAL_CALL_STAT_INC(EVAL_CALL_TOTAL); + if (tstate->interp->eval_frame == NULL) { + return _PyEval_EvalFrameDefault(tstate, frame, throwflag); + } + return tstate->interp->eval_frame(tstate, frame, throwflag); +} + +extern PyObject* +_PyEval_Vector(PyThreadState *tstate, + PyFunctionObject *func, PyObject *locals, + PyObject* const* args, size_t argcount, + PyObject *kwnames); + +extern int _PyEval_ThreadsInitialized(void); +extern void _PyEval_InitGIL(PyThreadState *tstate, int own_gil); +extern void _PyEval_FiniGIL(PyInterpreterState *interp); + +extern void _PyEval_AcquireLock(PyThreadState *tstate); + +extern void _PyEval_ReleaseLock(PyInterpreterState *, PyThreadState *, + int final_release); + +#ifdef Py_GIL_DISABLED +// Returns 0 or 1 if the GIL for the given thread's interpreter is disabled or +// enabled, respectively. +// +// The enabled state of the GIL will not change while one or more threads are +// attached. +static inline int +_PyEval_IsGILEnabled(PyThreadState *tstate) +{ + struct _gil_runtime_state *gil = tstate->interp->ceval.gil; + return _Py_atomic_load_int_relaxed(&gil->enabled) != 0; +} + +// Enable or disable the GIL used by the interpreter that owns tstate, which +// must be the current thread. This may affect other interpreters, if the GIL +// is shared. All three functions will be no-ops (and return 0) if the +// interpreter's `enable_gil' config is not _PyConfig_GIL_DEFAULT. +// +// Every call to _PyEval_EnableGILTransient() must be paired with exactly one +// call to either _PyEval_EnableGILPermanent() or +// _PyEval_DisableGIL(). _PyEval_EnableGILPermanent() and _PyEval_DisableGIL() +// must only be called while the GIL is enabled from a call to +// _PyEval_EnableGILTransient(). +// +// _PyEval_EnableGILTransient() returns 1 if it enabled the GIL, or 0 if the +// GIL was already enabled, whether transiently or permanently. The caller will +// hold the GIL upon return. +// +// _PyEval_EnableGILPermanent() returns 1 if it permanently enabled the GIL +// (which must already be enabled), or 0 if it was already permanently +// enabled. Once _PyEval_EnableGILPermanent() has been called once, all +// subsequent calls to any of the three functions will be no-ops. +// +// _PyEval_DisableGIL() returns 1 if it disabled the GIL, or 0 if the GIL was +// kept enabled because of another request, whether transient or permanent. +// +// All three functions must be called by an attached thread (this implies that +// if the GIL is enabled, the current thread must hold it). +extern int _PyEval_EnableGILTransient(PyThreadState *tstate); +extern int _PyEval_EnableGILPermanent(PyThreadState *tstate); +extern int _PyEval_DisableGIL(PyThreadState *state); + + +static inline _Py_CODEUNIT * +_PyEval_GetExecutableCode(PyThreadState *tstate, PyCodeObject *co) +{ + _Py_CODEUNIT *bc = _PyCode_GetTLBCFast(tstate, co); + if (bc != NULL) { + return bc; + } + return _PyCode_GetTLBC(co); +} + +#endif + +extern void _PyEval_DeactivateOpCache(void); + + +/* --- _Py_EnterRecursiveCall() ----------------------------------------- */ + +static inline int _Py_MakeRecCheck(PyThreadState *tstate) { + uintptr_t here_addr = _Py_get_machine_stack_pointer(); + _PyThreadStateImpl *_tstate = (_PyThreadStateImpl *)tstate; + // Overflow if stack pointer is between soft limit and the base of the hardware stack. + // If it is below the hardware stack base, assume that we have the wrong stack limits, and do nothing. + // We could have the wrong stack limits because of limited platform support, or user-space threads. +#if _Py_STACK_GROWS_DOWN + return here_addr < _tstate->c_stack_soft_limit && here_addr >= _tstate->c_stack_soft_limit - 2 * _PyOS_STACK_MARGIN_BYTES; +#else + return here_addr > _tstate->c_stack_soft_limit && here_addr <= _tstate->c_stack_soft_limit + 2 * _PyOS_STACK_MARGIN_BYTES; +#endif +} + +// Export for '_json' shared extension, used via _Py_EnterRecursiveCall() +// static inline function. +PyAPI_FUNC(int) _Py_CheckRecursiveCall( + PyThreadState *tstate, + const char *where); + +int _Py_CheckRecursiveCallPy( + PyThreadState *tstate); + +static inline int _Py_EnterRecursiveCallTstate(PyThreadState *tstate, + const char *where) { + return (_Py_MakeRecCheck(tstate) && _Py_CheckRecursiveCall(tstate, where)); +} + +static inline int _Py_EnterRecursiveCall(const char *where) { + PyThreadState *tstate = _PyThreadState_GET(); + return _Py_EnterRecursiveCallTstate(tstate, where); +} + +static inline void _Py_LeaveRecursiveCallTstate(PyThreadState *tstate) { + (void)tstate; +} + +PyAPI_FUNC(void) _Py_InitializeRecursionLimits(PyThreadState *tstate); + +static inline int _Py_ReachedRecursionLimit(PyThreadState *tstate) { + uintptr_t here_addr = _Py_get_machine_stack_pointer(); + _PyThreadStateImpl *_tstate = (_PyThreadStateImpl *)tstate; + assert(_tstate->c_stack_hard_limit != 0); +#if _Py_STACK_GROWS_DOWN + return here_addr <= _tstate->c_stack_soft_limit; +#else + return here_addr >= _tstate->c_stack_soft_limit; +#endif +} + +static inline void _Py_LeaveRecursiveCall(void) { +} + +extern _PyInterpreterFrame* _PyEval_GetFrame(void); + +extern PyObject * _PyEval_GetGlobalsFromRunningMain(PyThreadState *); +extern int _PyEval_EnsureBuiltins( + PyThreadState *, + PyObject *, + PyObject **p_builtins); +extern int _PyEval_EnsureBuiltinsWithModule( + PyThreadState *, + PyObject *, + PyObject **p_builtins); + +PyAPI_FUNC(PyObject *)_Py_MakeCoro(PyFunctionObject *func); + +/* Handle signals, pending calls, GIL drop request + and asynchronous exception */ +PyAPI_FUNC(int) _Py_HandlePending(PyThreadState *tstate); + +extern PyObject * _PyEval_GetFrameLocals(void); + +typedef PyObject *(*conversion_func)(PyObject *); + +PyAPI_DATA(const binaryfunc) _PyEval_BinaryOps[]; +PyAPI_DATA(const conversion_func) _PyEval_ConversionFuncs[]; + +typedef struct _special_method { + PyObject *name; + const char *error; + const char *error_suggestion; // improved optional suggestion +} _Py_SpecialMethod; + +PyAPI_DATA(const _Py_SpecialMethod) _Py_SpecialMethods[]; +PyAPI_DATA(const size_t) _Py_FunctionAttributeOffsets[]; + +PyAPI_FUNC(int) _PyEval_CheckExceptStarTypeValid(PyThreadState *tstate, PyObject* right); +PyAPI_FUNC(int) _PyEval_CheckExceptTypeValid(PyThreadState *tstate, PyObject* right); +PyAPI_FUNC(int) _PyEval_ExceptionGroupMatch(_PyInterpreterFrame *, PyObject* exc_value, PyObject *match_type, PyObject **match, PyObject **rest); +PyAPI_FUNC(void) _PyEval_FormatAwaitableError(PyThreadState *tstate, PyTypeObject *type, int oparg); +PyAPI_FUNC(void) _PyEval_FormatExcCheckArg(PyThreadState *tstate, PyObject *exc, const char *format_str, PyObject *obj); +PyAPI_FUNC(void) _PyEval_FormatExcUnbound(PyThreadState *tstate, PyCodeObject *co, int oparg); +PyAPI_FUNC(void) _PyEval_FormatKwargsError(PyThreadState *tstate, PyObject *func, PyObject *kwargs); +PyAPI_FUNC(PyObject *) _PyEval_ImportFrom(PyThreadState *, PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) _PyEval_ImportName(PyThreadState *, _PyInterpreterFrame *, PyObject *, PyObject *, PyObject *); +PyAPI_FUNC(PyObject *)_PyEval_MatchClass(PyThreadState *tstate, PyObject *subject, PyObject *type, Py_ssize_t nargs, PyObject *kwargs); +PyAPI_FUNC(PyObject *)_PyEval_MatchKeys(PyThreadState *tstate, PyObject *map, PyObject *keys); +PyAPI_FUNC(void) _PyEval_MonitorRaise(PyThreadState *tstate, _PyInterpreterFrame *frame, _Py_CODEUNIT *instr); +PyAPI_FUNC(bool) _PyEval_NoToolsForUnwind(PyThreadState *tstate); +PyAPI_FUNC(int) _PyEval_UnpackIterableStackRef(PyThreadState *tstate, PyObject *v, int argcnt, int argcntafter, _PyStackRef *sp); +PyAPI_FUNC(void) _PyEval_FrameClearAndPop(PyThreadState *tstate, _PyInterpreterFrame *frame); +PyAPI_FUNC(PyObject **) _PyObjectArray_FromStackRefArray(_PyStackRef *input, Py_ssize_t nargs, PyObject **scratch); + +PyAPI_FUNC(void) _PyObjectArray_Free(PyObject **array, PyObject **scratch); + +PyAPI_FUNC(PyObject *) _PyEval_GetANext(PyObject *aiter); +PyAPI_FUNC(void) _PyEval_LoadGlobalStackRef(PyObject *globals, PyObject *builtins, PyObject *name, _PyStackRef *writeto); +PyAPI_FUNC(PyObject *) _PyEval_GetAwaitable(PyObject *iterable, int oparg); +PyAPI_FUNC(PyObject *) _PyEval_LoadName(PyThreadState *tstate, _PyInterpreterFrame *frame, PyObject *name); +PyAPI_FUNC(int) +_Py_Check_ArgsIterable(PyThreadState *tstate, PyObject *func, PyObject *args); + +/* + * Indicate whether a special method of given 'oparg' can use the (improved) + * alternative error message instead. Only methods loaded by LOAD_SPECIAL + * support alternative error messages. + * + * Symbol is exported for the JIT (see discussion on GH-132218). + */ +PyAPI_FUNC(int) +_PyEval_SpecialMethodCanSuggest(PyObject *self, int oparg); + +/* Bits that can be set in PyThreadState.eval_breaker */ +#define _PY_GIL_DROP_REQUEST_BIT (1U << 0) +#define _PY_SIGNALS_PENDING_BIT (1U << 1) +#define _PY_CALLS_TO_DO_BIT (1U << 2) +#define _PY_ASYNC_EXCEPTION_BIT (1U << 3) +#define _PY_GC_SCHEDULED_BIT (1U << 4) +#define _PY_EVAL_PLEASE_STOP_BIT (1U << 5) +#define _PY_EVAL_EXPLICIT_MERGE_BIT (1U << 6) +#define _PY_EVAL_JIT_INVALIDATE_COLD_BIT (1U << 7) + +/* Reserve a few bits for future use */ +#define _PY_EVAL_EVENTS_BITS 8 +#define _PY_EVAL_EVENTS_MASK ((1 << _PY_EVAL_EVENTS_BITS)-1) + +static inline void +_Py_set_eval_breaker_bit(PyThreadState *tstate, uintptr_t bit) +{ + _Py_atomic_or_uintptr(&tstate->eval_breaker, bit); +} + +static inline void +_Py_unset_eval_breaker_bit(PyThreadState *tstate, uintptr_t bit) +{ + _Py_atomic_and_uintptr(&tstate->eval_breaker, ~bit); +} + +static inline int +_Py_eval_breaker_bit_is_set(PyThreadState *tstate, uintptr_t bit) +{ + uintptr_t b = _Py_atomic_load_uintptr_relaxed(&tstate->eval_breaker); + return (b & bit) != 0; +} + +// Free-threaded builds use these functions to set or unset a bit on all +// threads in the given interpreter. +void _Py_set_eval_breaker_bit_all(PyInterpreterState *interp, uintptr_t bit); +void _Py_unset_eval_breaker_bit_all(PyInterpreterState *interp, uintptr_t bit); + +PyAPI_FUNC(_PyStackRef) _PyFloat_FromDouble_ConsumeInputs(_PyStackRef left, _PyStackRef right, double value); + +#ifndef Py_SUPPORTS_REMOTE_DEBUG + #if defined(__APPLE__) + #include + # if !defined(TARGET_OS_OSX) +// Older macOS SDKs do not define TARGET_OS_OSX + # define TARGET_OS_OSX 1 + # endif + #endif + #if ((defined(__APPLE__) && TARGET_OS_OSX) || defined(MS_WINDOWS) || (defined(__linux__) && HAVE_PROCESS_VM_READV)) + # define Py_SUPPORTS_REMOTE_DEBUG 1 + #endif +#endif + +#if defined(Py_REMOTE_DEBUG) && defined(Py_SUPPORTS_REMOTE_DEBUG) +extern int _PyRunRemoteDebugger(PyThreadState *tstate); +#endif + +/* Special methods used by LOAD_SPECIAL */ +#define SPECIAL___ENTER__ 0 +#define SPECIAL___EXIT__ 1 +#define SPECIAL___AENTER__ 2 +#define SPECIAL___AEXIT__ 3 +#define SPECIAL_MAX 3 + +PyAPI_FUNC(_PyStackRef) +_Py_LoadAttr_StackRefSteal( + PyThreadState *tstate, _PyStackRef owner, + PyObject *name, _PyStackRef *self_or_null); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_CEVAL_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_ceval_state.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_ceval_state.h new file mode 100644 index 0000000000000000000000000000000000000000..64128a78136e56378107d45b3f92068922ddd8cf --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_ceval_state.h @@ -0,0 +1,48 @@ +#ifndef Py_INTERNAL_CEVAL_STATE_H +#define Py_INTERNAL_CEVAL_STATE_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_gil.h" // struct _gil_runtime_state + + +#define MAXPENDINGCALLS PENDINGCALLSARRAYSIZE +/* For interpreter-level pending calls, we want to avoid spending too + much time on pending calls in any one thread, so we apply a limit. */ +#if MAXPENDINGCALLS > 100 +# define MAXPENDINGCALLSLOOP 100 +#else +# define MAXPENDINGCALLSLOOP MAXPENDINGCALLS +#endif + +/* We keep the number small to preserve as much compatibility + as possible with earlier versions. */ +#define MAXPENDINGCALLS_MAIN 32 +/* For the main thread, we want to make sure all pending calls are + run at once, for the sake of prompt signal handling. This is + unlikely to cause any problems since there should be very few + pending calls for the main thread. */ +#define MAXPENDINGCALLSLOOP_MAIN 0 + + +#ifdef PY_HAVE_PERF_TRAMPOLINE +# define _PyEval_RUNTIME_PERF_INIT \ + { \ + .status = PERF_STATUS_NO_INIT, \ + .extra_code_index = -1, \ + .persist_after_fork = 0, \ + } +#else +# define _PyEval_RUNTIME_PERF_INIT {0} +#endif + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_CEVAL_STATE_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_code.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_code.h new file mode 100644 index 0000000000000000000000000000000000000000..dc0ea9c669b731262cd1806cb84c88b62c13ad9b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_code.h @@ -0,0 +1,671 @@ +#ifndef Py_INTERNAL_CODE_H +#define Py_INTERNAL_CODE_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_backoff.h" // _Py_BackoffCounter +#include "pycore_structs.h" // _Py_CODEUNIT +#include "pycore_tstate.h" // _PyThreadStateImpl + + +#define _PyCode_CODE(CO) _Py_RVALUE((_Py_CODEUNIT *)(CO)->co_code_adaptive) +#define _PyCode_NBYTES(CO) (Py_SIZE(CO) * (Py_ssize_t)sizeof(_Py_CODEUNIT)) + + +/* These macros only remain defined for compatibility. */ +#define _Py_OPCODE(word) ((word).op.code) +#define _Py_OPARG(word) ((word).op.arg) + +static inline _Py_CODEUNIT +_py_make_codeunit(uint8_t opcode, uint8_t oparg) +{ + // No designated initialisers because of C++ compat + _Py_CODEUNIT word; + word.op.code = opcode; + word.op.arg = oparg; + return word; +} + +static inline void +_py_set_opcode(_Py_CODEUNIT *word, uint8_t opcode) +{ + word->op.code = opcode; +} + +#define _Py_MAKE_CODEUNIT(opcode, oparg) _py_make_codeunit((opcode), (oparg)) +#define _Py_SET_OPCODE(word, opcode) _py_set_opcode(&(word), (opcode)) + + +// We hide some of the newer PyCodeObject fields behind macros. +// This helps with backporting certain changes to 3.12. +#define _PyCode_HAS_EXECUTORS(CODE) \ + (CODE->co_executors != NULL) +#define _PyCode_HAS_INSTRUMENTATION(CODE) \ + (CODE->_co_instrumentation_version > 0) + + +extern PyStatus _PyCode_Init(PyInterpreterState *interp); +extern void _PyCode_Fini(PyInterpreterState *interp); + + +/* PEP 659 + * Specialization and quickening structs and helper functions + */ + + +// Inline caches. If you change the number of cache entries for an instruction, +// you must *also* update the number of cache entries in Lib/opcode.py and bump +// the magic number in Lib/importlib/_bootstrap_external.py! + +#define CACHE_ENTRIES(cache) (sizeof(cache)/sizeof(_Py_CODEUNIT)) + +typedef struct { + _Py_BackoffCounter counter; + uint16_t module_keys_version; + uint16_t builtin_keys_version; + uint16_t index; +} _PyLoadGlobalCache; + +#define INLINE_CACHE_ENTRIES_LOAD_GLOBAL CACHE_ENTRIES(_PyLoadGlobalCache) + +typedef struct { + _Py_BackoffCounter counter; + uint16_t external_cache[4]; +} _PyBinaryOpCache; + +#define INLINE_CACHE_ENTRIES_BINARY_OP CACHE_ENTRIES(_PyBinaryOpCache) + +typedef struct { + _Py_BackoffCounter counter; +} _PyUnpackSequenceCache; + +#define INLINE_CACHE_ENTRIES_UNPACK_SEQUENCE \ + CACHE_ENTRIES(_PyUnpackSequenceCache) + +typedef struct { + _Py_BackoffCounter counter; +} _PyCompareOpCache; + +#define INLINE_CACHE_ENTRIES_COMPARE_OP CACHE_ENTRIES(_PyCompareOpCache) + +typedef struct { + _Py_BackoffCounter counter; +} _PySuperAttrCache; + +#define INLINE_CACHE_ENTRIES_LOAD_SUPER_ATTR CACHE_ENTRIES(_PySuperAttrCache) + +typedef struct { + _Py_BackoffCounter counter; + uint16_t version[2]; + uint16_t index; +} _PyAttrCache; + +typedef struct { + _Py_BackoffCounter counter; + uint16_t type_version[2]; + union { + uint16_t keys_version[2]; + uint16_t dict_offset; + }; + uint16_t descr[4]; +} _PyLoadMethodCache; + + +// MUST be the max(_PyAttrCache, _PyLoadMethodCache) +#define INLINE_CACHE_ENTRIES_LOAD_ATTR CACHE_ENTRIES(_PyLoadMethodCache) + +#define INLINE_CACHE_ENTRIES_STORE_ATTR CACHE_ENTRIES(_PyAttrCache) + +typedef struct { + _Py_BackoffCounter counter; + uint16_t func_version[2]; +} _PyCallCache; + +#define INLINE_CACHE_ENTRIES_CALL CACHE_ENTRIES(_PyCallCache) +#define INLINE_CACHE_ENTRIES_CALL_KW CACHE_ENTRIES(_PyCallCache) + +typedef struct { + _Py_BackoffCounter counter; +} _PyStoreSubscrCache; + +#define INLINE_CACHE_ENTRIES_STORE_SUBSCR CACHE_ENTRIES(_PyStoreSubscrCache) + +typedef struct { + _Py_BackoffCounter counter; +} _PyForIterCache; + +#define INLINE_CACHE_ENTRIES_FOR_ITER CACHE_ENTRIES(_PyForIterCache) + +typedef struct { + _Py_BackoffCounter counter; +} _PySendCache; + +#define INLINE_CACHE_ENTRIES_SEND CACHE_ENTRIES(_PySendCache) + +typedef struct { + _Py_BackoffCounter counter; + uint16_t version[2]; +} _PyToBoolCache; + +#define INLINE_CACHE_ENTRIES_TO_BOOL CACHE_ENTRIES(_PyToBoolCache) + +typedef struct { + _Py_BackoffCounter counter; +} _PyContainsOpCache; + +#define INLINE_CACHE_ENTRIES_CONTAINS_OP CACHE_ENTRIES(_PyContainsOpCache) + +/* "Locals plus" for a code object is the set of locals + cell vars + + * free vars. This relates to variable names as well as offsets into + * the "fast locals" storage array of execution frames. The compiler + * builds the list of names, their offsets, and the corresponding + * kind of local. + * + * Those kinds represent the source of the initial value and the + * variable's scope (as related to closures). A "local" is an + * argument or other variable defined in the current scope. A "free" + * variable is one that is defined in an outer scope and comes from + * the function's closure. A "cell" variable is a local that escapes + * into an inner function as part of a closure, and thus must be + * wrapped in a cell. Any "local" can also be a "cell", but the + * "free" kind is mutually exclusive with both. + */ + +// Note that these all fit within a byte, as do combinations. +#define CO_FAST_ARG_POS (0x02) // pos-only, pos-or-kw, varargs +#define CO_FAST_ARG_KW (0x04) // kw-only, pos-or-kw, varkwargs +#define CO_FAST_ARG_VAR (0x08) // varargs, varkwargs +#define CO_FAST_ARG (CO_FAST_ARG_POS | CO_FAST_ARG_KW | CO_FAST_ARG_VAR) +#define CO_FAST_HIDDEN (0x10) +#define CO_FAST_LOCAL (0x20) +#define CO_FAST_CELL (0x40) +#define CO_FAST_FREE (0x80) + +typedef unsigned char _PyLocals_Kind; + +static inline _PyLocals_Kind +_PyLocals_GetKind(PyObject *kinds, int i) +{ + assert(PyBytes_Check(kinds)); + assert(0 <= i && i < PyBytes_GET_SIZE(kinds)); + char *ptr = PyBytes_AS_STRING(kinds); + return (_PyLocals_Kind)(ptr[i]); +} + +static inline void +_PyLocals_SetKind(PyObject *kinds, int i, _PyLocals_Kind kind) +{ + assert(PyBytes_Check(kinds)); + assert(0 <= i && i < PyBytes_GET_SIZE(kinds)); + char *ptr = PyBytes_AS_STRING(kinds); + ptr[i] = (char) kind; +} + + +struct _PyCodeConstructor { + /* metadata */ + PyObject *filename; + PyObject *name; + PyObject *qualname; + int flags; + + /* the code */ + PyObject *code; + int firstlineno; + PyObject *linetable; + + /* used by the code */ + PyObject *consts; + PyObject *names; + + /* mapping frame offsets to information */ + PyObject *localsplusnames; // Tuple of strings + PyObject *localspluskinds; // Bytes object, one byte per variable + + /* args (within varnames) */ + int argcount; + int posonlyargcount; + // XXX Replace argcount with posorkwargcount (argcount - posonlyargcount). + int kwonlyargcount; + + /* needed to create the frame */ + int stacksize; + + /* used by the eval loop */ + PyObject *exceptiontable; +}; + +// Using an "arguments struct" like this is helpful for maintainability +// in a case such as this with many parameters. It does bear a risk: +// if the struct changes and callers are not updated properly then the +// compiler will not catch problems (like a missing argument). This can +// cause hard-to-debug problems. The risk is mitigated by the use of +// check_code() in codeobject.c. However, we may decide to switch +// back to a regular function signature. Regardless, this approach +// wouldn't be appropriate if this weren't a strictly internal API. +// (See the comments in https://github.com/python/cpython/pull/26258.) +extern int _PyCode_Validate(struct _PyCodeConstructor *); +extern PyCodeObject* _PyCode_New(struct _PyCodeConstructor *); + + +/* Private API */ + +/* Getters for internal PyCodeObject data. */ +extern PyObject* _PyCode_GetVarnames(PyCodeObject *); +extern PyObject* _PyCode_GetCellvars(PyCodeObject *); +extern PyObject* _PyCode_GetFreevars(PyCodeObject *); +extern PyObject* _PyCode_GetCode(PyCodeObject *); + +/** API for initializing the line number tables. */ +extern int _PyCode_InitAddressRange(PyCodeObject* co, PyCodeAddressRange *bounds); + +/** Out of process API for initializing the location table. */ +extern void _PyLineTable_InitAddressRange( + const char *linetable, + Py_ssize_t length, + int firstlineno, + PyCodeAddressRange *range); + +/** API for traversing the line number table. */ +extern int _PyLineTable_NextAddressRange(PyCodeAddressRange *range); +extern int _PyLineTable_PreviousAddressRange(PyCodeAddressRange *range); + +// Similar to PyCode_Addr2Line(), but return -1 if the code object is invalid +// and can be called without an attached tstate. Used by dump_frame() in +// Python/traceback.c. The function uses heuristics to detect freed memory, +// it's not 100% reliable. +extern int _PyCode_SafeAddr2Line(PyCodeObject *co, int addr); + + +/** API for executors */ +extern void _PyCode_Clear_Executors(PyCodeObject *code); + + +#ifdef Py_GIL_DISABLED +// gh-115999 tracks progress on addressing this. +#define ENABLE_SPECIALIZATION 0 +// Use this to enable specialization families once they are thread-safe. All +// uses will be replaced with ENABLE_SPECIALIZATION once all families are +// thread-safe. +#define ENABLE_SPECIALIZATION_FT 1 +#else +#define ENABLE_SPECIALIZATION 1 +#define ENABLE_SPECIALIZATION_FT ENABLE_SPECIALIZATION +#endif + +/* Specialization functions */ + +extern void _Py_Specialize_LoadSuperAttr(_PyStackRef global_super, _PyStackRef cls, + _Py_CODEUNIT *instr, int load_method); +extern void _Py_Specialize_LoadAttr(_PyStackRef owner, _Py_CODEUNIT *instr, + PyObject *name); +extern void _Py_Specialize_StoreAttr(_PyStackRef owner, _Py_CODEUNIT *instr, + PyObject *name); +extern void _Py_Specialize_LoadGlobal(PyObject *globals, PyObject *builtins, + _Py_CODEUNIT *instr, PyObject *name); +extern void _Py_Specialize_StoreSubscr(_PyStackRef container, _PyStackRef sub, + _Py_CODEUNIT *instr); +extern void _Py_Specialize_Call(_PyStackRef callable, _Py_CODEUNIT *instr, + int nargs); +extern void _Py_Specialize_CallKw(_PyStackRef callable, _Py_CODEUNIT *instr, + int nargs); +extern void _Py_Specialize_BinaryOp(_PyStackRef lhs, _PyStackRef rhs, _Py_CODEUNIT *instr, + int oparg, _PyStackRef *locals); +extern void _Py_Specialize_CompareOp(_PyStackRef lhs, _PyStackRef rhs, + _Py_CODEUNIT *instr, int oparg); +extern void _Py_Specialize_UnpackSequence(_PyStackRef seq, _Py_CODEUNIT *instr, + int oparg); +extern void _Py_Specialize_ForIter(_PyStackRef iter, _Py_CODEUNIT *instr, int oparg); +extern void _Py_Specialize_Send(_PyStackRef receiver, _Py_CODEUNIT *instr); +extern void _Py_Specialize_ToBool(_PyStackRef value, _Py_CODEUNIT *instr); +extern void _Py_Specialize_ContainsOp(_PyStackRef value, _Py_CODEUNIT *instr); +extern void _Py_GatherStats_GetIter(_PyStackRef iterable); + +// Utility functions for reading/writing 32/64-bit values in the inline caches. +// Great care should be taken to ensure that these functions remain correct and +// performant! They should compile to just "move" instructions on all supported +// compilers and platforms. + +// We use memcpy to let the C compiler handle unaligned accesses and endianness +// issues for us. It also seems to produce better code than manual copying for +// most compilers (see https://blog.regehr.org/archives/959 for more info). + +static inline void +write_u32(uint16_t *p, uint32_t val) +{ + memcpy(p, &val, sizeof(val)); +} + +static inline void +write_u64(uint16_t *p, uint64_t val) +{ + memcpy(p, &val, sizeof(val)); +} + +static inline void +write_ptr(uint16_t *p, void *val) +{ + memcpy(p, &val, sizeof(val)); +} + +static inline uint16_t +read_u16(uint16_t *p) +{ + return *p; +} + +static inline uint32_t +read_u32(uint16_t *p) +{ + uint32_t val; + memcpy(&val, p, sizeof(val)); + return val; +} + +static inline uint64_t +read_u64(uint16_t *p) +{ + uint64_t val; + memcpy(&val, p, sizeof(val)); + return val; +} + +static inline PyObject * +read_obj(uint16_t *p) +{ + PyObject *val; + memcpy(&val, p, sizeof(val)); + return val; +} + +/* See InternalDocs/exception_handling.md for details. + */ +static inline unsigned char * +parse_varint(unsigned char *p, int *result) { + int val = p[0] & 63; + while (p[0] & 64) { + p++; + val = (val << 6) | (p[0] & 63); + } + *result = val; + return p+1; +} + +static inline int +write_varint(uint8_t *ptr, unsigned int val) +{ + int written = 1; + while (val >= 64) { + *ptr++ = 64 | (val & 63); + val >>= 6; + written++; + } + *ptr = (uint8_t)val; + return written; +} + +static inline int +write_signed_varint(uint8_t *ptr, int val) +{ + unsigned int uval; + if (val < 0) { + // (unsigned int)(-val) has an undefined behavior for INT_MIN + uval = ((0 - (unsigned int)val) << 1) | 1; + } + else { + uval = (unsigned int)val << 1; + } + return write_varint(ptr, uval); +} + +static inline int +write_location_entry_start(uint8_t *ptr, int code, int length) +{ + assert((code & 15) == code); + *ptr = 128 | (uint8_t)(code << 3) | (uint8_t)(length - 1); + return 1; +} + + +/** Counters + * The first 16-bit value in each inline cache is a counter. + * + * When counting executions until the next specialization attempt, + * exponential backoff is used to reduce the number of specialization failures. + * See pycore_backoff.h for more details. + * On a specialization failure, the backoff counter is restarted. + */ + +// A value of 1 means that we attempt to specialize the *second* time each +// instruction is executed. Executing twice is a much better indicator of +// "hotness" than executing once, but additional warmup delays only prevent +// specialization. Most types stabilize by the second execution, too: +#define ADAPTIVE_WARMUP_VALUE 1 +#define ADAPTIVE_WARMUP_BACKOFF 1 + +// A value of 52 means that we attempt to re-specialize after 53 misses (a prime +// number, useful for avoiding artifacts if every nth value is a different type +// or something). Setting the backoff to 0 means that the counter is reset to +// the same state as a warming-up instruction (value == 1, backoff == 1) after +// deoptimization. This isn't strictly necessary, but it is bit easier to reason +// about when thinking about the opcode transitions as a state machine: +#define ADAPTIVE_COOLDOWN_VALUE 52 +#define ADAPTIVE_COOLDOWN_BACKOFF 0 + +// Can't assert this in pycore_backoff.h because of header order dependencies +#if SIDE_EXIT_INITIAL_VALUE <= ADAPTIVE_COOLDOWN_VALUE +# error "Cold exit value should be larger than adaptive cooldown value" +#endif + +static inline _Py_BackoffCounter +adaptive_counter_bits(uint16_t value, uint16_t backoff) { + return make_backoff_counter(value, backoff); +} + +static inline _Py_BackoffCounter +adaptive_counter_warmup(void) { + return adaptive_counter_bits(ADAPTIVE_WARMUP_VALUE, + ADAPTIVE_WARMUP_BACKOFF); +} + +static inline _Py_BackoffCounter +adaptive_counter_cooldown(void) { + return adaptive_counter_bits(ADAPTIVE_COOLDOWN_VALUE, + ADAPTIVE_COOLDOWN_BACKOFF); +} + +static inline _Py_BackoffCounter +adaptive_counter_backoff(_Py_BackoffCounter counter) { + return restart_backoff_counter(counter); +} + +/* Specialization Extensions */ + +/* callbacks for an external specialization */ +typedef int (*binaryopguardfunc)(PyObject *lhs, PyObject *rhs); +typedef PyObject *(*binaryopactionfunc)(PyObject *lhs, PyObject *rhs); + +typedef struct { + int oparg; + binaryopguardfunc guard; + binaryopactionfunc action; +} _PyBinaryOpSpecializationDescr; + +/* Comparison bit masks. */ + +/* Note this evaluates its arguments twice each */ +#define COMPARISON_BIT(x, y) (1 << (2 * ((x) >= (y)) + ((x) <= (y)))) + +/* + * The following bits are chosen so that the value of + * COMPARSION_BIT(left, right) + * masked by the values below will be non-zero if the + * comparison is true, and zero if it is false */ + +/* This is for values that are unordered, ie. NaN, not types that are unordered, e.g. sets */ +#define COMPARISON_UNORDERED 1 + +#define COMPARISON_LESS_THAN 2 +#define COMPARISON_GREATER_THAN 4 +#define COMPARISON_EQUALS 8 + +#define COMPARISON_NOT_EQUALS (COMPARISON_UNORDERED | COMPARISON_LESS_THAN | COMPARISON_GREATER_THAN) + +extern int _Py_Instrument(PyCodeObject *co, PyInterpreterState *interp); + +extern _Py_CODEUNIT _Py_GetBaseCodeUnit(PyCodeObject *code, int offset); + +extern int _PyInstruction_GetLength(PyCodeObject *code, int offset); + +extern PyObject *_PyInstrumentation_BranchesIterator(PyCodeObject *code); + +struct _PyCode8 _PyCode_DEF(8); + +PyAPI_DATA(const struct _PyCode8) _Py_InitCleanup; + +#ifdef Py_GIL_DISABLED + +static inline _PyCodeArray * +_PyCode_GetTLBCArray(PyCodeObject *co) +{ + return _Py_STATIC_CAST(_PyCodeArray *, + _Py_atomic_load_ptr_acquire(&co->co_tlbc)); +} + +// Return a pointer to the thread-local bytecode for the current thread, if it +// exists. +static inline _Py_CODEUNIT * +_PyCode_GetTLBCFast(PyThreadState *tstate, PyCodeObject *co) +{ + _PyCodeArray *code = _PyCode_GetTLBCArray(co); + int32_t idx = ((_PyThreadStateImpl*) tstate)->tlbc_index; + if (idx < code->size && code->entries[idx] != NULL) { + return (_Py_CODEUNIT *) code->entries[idx]; + } + return NULL; +} + +// Return a pointer to the thread-local bytecode for the current thread, +// creating it if necessary. +extern _Py_CODEUNIT *_PyCode_GetTLBC(PyCodeObject *co); + +// Reserve an index for the current thread into thread-local bytecode +// arrays +// +// Returns the reserved index or -1 on error. +extern int32_t _Py_ReserveTLBCIndex(PyInterpreterState *interp); + +// Release the current thread's index into thread-local bytecode arrays +extern void _Py_ClearTLBCIndex(_PyThreadStateImpl *tstate); + +// Free all TLBC copies not associated with live threads. +// +// Returns 0 on success or -1 on error. +extern int _Py_ClearUnusedTLBC(PyInterpreterState *interp); +#endif + + +typedef struct { + int total; + struct co_locals_counts { + int total; + struct { + int total; + int numposonly; + int numposorkw; + int numkwonly; + int varargs; + int varkwargs; + } args; + int numpure; + struct { + int total; + // numargs does not contribute to locals.total. + int numargs; + int numothers; + } cells; + struct { + int total; + int numpure; + int numcells; + } hidden; + } locals; + int numfree; // nonlocal + struct co_unbound_counts { + int total; + struct { + int total; + int numglobal; + int numbuiltin; + int numunknown; + } globals; + int numattrs; + int numunknown; + } unbound; +} _PyCode_var_counts_t; + +PyAPI_FUNC(void) _PyCode_GetVarCounts( + PyCodeObject *, + _PyCode_var_counts_t *); +PyAPI_FUNC(int) _PyCode_SetUnboundVarCounts( + PyThreadState *, + PyCodeObject *, + _PyCode_var_counts_t *, + PyObject *globalnames, + PyObject *attrnames, + PyObject *globalsns, + PyObject *builtinsns); + + +/* "Stateless" code is a function or code object which does not rely on + * external state or internal state. It may rely on arguments and + * builtins, but not globals or a closure. Thus it does not rely + * on __globals__ or __closure__, and a stateless function + * is equivalent to its code object. + * + * Stateless code also does not keep any persistent state + * of its own, so it can't have any executors, monitoring, + * instrumentation, or "extras" (i.e. co_extra). + * + * Stateless code may create nested functions, including closures. + * However, nested functions must themselves be stateless, except they + * *can* close on the enclosing locals. + * + * Stateless code may return any value, including nested functions and closures. + * + * Stateless code that takes no arguments and doesn't return anything + * may be treated like a script. + * + * We consider stateless code to be "portable" if it does not return + * any object that holds a reference to any of the code's locals. Thus + * generators and coroutines are not portable. Likewise a function + * that returns a closure is not portable. The concept of + * portability is useful in cases where the code is run + * in a different execution context than where + * the return value will be used. */ + +PyAPI_FUNC(int) _PyCode_CheckNoInternalState(PyCodeObject *, const char **); +PyAPI_FUNC(int) _PyCode_CheckNoExternalState( + PyCodeObject *, + _PyCode_var_counts_t *, + const char **); +PyAPI_FUNC(int) _PyCode_VerifyStateless( + PyThreadState *, + PyCodeObject *, + PyObject *globalnames, + PyObject *globalsns, + PyObject *builtinsns); + +PyAPI_FUNC(int) _PyCode_CheckPureFunction(PyCodeObject *, const char **); +PyAPI_FUNC(int) _PyCode_ReturnsOnlyNone(PyCodeObject *); + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_CODE_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_codecs.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_codecs.h new file mode 100644 index 0000000000000000000000000000000000000000..52dca1362592d693e5871d87bbda01cb2cd9420d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_codecs.h @@ -0,0 +1,76 @@ +#ifndef Py_INTERNAL_CODECS_H +#define Py_INTERNAL_CODECS_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_interp_structs.h" // struct codecs_state + +/* Initialize codecs-related state for the given interpreter, including + registering the first codec search function. Must be called before any other + PyCodec-related functions, and while only one thread is active. */ +extern PyStatus _PyCodec_InitRegistry(PyInterpreterState *interp); + +/* Finalize codecs-related state for the given interpreter. No PyCodec-related + functions other than PyCodec_Unregister() may be called after this. */ +extern void _PyCodec_Fini(PyInterpreterState *interp); + +extern PyObject* _PyCodec_Lookup(const char *encoding); + +/* + * Un-register the error handling callback function registered under + * the given 'name'. Only custom error handlers can be un-registered. + * + * - Return -1 and set an exception if 'name' refers to a built-in + * error handling name (e.g., 'strict'), or if an error occurred. + * - Return 0 if no custom error handler can be found for 'name'. + * - Return 1 if the custom error handler was successfully removed. + */ +extern int _PyCodec_UnregisterError(const char *name); + +/* Text codec specific encoding and decoding API. + + Checks the encoding against a list of codecs which do not + implement a str<->bytes encoding before attempting the + operation. + + Please note that these APIs are internal and should not + be used in Python C extensions. + + XXX (ncoghlan): should we make these, or something like them, public + in Python 3.5+? + + */ +extern PyObject* _PyCodec_LookupTextEncoding( + const char *encoding, + const char *alternate_command); + +extern PyObject* _PyCodec_EncodeText( + PyObject *object, + const char *encoding, + const char *errors); + +extern PyObject* _PyCodec_DecodeText( + PyObject *object, + const char *encoding, + const char *errors); + +/* These two aren't actually text encoding specific, but _io.TextIOWrapper + * is the only current API consumer. + */ +extern PyObject* _PyCodecInfo_GetIncrementalDecoder( + PyObject *codec_info, + const char *errors); + +extern PyObject* _PyCodecInfo_GetIncrementalEncoder( + PyObject *codec_info, + const char *errors); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_CODECS_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_compile.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_compile.h new file mode 100644 index 0000000000000000000000000000000000000000..ed776bbb73a0ee9b2b1d7a46e2c0ff2945f0a4a6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_compile.h @@ -0,0 +1,230 @@ +#ifndef Py_INTERNAL_COMPILE_H +#define Py_INTERNAL_COMPILE_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include + +#include "pycore_ast.h" // mod_ty +#include "pycore_symtable.h" // _Py_SourceLocation +#include "pycore_instruction_sequence.h" + +/* A soft limit for stack use, to avoid excessive + * memory use for large constants, etc. + * + * The value 30 is plucked out of thin air. + * Code that could use more stack than this is + * rare, so the exact value is unimportant. + */ +#define _PY_STACK_USE_GUIDELINE 30 + +struct _arena; // Type defined in pycore_pyarena.h +struct _mod; // Type defined in pycore_ast.h + +// Export for 'test_peg_generator' shared extension +PyAPI_FUNC(PyCodeObject*) _PyAST_Compile( + struct _mod *mod, + PyObject *filename, + PyCompilerFlags *flags, + int optimize, + struct _arena *arena); + +/* AST preprocessing */ +extern int _PyCompile_AstPreprocess( + struct _mod *mod, + PyObject *filename, + PyCompilerFlags *flags, + int optimize, + struct _arena *arena, + int syntax_check_only); + +extern int _PyAST_Preprocess( + struct _mod *, + struct _arena *arena, + PyObject *filename, + int optimize, + int ff_features, + int syntax_check_only, + int enable_warnings); + + +typedef struct { + PyObject *u_name; + PyObject *u_qualname; /* dot-separated qualified name (lazy) */ + + /* The following fields are dicts that map objects to + the index of them in co_XXX. The index is used as + the argument for opcodes that refer to those collections. + */ + PyObject *u_consts; /* all constants */ + PyObject *u_names; /* all names */ + PyObject *u_varnames; /* local variables */ + PyObject *u_cellvars; /* cell variables */ + PyObject *u_freevars; /* free variables */ + PyObject *u_fasthidden; /* dict; keys are names that are fast-locals only + temporarily within an inlined comprehension. When + value is True, treat as fast-local. */ + + Py_ssize_t u_argcount; /* number of arguments for block */ + Py_ssize_t u_posonlyargcount; /* number of positional only arguments for block */ + Py_ssize_t u_kwonlyargcount; /* number of keyword only arguments for block */ + + int u_firstlineno; /* the first lineno of the block */ +} _PyCompile_CodeUnitMetadata; + +struct _PyCompiler; + +typedef enum { + COMPILE_OP_FAST, + COMPILE_OP_GLOBAL, + COMPILE_OP_DEREF, + COMPILE_OP_NAME, +} _PyCompile_optype; + +/* _PyCompile_FBlockInfo tracks the current frame block. + * + * A frame block is used to handle loops, try/except, and try/finally. + * It's called a frame block to distinguish it from a basic block in the + * compiler IR. + */ + +enum _PyCompile_FBlockType { + COMPILE_FBLOCK_WHILE_LOOP, + COMPILE_FBLOCK_FOR_LOOP, + COMPILE_FBLOCK_TRY_EXCEPT, + COMPILE_FBLOCK_FINALLY_TRY, + COMPILE_FBLOCK_FINALLY_END, + COMPILE_FBLOCK_WITH, + COMPILE_FBLOCK_ASYNC_WITH, + COMPILE_FBLOCK_HANDLER_CLEANUP, + COMPILE_FBLOCK_POP_VALUE, + COMPILE_FBLOCK_EXCEPTION_HANDLER, + COMPILE_FBLOCK_EXCEPTION_GROUP_HANDLER, + COMPILE_FBLOCK_ASYNC_COMPREHENSION_GENERATOR, + COMPILE_FBLOCK_STOP_ITERATION, +}; + +typedef struct { + enum _PyCompile_FBlockType fb_type; + _PyJumpTargetLabel fb_block; + _Py_SourceLocation fb_loc; + /* (optional) type-specific exit or cleanup block */ + _PyJumpTargetLabel fb_exit; + /* (optional) additional information required for unwinding */ + void *fb_datum; +} _PyCompile_FBlockInfo; + + +int _PyCompile_PushFBlock(struct _PyCompiler *c, _Py_SourceLocation loc, + enum _PyCompile_FBlockType t, + _PyJumpTargetLabel block_label, + _PyJumpTargetLabel exit, void *datum); +void _PyCompile_PopFBlock(struct _PyCompiler *c, enum _PyCompile_FBlockType t, + _PyJumpTargetLabel block_label); +_PyCompile_FBlockInfo *_PyCompile_TopFBlock(struct _PyCompiler *c); + +int _PyCompile_EnterScope(struct _PyCompiler *c, identifier name, int scope_type, + void *key, int lineno, PyObject *private, + _PyCompile_CodeUnitMetadata *umd); +void _PyCompile_ExitScope(struct _PyCompiler *c); +Py_ssize_t _PyCompile_AddConst(struct _PyCompiler *c, PyObject *o); +_PyInstructionSequence *_PyCompile_InstrSequence(struct _PyCompiler *c); +int _PyCompile_StartAnnotationSetup(struct _PyCompiler *c); +int _PyCompile_EndAnnotationSetup(struct _PyCompiler *c); +int _PyCompile_FutureFeatures(struct _PyCompiler *c); +void _PyCompile_DeferredAnnotations( + struct _PyCompiler *c, PyObject **deferred_annotations, + PyObject **conditional_annotation_indices); +PyObject *_PyCompile_Mangle(struct _PyCompiler *c, PyObject *name); +PyObject *_PyCompile_MaybeMangle(struct _PyCompiler *c, PyObject *name); +int _PyCompile_MaybeAddStaticAttributeToClass(struct _PyCompiler *c, expr_ty e); +int _PyCompile_GetRefType(struct _PyCompiler *c, PyObject *name); +int _PyCompile_LookupCellvar(struct _PyCompiler *c, PyObject *name); +int _PyCompile_ResolveNameop(struct _PyCompiler *c, PyObject *mangled, int scope, + _PyCompile_optype *optype, Py_ssize_t *arg); + +int _PyCompile_IsInteractiveTopLevel(struct _PyCompiler *c); +int _PyCompile_IsInInlinedComp(struct _PyCompiler *c); +int _PyCompile_ScopeType(struct _PyCompiler *c); +int _PyCompile_OptimizationLevel(struct _PyCompiler *c); +int _PyCompile_LookupArg(struct _PyCompiler *c, PyCodeObject *co, PyObject *name); +PyObject *_PyCompile_Qualname(struct _PyCompiler *c); +_PyCompile_CodeUnitMetadata *_PyCompile_Metadata(struct _PyCompiler *c); +PyObject *_PyCompile_StaticAttributesAsTuple(struct _PyCompiler *c); + +struct symtable *_PyCompile_Symtable(struct _PyCompiler *c); +PySTEntryObject *_PyCompile_SymtableEntry(struct _PyCompiler *c); + +enum { + COMPILE_SCOPE_MODULE, + COMPILE_SCOPE_CLASS, + COMPILE_SCOPE_FUNCTION, + COMPILE_SCOPE_ASYNC_FUNCTION, + COMPILE_SCOPE_LAMBDA, + COMPILE_SCOPE_COMPREHENSION, + COMPILE_SCOPE_ANNOTATIONS, +}; + + +typedef struct { + PyObject *pushed_locals; + PyObject *temp_symbols; + PyObject *fast_hidden; + _PyJumpTargetLabel cleanup; +} _PyCompile_InlinedComprehensionState; + +int _PyCompile_TweakInlinedComprehensionScopes(struct _PyCompiler *c, _Py_SourceLocation loc, + PySTEntryObject *entry, + _PyCompile_InlinedComprehensionState *state); +int _PyCompile_RevertInlinedComprehensionScopes(struct _PyCompiler *c, _Py_SourceLocation loc, + _PyCompile_InlinedComprehensionState *state); +int _PyCompile_AddDeferredAnnotation(struct _PyCompiler *c, stmt_ty s, + PyObject **conditional_annotation_index); +void _PyCompile_EnterConditionalBlock(struct _PyCompiler *c); +void _PyCompile_LeaveConditionalBlock(struct _PyCompiler *c); + +int _PyCodegen_AddReturnAtEnd(struct _PyCompiler *c, int addNone); +int _PyCodegen_EnterAnonymousScope(struct _PyCompiler* c, mod_ty mod); +int _PyCodegen_Expression(struct _PyCompiler *c, expr_ty e); +int _PyCodegen_Module(struct _PyCompiler *c, _Py_SourceLocation loc, asdl_stmt_seq *stmts, + bool is_interactive); + +int _PyCompile_ConstCacheMergeOne(PyObject *const_cache, PyObject **obj); + +PyCodeObject *_PyCompile_OptimizeAndAssemble(struct _PyCompiler *c, int addNone); + +Py_ssize_t _PyCompile_DictAddObj(PyObject *dict, PyObject *o); +int _PyCompile_Error(struct _PyCompiler *c, _Py_SourceLocation loc, const char *format, ...); +int _PyCompile_Warn(struct _PyCompiler *c, _Py_SourceLocation loc, const char *format, ...); + +// Export for '_opcode' extension module +PyAPI_FUNC(PyObject*) _PyCompile_GetUnaryIntrinsicName(int index); +PyAPI_FUNC(PyObject*) _PyCompile_GetBinaryIntrinsicName(int index); + +/* Access compiler internals for unit testing */ + +// Export for '_testinternalcapi' shared extension +PyAPI_FUNC(PyObject*) _PyCompile_CleanDoc(PyObject *doc); + +// Export for '_testinternalcapi' shared extension +PyAPI_FUNC(PyObject*) _PyCompile_CodeGen( + PyObject *ast, + PyObject *filename, + PyCompilerFlags *flags, + int optimize, + int compile_mode); + +// Export for '_testinternalcapi' shared extension +PyAPI_FUNC(PyCodeObject*) +_PyCompile_Assemble(_PyCompile_CodeUnitMetadata *umd, PyObject *filename, + PyObject *instructions); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_COMPILE_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_complexobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_complexobject.h new file mode 100644 index 0000000000000000000000000000000000000000..f595f6ab7a674d18533a716cbb4e12d342dfe70d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_complexobject.h @@ -0,0 +1,34 @@ +#ifndef Py_INTERNAL_COMPLEXOBJECT_H +#define Py_INTERNAL_COMPLEXOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_unicodeobject.h" // _PyUnicodeWriter + +/* Format the object based on the format_spec, as defined in PEP 3101 + (Advanced String Formatting). */ +extern int _PyComplex_FormatAdvancedWriter( + _PyUnicodeWriter *writer, + PyObject *obj, + PyObject *format_spec, + Py_ssize_t start, + Py_ssize_t end); + +// Operations on complex numbers. +PyAPI_FUNC(Py_complex) _Py_cr_sum(Py_complex, double); +PyAPI_FUNC(Py_complex) _Py_cr_diff(Py_complex, double); +PyAPI_FUNC(Py_complex) _Py_rc_diff(double, Py_complex); +PyAPI_FUNC(Py_complex) _Py_cr_prod(Py_complex, double); +PyAPI_FUNC(Py_complex) _Py_cr_quot(Py_complex, double); +PyAPI_FUNC(Py_complex) _Py_rc_quot(double, Py_complex); + + +#ifdef __cplusplus +} +#endif +#endif // !Py_INTERNAL_COMPLEXOBJECT_H diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_condvar.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_condvar.h new file mode 100644 index 0000000000000000000000000000000000000000..55271f0a4116ba03fe5314751adb2cb4e0067a6c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_condvar.h @@ -0,0 +1,93 @@ +#ifndef Py_INTERNAL_CONDVAR_H +#define Py_INTERNAL_CONDVAR_H + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_pythread.h" // _POSIX_THREADS + + +#ifdef _POSIX_THREADS +/* + * POSIX support + */ +#define Py_HAVE_CONDVAR + +#ifdef HAVE_PTHREAD_H +# include // pthread_mutex_t +#endif + +#define PyMUTEX_T pthread_mutex_t +#define PyCOND_T pthread_cond_t + +#elif defined(NT_THREADS) +/* + * Windows (XP, 2003 server and later, as well as (hopefully) CE) support + * + * Emulated condition variables ones that work with XP and later, plus + * example native support on VISTA and onwards. + */ +#define Py_HAVE_CONDVAR + +/* include windows if it hasn't been done before */ +#ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif +#include // CRITICAL_SECTION + +/* options */ +/* emulated condition variables are provided for those that want + * to target Windows XP or earlier. Modify this macro to enable them. + */ +#ifndef _PY_EMULATED_WIN_CV +#define _PY_EMULATED_WIN_CV 0 /* use non-emulated condition variables */ +#endif + +/* fall back to emulation if targeting earlier than Vista */ +#if !defined NTDDI_VISTA || NTDDI_VERSION < NTDDI_VISTA +#undef _PY_EMULATED_WIN_CV +#define _PY_EMULATED_WIN_CV 1 +#endif + +#if _PY_EMULATED_WIN_CV + +typedef CRITICAL_SECTION PyMUTEX_T; + +/* The ConditionVariable object. From XP onwards it is easily emulated + with a Semaphore. + Semaphores are available on Windows XP (2003 server) and later. + We use a Semaphore rather than an auto-reset event, because although + an auto-reset event might appear to solve the lost-wakeup bug (race + condition between releasing the outer lock and waiting) because it + maintains state even though a wait hasn't happened, there is still + a lost wakeup problem if more than one thread are interrupted in the + critical place. A semaphore solves that, because its state is + counted, not Boolean. + Because it is ok to signal a condition variable with no one + waiting, we need to keep track of the number of + waiting threads. Otherwise, the semaphore's state could rise + without bound. This also helps reduce the number of "spurious wakeups" + that would otherwise happen. + */ + +typedef struct _PyCOND_T +{ + HANDLE sem; + int waiting; /* to allow PyCOND_SIGNAL to be a no-op */ +} PyCOND_T; + +#else /* !_PY_EMULATED_WIN_CV */ + +/* Use native Windows primitives if build target is Vista or higher */ + +/* SRWLOCK is faster and better than CriticalSection */ +typedef SRWLOCK PyMUTEX_T; + +typedef CONDITION_VARIABLE PyCOND_T; + +#endif /* _PY_EMULATED_WIN_CV */ + +#endif /* _POSIX_THREADS, NT_THREADS */ + +#endif /* Py_INTERNAL_CONDVAR_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_context.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_context.h new file mode 100644 index 0000000000000000000000000000000000000000..c77ef7910c09aa684b290b23de78ed161a7bd1eb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_context.h @@ -0,0 +1,59 @@ +#ifndef Py_INTERNAL_CONTEXT_H +#define Py_INTERNAL_CONTEXT_H + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_structs.h" + +extern PyTypeObject _PyContextTokenMissing_Type; + +/* runtime lifecycle */ + +PyStatus _PyContext_Init(PyInterpreterState *); + + +/* other API */ + +typedef struct { + PyObject_HEAD +} _PyContextTokenMissing; + +struct _pycontextobject { + PyObject_HEAD + PyContext *ctx_prev; + PyHamtObject *ctx_vars; + PyObject *ctx_weakreflist; + int ctx_entered; +}; + + +struct _pycontextvarobject { + PyObject_HEAD + PyObject *var_name; + PyObject *var_default; +#ifndef Py_GIL_DISABLED + PyObject *var_cached; + uint64_t var_cached_tsid; + uint64_t var_cached_tsver; +#endif + Py_hash_t var_hash; +}; + + +struct _pycontexttokenobject { + PyObject_HEAD + PyContext *tok_ctx; + PyContextVar *tok_var; + PyObject *tok_oldval; + int tok_used; +}; + + +// _testinternalcapi.hamt() used by tests. +// Export for '_testcapi' shared extension +PyAPI_FUNC(PyObject*) _PyContext_NewHamtForTests(void); + + +#endif /* !Py_INTERNAL_CONTEXT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_critical_section.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_critical_section.h new file mode 100644 index 0000000000000000000000000000000000000000..2b49b9f00df3ea5bde0822aca0014a56d391f952 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_critical_section.h @@ -0,0 +1,237 @@ +#ifndef Py_INTERNAL_CRITICAL_SECTION_H +#define Py_INTERNAL_CRITICAL_SECTION_H + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_lock.h" // PyMutex_LockFast() +#include "pycore_pystate.h" // _PyThreadState_GET() +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// Tagged pointers to critical sections use the two least significant bits to +// mark if the pointed-to critical section is inactive and whether it is a +// PyCriticalSection2 object. +#define _Py_CRITICAL_SECTION_INACTIVE 0x1 +#define _Py_CRITICAL_SECTION_TWO_MUTEXES 0x2 +#define _Py_CRITICAL_SECTION_MASK 0x3 + +#ifdef Py_GIL_DISABLED +// Specialized version of critical section locking to safely use +// PySequence_Fast APIs without the GIL. For performance, the argument *to* +// PySequence_Fast() is provided to the macro, not the *result* of +// PySequence_Fast(), which would require an extra test to determine if the +// lock must be acquired. +# define Py_BEGIN_CRITICAL_SECTION_SEQUENCE_FAST(original) \ + { \ + PyObject *_orig_seq = _PyObject_CAST(original); \ + const bool _should_lock_cs = PyList_CheckExact(_orig_seq); \ + PyCriticalSection _cs; \ + if (_should_lock_cs) { \ + _PyCriticalSection_Begin(&_cs, _orig_seq); \ + } + +# define Py_END_CRITICAL_SECTION_SEQUENCE_FAST() \ + if (_should_lock_cs) { \ + PyCriticalSection_End(&_cs); \ + } \ + } + +// Asserts that the mutex is locked. The mutex must be held by the +// top-most critical section otherwise there's the possibility +// that the mutex would be swalled out in some code paths. +#define _Py_CRITICAL_SECTION_ASSERT_MUTEX_LOCKED(mutex) \ + _PyCriticalSection_AssertHeld(mutex) + +// Asserts that the mutex for the given object is locked. The mutex must +// be held by the top-most critical section otherwise there's the +// possibility that the mutex would be swalled out in some code paths. +#ifdef Py_DEBUG + +# define _Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(op) \ + if (Py_REFCNT(op) != 1) { \ + _Py_CRITICAL_SECTION_ASSERT_MUTEX_LOCKED(&_PyObject_CAST(op)->ob_mutex); \ + } + +#else /* Py_DEBUG */ + +# define _Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(op) + +#endif /* Py_DEBUG */ + +#else /* !Py_GIL_DISABLED */ +// The critical section APIs are no-ops with the GIL. +# define Py_BEGIN_CRITICAL_SECTION_SEQUENCE_FAST(original) { +# define Py_END_CRITICAL_SECTION_SEQUENCE_FAST() } +# define _Py_CRITICAL_SECTION_ASSERT_MUTEX_LOCKED(mutex) +# define _Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(op) +#endif /* !Py_GIL_DISABLED */ + +// Resumes the top-most critical section. +PyAPI_FUNC(void) +_PyCriticalSection_Resume(PyThreadState *tstate); + +// (private) slow path for locking the mutex +PyAPI_FUNC(void) +_PyCriticalSection_BeginSlow(PyCriticalSection *c, PyMutex *m); + +PyAPI_FUNC(void) +_PyCriticalSection2_BeginSlow(PyCriticalSection2 *c, PyMutex *m1, PyMutex *m2, + int is_m1_locked); + +PyAPI_FUNC(void) +_PyCriticalSection_SuspendAll(PyThreadState *tstate); + +#ifdef Py_GIL_DISABLED + +static inline int +_PyCriticalSection_IsActive(uintptr_t tag) +{ + return tag != 0 && (tag & _Py_CRITICAL_SECTION_INACTIVE) == 0; +} + +static inline void +_PyCriticalSection_BeginMutex(PyCriticalSection *c, PyMutex *m) +{ + if (PyMutex_LockFast(m)) { + PyThreadState *tstate = _PyThreadState_GET(); + c->_cs_mutex = m; + c->_cs_prev = tstate->critical_section; + tstate->critical_section = (uintptr_t)c; + } + else { + _PyCriticalSection_BeginSlow(c, m); + } +} +#define PyCriticalSection_BeginMutex _PyCriticalSection_BeginMutex + +static inline void +_PyCriticalSection_Begin(PyCriticalSection *c, PyObject *op) +{ + _PyCriticalSection_BeginMutex(c, &op->ob_mutex); +} +#define PyCriticalSection_Begin _PyCriticalSection_Begin + +// Removes the top-most critical section from the thread's stack of critical +// sections. If the new top-most critical section is inactive, then it is +// resumed. +static inline void +_PyCriticalSection_Pop(PyCriticalSection *c) +{ + PyThreadState *tstate = _PyThreadState_GET(); + uintptr_t prev = c->_cs_prev; + tstate->critical_section = prev; + + if ((prev & _Py_CRITICAL_SECTION_INACTIVE) != 0) { + _PyCriticalSection_Resume(tstate); + } +} + +static inline void +_PyCriticalSection_End(PyCriticalSection *c) +{ + // If the mutex is NULL, we used the fast path in + // _PyCriticalSection_BeginSlow for locks already held in the top-most + // critical section, and we shouldn't unlock or pop this critical section. + if (c->_cs_mutex == NULL) { + return; + } + PyMutex_Unlock(c->_cs_mutex); + _PyCriticalSection_Pop(c); +} +#define PyCriticalSection_End _PyCriticalSection_End + +static inline void +_PyCriticalSection2_BeginMutex(PyCriticalSection2 *c, PyMutex *m1, PyMutex *m2) +{ + if (m1 == m2) { + // If the two mutex arguments are the same, treat this as a critical + // section with a single mutex. + c->_cs_mutex2 = NULL; + _PyCriticalSection_BeginMutex(&c->_cs_base, m1); + return; + } + + if ((uintptr_t)m2 < (uintptr_t)m1) { + // Sort the mutexes so that the lower address is locked first. + // The exact order does not matter, but we need to acquire the mutexes + // in a consistent order to avoid lock ordering deadlocks. + PyMutex *tmp = m1; + m1 = m2; + m2 = tmp; + } + + if (PyMutex_LockFast(m1)) { + if (PyMutex_LockFast(m2)) { + PyThreadState *tstate = _PyThreadState_GET(); + c->_cs_base._cs_mutex = m1; + c->_cs_mutex2 = m2; + c->_cs_base._cs_prev = tstate->critical_section; + + uintptr_t p = (uintptr_t)c | _Py_CRITICAL_SECTION_TWO_MUTEXES; + tstate->critical_section = p; + } + else { + _PyCriticalSection2_BeginSlow(c, m1, m2, 1); + } + } + else { + _PyCriticalSection2_BeginSlow(c, m1, m2, 0); + } +} +#define PyCriticalSection2_BeginMutex _PyCriticalSection2_BeginMutex + +static inline void +_PyCriticalSection2_Begin(PyCriticalSection2 *c, PyObject *a, PyObject *b) +{ + _PyCriticalSection2_BeginMutex(c, &a->ob_mutex, &b->ob_mutex); +} +#define PyCriticalSection2_Begin _PyCriticalSection2_Begin + +static inline void +_PyCriticalSection2_End(PyCriticalSection2 *c) +{ + // if mutex1 is NULL, we used the fast path in + // _PyCriticalSection_BeginSlow for mutexes that are already held, + // which should only happen when mutex1 and mutex2 were the same mutex, + // and mutex2 should also be NULL. + if (c->_cs_base._cs_mutex == NULL) { + assert(c->_cs_mutex2 == NULL); + return; + } + if (c->_cs_mutex2) { + PyMutex_Unlock(c->_cs_mutex2); + } + PyMutex_Unlock(c->_cs_base._cs_mutex); + _PyCriticalSection_Pop(&c->_cs_base); +} +#define PyCriticalSection2_End _PyCriticalSection2_End + +static inline void +_PyCriticalSection_AssertHeld(PyMutex *mutex) +{ +#ifdef Py_DEBUG + PyThreadState *tstate = _PyThreadState_GET(); + uintptr_t prev = tstate->critical_section; + if (prev & _Py_CRITICAL_SECTION_TWO_MUTEXES) { + PyCriticalSection2 *cs = (PyCriticalSection2 *)(prev & ~_Py_CRITICAL_SECTION_MASK); + assert(cs != NULL && (cs->_cs_base._cs_mutex == mutex || cs->_cs_mutex2 == mutex)); + } + else { + PyCriticalSection *cs = (PyCriticalSection *)(tstate->critical_section & ~_Py_CRITICAL_SECTION_MASK); + assert(cs != NULL && cs->_cs_mutex == mutex); + } + +#endif +} + +#endif /* Py_GIL_DISABLED */ + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_CRITICAL_SECTION_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_crossinterp.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_crossinterp.h new file mode 100644 index 0000000000000000000000000000000000000000..81faffac1941719cfccd5c44f0b8b4fae81f45fe --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_crossinterp.h @@ -0,0 +1,406 @@ +#ifndef Py_INTERNAL_CROSSINTERP_H +#define Py_INTERNAL_CROSSINTERP_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_pyerrors.h" + + +/**************/ +/* exceptions */ +/**************/ + +PyAPI_DATA(PyObject *) PyExc_InterpreterError; +PyAPI_DATA(PyObject *) PyExc_InterpreterNotFoundError; + + +/***************************/ +/* cross-interpreter calls */ +/***************************/ + +typedef int (*_Py_simple_func)(void *); +extern int _Py_CallInInterpreter( + PyInterpreterState *interp, + _Py_simple_func func, + void *arg); +extern int _Py_CallInInterpreterAndRawFree( + PyInterpreterState *interp, + _Py_simple_func func, + void *arg); + + +/**************************/ +/* cross-interpreter data */ +/**************************/ + +typedef struct _xidata _PyXIData_t; +typedef PyObject *(*xid_newobjfunc)(_PyXIData_t *); +typedef void (*xid_freefunc)(void *); + +// _PyXIData_t is similar to Py_buffer as an effectively +// opaque struct that holds data outside the object machinery. This +// is necessary to pass safely between interpreters in the same process. +struct _xidata { + // data is the cross-interpreter-safe derivation of a Python object + // (see _PyObject_GetXIData). It will be NULL if the + // new_object func (below) encodes the data. + void *data; + // obj is the Python object from which the data was derived. This + // is non-NULL only if the data remains bound to the object in some + // way, such that the object must be "released" (via a decref) when + // the data is released. In that case the code that sets the field, + // likely a registered "xidatafunc", is responsible for + // ensuring it owns the reference (i.e. incref). + PyObject *obj; + // interpid is the ID of the owning interpreter of the original + // object. It corresponds to the active interpreter when + // _PyObject_GetXIData() was called. This should only + // be set by the cross-interpreter machinery. + // + // We use the ID rather than the PyInterpreterState to avoid issues + // with deleted interpreters. Note that IDs are never re-used, so + // each one will always correspond to a specific interpreter + // (whether still alive or not). + int64_t interpid; + // new_object is a function that returns a new object in the current + // interpreter given the data. The resulting object (a new + // reference) will be equivalent to the original object. This field + // is required. + xid_newobjfunc new_object; + // free is called when the data is released. If it is NULL then + // nothing will be done to free the data. For some types this is + // okay (e.g. bytes) and for those types this field should be set + // to NULL. However, for most the data was allocated just for + // cross-interpreter use, so it must be freed when + // _PyXIData_Release is called or the memory will + // leak. In that case, at the very least this field should be set + // to PyMem_RawFree (the default if not explicitly set to NULL). + // The call will happen with the original interpreter activated. + xid_freefunc free; +}; + +PyAPI_FUNC(_PyXIData_t *) _PyXIData_New(void); +PyAPI_FUNC(void) _PyXIData_Free(_PyXIData_t *data); + +#define _PyXIData_DATA(DATA) ((DATA)->data) +#define _PyXIData_OBJ(DATA) ((DATA)->obj) +#define _PyXIData_INTERPID(DATA) ((DATA)->interpid) +// Users should not need getters for "new_object" or "free". + + +/* defining cross-interpreter data */ + +PyAPI_FUNC(void) _PyXIData_Init( + _PyXIData_t *data, + PyInterpreterState *interp, void *shared, PyObject *obj, + xid_newobjfunc new_object); +PyAPI_FUNC(int) _PyXIData_InitWithSize( + _PyXIData_t *, + PyInterpreterState *interp, const size_t, PyObject *, + xid_newobjfunc); +PyAPI_FUNC(void) _PyXIData_Clear(PyInterpreterState *, _PyXIData_t *); + +// Normally the Init* functions are sufficient. The only time +// additional initialization might be needed is to set the "free" func, +// though that should be infrequent. +#define _PyXIData_SET_FREE(DATA, FUNC) \ + do { \ + (DATA)->free = (FUNC); \ + } while (0) +#define _PyXIData_CHECK_FREE(DATA, FUNC) \ + ((DATA)->free == (FUNC)) +// Additionally, some shareable types are essentially light wrappers +// around other shareable types. The xidatafunc of the wrapper +// can often be implemented by calling the wrapped object's +// xidatafunc and then changing the "new_object" function. +// We have _PyXIData_SET_NEW_OBJECT() here for that, +// but might be better to have a function like +// _PyXIData_AdaptToWrapper() instead. +#define _PyXIData_SET_NEW_OBJECT(DATA, FUNC) \ + do { \ + (DATA)->new_object = (FUNC); \ + } while (0) +#define _PyXIData_CHECK_NEW_OBJECT(DATA, FUNC) \ + ((DATA)->new_object == (FUNC)) + + +/* getting cross-interpreter data */ + +typedef int xidata_fallback_t; +#define _PyXIDATA_XIDATA_ONLY (0) +#define _PyXIDATA_FULL_FALLBACK (1) + +// Technically, we don't need two different function types; +// we could go with just the fallback one. However, only container +// types like tuple need it, so always having the extra arg would be +// a bit unfortunate. It's also nice to be able to clearly distinguish +// between types that might call _PyObject_GetXIData() and those that won't. +// +typedef int (*xidatafunc)(PyThreadState *, PyObject *, _PyXIData_t *); +typedef int (*xidatafbfunc)( + PyThreadState *, PyObject *, xidata_fallback_t, _PyXIData_t *); +typedef struct { + xidatafunc basic; + xidatafbfunc fallback; +} _PyXIData_getdata_t; + +PyAPI_FUNC(PyObject *) _PyXIData_GetNotShareableErrorType(PyThreadState *); +PyAPI_FUNC(void) _PyXIData_SetNotShareableError(PyThreadState *, const char *); +PyAPI_FUNC(void) _PyXIData_FormatNotShareableError( + PyThreadState *, + const char *, + ...); + +PyAPI_FUNC(_PyXIData_getdata_t) _PyXIData_Lookup( + PyThreadState *, + PyObject *); +PyAPI_FUNC(int) _PyObject_CheckXIData( + PyThreadState *, + PyObject *); + +PyAPI_FUNC(int) _PyObject_GetXIDataNoFallback( + PyThreadState *, + PyObject *, + _PyXIData_t *); +PyAPI_FUNC(int) _PyObject_GetXIData( + PyThreadState *, + PyObject *, + xidata_fallback_t, + _PyXIData_t *); + +// _PyObject_GetXIData() for bytes +typedef struct { + const char *bytes; + Py_ssize_t len; +} _PyBytes_data_t; +PyAPI_FUNC(int) _PyBytes_GetData(PyObject *, _PyBytes_data_t *); +PyAPI_FUNC(PyObject *) _PyBytes_FromData(_PyBytes_data_t *); +PyAPI_FUNC(PyObject *) _PyBytes_FromXIData(_PyXIData_t *); +PyAPI_FUNC(int) _PyBytes_GetXIData( + PyThreadState *, + PyObject *, + _PyXIData_t *); +PyAPI_FUNC(_PyBytes_data_t *) _PyBytes_GetXIDataWrapped( + PyThreadState *, + PyObject *, + size_t, + xid_newobjfunc, + _PyXIData_t *); + +// _PyObject_GetXIData() for pickle +PyAPI_DATA(PyObject *) _PyPickle_LoadFromXIData(_PyXIData_t *); +PyAPI_FUNC(int) _PyPickle_GetXIData( + PyThreadState *, + PyObject *, + _PyXIData_t *); + +// _PyObject_GetXIData() for marshal +PyAPI_FUNC(PyObject *) _PyMarshal_ReadObjectFromXIData(_PyXIData_t *); +PyAPI_FUNC(int) _PyMarshal_GetXIData( + PyThreadState *, + PyObject *, + _PyXIData_t *); + +// _PyObject_GetXIData() for code objects +PyAPI_FUNC(PyObject *) _PyCode_FromXIData(_PyXIData_t *); +PyAPI_FUNC(int) _PyCode_GetXIData( + PyThreadState *, + PyObject *, + _PyXIData_t *); +PyAPI_FUNC(int) _PyCode_GetScriptXIData( + PyThreadState *, + PyObject *, + _PyXIData_t *); +PyAPI_FUNC(int) _PyCode_GetPureScriptXIData( + PyThreadState *, + PyObject *, + _PyXIData_t *); + +// _PyObject_GetXIData() for functions +PyAPI_FUNC(PyObject *) _PyFunction_FromXIData(_PyXIData_t *); +PyAPI_FUNC(int) _PyFunction_GetXIData( + PyThreadState *, + PyObject *, + _PyXIData_t *); + + +/* using cross-interpreter data */ + +PyAPI_FUNC(PyObject *) _PyXIData_NewObject(_PyXIData_t *); +PyAPI_FUNC(int) _PyXIData_Release(_PyXIData_t *); +PyAPI_FUNC(int) _PyXIData_ReleaseAndRawFree(_PyXIData_t *); + + +/* cross-interpreter data registry */ + +#define Py_CORE_CROSSINTERP_DATA_REGISTRY_H +#include "pycore_crossinterp_data_registry.h" +#undef Py_CORE_CROSSINTERP_DATA_REGISTRY_H + + +/*****************************/ +/* runtime state & lifecycle */ +/*****************************/ + +typedef struct _xid_lookup_state _PyXIData_lookup_t; + +typedef struct { + // builtin types + _PyXIData_lookup_t data_lookup; +} _PyXI_global_state_t; + +typedef struct { + // heap types + _PyXIData_lookup_t data_lookup; + + struct xi_exceptions { + // static types + PyObject *PyExc_InterpreterError; + PyObject *PyExc_InterpreterNotFoundError; + // heap types + PyObject *PyExc_NotShareableError; + } exceptions; +} _PyXI_state_t; + +#define _PyXI_GET_GLOBAL_STATE(interp) (&(interp)->runtime->xi) +#define _PyXI_GET_STATE(interp) (&(interp)->xi) + +#ifndef Py_BUILD_CORE_MODULE +extern PyStatus _PyXI_Init(PyInterpreterState *interp); +extern void _PyXI_Fini(PyInterpreterState *interp); +extern PyStatus _PyXI_InitTypes(PyInterpreterState *interp); +extern void _PyXI_FiniTypes(PyInterpreterState *interp); +#endif // Py_BUILD_CORE_MODULE + +int _Py_xi_global_state_init(_PyXI_global_state_t *); +void _Py_xi_global_state_fini(_PyXI_global_state_t *); +int _Py_xi_state_init(_PyXI_state_t *, PyInterpreterState *); +void _Py_xi_state_fini(_PyXI_state_t *, PyInterpreterState *); + + +/***************************/ +/* short-term data sharing */ +/***************************/ + +// Ultimately we'd like to preserve enough information about the +// exception and traceback that we could re-constitute (or at least +// simulate, a la traceback.TracebackException), and even chain, a copy +// of the exception in the calling interpreter. + +typedef struct _excinfo { + struct _excinfo_type { + PyTypeObject *builtin; + const char *name; + const char *qualname; + const char *module; + } type; + const char *msg; + const char *errdisplay; +} _PyXI_excinfo; + +PyAPI_FUNC(_PyXI_excinfo *) _PyXI_NewExcInfo(PyObject *exc); +PyAPI_FUNC(void) _PyXI_FreeExcInfo(_PyXI_excinfo *info); +PyAPI_FUNC(PyObject *) _PyXI_FormatExcInfo(_PyXI_excinfo *info); +PyAPI_FUNC(PyObject *) _PyXI_ExcInfoAsObject(_PyXI_excinfo *info); + + +typedef enum error_code { + _PyXI_ERR_NO_ERROR = 0, + _PyXI_ERR_UNCAUGHT_EXCEPTION = -1, + _PyXI_ERR_OTHER = -2, + _PyXI_ERR_NO_MEMORY = -3, + _PyXI_ERR_ALREADY_RUNNING = -4, + _PyXI_ERR_MAIN_NS_FAILURE = -5, + _PyXI_ERR_APPLY_NS_FAILURE = -6, + _PyXI_ERR_PRESERVE_FAILURE = -7, + _PyXI_ERR_EXC_PROPAGATION_FAILURE = -8, + _PyXI_ERR_NOT_SHAREABLE = -9, +} _PyXI_errcode; + +typedef struct xi_failure _PyXI_failure; + +PyAPI_FUNC(_PyXI_failure *) _PyXI_NewFailure(void); +PyAPI_FUNC(void) _PyXI_FreeFailure(_PyXI_failure *); +PyAPI_FUNC(_PyXI_errcode) _PyXI_GetFailureCode(_PyXI_failure *); +PyAPI_FUNC(int) _PyXI_InitFailure(_PyXI_failure *, _PyXI_errcode, PyObject *); +PyAPI_FUNC(void) _PyXI_InitFailureUTF8( + _PyXI_failure *, + _PyXI_errcode, + const char *); + +PyAPI_FUNC(int) _PyXI_UnwrapNotShareableError( + PyThreadState *, + _PyXI_failure *); + + +// A cross-interpreter session involves entering an interpreter +// with _PyXI_Enter(), doing some work with it, and finally exiting +// that interpreter with _PyXI_Exit(). +// +// At the boundaries of the session, both entering and exiting, +// data may be exchanged between the previous interpreter and the +// target one in a thread-safe way that does not violate the +// isolation between interpreters. This includes setting objects +// in the target's __main__ module on the way in, and capturing +// uncaught exceptions on the way out. +typedef struct xi_session _PyXI_session; + +PyAPI_FUNC(_PyXI_session *) _PyXI_NewSession(void); +PyAPI_FUNC(void) _PyXI_FreeSession(_PyXI_session *); + +typedef struct { + PyObject *preserved; + PyObject *excinfo; + _PyXI_errcode errcode; +} _PyXI_session_result; +PyAPI_FUNC(void) _PyXI_ClearResult(_PyXI_session_result *); + +PyAPI_FUNC(int) _PyXI_Enter( + _PyXI_session *session, + PyInterpreterState *interp, + PyObject *nsupdates, + _PyXI_session_result *); +PyAPI_FUNC(int) _PyXI_Exit( + _PyXI_session *, + _PyXI_failure *, + _PyXI_session_result *); + +PyAPI_FUNC(PyObject *) _PyXI_GetMainNamespace( + _PyXI_session *, + _PyXI_failure *); + +PyAPI_FUNC(int) _PyXI_Preserve( + _PyXI_session *, + const char *, + PyObject *, + _PyXI_failure *); +PyAPI_FUNC(PyObject *) _PyXI_GetPreserved( + _PyXI_session_result *, + const char *); + + +/*************/ +/* other API */ +/*************/ + +// Export for _testinternalcapi shared extension +PyAPI_FUNC(PyInterpreterState *) _PyXI_NewInterpreter( + PyInterpreterConfig *config, + long *maybe_whence, + PyThreadState **p_tstate, + PyThreadState **p_save_tstate); +PyAPI_FUNC(void) _PyXI_EndInterpreter( + PyInterpreterState *interp, + PyThreadState *tstate, + PyThreadState **p_save_tstate); + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_CROSSINTERP_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_crossinterp_data_registry.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_crossinterp_data_registry.h new file mode 100644 index 0000000000000000000000000000000000000000..fbb4cad5cac32e0a8a39c72b3223baf16f2c30a1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_crossinterp_data_registry.h @@ -0,0 +1,41 @@ +#ifndef Py_CORE_CROSSINTERP_DATA_REGISTRY_H +# error "this header must not be included directly" +#endif + + +// For now we use a global registry of shareable classes. An +// alternative would be to add a tp_* slot for a class's +// xidatafunc. It would be simpler and more efficient. + +struct _xid_regitem; + +typedef struct _xid_regitem { + struct _xid_regitem *prev; + struct _xid_regitem *next; + /* This can be a dangling pointer, but only if weakref is set. */ + PyTypeObject *cls; + /* This is NULL for builtin types. */ + PyObject *weakref; + size_t refcount; + _PyXIData_getdata_t getdata; +} _PyXIData_regitem_t; + +typedef struct { + int global; /* builtin types or heap types */ + int initialized; + PyMutex mutex; + _PyXIData_regitem_t *head; +} _PyXIData_registry_t; + +PyAPI_FUNC(int) _PyXIData_RegisterClass( + PyThreadState *, + PyTypeObject *, + _PyXIData_getdata_t); +PyAPI_FUNC(int) _PyXIData_UnregisterClass( + PyThreadState *, + PyTypeObject *); + +struct _xid_lookup_state { + // XXX Remove this field once we have a tp_* slot. + _PyXIData_registry_t registry; +}; diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_debug_offsets.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_debug_offsets.h new file mode 100644 index 0000000000000000000000000000000000000000..8e7cd16acffa48ac8934df9749350842ed1c4bed --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_debug_offsets.h @@ -0,0 +1,379 @@ +#ifndef Py_INTERNAL_DEBUG_OFFSETS_H +#define Py_INTERNAL_DEBUG_OFFSETS_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + + +#define _Py_Debug_Cookie "xdebugpy" + +#if defined(__APPLE__) +# include +#endif + +// Macros to burn global values in custom sections so out-of-process +// profilers can locate them easily. +#define GENERATE_DEBUG_SECTION(name, declaration) \ + _GENERATE_DEBUG_SECTION_WINDOWS(name) \ + _GENERATE_DEBUG_SECTION_APPLE(name) \ + declaration \ + _GENERATE_DEBUG_SECTION_LINUX(name) + +// Please note that section names are truncated to eight bytes +// on Windows! +#if defined(MS_WINDOWS) +#define _GENERATE_DEBUG_SECTION_WINDOWS(name) \ + _Pragma(Py_STRINGIFY(section(Py_STRINGIFY(name), read, write))) \ + __declspec(allocate(Py_STRINGIFY(name))) +#else +#define _GENERATE_DEBUG_SECTION_WINDOWS(name) +#endif + +#if defined(__APPLE__) +#define _GENERATE_DEBUG_SECTION_APPLE(name) \ + __attribute__((section(SEG_DATA "," Py_STRINGIFY(name)))) \ + __attribute__((used)) +#else +#define _GENERATE_DEBUG_SECTION_APPLE(name) +#endif + +#if defined(__linux__) && (defined(__GNUC__) || defined(__clang__)) +#define _GENERATE_DEBUG_SECTION_LINUX(name) \ + __attribute__((section("." Py_STRINGIFY(name)))) \ + __attribute__((used)) +#else +#define _GENERATE_DEBUG_SECTION_LINUX(name) +#endif + +#ifdef Py_GIL_DISABLED +# define _Py_Debug_gilruntimestate_enabled offsetof(struct _gil_runtime_state, enabled) +# define _Py_Debug_Free_Threaded 1 +# define _Py_Debug_code_object_co_tlbc offsetof(PyCodeObject, co_tlbc) +# define _Py_Debug_interpreter_frame_tlbc_index offsetof(_PyInterpreterFrame, tlbc_index) +# define _Py_Debug_interpreter_state_tlbc_generation offsetof(PyInterpreterState, tlbc_indices.tlbc_generation) +#else +# define _Py_Debug_gilruntimestate_enabled 0 +# define _Py_Debug_Free_Threaded 0 +# define _Py_Debug_code_object_co_tlbc 0 +# define _Py_Debug_interpreter_frame_tlbc_index 0 +# define _Py_Debug_interpreter_state_tlbc_generation 0 +#endif + + +typedef struct _Py_DebugOffsets { + char cookie[8] _Py_NONSTRING; + uint64_t version; + uint64_t free_threaded; + // Runtime state offset; + struct _runtime_state { + uint64_t size; + uint64_t finalizing; + uint64_t interpreters_head; + } runtime_state; + + // Interpreter state offset; + struct _interpreter_state { + uint64_t size; + uint64_t id; + uint64_t next; + uint64_t threads_head; + uint64_t threads_main; + uint64_t gc; + uint64_t imports_modules; + uint64_t sysdict; + uint64_t builtins; + uint64_t ceval_gil; + uint64_t gil_runtime_state; + uint64_t gil_runtime_state_enabled; + uint64_t gil_runtime_state_locked; + uint64_t gil_runtime_state_holder; + uint64_t code_object_generation; + uint64_t tlbc_generation; + } interpreter_state; + + // Thread state offset; + struct _thread_state{ + uint64_t size; + uint64_t prev; + uint64_t next; + uint64_t interp; + uint64_t current_frame; + uint64_t thread_id; + uint64_t native_thread_id; + uint64_t datastack_chunk; + uint64_t status; + } thread_state; + + // InterpreterFrame offset; + struct _interpreter_frame { + uint64_t size; + uint64_t previous; + uint64_t executable; + uint64_t instr_ptr; + uint64_t localsplus; + uint64_t owner; + uint64_t stackpointer; + uint64_t tlbc_index; + } interpreter_frame; + + // Code object offset; + struct _code_object { + uint64_t size; + uint64_t filename; + uint64_t name; + uint64_t qualname; + uint64_t linetable; + uint64_t firstlineno; + uint64_t argcount; + uint64_t localsplusnames; + uint64_t localspluskinds; + uint64_t co_code_adaptive; + uint64_t co_tlbc; + } code_object; + + // PyObject offset; + struct _pyobject { + uint64_t size; + uint64_t ob_type; + } pyobject; + + // PyTypeObject object offset; + struct _type_object { + uint64_t size; + uint64_t tp_name; + uint64_t tp_repr; + uint64_t tp_flags; + } type_object; + + // PyTuple object offset; + struct _tuple_object { + uint64_t size; + uint64_t ob_item; + uint64_t ob_size; + } tuple_object; + + // PyList object offset; + struct _list_object { + uint64_t size; + uint64_t ob_item; + uint64_t ob_size; + } list_object; + + // PySet object offset; + struct _set_object { + uint64_t size; + uint64_t used; + uint64_t table; + uint64_t mask; + } set_object; + + // PyDict object offset; + struct _dict_object { + uint64_t size; + uint64_t ma_keys; + uint64_t ma_values; + } dict_object; + + // PyFloat object offset; + struct _float_object { + uint64_t size; + uint64_t ob_fval; + } float_object; + + // PyLong object offset; + struct _long_object { + uint64_t size; + uint64_t lv_tag; + uint64_t ob_digit; + } long_object; + + // PyBytes object offset; + struct _bytes_object { + uint64_t size; + uint64_t ob_size; + uint64_t ob_sval; + } bytes_object; + + // Unicode object offset; + struct _unicode_object { + uint64_t size; + uint64_t state; + uint64_t length; + uint64_t asciiobject_size; + } unicode_object; + + // GC runtime state offset; + struct _gc { + uint64_t size; + uint64_t collecting; + } gc; + + // Generator object offset; + struct _gen_object { + uint64_t size; + uint64_t gi_name; + uint64_t gi_iframe; + uint64_t gi_frame_state; + } gen_object; + + struct _llist_node { + uint64_t next; + uint64_t prev; + } llist_node; + + struct _debugger_support { + uint64_t eval_breaker; + uint64_t remote_debugger_support; + uint64_t remote_debugging_enabled; + uint64_t debugger_pending_call; + uint64_t debugger_script_path; + uint64_t debugger_script_path_size; + } debugger_support; +} _Py_DebugOffsets; + + +#define _Py_DebugOffsets_INIT(debug_cookie) { \ + .cookie = debug_cookie, \ + .version = PY_VERSION_HEX, \ + .free_threaded = _Py_Debug_Free_Threaded, \ + .runtime_state = { \ + .size = sizeof(_PyRuntimeState), \ + .finalizing = offsetof(_PyRuntimeState, _finalizing), \ + .interpreters_head = offsetof(_PyRuntimeState, interpreters.head), \ + }, \ + .interpreter_state = { \ + .size = sizeof(PyInterpreterState), \ + .id = offsetof(PyInterpreterState, id), \ + .next = offsetof(PyInterpreterState, next), \ + .threads_head = offsetof(PyInterpreterState, threads.head), \ + .threads_main = offsetof(PyInterpreterState, threads.main), \ + .gc = offsetof(PyInterpreterState, gc), \ + .imports_modules = offsetof(PyInterpreterState, imports.modules), \ + .sysdict = offsetof(PyInterpreterState, sysdict), \ + .builtins = offsetof(PyInterpreterState, builtins), \ + .ceval_gil = offsetof(PyInterpreterState, ceval.gil), \ + .gil_runtime_state = offsetof(PyInterpreterState, _gil), \ + .gil_runtime_state_enabled = _Py_Debug_gilruntimestate_enabled, \ + .gil_runtime_state_locked = offsetof(PyInterpreterState, _gil.locked), \ + .gil_runtime_state_holder = offsetof(PyInterpreterState, _gil.last_holder), \ + .code_object_generation = offsetof(PyInterpreterState, _code_object_generation), \ + .tlbc_generation = _Py_Debug_interpreter_state_tlbc_generation, \ + }, \ + .thread_state = { \ + .size = sizeof(PyThreadState), \ + .prev = offsetof(PyThreadState, prev), \ + .next = offsetof(PyThreadState, next), \ + .interp = offsetof(PyThreadState, interp), \ + .current_frame = offsetof(PyThreadState, current_frame), \ + .thread_id = offsetof(PyThreadState, thread_id), \ + .native_thread_id = offsetof(PyThreadState, native_thread_id), \ + .datastack_chunk = offsetof(PyThreadState, datastack_chunk), \ + .status = offsetof(PyThreadState, _status), \ + }, \ + .interpreter_frame = { \ + .size = sizeof(_PyInterpreterFrame), \ + .previous = offsetof(_PyInterpreterFrame, previous), \ + .executable = offsetof(_PyInterpreterFrame, f_executable), \ + .instr_ptr = offsetof(_PyInterpreterFrame, instr_ptr), \ + .localsplus = offsetof(_PyInterpreterFrame, localsplus), \ + .owner = offsetof(_PyInterpreterFrame, owner), \ + .stackpointer = offsetof(_PyInterpreterFrame, stackpointer), \ + .tlbc_index = _Py_Debug_interpreter_frame_tlbc_index, \ + }, \ + .code_object = { \ + .size = sizeof(PyCodeObject), \ + .filename = offsetof(PyCodeObject, co_filename), \ + .name = offsetof(PyCodeObject, co_name), \ + .qualname = offsetof(PyCodeObject, co_qualname), \ + .linetable = offsetof(PyCodeObject, co_linetable), \ + .firstlineno = offsetof(PyCodeObject, co_firstlineno), \ + .argcount = offsetof(PyCodeObject, co_argcount), \ + .localsplusnames = offsetof(PyCodeObject, co_localsplusnames), \ + .localspluskinds = offsetof(PyCodeObject, co_localspluskinds), \ + .co_code_adaptive = offsetof(PyCodeObject, co_code_adaptive), \ + .co_tlbc = _Py_Debug_code_object_co_tlbc, \ + }, \ + .pyobject = { \ + .size = sizeof(PyObject), \ + .ob_type = offsetof(PyObject, ob_type), \ + }, \ + .type_object = { \ + .size = sizeof(PyTypeObject), \ + .tp_name = offsetof(PyTypeObject, tp_name), \ + .tp_repr = offsetof(PyTypeObject, tp_repr), \ + .tp_flags = offsetof(PyTypeObject, tp_flags), \ + }, \ + .tuple_object = { \ + .size = sizeof(PyTupleObject), \ + .ob_item = offsetof(PyTupleObject, ob_item), \ + .ob_size = offsetof(PyTupleObject, ob_base.ob_size), \ + }, \ + .list_object = { \ + .size = sizeof(PyListObject), \ + .ob_item = offsetof(PyListObject, ob_item), \ + .ob_size = offsetof(PyListObject, ob_base.ob_size), \ + }, \ + .set_object = { \ + .size = sizeof(PySetObject), \ + .used = offsetof(PySetObject, used), \ + .table = offsetof(PySetObject, table), \ + .mask = offsetof(PySetObject, mask), \ + }, \ + .dict_object = { \ + .size = sizeof(PyDictObject), \ + .ma_keys = offsetof(PyDictObject, ma_keys), \ + .ma_values = offsetof(PyDictObject, ma_values), \ + }, \ + .float_object = { \ + .size = sizeof(PyFloatObject), \ + .ob_fval = offsetof(PyFloatObject, ob_fval), \ + }, \ + .long_object = { \ + .size = sizeof(PyLongObject), \ + .lv_tag = offsetof(PyLongObject, long_value.lv_tag), \ + .ob_digit = offsetof(PyLongObject, long_value.ob_digit), \ + }, \ + .bytes_object = { \ + .size = sizeof(PyBytesObject), \ + .ob_size = offsetof(PyBytesObject, ob_base.ob_size), \ + .ob_sval = offsetof(PyBytesObject, ob_sval), \ + }, \ + .unicode_object = { \ + .size = sizeof(PyUnicodeObject), \ + .state = offsetof(PyUnicodeObject, _base._base.state), \ + .length = offsetof(PyUnicodeObject, _base._base.length), \ + .asciiobject_size = sizeof(PyASCIIObject), \ + }, \ + .gc = { \ + .size = sizeof(struct _gc_runtime_state), \ + .collecting = offsetof(struct _gc_runtime_state, collecting), \ + }, \ + .gen_object = { \ + .size = sizeof(PyGenObject), \ + .gi_name = offsetof(PyGenObject, gi_name), \ + .gi_iframe = offsetof(PyGenObject, gi_iframe), \ + .gi_frame_state = offsetof(PyGenObject, gi_frame_state), \ + }, \ + .llist_node = { \ + .next = offsetof(struct llist_node, next), \ + .prev = offsetof(struct llist_node, prev), \ + }, \ + .debugger_support = { \ + .eval_breaker = offsetof(PyThreadState, eval_breaker), \ + .remote_debugger_support = offsetof(PyThreadState, remote_debugger_support), \ + .remote_debugging_enabled = offsetof(PyInterpreterState, config.remote_debug), \ + .debugger_pending_call = offsetof(_PyRemoteDebuggerSupport, debugger_pending_call), \ + .debugger_script_path = offsetof(_PyRemoteDebuggerSupport, debugger_script_path), \ + .debugger_script_path_size = _Py_MAX_SCRIPT_PATH_SIZE, \ + }, \ +} + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_DEBUG_OFFSETS_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_descrobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_descrobject.h new file mode 100644 index 0000000000000000000000000000000000000000..3cec59a68a3d2b2af5320fe1435c13a4aa66886c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/include/internal/pycore_descrobject.h @@ -0,0 +1,28 @@ +#ifndef Py_INTERNAL_DESCROBJECT_H +#define Py_INTERNAL_DESCROBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +typedef struct { + PyObject_HEAD + PyObject *prop_get; + PyObject *prop_set; + PyObject *prop_del; + PyObject *prop_doc; + PyObject *prop_name; + int getter_doc; +} propertyobject; + +typedef propertyobject _PyPropertyObject; + +extern PyTypeObject _PyMethodWrapper_Type; + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_DESCROBJECT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/licenses/LICENSE b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..20cf39097c68baa17cc566b64e76d34ebf034044 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/licenses/LICENSE @@ -0,0 +1,277 @@ +A. HISTORY OF THE SOFTWARE +========================== + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see https://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see https://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations, which became +Zope Corporation. In 2001, the Python Software Foundation (PSF, see +https://www.python.org/psf/) was formed, a non-profit organization +created specifically to own Python-related Intellectual Property. +Zope Corporation was a sponsoring member of the PSF. + +All Python releases are Open Source (see https://opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2 and above 2.1.1 2001-now PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +=============================================================== + +Python software and documentation are licensed under the +Python Software Foundation License Version 2. + +Starting with Python 3.8.6, examples, recipes, and other code in +the documentation are dual licensed under the PSF License Version 2 +and the Zero-Clause BSD license. + +Some software incorporated into Python is under different licenses. +The licenses are listed with code falling under that license. + + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001 Python Software Foundation; All Rights Reserved" +are retained in Python alone or in any derivative version prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +------------------------------------------- + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +--------------------------------------- + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +-------------------------------------------------- + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION +---------------------------------------------------------------------- + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/build_base.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/build_base.bat new file mode 100644 index 0000000000000000000000000000000000000000..7dd5ccfe8347cd210ff6cc5bf3f036f53a087a8d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/build_base.bat @@ -0,0 +1,241 @@ +setlocal EnableDelayedExpansion +echo on + +:: Compile python, extensions and external libraries +if "%target_platform%"=="win-64" ( + set HOST_PLATFORM=x64 + set HOST_DIR=amd64 +) +if "%target_platform%"=="win-32" ( + set HOST_PLATFORM=Win32 + set HOST_DIR=win32 +) +if "%target_platform%"=="win-arm64" ( + set HOST_PLATFORM=ARM64 + set HOST_DIR=arm64 +) + +if "%build_platform%"=="win-64" ( + set BUILD_PLATFORM=x64 + set BUILD_DIR=amd64 +) +if "%build_platform%"=="win-32" ( + set BUILD_PLATFORM=Win32 + set BUILD_DIR=win32 +) +if "%build_platform%"=="win-arm64" ( + set BUILD_PLATFORM=ARM64 + set BUILD_DIR=arm64 +) + +for /F "tokens=1,2 delims=." %%i in ("%PKG_VERSION%") do ( + set "VERNODOTS=%%i%%j" +) + +for /F "tokens=1,2 delims=." %%i in ("%PKG_VERSION%") do ( + set "VER=%%i.%%j" +) + +:: Make sure the "python" value in conda_build_config.yaml is up to date. +for /F "tokens=1,2 delims=." %%i in ("%PKG_VERSION%") do ( + if NOT "%PY_VER%"=="%%i.%%j" exit 1 +) + +for /f "usebackq delims=" %%i in (`conda list -p %PREFIX% sqlite --no-show-channel-urls --json ^| findstr "version"`) do set SQLITE3_VERSION_LINE=%%i +for /f "tokens=2 delims==/ " %%i IN ('echo %SQLITE3_VERSION_LINE%') do (set SQLITE3_VERSION=%%~i) +echo SQLITE3_VERSION detected as %SQLITE3_VERSION% + +if "%PY_INTERP_DEBUG%"=="yes" ( + set CONFIG=-d + set _D=_d +) else ( + set CONFIG= + set _D= +) + +set PGO=--pgo +if "%DEBUG_C%"=="yes" ( + set PGO= +) +if "%CONDA_BUILD_CROSS_COMPILATION%" == "1" ( + set PGO= +) + +if "%PY_FREETHREADING%" == "yes" ( + set "FREETHREADING=--disable-gil" + set "THREAD=t" + set "EXE_T=%VER%t" +) else ( + set "FREETHREADING=--experimental-jit-off" + set "THREAD=" + set "EXE_T=" +) + +cd PCbuild + +setlocal EnableDelayedExpansion +if "%CONDA_BUILD_CROSS_COMPILATION%" == "1" ( + REM build for the build platform. LIBRARY_PREFIX is used by the patches + REM No PGO. No externals, i.e. remove building extension modules + REM we don't need. + set LIBRARY_PREFIX=%BUILD_PREFIX%\\Library + call build.bat %CONFIG% %FREETHREADING% -m -E -v -p %BUILD_PLATFORM% + if errorlevel 1 exit 1 +) +endlocal +:: Twice because: +:: error : importlib_zipimport.h updated. You will need to rebuild pythoncore to see the changes. +call build.bat %PGO% %CONFIG% %FREETHREADING% -m -e -v -p %HOST_PLATFORM% +call build.bat %PGO% %CONFIG% %FREETHREADING% -m -e -v -p %HOST_PLATFORM% +if errorlevel 1 exit 1 +cd .. + +:: Populate the root package directory +for %%x in (python%VERNODOTS%%THREAD%%_D%.dll python3%THREAD%%_D%.dll python%EXE_T%%_D%.exe pythonw%EXE_T%%_D%.exe) do ( + if exist %SRC_DIR%\PCbuild\%HOST_DIR%\%%x ( + copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\%%x %PREFIX% + ) else ( + echo "WARNING :: %SRC_DIR%\PCbuild\%HOST_DIR%\%%x does not exist" + ) +) + +for %%x in (python%THREAD%%_D%.pdb python%VERNODOTS%%THREAD%%_D%.pdb pythonw%THREAD%%_D%.pdb) do ( + if exist %SRC_DIR%\PCbuild\%HOST_DIR%\%%x ( + copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\%%x %PREFIX% + ) else ( + echo "WARNING :: %SRC_DIR%\PCbuild\%HOST_DIR%\%%x does not exist" + ) +) + +@echo on + +copy %SRC_DIR%\LICENSE %PREFIX%\LICENSE_PYTHON.txt +if errorlevel 1 exit 1 + +:: Populate the DLLs directory +mkdir %PREFIX%\DLLs +xcopy /s /y %SRC_DIR%\PCBuild\%HOST_DIR%\*.pyd %PREFIX%\DLLs\ +if errorlevel 1 exit 1 + +copy /Y %SRC_DIR%\PC\icons\py.ico %PREFIX%\DLLs\ +if errorlevel 1 exit 1 +copy /Y %SRC_DIR%\PC\icons\pyc.ico %PREFIX%\DLLs\ +if errorlevel 1 exit 1 + +:: Populate the Tools directory +mkdir %PREFIX%\Tools +xcopy /s /y /i %SRC_DIR%\Tools\i18n %PREFIX%\Tools\i18n +if errorlevel 1 exit 1 +xcopy /s /y /i %SRC_DIR%\Tools\scripts %PREFIX%\Tools\scripts +if errorlevel 1 exit 1 + +del %PREFIX%\Tools\scripts\README +if errorlevel 1 exit 1 +del %PREFIX%\Tools\scripts\idle3 +if errorlevel 1 exit 1 + +move /y %PREFIX%\Tools\scripts\pydoc3 %PREFIX%\Tools\scripts\pydoc3.py +if errorlevel 1 exit 1 + +:: Populate the include directory +xcopy /s /y %SRC_DIR%\Include %PREFIX%\include\ +if errorlevel 1 exit 1 + +:: Copy generated pyconfig.h +copy /Y %SRC_DIR%\PC\pyconfig.h %PREFIX%\include\ +if errorlevel 1 exit 1 + +:: Populate the Scripts directory +if not exist %SCRIPTS% (mkdir %SCRIPTS%) +if errorlevel 1 exit 1 + +for %%x in (idle pydoc) do ( + copy /Y %SRC_DIR%\Tools\scripts\%%x3 %SCRIPTS%\%%x + if errorlevel 1 exit 1 +) + +:: Populate the libs directory +if not exist %PREFIX%\libs mkdir %PREFIX%\libs +dir %SRC_DIR%\PCbuild\%HOST_DIR%\ +if exist %SRC_DIR%\PCbuild\%HOST_DIR%\python%VERNODOTS%%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\python%VERNODOTS%%THREAD%%_D%.lib %PREFIX%\libs\ +if errorlevel 1 exit 1 +if exist %SRC_DIR%\PCbuild\%HOST_DIR%\python3%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\python3%THREAD%%_D%.lib %PREFIX%\libs\ +if errorlevel 1 exit 1 +if exist %SRC_DIR%\PCbuild\%HOST_DIR%\_tkinter%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\_tkinter%THREAD%%_D%.lib %PREFIX%\libs\ +if errorlevel 1 exit 1 + + +:: Populate the Lib directory +del %PREFIX%\libs\libpython*.a +xcopy /s /y %SRC_DIR%\Lib %PREFIX%\Lib\ +if errorlevel 1 exit 1 + +:: Copy venv[w]launcher scripts to venv\srcipts\nt +:: See https://github.com/python/cpython/blob/b4a316087c32d83e375087fd35fc511bc430ee8b/Lib/venv/__init__.py#L334-L376 +if exist %SRC_DIR%\PCbuild\%HOST_DIR%\venvlauncher%THREAD%%_D%.exe ( + @rem We did copy pythonw.exe until 3.12 but starting with 3.13 we seem to need the latter. Should we omit the first? + copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\venvlauncher%THREAD%%_D%.exe %PREFIX%\Lib\venv\scripts\nt\python.exe + copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\venvlauncher%THREAD%%_D%.exe %PREFIX%\Lib\venv\scripts\nt\venvlauncher%THREAD%%_D%.exe +) else ( + echo "WARNING :: %SRC_DIR%\PCbuild\%HOST_DIR%\venvlauncher%THREAD%%_D%.exe does not exist" +) + +if exist %SRC_DIR%\PCbuild\%HOST_DIR%\venvwlauncher%THREAD%%_D%.exe ( + @rem We did copy pythonw.exe until 3.12 but starting with 3.13 we seem to need the latter. Should we omit the first? + copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\venvwlauncher%THREAD%%_D%.exe %PREFIX%\Lib\venv\scripts\nt\pythonw.exe + copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\venvwlauncher%THREAD%%_D%.exe %PREFIX%\Lib\venv\scripts\nt\venvwlauncher%THREAD%%_D%.exe +) else ( + echo "WARNING :: %SRC_DIR%\PCbuild\%HOST_DIR%\venvwlauncher%THREAD%%_D%.exe does not exist" +) + +:: Remove test data to save space. +:: Though keep `support` as some things use that. +mkdir %PREFIX%\Lib\test_keep +if errorlevel 1 exit 1 +move %PREFIX%\Lib\test\__init__.py %PREFIX%\Lib\test_keep\ +if errorlevel 1 exit 1 +move %PREFIX%\Lib\test\support %PREFIX%\Lib\test_keep\ +if errorlevel 1 exit 1 +rd /s /q %PREFIX%\Lib\test +if errorlevel 1 exit 1 +move %PREFIX%\Lib\test_keep %PREFIX%\Lib\test +if errorlevel 1 exit 1 + +:: We need our Python to be found! +if "%_D%" neq "" copy %PREFIX%\python%_D%.exe %PREFIX%\python.exe +if "%EXE_T%" neq "" copy %PREFIX%\python%EXE_T%.exe %PREFIX%\python.exe + +if "%CONDA_BUILD_CROSS_COMPILATION%" == "1" ( + set "PYTHON=%SRC_DIR%\PCbuild\%BUILD_DIR%\\python%EXE_T%%_D%.exe" +) else ( + set "PYTHON=%PREFIX%\python.exe" +) +:: bytecode compile the standard library +%PYTHON% -Wi %PREFIX%\Lib\compileall.py -f -q -x "bad_coding|badsyntax|py2_" %PREFIX%\Lib +if errorlevel 1 exit 1 + +:: Ensure that scripts are generated +:: https://github.com/conda-forge/python-feedstock/issues/384 +%PYTHON% %RECIPE_DIR%\fix_staged_scripts.py +if errorlevel 1 exit 1 + +if NOT "%CONDA_BUILD_CROSS_COMPILATION%" == "1" ( + REM Some quick tests for common failures + echo "Testing print() does not print: Hello" + %PREFIX%\python.exe -c "print()" 2>&1 | findstr /r /c:"Hello" + if %errorlevel% neq 1 exit /b 1 + + echo "Testing print('Hello') prints: Hello" + %PREFIX%\python.exe -c "print('Hello')" 2>&1 | findstr /r /c:"Hello" + if %errorlevel% neq 0 exit /b 1 + + echo "Testing import of os (no DLL needed) does not print: The specified module could not be found" + %PREFIX%\python.exe -v -c "import os" 2>&1 + %PREFIX%\python.exe -v -c "import os" 2>&1 | findstr /r /c:"The specified module could not be found" + if %errorlevel% neq 1 exit /b 1 + + echo "Testing import of _sqlite3 (DLL located via PATH needed) does not print: The specified module could not be found" + %PREFIX%\python.exe -v -c "import _sqlite3" 2>&1 + %PREFIX%\python.exe -v -c "import _sqlite3" 2>&1 | findstr /r /c:"The specified module could not be found" + if %errorlevel% neq 1 exit /b 1 +) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/conda_build_config.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c584a98b106f1a04bddaa1787fa1560d66c0c89d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/conda_build_config.yaml @@ -0,0 +1,48 @@ +CI: azure +CONDA_BUILD_SKIP_TESTS: '0' +build_type: release +bzip2: '1' +c_compiler: vs2022 +c_stdlib: vs +channel_sources: conda-forge/label/python_rc,conda-forge +channel_targets: conda-forge main +cpu_optimization_target: nocona +cran_mirror: https://cran.r-project.org +cxx_compiler: vs2022 +expat: '2' +extend_keys: +- ignore_version +- extend_keys +- pin_run_as_build +- ignore_build_only_deps +fortran_compiler: gfortran +freethreading: 'yes' +ignore_build_only_deps: +- numpy +- python +is_python_min: 'no' +libffi: '3.5' +liblzma_devel: '5' +libsqlite: '3' +lua: '5' +numpy: '1.16' +openssl: '3.5' +perl: 5.26.2 +pin_run_as_build: + python: + max_pin: x.x + min_pin: x.x + r-base: + max_pin: x.x + min_pin: x.x +python: '3.14' +python_impl: cpython +r_base: '3.4' +target_platform: win-64 +tk: '8.6' +vc: '14' +zip_keys: +- - build_type + - channel_targets +zlib: '1' +zstd: '1.5' diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/meta.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cb968db49a2b57b96ad2818efd3f0df55bc70ef4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/meta.yaml @@ -0,0 +1,200 @@ +# This file created by conda-build 26.3.0 +# ------------------------------------------------ + +package: + name: python + version: 3.14.4 +source: + - url: https://www.python.org/ftp/python/3.14.4/Python-3.14.4.tar.xz + sha256: d923c51303e38e249136fc1bdf3568d56ecb03214efdef48516176d3d7faaef8 + patches: + - patches/0001-Win32-Change-FD_SETSIZE-from-512-to-2048.patch + - patches/0002-Win32-Do-not-download-externals.patch + - patches/0003-Fix-find_library-so-that-it-looks-in-sys.prefix-lib-.patch + - patches/0004-Disable-registry-lookup-unless-CONDA_PY_ALLOW_REG_PA.patch + - patches/0005-Unvendor-openssl.patch + - patches/0006-Unvendor-sqlite3.patch + - patches/0007-Add-CondaEcosystemModifyDllSearchPath.patch + - patches/0008-Doing-d1trimfile.patch + - patches/0009-cross-compile-darwin.patch + - patches/0010-Fix-TZPATH-on-windows.patch + - patches/0011-Make-dyld-search-work-with-SYSTEM_VERSION_COMPAT-1.patch + - patches/0012-Unvendor-bzip2.patch + - patches/0013-Unvendor-libffi.patch + - patches/0014-Unvendor-tcltk.patch + - patches/0015-unvendor-xz.patch + - patches/0016-unvendor-zlib.patch + - patches/0017-Do-not-pass-g-to-GCC-when-not-Py_DEBUG.patch + - patches/0018-Unvendor-expat.patch + - patches/0019-Remove-unused-readelf.patch + - patches/0020-Don-t-checksharedmods-if-cross-compiling.patch + - patches/0021-Override-configure-LIBFFI.patch + - patches/0022-Unvendor-libmpdec.patch + - patches/0023-Brand-conda-forge.patch + - patches/0024-Do-not-define-pid_t-as-it-might-conflict-with-the-ac.patch + - patches/0025-Unvendor-zstd.patch + - patches/0026-Set-Py_GIL_DISABLED-in-windows-to-match-unix.patch +build: + number: 0 + activate_in_script: true + no_link: + - DLLs/_ctypes.pyd + ignore_run_exports_from: null + detect_binary_files_with_prefix: true + skip_compile_pyc: null + string: h7c1dbca_0_cp314t + python_site_packages_path: Lib/site-packages + run_exports: + noarch: + - python + weak: + - python_abi 3.14.* *_cp314t + track_features: + - py_freethreading + script_env: + - PY_FREETHREADING=yes + - PY_INTERP_DEBUG=no + missing_dso_whitelist: + - '**/MSVCR71.dll' + - '**/MSVCR80.dll' + - '**/api-ms-win-core-path-l1-1-0.dll' +requirements: + build: + - clang 19.1.7 default_hac490eb_8 + - clang-19 19.1.7 default_hac490eb_8 + - libiconv 1.18 hc1393d2_2 + - libllvm19 19.1.7 h830ff33_2 + - liblzma 5.8.2 hfd05255_0 + - libxml2 2.15.2 h5d26750_0 + - libxml2-16 2.15.2 h692994f_0 + - libzlib 1.3.2 hfd05255_2 + - llvm-tools 19.1.7 h752b59f_2 + - ucrt 10.0.26100.0 h57928b3_0 + - vc 14.3 h41ae7f8_34 + - vc14_runtime 14.44.35208 h818238b_34 + - vcomp14 14.44.35208 h818238b_34 + - vs2022_win-64 19.44.35207 ha74f236_34 + - vs_win-64 2022.14 ha74f236_34 + - vswhere 3.1.7 h40126e0_1 + - zstd 1.5.7 h534d264_6 + host: + - bzip2 1.0.8 h0ad9c76_9 + - ca-certificates 2026.2.25 h4c7d964_0 + - expat 2.7.5 hac47afa_0 + - libexpat 2.7.5 hac47afa_0 + - libffi 3.5.2 h3d046cb_0 + - liblzma 5.8.2 hfd05255_0 + - liblzma-devel 5.8.2 hfd05255_0 + - libmpdec 4.0.0 hfd05255_1 + - libmpdec-devel 4.0.0 h57928b3_1 + - libsqlite 3.52.0 hf5d6505_0 + - libzlib 1.3.2 hfd05255_2 + - openssl 3.5.6 hf411b9b_0 + - tk 8.6.13 h6ed50ae_3 + - ucrt 10.0.26100.0 h57928b3_0 + - vc 14.3 h41ae7f8_34 + - vc14_runtime 14.44.35208 h818238b_34 + - vcomp14 14.44.35208 h818238b_34 + - zlib 1.3.2 hfd05255_2 + - zstd 1.5.7 h534d264_6 + run: + - bzip2 >=1.0.8,<2.0a0 + - libexpat >=2.7.5,<3.0a0 + - libffi >=3.5.2,<3.6.0a0 + - liblzma >=5.8.2,<6.0a0 + - libmpdec >=4.0.0,<5.0a0 + - libsqlite >=3.52.0,<4.0a0 + - libzlib >=1.3.2,<2.0a0 + - openssl >=3.5.6,<4.0a0 + - python_abi 3.14.* *_cp314t + - tk >=8.6.13,<8.7.0a0 + - tzdata + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - zstd >=1.5.7,<1.6.0a0 +test: + downstreams: + - cython + - setuptools + requires: + - cmake + - ninja + - ripgrep + - vs2022_win-64 + - vs_win-64 + files: + - run_test.py + - tests/cmake/* + - tests/cython/* + - tests/prefix-replacement/* + commands: + - echo on + - set + - python -V + - pydoc -h + - set "PIP_NO_BUILD_ISOLATION=False" + - set "PIP_NO_DEPENDENCIES=True" + - set "PIP_IGNORE_INSTALLED=True" + - set "PIP_NO_INDEX=True" + - set "PIP_CACHE_DIR=%CONDA_PREFIX%/pip_cache" + - set "TEMP=%CONDA_PREFIX%/tmp" + - mkdir "%TEMP%" + - python -Im ensurepip --upgrade --default-pip + - python -c "from zoneinfo import ZoneInfo; from datetime import datetime; dt + = datetime(2020, 10, 31, 12, tzinfo=ZoneInfo('America/Los_Angeles')); print(dt.tzname())" + - python -m venv test-venv + - test-venv\\Scripts\\python.exe -c "import ctypes" + - if not exist %PREFIX%\\libs\\python3t.lib exit 1 + - if not exist %PREFIX%\\libs\\python314t.lib exit 1 + - if exist %PREFIX%\\Scripts\\pydoc exit 1 + - if exist %PREFIX%\\Scripts\\idle exit 1 + - if not exist %PREFIX%\\Scripts\\pydoc-script.py exit 1 + - if not exist %PREFIX%\\Scripts\\idle-script.py exit 1 + - if not exist %PREFIX%\\Scripts\\idle.exe exit 1 + - if not exist %PREFIX%\\Scripts\\pydoc.exe exit 1 + - if not exist %PREFIX%\\include\\pyconfig.h exit 1 + - pushd tests + - pushd cmake + - popd + - popd + - python run_test.py + - python -c "from ctypes import CFUNCTYPE; CFUNCTYPE(None)(id)" +about: + home: https://www.python.org/ + license: Python-2.0 + license_file: LICENSE + summary: General purpose programming language + description: "Python is a widely used high-level, general-purpose, interpreted,\ + \ dynamic\nprogramming language. Its design philosophy emphasizes code\nreadability,\ + \ and its syntax allows programmers to express concepts in\nfewer lines of code\ + \ than would be possible in languages such as C++ or\nJava. The language provides\ + \ constructs intended to enable clear programs\non both a small and large scale.\n\ + \nWe provide some meta packages for convenience.\nTo get a CPython flavour, use:\n\ + \n conda install cpython\n\nTo get the freethreading build (i.e. without the\ + \ Global Interpreter Lock - GIL):\n\n conda install python-freethreading\n\n\ + To get the default build (i.e. with the GIL):\n\n conda install python-gil\n\ + \nTo enable the use of the experimental JIT compiler in CPython:\n\n conda\ + \ install python-jit\n\nor set the environment variable PYTHON_JIT=1. Note that\ + \ the JIT support\nis available for x86_64 builds only.\n" + doc_url: https://www.python.org/doc/versions/ + doc_source_url: https://github.com/python/pythondotorg/blob/master/docs/source/index.rst + dev_url: https://docs.python.org/devguide/ +extra: + feedstock-name: python + recipe-maintainers: + - chrisburr + - isuruf + - jakirkham + - katietz + - mbargull + - msarahan + - ocefpaf + - pelson + - scopatz + - xhochy + final: true + copy_test_source_files: true + flow_run_id: azure_20260407.5.1 + remote_url: https://github.com/conda-forge/python-feedstock + sha: a7005d06fd1d03157a094ed247ed324e7924102d diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/LICENSE.txt b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..f6c152a191ca636ae911804d8abf3ae8e642c7d7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/LICENSE.txt @@ -0,0 +1,13 @@ +BSD 3-clause license +Copyright (c) 2015-2017, conda-forge +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/build_base.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/build_base.bat new file mode 100644 index 0000000000000000000000000000000000000000..7dd5ccfe8347cd210ff6cc5bf3f036f53a087a8d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/build_base.bat @@ -0,0 +1,241 @@ +setlocal EnableDelayedExpansion +echo on + +:: Compile python, extensions and external libraries +if "%target_platform%"=="win-64" ( + set HOST_PLATFORM=x64 + set HOST_DIR=amd64 +) +if "%target_platform%"=="win-32" ( + set HOST_PLATFORM=Win32 + set HOST_DIR=win32 +) +if "%target_platform%"=="win-arm64" ( + set HOST_PLATFORM=ARM64 + set HOST_DIR=arm64 +) + +if "%build_platform%"=="win-64" ( + set BUILD_PLATFORM=x64 + set BUILD_DIR=amd64 +) +if "%build_platform%"=="win-32" ( + set BUILD_PLATFORM=Win32 + set BUILD_DIR=win32 +) +if "%build_platform%"=="win-arm64" ( + set BUILD_PLATFORM=ARM64 + set BUILD_DIR=arm64 +) + +for /F "tokens=1,2 delims=." %%i in ("%PKG_VERSION%") do ( + set "VERNODOTS=%%i%%j" +) + +for /F "tokens=1,2 delims=." %%i in ("%PKG_VERSION%") do ( + set "VER=%%i.%%j" +) + +:: Make sure the "python" value in conda_build_config.yaml is up to date. +for /F "tokens=1,2 delims=." %%i in ("%PKG_VERSION%") do ( + if NOT "%PY_VER%"=="%%i.%%j" exit 1 +) + +for /f "usebackq delims=" %%i in (`conda list -p %PREFIX% sqlite --no-show-channel-urls --json ^| findstr "version"`) do set SQLITE3_VERSION_LINE=%%i +for /f "tokens=2 delims==/ " %%i IN ('echo %SQLITE3_VERSION_LINE%') do (set SQLITE3_VERSION=%%~i) +echo SQLITE3_VERSION detected as %SQLITE3_VERSION% + +if "%PY_INTERP_DEBUG%"=="yes" ( + set CONFIG=-d + set _D=_d +) else ( + set CONFIG= + set _D= +) + +set PGO=--pgo +if "%DEBUG_C%"=="yes" ( + set PGO= +) +if "%CONDA_BUILD_CROSS_COMPILATION%" == "1" ( + set PGO= +) + +if "%PY_FREETHREADING%" == "yes" ( + set "FREETHREADING=--disable-gil" + set "THREAD=t" + set "EXE_T=%VER%t" +) else ( + set "FREETHREADING=--experimental-jit-off" + set "THREAD=" + set "EXE_T=" +) + +cd PCbuild + +setlocal EnableDelayedExpansion +if "%CONDA_BUILD_CROSS_COMPILATION%" == "1" ( + REM build for the build platform. LIBRARY_PREFIX is used by the patches + REM No PGO. No externals, i.e. remove building extension modules + REM we don't need. + set LIBRARY_PREFIX=%BUILD_PREFIX%\\Library + call build.bat %CONFIG% %FREETHREADING% -m -E -v -p %BUILD_PLATFORM% + if errorlevel 1 exit 1 +) +endlocal +:: Twice because: +:: error : importlib_zipimport.h updated. You will need to rebuild pythoncore to see the changes. +call build.bat %PGO% %CONFIG% %FREETHREADING% -m -e -v -p %HOST_PLATFORM% +call build.bat %PGO% %CONFIG% %FREETHREADING% -m -e -v -p %HOST_PLATFORM% +if errorlevel 1 exit 1 +cd .. + +:: Populate the root package directory +for %%x in (python%VERNODOTS%%THREAD%%_D%.dll python3%THREAD%%_D%.dll python%EXE_T%%_D%.exe pythonw%EXE_T%%_D%.exe) do ( + if exist %SRC_DIR%\PCbuild\%HOST_DIR%\%%x ( + copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\%%x %PREFIX% + ) else ( + echo "WARNING :: %SRC_DIR%\PCbuild\%HOST_DIR%\%%x does not exist" + ) +) + +for %%x in (python%THREAD%%_D%.pdb python%VERNODOTS%%THREAD%%_D%.pdb pythonw%THREAD%%_D%.pdb) do ( + if exist %SRC_DIR%\PCbuild\%HOST_DIR%\%%x ( + copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\%%x %PREFIX% + ) else ( + echo "WARNING :: %SRC_DIR%\PCbuild\%HOST_DIR%\%%x does not exist" + ) +) + +@echo on + +copy %SRC_DIR%\LICENSE %PREFIX%\LICENSE_PYTHON.txt +if errorlevel 1 exit 1 + +:: Populate the DLLs directory +mkdir %PREFIX%\DLLs +xcopy /s /y %SRC_DIR%\PCBuild\%HOST_DIR%\*.pyd %PREFIX%\DLLs\ +if errorlevel 1 exit 1 + +copy /Y %SRC_DIR%\PC\icons\py.ico %PREFIX%\DLLs\ +if errorlevel 1 exit 1 +copy /Y %SRC_DIR%\PC\icons\pyc.ico %PREFIX%\DLLs\ +if errorlevel 1 exit 1 + +:: Populate the Tools directory +mkdir %PREFIX%\Tools +xcopy /s /y /i %SRC_DIR%\Tools\i18n %PREFIX%\Tools\i18n +if errorlevel 1 exit 1 +xcopy /s /y /i %SRC_DIR%\Tools\scripts %PREFIX%\Tools\scripts +if errorlevel 1 exit 1 + +del %PREFIX%\Tools\scripts\README +if errorlevel 1 exit 1 +del %PREFIX%\Tools\scripts\idle3 +if errorlevel 1 exit 1 + +move /y %PREFIX%\Tools\scripts\pydoc3 %PREFIX%\Tools\scripts\pydoc3.py +if errorlevel 1 exit 1 + +:: Populate the include directory +xcopy /s /y %SRC_DIR%\Include %PREFIX%\include\ +if errorlevel 1 exit 1 + +:: Copy generated pyconfig.h +copy /Y %SRC_DIR%\PC\pyconfig.h %PREFIX%\include\ +if errorlevel 1 exit 1 + +:: Populate the Scripts directory +if not exist %SCRIPTS% (mkdir %SCRIPTS%) +if errorlevel 1 exit 1 + +for %%x in (idle pydoc) do ( + copy /Y %SRC_DIR%\Tools\scripts\%%x3 %SCRIPTS%\%%x + if errorlevel 1 exit 1 +) + +:: Populate the libs directory +if not exist %PREFIX%\libs mkdir %PREFIX%\libs +dir %SRC_DIR%\PCbuild\%HOST_DIR%\ +if exist %SRC_DIR%\PCbuild\%HOST_DIR%\python%VERNODOTS%%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\python%VERNODOTS%%THREAD%%_D%.lib %PREFIX%\libs\ +if errorlevel 1 exit 1 +if exist %SRC_DIR%\PCbuild\%HOST_DIR%\python3%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\python3%THREAD%%_D%.lib %PREFIX%\libs\ +if errorlevel 1 exit 1 +if exist %SRC_DIR%\PCbuild\%HOST_DIR%\_tkinter%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\_tkinter%THREAD%%_D%.lib %PREFIX%\libs\ +if errorlevel 1 exit 1 + + +:: Populate the Lib directory +del %PREFIX%\libs\libpython*.a +xcopy /s /y %SRC_DIR%\Lib %PREFIX%\Lib\ +if errorlevel 1 exit 1 + +:: Copy venv[w]launcher scripts to venv\srcipts\nt +:: See https://github.com/python/cpython/blob/b4a316087c32d83e375087fd35fc511bc430ee8b/Lib/venv/__init__.py#L334-L376 +if exist %SRC_DIR%\PCbuild\%HOST_DIR%\venvlauncher%THREAD%%_D%.exe ( + @rem We did copy pythonw.exe until 3.12 but starting with 3.13 we seem to need the latter. Should we omit the first? + copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\venvlauncher%THREAD%%_D%.exe %PREFIX%\Lib\venv\scripts\nt\python.exe + copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\venvlauncher%THREAD%%_D%.exe %PREFIX%\Lib\venv\scripts\nt\venvlauncher%THREAD%%_D%.exe +) else ( + echo "WARNING :: %SRC_DIR%\PCbuild\%HOST_DIR%\venvlauncher%THREAD%%_D%.exe does not exist" +) + +if exist %SRC_DIR%\PCbuild\%HOST_DIR%\venvwlauncher%THREAD%%_D%.exe ( + @rem We did copy pythonw.exe until 3.12 but starting with 3.13 we seem to need the latter. Should we omit the first? + copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\venvwlauncher%THREAD%%_D%.exe %PREFIX%\Lib\venv\scripts\nt\pythonw.exe + copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\venvwlauncher%THREAD%%_D%.exe %PREFIX%\Lib\venv\scripts\nt\venvwlauncher%THREAD%%_D%.exe +) else ( + echo "WARNING :: %SRC_DIR%\PCbuild\%HOST_DIR%\venvwlauncher%THREAD%%_D%.exe does not exist" +) + +:: Remove test data to save space. +:: Though keep `support` as some things use that. +mkdir %PREFIX%\Lib\test_keep +if errorlevel 1 exit 1 +move %PREFIX%\Lib\test\__init__.py %PREFIX%\Lib\test_keep\ +if errorlevel 1 exit 1 +move %PREFIX%\Lib\test\support %PREFIX%\Lib\test_keep\ +if errorlevel 1 exit 1 +rd /s /q %PREFIX%\Lib\test +if errorlevel 1 exit 1 +move %PREFIX%\Lib\test_keep %PREFIX%\Lib\test +if errorlevel 1 exit 1 + +:: We need our Python to be found! +if "%_D%" neq "" copy %PREFIX%\python%_D%.exe %PREFIX%\python.exe +if "%EXE_T%" neq "" copy %PREFIX%\python%EXE_T%.exe %PREFIX%\python.exe + +if "%CONDA_BUILD_CROSS_COMPILATION%" == "1" ( + set "PYTHON=%SRC_DIR%\PCbuild\%BUILD_DIR%\\python%EXE_T%%_D%.exe" +) else ( + set "PYTHON=%PREFIX%\python.exe" +) +:: bytecode compile the standard library +%PYTHON% -Wi %PREFIX%\Lib\compileall.py -f -q -x "bad_coding|badsyntax|py2_" %PREFIX%\Lib +if errorlevel 1 exit 1 + +:: Ensure that scripts are generated +:: https://github.com/conda-forge/python-feedstock/issues/384 +%PYTHON% %RECIPE_DIR%\fix_staged_scripts.py +if errorlevel 1 exit 1 + +if NOT "%CONDA_BUILD_CROSS_COMPILATION%" == "1" ( + REM Some quick tests for common failures + echo "Testing print() does not print: Hello" + %PREFIX%\python.exe -c "print()" 2>&1 | findstr /r /c:"Hello" + if %errorlevel% neq 1 exit /b 1 + + echo "Testing print('Hello') prints: Hello" + %PREFIX%\python.exe -c "print('Hello')" 2>&1 | findstr /r /c:"Hello" + if %errorlevel% neq 0 exit /b 1 + + echo "Testing import of os (no DLL needed) does not print: The specified module could not be found" + %PREFIX%\python.exe -v -c "import os" 2>&1 + %PREFIX%\python.exe -v -c "import os" 2>&1 | findstr /r /c:"The specified module could not be found" + if %errorlevel% neq 1 exit /b 1 + + echo "Testing import of _sqlite3 (DLL located via PATH needed) does not print: The specified module could not be found" + %PREFIX%\python.exe -v -c "import _sqlite3" 2>&1 + %PREFIX%\python.exe -v -c "import _sqlite3" 2>&1 | findstr /r /c:"The specified module could not be found" + if %errorlevel% neq 1 exit /b 1 +) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/build_base.sh b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/build_base.sh new file mode 100644 index 0000000000000000000000000000000000000000..755075d50dcfdea87cfcbb08fad387dbb5c8b118 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/build_base.sh @@ -0,0 +1,548 @@ +#!/bin/bash +set -ex + +# Get an updated config.sub and config.guess +cp $BUILD_PREFIX/share/libtool/build-aux/config.* . + +if [[ ! -d ${SRC_DIR}/python-bin ]]; then + # Need an up-to-date python to build python. + # python 3.10 in miniforge is too old. + CONDA_SUBDIR=$build_platform conda create -p ${SRC_DIR}/python-bin python -c conda-forge --override-channels --yes --quiet + export PATH=${SRC_DIR}/python-bin/bin:${PATH} +fi + +# The LTO/PGO information was sourced from @pitrou and the Debian rules file in: +# http://http.debian.net/debian/pool/main/p/python3.6/python3.6_3.6.2-2.debian.tar.xz +# https://packages.debian.org/source/sid/python3.6 +# or: +# http://bazaar.launchpad.net/~doko/python/pkg3.5-debian/view/head:/rules#L255 +# .. but upstream regrtest.py now has --pgo (since >= 3.6) and skips tests that are: +# "not helpful for PGO". + +VERFULL=${PKG_VERSION} +VER=${PKG_VERSION%.*} +VERNODOTS=${VER//./} +TCLTK_VER=${tk} +# Disables some PGO/LTO +QUICK_BUILD=no + +_buildd_static=build-static +_buildd_shared=build-shared +_ENABLE_SHARED=--enable-shared +# We *still* build a shared lib here for non-static embedded use cases +_DISABLE_SHARED=--disable-shared + +# For debugging builds, set this to no to disable profile-guided optimization +if [[ ${PY_INTERP_DEBUG} == yes ]]; then + _OPTIMIZED=no +else + _OPTIMIZED=yes +fi + +if [[ ${PY_INTERP_DEBUG} == yes ]]; then + # check that the rerendering is correct + if [[ "$CI" != "" && "$channel_targets" == "conda-forge main" ]]; then + exit 1 + fi +fi + +declare -a _dbg_opts +if [[ ${PY_INTERP_DEBUG} == yes ]]; then + # This Python will not be usable with non-debug Python modules. + _dbg_opts+=(--with-pydebug) + DBG=d +else + DBG= +fi + +if [[ ${PY_FREETHREADING} == yes ]]; then + # This Python will not be usable with non-free threading Python modules. + THREAD=t +else + THREAD= +fi + +ABIFLAGS=${DBG}${THREAD} +VERABI=${VER}${THREAD}${DBG} +VERABI_NO_DBG=${VER}${THREAD} + +# Make sure the "python" value in conda_build_config.yaml is up to date. +test "${PY_VER}" = "${VER}" + +# This is the mechanism by which we fall back to default gcc, but having it defined here +# would probably break the build by using incorrect settings and/or importing files that +# do not yet exist. +unset _PYTHON_SYSCONFIGDATA_NAME +unset _CONDA_PYTHON_SYSCONFIGDATA_NAME + +# Prevent lib/python${VERABI_NO_DBG}/_sysconfigdata_*.py from ending up with full paths to these things +# in _build_env because _build_env will not get found during prefix replacement, only _h_env_placeh ... +AR=$(basename "${AR}") + +# CC must contain the string 'gcc' or else distutils thinks it is on macOS and uses '-R' to set rpaths. +if [[ ${target_platform} == osx-* ]]; then + CC=$(basename "${CC}") +else + CC=$(basename "${GCC}") +fi +CXX=$(basename "${CXX}") +RANLIB=$(basename "${RANLIB}") +READELF=$(basename "${READELF}") + +if [[ ${HOST} =~ .*darwin.* ]] && [[ -n ${CONDA_BUILD_SYSROOT} ]]; then + # Python's setup.py will figure out that this is a macOS sysroot. + CFLAGS="-isysroot ${CONDA_BUILD_SYSROOT} "${CFLAGS} + LDFLAGS="-isysroot ${CONDA_BUILD_SYSROOT} "${LDFLAGS} + CPPFLAGS="-isysroot ${CONDA_BUILD_SYSROOT} "${CPPFLAGS} +fi + +# Debian uses -O3 then resets it at the end to -O2 in _sysconfigdata.py +if [[ ${_OPTIMIZED} = yes ]]; then + CPPFLAGS=$(echo "${CPPFLAGS}" | sed "s/-O2/-O3/g") + CFLAGS=$(echo "${CFLAGS}" | sed "s/-O2/-O3/g") + CXXFLAGS=$(echo "${CXXFLAGS}" | sed "s/-O2/-O3/g") +fi + +if [[ ${PY_INTERP_DEBUG} == yes ]]; then + CPPFLAGS=$(echo "${CPPFLAGS}" | sed "s/-O2/-O0/g") + CFLAGS=$(echo "${CFLAGS}" | sed "s/-O2/-O0/g") + CXXFLAGS=$(echo "${CXXFLAGS}" | sed "s/-O2/-O0/g") +fi + +if [[ "$target_platform" == linux-* ]]; then + cp ${PREFIX}/include/uuid/uuid.h ${PREFIX}/include/uuid.h +fi + +declare -a LTO_CFLAGS=() + +# Following is needed for building extensions like zlib +CPPFLAGS=${CPPFLAGS}" -I${PREFIX}/include" + +re='^(.*)(-I[^ ]*)(.*)$' +if [[ ${CFLAGS} =~ $re ]]; then + CFLAGS="${BASH_REMATCH[1]}${BASH_REMATCH[3]}" +fi + +# Force rebuild to avoid: +# ../work/Modules/unicodename_db.h:24118:30: note: (near initialization for 'code_hash') +# ../work/Modules/unicodename_db.h:24118:33: warning: excess elements in scalar initializer +# 0, 0, 12018, 0, 0, 0, 0, 0, 4422, 4708, 3799, 119358, 119357, 0, 120510, +# ^~~~ +# This should have been fixed by https://github.com/python/cpython/commit/7c69c1c0fba8c1c8ff3969bce4c1135736a4cc58 +# .. but that appears incomplete. In particular, the generated files contain: +# /* this file was generated by Tools/unicode/makeunicodedata.py 3.2 */ +# .. yet the PR updated to version of makeunicodedata.py to 3.3 +# rm -f Modules/unicodedata_db.h Modules/unicodename_db.h +# ${SYS_PYTHON} ${SRC_DIR}/Tools/unicode/makeunicodedata.py +# .. instead we revert this commit for now. + +export CPPFLAGS CFLAGS CXXFLAGS LDFLAGS + +declare -a _common_configure_args + +if [[ "${CONDA_BUILD_CROSS_COMPILATION}" == "1" ]]; then + # Build the exact same Python for the build machine. It would be nice (and might be + # possible already?) to be able to make this just an 'exact' pinned build dependency + # of a split-package? + BUILD_PYTHON_PREFIX=${PWD}/build-python-install + mkdir build-python-build + pushd build-python-build + (export CC=${CC_FOR_BUILD} \ + CXX=${CXX_FOR_BUILD} \ + CPP="${CC_FOR_BUILD} -E" \ + CFLAGS="-O2 -I${BUILD_PREFIX}/include" \ + CPPFLAGS="-O2 -I${BUILD_PREFIX}/include" \ + LDFLAGS=${LDFLAGS//${PREFIX}/${BUILD_PREFIX}} \ + PKG_CONFIG_PATH=${BUILD_PREFIX}/lib/pkgconfig \ + AR="$(${CC_FOR_BUILD} --print-prog-name=ar)" \ + RANLIB="$(${CC_FOR_BUILD} --print-prog-name=ranlib)" \ + LD="$(${CC_FOR_BUILD} --print-prog-name=ld)" && \ + ${SRC_DIR}/configure --build=${BUILD} \ + --host=${BUILD} \ + --prefix=${BUILD_PYTHON_PREFIX} \ + --with-ensurepip=no \ + --with-tzpath=${PREFIX}/share/zoneinfo \ + --with-platlibdir=lib && \ + make -j${CPU_COUNT} && \ + make install) + export PATH=${BUILD_PYTHON_PREFIX}/bin:${PATH} + ln -s ${BUILD_PYTHON_PREFIX}/bin/python${VER} ${BUILD_PYTHON_PREFIX}/bin/python + popd + echo "ac_cv_file__dev_ptmx=yes" > config.site + echo "ac_cv_file__dev_ptc=no" >> config.site + echo "ac_cv_pthread=yes" >> config.site + echo "ac_cv_little_endian_double=yes" >> config.site + if [[ "${target_platform}" == "osx-arm64" || "${target_platform}" == "linux-ppc64le" || "${target_platform}" == "linux-aarch64" ]]; then + echo "ac_cv_aligned_required=no" >> config.site + echo "ac_cv_pthread_is_default=yes" >> config.site + echo "ac_cv_working_tzset=yes" >> config.site + echo "ac_cv_pthread_system_supported=yes" >> config.site + else + echo "unknown cross compiling platform" + exit 1 + fi + export CONFIG_SITE=${PWD}/config.site + # This is needed for libffi: + export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig + _common_configure_args+=(--with-build-python=${BUILD_PYTHON_PREFIX}/bin/python) +fi + +# This causes setup.py to query the sysroot directories from the compiler, something which +# IMHO should be done by default anyway with a flag to disable it to workaround broken ones. +# Technically, setting _PYTHON_HOST_PLATFORM causes setup.py to consider it cross_compiling +if [[ -n ${HOST} ]]; then + if [[ ${HOST} =~ .*darwin.* ]]; then + # Even if BUILD is .*darwin.* you get better isolation by cross_compiling (no /usr/local) + IFS='-' read -r host_arch host_os host_kernel <<<"${HOST}" + export _PYTHON_HOST_PLATFORM=darwin-${host_arch} + else + IFS='-' read -r host_arch host_vendor host_os host_libc <<<"${HOST}" + export _PYTHON_HOST_PLATFORM=${host_os}-${host_arch} + fi +fi + +if [[ ${target_platform} == osx-64 ]]; then + export MACHDEP=darwin + export ac_sys_system=Darwin + export ac_sys_release=13.4.0 + export MACOSX_DEFAULT_ARCH=x86_64 + # TODO: check with LLVM 12 if the following hack is needed. + # https://reviews.llvm.org/D76461 may have fixed the need for the following hack. + echo '#!/bin/bash' > $BUILD_PREFIX/bin/$HOST-llvm-ar + echo "$BUILD_PREFIX/bin/llvm-ar --format=darwin" '"$@"' >> $BUILD_PREFIX/bin/$HOST-llvm-ar + chmod +x $BUILD_PREFIX/bin/$HOST-llvm-ar + export ARCHFLAGS="-arch x86_64" +elif [[ ${target_platform} == osx-arm64 ]]; then + export MACHDEP=darwin + export ac_sys_system=Darwin + export ac_sys_release=20.0.0 + export MACOSX_DEFAULT_ARCH=arm64 + echo '#!/bin/bash' > $BUILD_PREFIX/bin/$HOST-llvm-ar + echo "$BUILD_PREFIX/bin/llvm-ar --format=darwin" '"$@"' >> $BUILD_PREFIX/bin/$HOST-llvm-ar + chmod +x $BUILD_PREFIX/bin/$HOST-llvm-ar + export ARCHFLAGS="-arch arm64" + export CFLAGS="$CFLAGS $ARCHFLAGS" +elif [[ ${target_platform} == linux-* ]]; then + export MACHDEP=linux + export ac_sys_system=Linux + export ac_sys_release= +fi + +# Not used at present but we should run 'make test' and finish up TESTOPTS (see debians rules). +declare -a TEST_EXCLUDES +TEST_EXCLUDES+=(test_ensurepip test_venv) +TEST_EXCLUDES+=(test_tcl test_codecmaps_cn test_codecmaps_hk + test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw + test_normalization test_ossaudiodev test_socket) +if [[ ! -f /dev/dsp ]]; then + TEST_EXCLUDES+=(test_linuxaudiodev test_ossaudiodev) +fi +# hangs on Aarch64, see LP: #1264354 +if [[ ${CC} =~ .*-aarch64.* ]]; then + TEST_EXCLUDES+=(test_faulthandler) +fi +if [[ ${CC} =~ .*-arm.* ]]; then + TEST_EXCLUDES+=(test_ctypes) + TEST_EXCLUDES+=(test_compiler) +fi + +_common_configure_args+=(--prefix=${PREFIX}) +_common_configure_args+=(--build=${BUILD}) +_common_configure_args+=(--host=${HOST}) +_common_configure_args+=(--enable-ipv6) +_common_configure_args+=(--with-ensurepip=no) +_common_configure_args+=(--with-tzpath=${PREFIX}/share/zoneinfo) +_common_configure_args+=(--with-computed-gotos) +_common_configure_args+=(--with-system-expat) +_common_configure_args+=(--enable-loadable-sqlite-extensions) +_common_configure_args+=(--with-tcltk-includes="-I${PREFIX}/include") +_common_configure_args+=("--with-tcltk-libs=-L${PREFIX}/lib -ltcl8.6 -ltk8.6") +_common_configure_args+=(--with-platlibdir=lib) + +if [[ "${PY_INTERP_DEBUG}" == "yes" || "${target_platform}" != *"-64" || ${PY_FREETHREADING} == yes ]]; then + _common_configure_args+=(--enable-experimental-jit=no) +else + _common_configure_args+=(--enable-experimental-jit=yes-off) +fi + +if [[ "${target_platform}" == osx-* ]]; then + # This should only be used with clang 20.1+ + _common_configure_args+=(--with-tail-call-interp) +fi + +if [[ ${PY_FREETHREADING} == yes ]]; then + _common_configure_args+=(--disable-gil) +fi + +# Add more optimization flags for the static Python interpreter: +declare -a PROFILE_TASK=() +if [[ ${_OPTIMIZED} == yes ]]; then + _common_configure_args+=(--with-lto=full) + if [[ "$CONDA_BUILD_CROSS_COMPILATION" != "1" ]]; then + _common_configure_args+=(--enable-optimizations) + _MAKE_TARGET=profile-opt + # To speed up build times during testing (1): + if [[ ${QUICK_BUILD} == yes ]]; then + # TODO :: It seems this is just profiling everything, on Windows, only 40 odd tests are + # run while on Unix, all 400+ are run, making this slower and less well curated + _PROFILE_TASK+=(PROFILE_TASK="-m test --pgo") + else + # From talking to Steve Dower, who implemented pgo/pgo-extended, it is really not worth + # it to run pgo-extended (which runs the whole test-suite). The --pgo set of tests are + # curated specifically to be useful/appropriate for pgo instrumentation. + # _PROFILE_TASK+=(PROFILE_TASK="-m test --pgo-extended") + _PROFILE_TASK+=(PROFILE_TASK="-m test --pgo") + fi + fi + if [[ ${CC} =~ .*gcc.* ]]; then + LTO_CFLAGS+=(-fuse-linker-plugin) + LTO_CFLAGS+=(-ffat-lto-objects) + # -flto must come after -flto-partition due to the replacement code + # TODO :: Replace the replacement code using conda-build's in-build regex replacement. + LTO_CFLAGS+=(-flto-partition=none) + LTO_CFLAGS+=(-flto) + else + # TODO :: Check if -flto=thin gives better results. It is about faster + # compilation rather than faster execution so probably not: + # http://clang.llvm.org/docs/ThinLTO.html + # http://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html + LTO_CFLAGS+=(-flto) + # -flto breaks the check to determine whether float word ordering is bigendian + # see: + # https://bugs.python.org/issue28015 + # https://bugs.python.org/issue38527 + # manually specify this setting + export ax_cv_c_float_words_bigendian=no + fi + export CFLAGS="${CFLAGS} ${LTO_CFLAGS[@]}" +else + _MAKE_TARGET= +fi + +mkdir -p ${_buildd_shared} +pushd ${_buildd_shared} + ${SRC_DIR}/configure "${_common_configure_args[@]}" \ + "${_dbg_opts[@]}" \ + --oldincludedir=${BUILD_PREFIX}/${HOST}/sysroot/usr/include \ + --enable-shared +popd + +mkdir -p ${_buildd_static} +pushd ${_buildd_static} + ${SRC_DIR}/configure "${_common_configure_args[@]}" \ + "${_dbg_opts[@]}" \ + -oldincludedir=${BUILD_PREFIX}/${HOST}/sysroot/usr/include \ + ${_DISABLE_SHARED} "${_PROFILE_TASK[@]}" +popd + +if [[ "${CI}" == "travis" ]]; then + # Travis has issues with long logs + make -j${CPU_COUNT} -C ${_buildd_static} \ + EXTRA_CFLAGS="${EXTRA_CFLAGS}" \ + ${_MAKE_TARGET} "${_PROFILE_TASK[@]}" 2>&1 >make-static.log +else + make -j${CPU_COUNT} -C ${_buildd_static} \ + EXTRA_CFLAGS="${EXTRA_CFLAGS}" \ + ${_MAKE_TARGET} "${_PROFILE_TASK[@]}" 2>&1 | tee make-static.log +fi +if rg "Failed to build these modules" make-static.log; then + echo "(static) :: Failed to build some modules, check the log" + exit 1 +fi + +if [[ "${CI}" == "travis" ]]; then + # Travis has issues with long logs + make -j${CPU_COUNT} -C ${_buildd_shared} \ + EXTRA_CFLAGS="${EXTRA_CFLAGS}" 2>&1 >make-shared.log +else + make -j${CPU_COUNT} -C ${_buildd_shared} \ + EXTRA_CFLAGS="${EXTRA_CFLAGS}" 2>&1 | tee make-shared.log +fi +if rg "Failed to build these modules" make-shared.log; then + echo "(shared) :: Failed to build some modules, check the log" + exit 1 +fi + +# build a static library with PIC objects and without LTO/PGO +make -j${CPU_COUNT} -C ${_buildd_shared} \ + EXTRA_CFLAGS="${EXTRA_CFLAGS}" \ + LIBRARY=libpython${VERABI_NO_DBG}-pic.a libpython${VERABI_NO_DBG}-pic.a + +make -C ${_buildd_static} install + +declare -a _FLAGS_REPLACE=() +if [[ ${_OPTIMIZED} == yes ]]; then + _FLAGS_REPLACE+=(-O3) + _FLAGS_REPLACE+=(-O2) + _FLAGS_REPLACE+=("-fprofile-use") + _FLAGS_REPLACE+=("") + _FLAGS_REPLACE+=("-fprofile-correction") + _FLAGS_REPLACE+=("") + _FLAGS_REPLACE+=("-L.") + _FLAGS_REPLACE+=("") + for _LTO_CFLAG in "${LTO_CFLAGS[@]}"; do + _FLAGS_REPLACE+=(${_LTO_CFLAG}) + _FLAGS_REPLACE+=("") + done +fi +# Install the shared library (for people who embed Python only, e.g. GDB). +# Linking module extensions to this on Linux is redundant (but harmless). +# Linking module extensions to this on Darwin is harmful (multiply defined symbols). +shopt -s extglob +cp -pf ${_buildd_shared}/libpython*${SHLIB_EXT}!(.lto) ${PREFIX}/lib/ +shopt -u extglob +if [[ ${target_platform} =~ .*linux.* ]]; then + ln -sf ${PREFIX}/lib/libpython${VERABI}${SHLIB_EXT}.1.0 ${PREFIX}/lib/libpython${VERABI}${SHLIB_EXT} +fi + +SYSCONFIG=$(find ${_buildd_static}/$(cat ${_buildd_static}/pybuilddir.txt) -name "_sysconfigdata*.py" -print0) +cat ${SYSCONFIG} | ${SYS_PYTHON} "${RECIPE_DIR}"/replace-word-pairs.py \ + "${_FLAGS_REPLACE[@]}" \ + > ${PREFIX}/lib/python${VERABI_NO_DBG}/$(basename ${SYSCONFIG}) +BUILD_DETAILS=${_buildd_shared}/$(cat ${_buildd_shared}/pybuilddir.txt)/build-details.json +cp ${BUILD_DETAILS} ${PREFIX}/lib/python${VERABI_NO_DBG}/ +MAKEFILE=$(find ${PREFIX}/lib/python${VERABI_NO_DBG}/ -path "*config-*/Makefile" -print0) +cp ${MAKEFILE} /tmp/Makefile-$$ +cat /tmp/Makefile-$$ | ${SYS_PYTHON} "${RECIPE_DIR}"/replace-word-pairs.py \ + "${_FLAGS_REPLACE[@]}" \ + > ${MAKEFILE} +# Check to see that our differences took. +# echo diff -urN ${SYSCONFIG} ${PREFIX}/lib/python${VERABI_NO_DBG}/$(basename ${SYSCONFIG}) +# diff -urN ${SYSCONFIG} ${PREFIX}/lib/python${VERABI_NO_DBG}/$(basename ${SYSCONFIG}) + +# Python installs python${VER}m and python${VER}, one as a hardlink to the other. conda-build breaks these +# by copying. Since the executable may be static it may be very large so change one to be a symlink +# of the other. In this case, python${VER}m will be the symlink. +if [[ -f ${PREFIX}/bin/python${VER}m ]]; then + rm -f ${PREFIX}/bin/python${VER}m + ln -s ${PREFIX}/bin/python${VER} ${PREFIX}/bin/python${VER}m +fi +ln -s ${PREFIX}/bin/python${VER} ${PREFIX}/bin/python +ln -s ${PREFIX}/bin/pydoc${VER} ${PREFIX}/bin/pydoc +# Workaround for https://github.com/conda/conda/issues/10969 +ln -s ${PREFIX}/bin/python${VER} ${PREFIX}/bin/python3.1 + +# Remove test data to save space +# Though keep `support` as some things use that. +# TODO :: Make a subpackage for this once we implement multi-level testing. +pushd ${PREFIX}/lib/python${VERABI_NO_DBG} + mkdir test_keep + mv test/__init__.py test/support test/test_support* test/test_script_helper* test_keep/ + rm -rf test */test + mv test_keep test +popd + +# Size reductions: +pushd ${PREFIX} + if [[ -f lib/libpython${VERABI}.a ]]; then + chmod +w lib/libpython${VERABI}.a + ${STRIP} -S lib/libpython${VERABI}.a + fi + CONFIG_LIBPYTHON=$(find lib/python${VERABI_NO_DBG}/config-${VERABI}* -name "libpython${VERABI}.a") + if [[ -f lib/libpython${VERABI}.a ]] && [[ -f ${CONFIG_LIBPYTHON} ]]; then + chmod +w ${CONFIG_LIBPYTHON} + rm ${CONFIG_LIBPYTHON} + fi +popd + +# Copy sysconfig that gets recorded to a non-default name +# using the new compilers with python will require setting _PYTHON_SYSCONFIGDATA_NAME +# to the name of this file (minus the .py extension) +pushd "${PREFIX}"/lib/python${VERABI_NO_DBG} + # On Python 3.5 _sysconfigdata.py was getting copied in here and compiled for some reason. + # This breaks our attempt to find the right one as recorded_name. + find lib-dynload -name "_sysconfigdata*.py*" -exec rm {} \; + recorded_name=$(find . -name "_sysconfigdata*.py") + our_compilers_name=_sysconfigdata_$(echo ${HOST} | sed -e 's/[.-]/_/g').py + # So we can see if anything has significantly diverged by looking in a built package. + cp ${recorded_name} ${recorded_name}.orig + cp ${recorded_name} sysconfigfile + # fdebug-prefix-map for python work dir is useless for extensions + sed -i.bak "s@-fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/python-$PKG_VERSION@@g" sysconfigfile + sed -i.bak "s@-fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix@@g" sysconfigfile + # Append the conda-forge zoneinfo to the end + sed -i.bak "s@zoneinfo'@zoneinfo:$PREFIX/share/tzinfo'@g" sysconfigfile + # Remove osx sysroot as it depends on the build machine + # be sure CONDA_BUILD_SYSROOT has value, as other we will remove here instead spaces + if [[ "${target_platform}" == osx-* ]] && [[ -n ${CONDA_BUILD_SYSROOT} ]]; then + sed -i.bak "s@-isysroot @@g" sysconfigfile + sed -i.bak "s@$CONDA_BUILD_SYSROOT @@g" sysconfigfile + fi + # Remove unfilled config option + sed -i.bak "s/@SGI_ABI@//g" sysconfigfile + sed -i.bak "s@$BUILD_PREFIX/bin/${HOST}-llvm-ar@${HOST}-ar@g" sysconfigfile + # Remove GNULD=yes to make sure new-dtags are not used + sed -i.bak "s/'GNULD': 'yes'/'GNULD': 'no'/g" sysconfigfile + cp sysconfigfile ${our_compilers_name} + + # For system gcc remove the triple + sed -i.bak "s@$HOST-c++@g++@g" sysconfigfile + sed -i.bak "s@$HOST-@@g" sysconfigfile + if [[ "$target_platform" == linux* ]]; then + # For linux, make sure the system gcc uses our linker + sed -i.bak "s@-pthread@-pthread -B $PREFIX/share/python_compiler_compat@g" sysconfigfile + fi + # Don't set -march and -mtune for system gcc + sed -i.bak "s@-march=[^( |\\\"|\\\')]*@@g" sysconfigfile + sed -i.bak "s@-mtune=[^( |\\\"|\\\')]*@@g" sysconfigfile + # Remove these flags that older compilers and linkers may not know + for flag in "-fstack-protector-strong" "-ffunction-sections" "-pipe" "-fno-plt" \ + "-ftree-vectorize" "-Wl,--sort-common" "-Wl,--as-needed" "-Wl,-z,relro" \ + "-Wl,-z,now" "-Wl,--disable-new-dtags" "-Wl,--gc-sections" "-Wl,-O2" \ + "-fPIE" "-ftree-vectorize" "-mssse3" "-Wl,-pie" "-Wl,-dead_strip_dylibs" \ + "-Wl,-headerpad_max_install_names"; do + sed -i.bak "s@$flag@@g" sysconfigfile + done + # Cleanup some extra spaces from above + sed -i.bak "s@' [ ]*@'@g" sysconfigfile + cp sysconfigfile $recorded_name + echo "========================sysconfig===========================" + cat $recorded_name + echo "============================================================" + + rm sysconfigfile + rm sysconfigfile.bak +popd + +if [[ ${HOST} =~ .*linux.* ]]; then + mkdir -p ${PREFIX}/share/python_compiler_compat + ln -s ${PREFIX}/bin/${HOST}-ld ${PREFIX}/share/python_compiler_compat/ld + echo "Files in this folder are to enhance backwards compatibility of anaconda software with older compilers." > ${PREFIX}/share/python_compiler_compat/README + echo "See: https://github.com/conda/conda/issues/6030 for more information." >> ${PREFIX}/share/python_compiler_compat/README +fi + +python -c "import compileall,os;compileall.compile_dir(os.environ['PREFIX'])" +rm ${PREFIX}/lib/libpython${VERABI}.a + +if [[ ${PY_INTERP_DEBUG} == yes ]]; then + rm ${PREFIX}/bin/python${VER} + ln -s ${PREFIX}/bin/python${VERABI} ${PREFIX}/bin/python${VER} + ln -s ${PREFIX}/lib/libpython${VERABI}${SHLIB_EXT} ${PREFIX}/lib/libpython${VERABI_NO_DBG}${SHLIB_EXT} + ln -s ${PREFIX}/include/python${VERABI} ${PREFIX}/include/python${VER} +fi + +if [[ "$target_platform" == linux-* ]]; then + rm ${PREFIX}/include/uuid.h +fi + +# Workaround for https://github.com/conda/conda/issues/14053 +# Older conda versions install noarch: python packages in wrong places. +# For example python3.1 because older conda assumed python minor version +# will have only one digit. noarhc pkgs for freethreading builds are supposed +# to be installed into /lib/python3.13t/site-packages, but conda +# installs them to /lib/python3.13/site-packages. +# The workaround is to add all these wrong paths to sys.path using +# a pth file so that cpython and other tools like pip know about these +# locations to check when importing packages and uninstalling packages. +# When installing packages, pip will use the correct location +# /lib/python3.13t/site-packages. +# Note that these directories are not added to sys.path if they do not exist. +SP_DIR="${PREFIX}/lib/python${PY_VER}${THREAD}/site-packages" +if [[ ${PY_FREETHREADING} == yes ]]; then + echo "${PREFIX}/lib/python${PY_VER}/site-packages" >> $SP_DIR/conda-site.pth +fi +# Workaround for https://github.com/conda/conda/issues/10969 +echo "${PREFIX}/lib/python3.1/site-packages" >> $SP_DIR/conda-site.pth +# A python version independent directory that ABI3 and noarch packages can use. +# This is unused at the moment, but keeping it here for experimentation. +echo "${PREFIX}/lib/python/site-packages" >> $SP_DIR/conda-site.pth diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/build_static.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/build_static.bat new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/build_static.sh b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/build_static.sh new file mode 100644 index 0000000000000000000000000000000000000000..9027bc0cc8776e9a6144b221aa59476a61946402 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/build_static.sh @@ -0,0 +1,33 @@ +#!/bin/bash +set -ex + +_buildd_static=build-static +_buildd_shared=build-shared +if [[ ${PY_INTERP_DEBUG} == yes ]]; then + DBG=d +else + DBG= +fi +if [[ ${PY_FREETHREADING} == yes ]]; then + # This Python will not be usable with non-free threading Python modules. + THREAD=t +else + THREAD= +fi + +VER=${PKG_VERSION%.*} +ABIFLAGS=${DBG}${THREAD} +VERABI=${VER}${THREAD}${DBG} +VERABI_NO_DBG=${VER}${THREAD} + +cp -pf ${_buildd_static}/libpython${VERABI}.a ${PREFIX}/lib/libpython${VERABI}.a +if [[ ${HOST} =~ .*linux.* ]]; then + pushd ${PREFIX}/lib/python${VERABI_NO_DBG}/config-${VERABI}-${HOST/-conda/} +elif [[ ${HOST} =~ .*darwin.* ]]; then + pushd ${PREFIX}/lib/python${VERABI_NO_DBG}/config-${VERABI}-darwin +fi +ln -s ../../libpython${VERABI}.a libpython${VERABI}.a +popd +# If the LTO info in the normal lib is problematic (using different compilers for example +# we also provide a 'nolto' version). +cp -pf ${_buildd_shared}/libpython${VERABI_NO_DBG}-pic.a ${PREFIX}/lib/libpython${VERABI_NO_DBG}.nolto.a diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/conda_build_config.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..280eac5f6ce8d72cc6a56a6e4e66217fb6126178 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/conda_build_config.yaml @@ -0,0 +1,37 @@ +MACOSX_SDK_VERSION: # [osx and x86_64] + - 11.0 # [osx and x86_64] +# See https://docs.python.org/3.14/whatsnew/3.14.html#a-new-type-of-interpreter +c_compiler_version: # [osx] + - 20.1 # [osx] +cxx_compiler_version: # [osx] + - 20.1 # [osx] + +# Override Python `zip_keys` +python: + - 3.14 +numpy: + - 1.16 +python_impl: + - cpython +is_python_min: + - no + +# Whether to build free-threaded Python (3.13+) +freethreading: + - yes + - no + +# Use Python RC components in build +channel_sources: + - conda-forge/label/python_rc,conda-forge + +# Configuration for debug and release builds +build_type: + - release + - debug # [not win] +channel_targets: + - conda-forge main + - conda-forge python_debug # [not win] +zip_keys: + - build_type + - channel_targets diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/fix_staged_scripts.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/fix_staged_scripts.py new file mode 100644 index 0000000000000000000000000000000000000000..29489b30db4f6d422168675a864233d036832b42 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/fix_staged_scripts.py @@ -0,0 +1,41 @@ +from os.path import isdir, isfile, dirname, join + +import os +import shutil + + +# Taken and adapted from conda_build/windows.py +def fix_staged_scripts(scripts_dir): + """ + Fixes scripts which have been installed unix-style to have a .bat + helper + """ + if not isdir(scripts_dir): + return + for fn in os.listdir(scripts_dir): + # process all the extensionless files + if not isfile(join(scripts_dir, fn)) or '.' in fn: + continue + + # read as binary file to ensure we don't run into encoding errors, see #1632 + with open(join(scripts_dir, fn), 'rb') as f: + line = f.readline() + # If it's a #!python script + if not (line.startswith(b'#!') and b'python' in line.lower()): + continue + print('Adjusting unix-style #! script %s, ' + 'and adding a .bat file for it' % fn) + # copy it with a .py extension (skipping that first #! line) + with open(join(scripts_dir, fn + '-script.py'), 'wb') as fo: + fo.write(f.read()) + # now create the .exe file + # This is hardcoded that conda and conda-build are in the same environment + base_env = dirname(dirname(os.environ['CONDA_EXE'])) + exe = join(base_env, 'lib', 'site-packages', 'conda_build', 'cli-64.exe') + shutil.copyfile(exe, join(scripts_dir, fn + '.exe')) + + # remove the original script + os.remove(join(scripts_dir, fn)) + + +fix_staged_scripts(os.environ['SCRIPTS']) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/install_jit_activation.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/install_jit_activation.bat new file mode 100644 index 0000000000000000000000000000000000000000..799d08944fbd960e0d247ff031d7b3e3c7086f0f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/install_jit_activation.bat @@ -0,0 +1,16 @@ +@echo on + +:: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d. +:: This will allow them to be run on environment activation. +if not exist %PREFIX%\etc\conda\activate.d mkdir %PREFIX%\etc\conda\activate.d +copy %RECIPE_DIR%\scripts\activate.bat %PREFIX%\etc\conda\activate.d\%PKG_NAME%_activate.bat +if errorlevel 1 exit 1 +:: We also copy .sh scripts to be able to use them with POSIX CLI on Windows. +copy %RECIPE_DIR%\scripts\activate.sh %PREFIX%\etc\conda\activate.d\%PKG_NAME%_activate.sh +if errorlevel 1 exit 1 + +if not exist %PREFIX%\etc\conda\deactivate.d mkdir %PREFIX%\etc\conda\deactivate.d +copy %RECIPE_DIR%\scripts\deactivate.bat %PREFIX%\etc\conda\deactivate.d\%PKG_NAME%_deactivate.bat +if errorlevel 1 exit 1 +copy %RECIPE_DIR%\scripts\deactivate.sh %PREFIX%\etc\conda\deactivate.d\%PKG_NAME%_deactivate.sh +if errorlevel 1 exit 1 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/install_jit_activation.sh b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/install_jit_activation.sh new file mode 100644 index 0000000000000000000000000000000000000000..d8e18109a347d577c411753eef86713bcc4d8bd5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/install_jit_activation.sh @@ -0,0 +1,7 @@ +# Copy the [de]activate scripts to $PREFIX/etc/conda/[de]activate.d. +# This will allow them to be run on environment activation. +for CHANGE in "activate" "deactivate" +do + mkdir -p "${PREFIX}/etc/conda/${CHANGE}.d" + cp "${RECIPE_DIR}/scripts/${CHANGE}.sh" "${PREFIX}/etc/conda/${CHANGE}.d/${PKG_NAME}_${CHANGE}.sh" +done diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/meta.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..41f14fc5f12b83dc79bc4fd70f1eb2ddb322db32 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/meta.yaml @@ -0,0 +1,414 @@ +{% set version = "3.14.4" %} +{% set dev = "" %} +{% set dev_ = "" %} +{% set ver2 = '.'.join(version.split('.')[0:2]) %} +{% set ver2nd = ''.join(version.split('.')[0:2]) %} +{% set ver3nd = ''.join(version.split('.')[0:3]) %} +{% set build_number = 0 %} + +# this makes the linter happy +{% set channel_targets = channel_targets or 'conda-forge main' %} + +# Sanitize build system env. var tweak parameters +# (passed to the build scripts via script_env). +{% if freethreading is not defined %} + {% set freethreading = "yes" %} +{% endif %} + +{% set abi_tag = "cp" + ver2nd %} +# freethreading, set using conda_build_config.yaml +{% if freethreading == "yes" %} + {% set abi_tag = abi_tag + "t" %} +{% else %} + {% set build_number = build_number + 100 %} +{% endif %} + +{% if build_type == "debug" %} + {% set py_interp_debug = "yes" %} + {% set debug = "_debug" %} +{% else %} + {% set py_interp_debug = "no" %} + {% set debug = "" %} +{% endif %} + +{% if win %} + {% set site_packages_path = "Lib/site-packages" %} +{% elif freethreading == "yes" %} + {% set site_packages_path = "lib/python" + ver2 + "t/site-packages" %} +{% else %} + {% set site_packages_path = "lib/python" + ver2 + "/site-packages" %} +{% endif %} + +package: + name: python-split + version: {{ version }}{{ dev }} + +source: + - url: https://www.python.org/ftp/python/{{ version }}/Python-{{ version }}{{ dev }}.tar.xz + # sha256 from: https://www.python.org/downloads/release/python-{{ ver3nd }}{{ dev }}/ + sha256: d923c51303e38e249136fc1bdf3568d56ecb03214efdef48516176d3d7faaef8 + patches: + - patches/0001-Win32-Change-FD_SETSIZE-from-512-to-2048.patch + - patches/0002-Win32-Do-not-download-externals.patch + - patches/0003-Fix-find_library-so-that-it-looks-in-sys.prefix-lib-.patch + - patches/0004-Disable-registry-lookup-unless-CONDA_PY_ALLOW_REG_PA.patch + - patches/0005-Unvendor-openssl.patch + - patches/0006-Unvendor-sqlite3.patch + - patches/0007-Add-CondaEcosystemModifyDllSearchPath.patch + - patches/0008-Doing-d1trimfile.patch + # https://github.com/python/cpython/pull/23523 + - patches/0009-cross-compile-darwin.patch + - patches/0010-Fix-TZPATH-on-windows.patch + # https://github.com/python/cpython/pull/24324 + - patches/0011-Make-dyld-search-work-with-SYSTEM_VERSION_COMPAT-1.patch + - patches/0012-Unvendor-bzip2.patch + - patches/0013-Unvendor-libffi.patch + - patches/0014-Unvendor-tcltk.patch + - patches/0015-unvendor-xz.patch + - patches/0016-unvendor-zlib.patch + - patches/0017-Do-not-pass-g-to-GCC-when-not-Py_DEBUG.patch + - patches/0018-Unvendor-expat.patch + - patches/0019-Remove-unused-readelf.patch + - patches/0020-Don-t-checksharedmods-if-cross-compiling.patch + - patches/0021-Override-configure-LIBFFI.patch + - patches/0022-Unvendor-libmpdec.patch +{% if 'conda-forge' in channel_targets %} + - patches/0023-Brand-conda-forge.patch +{% endif %} + - patches/0024-Do-not-define-pid_t-as-it-might-conflict-with-the-ac.patch + - patches/0025-Unvendor-zstd.patch +{% if freethreading == "yes" %} + - patches/0026-Set-Py_GIL_DISABLED-in-windows-to-match-unix.patch +{% endif %} + +build: + number: {{ build_number }} + +requirements: + build: + - patch # [not win] + - m2-patch # [win] + - m2-gcc-libs # [win] + +outputs: + - name: python + script: build_base.sh # [unix] + script: build_base.bat # [win] + build: + number: {{ build_number }} + activate_in_script: true + # Windows has issues updating python if conda is using files itself. + # Copy rather than link. + no_link: + - DLLs/_ctypes.pyd # [win] + ignore_run_exports_from: + # C++ only installed so CXX is defined for distutils/sysconfig. + - {{ compiler('cxx') }} # [unix] + # These two are just to get the headers needed for tk.h, but is unused + - xorg-libx11 # [unix] + - xorg-xorgproto # [unix] + # Disabled until verified to work correctly + detect_binary_files_with_prefix: true + # detect_binary_files_with_prefix: False + # binary_has_prefix_files: + # - lib/libpython{{ ver2 }}.*.1.0 + # - bin/python{{ ver2 }} # [linux] + # - lib/libpython{{ ver2 }}.a # [linux] + # - lib/libpython{{ ver2 }}.nolto.a # [linux] + # - lib/libpython3.so # [linux] + # - lib/python{{ ver2 }}/lib-dynload/_hashlib.cpython-{{ ver2nd }}-x86_64-linux-gnu.so # [linux] + # - lib/libpython3.dylib # [osx] + # match python.org compiler standard + skip: true # [win and int(float(vc)) < 14] + skip_compile_pyc: + - '*.py' # [build_platform != target_platform] + string: {{ dev_ }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ debug }}_{{ abi_tag }} + python_site_packages_path: {{ site_packages_path }} + run_exports: + noarch: + - python + weak: + - python_abi {{ ver2 }}.* *_{{ abi_tag }} +{% if py_interp_debug == "yes" %} + - python {{ ver2 }}.* *_debug_{{ abi_tag }} +{% endif %} + track_features: +{% if freethreading == "yes" %} + - py_freethreading +{% endif %} + script_env: + - PY_INTERP_DEBUG={{ py_interp_debug }} + - PY_FREETHREADING={{ freethreading }} + # Putting these here means they get emitted to build_env_setup.{sh,bat} meaning we can launch IDEs + # after sourcing or calling that script without examine the contents of conda_build.{sh,bat} for + # important env. vars. + missing_dso_whitelist: # [win] + - '**/MSVCR71.dll' # [win] + - '**/MSVCR80.dll' # [win] + # I have no idea why this is not in C:\Windows\System32\downlevel + - '**/api-ms-win-core-path-l1-1-0.dll' # [win] + requirements: + build: + - {{ compiler('c') }} + - {{ stdlib('c') }} + - {{ compiler('cxx') }} + - make # [not win] + - libtool # [unix] + - pkg-config # [not win] + # configure script looks for llvm-ar for lto + - llvm-tools # [osx] + - ld_impl_{{ target_platform }} # [linux] + - binutils_impl_{{ target_platform }} # [linux] + - clang-19 # [not win] + - llvm-tools-19 # [not win] + - clang 19.* # [win] + - llvm-tools 19.* # [win] + - bzip2 # [build_platform != target_platform] + - libsqlite # [build_platform != target_platform] + - liblzma-devel # [build_platform != target_platform] + - zlib # [build_platform != target_platform] + - zstd # [build_platform != target_platform] + - openssl # [build_platform != target_platform] + - readline # [not win and build_platform != target_platform] + - tk # [build_platform != target_platform] + - ncurses # [unix and build_platform != target_platform] + - libffi # [build_platform != target_platform] + - libuuid # [linux and build_platform != target_platform] + - libmpdec-devel # [build_platform != target_platform] + - expat # [build_platform != target_platform] + host: + - bzip2 + - libsqlite + - liblzma-devel + - zlib + - zstd + - openssl + - readline # [not win] + - tk + # These two are just to get the headers needed for tk.h, but is unused + - xorg-libx11 # [unix] + - xorg-xorgproto # [unix] + - ncurses # [unix] + - libffi + - ld_impl_{{ target_platform }} >=2.36.1 # [linux] + - libuuid # [linux] + - libmpdec-devel + - expat + run: + - ld_impl_{{ target_platform }} >=2.36.1 # [linux] + - tzdata +{% if dev != '' %} + - _python_rc +{% endif %} + - python_abi {{ ver2 }}.* *_{{ abi_tag }} + test: + downstreams: + - cython + - setuptools + requires: + - ripgrep + - cmake + - ninja + - {{ stdlib('c') }} + - {{ compiler('c') }} + # Tried to use enable_language(C) to avoid needing this. It does not work. + - {{ compiler('cxx') }} + # For tkinter, but we expect from system + - xorg-libx11 # [unix] + files: + - tests/cmake/* + - tests/cython/* + - tests/prefix-replacement/* + - run_test.py + commands: + - echo on # [win] + - set # [win] + - python -V + - python3 -V # [not win] + - pydoc -h + - python3-config --help # [not win] + - set "PIP_NO_BUILD_ISOLATION=False" # [win] + - set "PIP_NO_DEPENDENCIES=True" # [win] + - set "PIP_IGNORE_INSTALLED=True" # [win] + - set "PIP_NO_INDEX=True" # [win] + - set "PIP_CACHE_DIR=%CONDA_PREFIX%/pip_cache" # [win] + - set "TEMP=%CONDA_PREFIX%/tmp" # [win] + - mkdir "%TEMP%" # [win] + - python -Im ensurepip --upgrade --default-pip # [win] + # tzdata/zoneinfo test that will need the tzdata package to pass + - python -c "from zoneinfo import ZoneInfo; from datetime import datetime; dt = datetime(2020, 10, 31, 12, tzinfo=ZoneInfo('America/Los_Angeles')); print(dt.tzname())" + - python -m venv test-venv + - test-venv\\Scripts\\python.exe -c "import ctypes" # [win] + - test-venv/bin/python -c "import ctypes" # [unix] + - python -c "import sysconfig; print(sysconfig.get_config_var('CC'))" # [not win] + - _CONDA_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_x86_64_conda_linux_gnu python -c "import sysconfig; print(sysconfig.get_config_var('CC'))" # [linux64] + # check for unreplaced @ symbols in sysconfig files, excluding e.g. '"$@".lto' + - for f in ${CONDA_PREFIX}/lib/python*/_sysconfig*.py; do echo "Checking $f:"; if [[ `rg @[^@]*@ $f` ]]; then echo "FAILED ON $f"; cat $f; exit 1; fi; done # [linux64 or osx] + - test ! -f ${PREFIX}/lib/libpython${PKG_VERSION%.*}.a # [unix] + - test ! -f ${PREFIX}/lib/libpython${PKG_VERSION%.*}.nolto.a # [unix] + {% if freethreading == "yes" %} + - if not exist %PREFIX%\\libs\\python3t.lib exit 1 # [win] + - if not exist %PREFIX%\\libs\\python{{ ver2nd }}t.lib exit 1 # [win] + {% else %} + - if not exist %PREFIX%\\libs\\python3.lib exit 1 # [win] + - if not exist %PREFIX%\\libs\\python{{ ver2nd }}.lib exit 1 # [win] + {% endif %} + # https://github.com/conda-forge/python-feedstock/issues/384 + - if exist %PREFIX%\\Scripts\\pydoc exit 1 # [win] + - if exist %PREFIX%\\Scripts\\idle exit 1 # [win] + - if not exist %PREFIX%\\Scripts\\pydoc-script.py exit 1 # [win] + - if not exist %PREFIX%\\Scripts\\idle-script.py exit 1 # [win] + - if not exist %PREFIX%\\Scripts\\idle.exe exit 1 # [win] + - if not exist %PREFIX%\\Scripts\\pydoc.exe exit 1 # [win] + - if not exist %PREFIX%\\include\\pyconfig.h exit 1 # [win] + - pushd tests + - pushd prefix-replacement # [unix] + - bash build-and-test.sh # [unix] + - popd # [unix] + - pushd cmake +{% if freethreading == "no" %} + # TODO: use the new FindPython3 which supports freethreading + - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . +{% endif %} + - popd + - popd + - python run_test.py + - test ! -f default.profraw # [osx] + - python3.1 --version # [unix] + # Test for segfault on osx-64 with libffi=3.4, see https://bugs.python.org/issue44556 + - python -c "from ctypes import CFUNCTYPE; CFUNCTYPE(None)(id)" + # Test for wide character supported via ncursesw + - TERM=xterm >/dev/null python -c "import curses; scr = curses.initscr(); curses.unget_wch('x'); assert 'x' == scr.get_wch()" # [unix] + + - name: libpython-static + script: build_static.sh # [unix] + script: build_static.bat # [win] + build: + number: {{ build_number }} + activate_in_script: true + ignore_run_exports: + - python_abi + script_env: + - PY_INTERP_DEBUG={{ py_interp_debug }} + - PY_FREETHREADING={{ freethreading }} + string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ debug }}_{{ abi_tag }} + requirements: + build: + - {{ compiler('c') }} + - {{ stdlib('c') }} + - {{ compiler('cxx') }} + host: + - {{ pin_subpackage('python', exact=True) }} + run: + - {{ pin_subpackage('python', exact=True) }} + test: + files: + - tests/prefix-replacement/* + requires: + - {{ stdlib('c') }} + - {{ compiler('c') }} + - ripgrep + commands: + - VER=${PKG_VERSION%.*} # [not win] + - VERABI=${VER} # [not win] +{% if freethreading == "yes" %} + - VERABI=${VERABI}t # [not win] +{% endif %} + - VERABI_NO_DBG=${VERABI} # [not win] +{% if py_interp_debug == "yes" %} + - VERABI=${VERABI}d # [not win] +{% endif %} + - test -f ${PREFIX}/lib/libpython${VERABI}.a # [unix] + - test -f ${PREFIX}/lib/libpython${VERABI_NO_DBG}.nolto.a # [unix] + - test -f ${PREFIX}/lib/python${VERABI_NO_DBG}/config-${VERABI}-darwin/libpython${VERABI}.a # [osx] + - pushd tests/prefix-replacement # [unix] + - bash build-and-test.sh # [unix] + - popd # [unix] + + - name: cpython + build: + noarch: generic + requirements: + - python {{ version }}{{ dev }} + - python_abi * *_{{ abi_tag }} + + - name: python-freethreading + build: + noarch: generic +{% if freethreading != "yes" %} + skip: true +{% endif %} + requirements: + - cpython {{ version }}{{ dev }} + - python_abi * *_{{ abi_tag }} + + - name: python-gil + build: + noarch: generic +{% if freethreading == "yes" %} + skip: true +{% endif %} + requirements: + - cpython {{ version }}{{ dev }} + - python_abi * *_{{ abi_tag }} + + - name: python-jit + script: install_jit_activation.sh # [not win] + script: install_jit_activation.bat # [win] + build: + noarch: generic + requirements: + - cpython {{ version }}{{ dev }} + - __unix # [unix] + - __win # [win] + +about: + home: https://www.python.org/ + license: Python-2.0 + license_file: LICENSE + summary: General purpose programming language + description: | + Python is a widely used high-level, general-purpose, interpreted, dynamic + programming language. Its design philosophy emphasizes code + readability, and its syntax allows programmers to express concepts in + fewer lines of code than would be possible in languages such as C++ or + Java. The language provides constructs intended to enable clear programs + on both a small and large scale. + + We provide some meta packages for convenience. + To get a CPython flavour, use: + + conda install cpython + + To get the freethreading build (i.e. without the Global Interpreter Lock - GIL): + + conda install python-freethreading + + To get the default build (i.e. with the GIL): + + conda install python-gil + + To enable the use of the experimental JIT compiler in CPython: + + conda install python-jit + + or set the environment variable PYTHON_JIT=1. Note that the JIT support + is available for x86_64 builds only. + + doc_url: https://www.python.org/doc/versions/ + doc_source_url: https://github.com/python/pythondotorg/blob/master/docs/source/index.rst + dev_url: https://docs.python.org/devguide/ + +extra: + feedstock-name: python + recipe-maintainers: + - chrisburr + - isuruf + - jakirkham + - mbargull + - msarahan + - pelson + - ocefpaf + - scopatz + - katietz + - xhochy diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0001-Win32-Change-FD_SETSIZE-from-512-to-2048.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0001-Win32-Change-FD_SETSIZE-from-512-to-2048.patch new file mode 100644 index 0000000000000000000000000000000000000000..371daf0ec071f4bd67f95aa1af29d706f12b2ca7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0001-Win32-Change-FD_SETSIZE-from-512-to-2048.patch @@ -0,0 +1,23 @@ +From bc87f7d41e5dbda75de04d93b6e60075f579d5f2 Mon Sep 17 00:00:00 2001 +From: Ray Donnelly +Date: Wed, 16 Aug 2017 11:53:55 +0100 +Subject: [PATCH 01/26] Win32: Change FD_SETSIZE from 512 to 2048 + +https://github.com/ContinuumIO/anaconda-issues/issues/1241 +--- + Modules/selectmodule.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c +index d234d504cb5..3856307c611 100644 +--- a/Modules/selectmodule.c ++++ b/Modules/selectmodule.c +@@ -44,7 +44,7 @@ + FD_SETSIZE higher before this; e.g., via compiler /D switch. + */ + #if defined(MS_WINDOWS) && !defined(FD_SETSIZE) +-#define FD_SETSIZE 512 ++#define FD_SETSIZE 2048 + #endif + + #if defined(HAVE_POLL_H) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0002-Win32-Do-not-download-externals.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0002-Win32-Do-not-download-externals.patch new file mode 100644 index 0000000000000000000000000000000000000000..48fab71f59008c179af0449319f2d2d571843dda --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0002-Win32-Do-not-download-externals.patch @@ -0,0 +1,22 @@ +From ac7720a49412776a03313fecf281be7aa6d9d6d3 Mon Sep 17 00:00:00 2001 +From: Ray Donnelly +Date: Thu, 7 Sep 2017 11:35:47 +0100 +Subject: [PATCH 02/26] Win32: Do not download externals + +--- + PCbuild/build.bat | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/PCbuild/build.bat b/PCbuild/build.bat +index 60235704886..717a35c9d7e 100644 +--- a/PCbuild/build.bat ++++ b/PCbuild/build.bat +@@ -113,7 +113,7 @@ if "%IncludeSSL%"=="" set IncludeSSL=true + if "%IncludeTkinter%"=="" set IncludeTkinter=true + if "%UseJIT%" NEQ "true" set IncludeLLVM=false + +-if "%IncludeExternals%"=="true" call "%dir%get_externals.bat" ++@rem if "%IncludeExternals%"=="true" call "%dir%get_externals.bat" + + if "%do_pgo%" EQU "true" if "%platf%" EQU "x64" ( + if "%PROCESSOR_ARCHITEW6432%" NEQ "AMD64" if "%PROCESSOR_ARCHITECTURE%" NEQ "AMD64" ( diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0003-Fix-find_library-so-that-it-looks-in-sys.prefix-lib-.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0003-Fix-find_library-so-that-it-looks-in-sys.prefix-lib-.patch new file mode 100644 index 0000000000000000000000000000000000000000..34b6f1632c9ac679193c09016753e39fdd8cb2a4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0003-Fix-find_library-so-that-it-looks-in-sys.prefix-lib-.patch @@ -0,0 +1,73 @@ +From f55dbad460ad50580aac291f5f68f77b4eb5e443 Mon Sep 17 00:00:00 2001 +From: Ray Donnelly +Date: Tue, 5 Dec 2017 22:47:59 +0000 +Subject: [PATCH 03/26] Fix find_library so that it looks in sys.prefix/lib + first + +--- + Lib/ctypes/macholib/dyld.py | 4 ++++ + Lib/ctypes/util.py | 27 ++++++++++++++++++++++++--- + 2 files changed, 28 insertions(+), 3 deletions(-) + +diff --git a/Lib/ctypes/macholib/dyld.py b/Lib/ctypes/macholib/dyld.py +index 583c47daff3..ab9b01c87e2 100644 +--- a/Lib/ctypes/macholib/dyld.py ++++ b/Lib/ctypes/macholib/dyld.py +@@ -93,6 +93,10 @@ def dyld_executable_path_search(name, executable_path=None): + # If we haven't done any searching and found a library and the + # dylib_name starts with "@executable_path/" then construct the + # library name. ++ if not executable_path: ++ import sys ++ if sys.prefix: ++ executable_path = os.path.join(sys.prefix, 'bin') + if name.startswith('@executable_path/') and executable_path is not None: + yield os.path.join(executable_path, name[len('@executable_path/'):]) + +diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py +index 3b21658433b..2c900c1e2cf 100644 +--- a/Lib/ctypes/util.py ++++ b/Lib/ctypes/util.py +@@ -135,7 +135,8 @@ def dllist(): + elif os.name == "posix" and sys.platform in {"darwin", "ios", "tvos", "watchos"}: + from ctypes.macholib.dyld import dyld_find as _dyld_find + def find_library(name): +- possible = ['lib%s.dylib' % name, ++ possible = ['@executable_path/../lib/lib%s.dylib' % name, ++ 'lib%s.dylib' % name, + '%s.dylib' % name, + '%s.framework/%s' % (name, name)] + for name in possible: +@@ -436,10 +437,30 @@ def _findLib_ld(name): + pass # result will be None + return result + ++ def _findLib_prefix(name): ++ if not name: ++ return None ++ for fullname in (name, "lib%s.so" % (name)): ++ path = os.path.join(sys.prefix, 'lib', fullname) ++ if os.path.exists(path) and not os.path.isdir(path): ++ return path ++ return None ++ + def find_library(name): + # See issue #9998 +- return _findSoname_ldconfig(name) or \ +- _get_soname(_findLib_gcc(name)) or _get_soname(_findLib_ld(name)) ++ # Yes calling _findLib_prefix twice is deliberate, because _get_soname ditches ++ # the full path. ++ # When objdump is unavailable this returns None ++ so_name = _get_soname(_findLib_prefix(name)) or name ++ if so_name != name: ++ return _findLib_prefix(so_name) or \ ++ _findLib_prefix(name) or \ ++ _findSoname_ldconfig(name) or \ ++ _get_soname(_findLib_gcc(name)) or _get_soname(_findLib_ld(name)) ++ else: ++ return _findLib_prefix(name) or \ ++ _findSoname_ldconfig(name) or \ ++ _get_soname(_findLib_gcc(name)) or _get_soname(_findLib_ld(name)) + + + # Listing loaded libraries on other systems will try to use diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0004-Disable-registry-lookup-unless-CONDA_PY_ALLOW_REG_PA.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0004-Disable-registry-lookup-unless-CONDA_PY_ALLOW_REG_PA.patch new file mode 100644 index 0000000000000000000000000000000000000000..ceeb7db68a62e360ced1d311bb6c142fc3cf03fe --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0004-Disable-registry-lookup-unless-CONDA_PY_ALLOW_REG_PA.patch @@ -0,0 +1,45 @@ +From 29f68dcae94d2ad54f7e36df12175fb2bd3ef467 Mon Sep 17 00:00:00 2001 +From: Ray Donnelly +Date: Sat, 27 Oct 2018 18:48:30 +0100 +Subject: [PATCH 04/26] Disable registry lookup unless CONDA_PY_ALLOW_REG_PATHS + is not 0 + +Co-authored-by: Isuru Fernando +--- + Modules/getpath.c | 1 + + Modules/getpath.py | 3 ++- + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/Modules/getpath.c b/Modules/getpath.c +index 1e75993480a..ff96c8e1990 100644 +--- a/Modules/getpath.c ++++ b/Modules/getpath.c +@@ -937,6 +937,7 @@ _PyConfig_InitPathConfig(PyConfig *config, int compute_path_config) + !env_to_dict(dict, "ENV_PATH", 0) || + !env_to_dict(dict, "ENV_PYTHONHOME", 0) || + !env_to_dict(dict, "ENV_PYTHONEXECUTABLE", 0) || ++ !env_to_dict(dict, "ENV_CONDA_PY_ALLOW_REG_PATHS", 0) || + !env_to_dict(dict, "ENV___PYVENV_LAUNCHER__", 1) || + !progname_to_dict(dict, "real_executable") || + !library_to_dict(dict, "library") || +diff --git a/Modules/getpath.py b/Modules/getpath.py +index b89d7427e3f..21df0efac12 100644 +--- a/Modules/getpath.py ++++ b/Modules/getpath.py +@@ -52,6 +52,7 @@ + # ENV_PYTHONHOME -- [in] getenv(...) + # ENV_PYTHONEXECUTABLE -- [in] getenv(...) + # ENV___PYVENV_LAUNCHER__ -- [in] getenv(...) ++# ENV_CONDA_PY_ALLOW_REG_PATHS -- [in] getenv(...) + + # ** Values calculated at runtime ** + # config -- [in/out] dict of the PyConfig structure +@@ -704,7 +705,7 @@ def search_up(prefix, *landmarks, test=isfile): + else: + pythonpath.append(joinpath(base_prefix, ZIP_LANDMARK)) + +- if os_name == 'nt' and use_environment and winreg: ++ if os_name == 'nt' and use_environment and winreg and ENV_CONDA_PY_ALLOW_REG_PATHS and ENV_CONDA_PY_ALLOW_REG_PATHS != '0': + # QUIRK: Windows also lists paths in the registry. Paths are stored + # as the default value of each subkey of + # {HKCU,HKLM}\Software\Python\PythonCore\{winver}\PythonPath diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0005-Unvendor-openssl.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0005-Unvendor-openssl.patch new file mode 100644 index 0000000000000000000000000000000000000000..a70a24c6ac031f3fef92d6247682354201f5de1e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0005-Unvendor-openssl.patch @@ -0,0 +1,152 @@ +From 17fc2b4af07c3e2732f8f9c62f34d0e1b57597bf Mon Sep 17 00:00:00 2001 +From: Nehal J Wani +Date: Sat, 24 Nov 2018 20:38:02 -0600 +Subject: [PATCH 05/26] Unvendor openssl + +Co-authored-by: Isuru Fernando +--- + PCbuild/openssl.props | 14 ++------------ + PCbuild/openssl.vcxproj | 32 -------------------------------- + PCbuild/python.props | 13 +------------ + PCbuild/python.vcxproj | 3 +++ + PCbuild/pythonw.vcxproj | 3 +++ + 5 files changed, 9 insertions(+), 56 deletions(-) + +diff --git a/PCbuild/openssl.props b/PCbuild/openssl.props +index 5fd708b211e..044cefd95ea 100644 +--- a/PCbuild/openssl.props ++++ b/PCbuild/openssl.props +@@ -2,10 +2,10 @@ + + + +- $(opensslIncludeDir);%(AdditionalIncludeDirectories) ++ $(condaDir)include;%(AdditionalIncludeDirectories) + + +- $(opensslOutDir);%(AdditionalLibraryDirectories) ++ $(condaDir)lib;%(AdditionalLibraryDirectories) + ws2_32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) + + +@@ -21,14 +21,4 @@ + <_SSLDLL Include="$(opensslOutDir)\libssl$(_DLLSuffix).dll" /> + <_SSLDLL Include="$(opensslOutDir)\libssl$(_DLLSuffix).pdb" /> + +- +- +- +- +- +- + +diff --git a/PCbuild/openssl.vcxproj b/PCbuild/openssl.vcxproj +index 7ca750dda8f..17eee400ebb 100644 +--- a/PCbuild/openssl.vcxproj ++++ b/PCbuild/openssl.vcxproj +@@ -60,40 +60,8 @@ + + + +- +- $(opensslDir)\tmp$(Bitness)dll +- $(opensslOutDir) +- setlocal +-set VCINSTALLDIR=$(VCInstallDir) +-if not exist "$(IntDir.TrimEnd('\'))" mkdir "$(IntDir.TrimEnd('\'))" +-cd /D "$(IntDir.TrimEnd('\'))" +-$(Perl) "$(opensslDir)\configure" $(OpenSSLPlatform) no-asm no-uplink +-nmake +- +- +- + + +- +- +- <_Built Include="$(opensslDir)\LICENSE" /> +- <_Built Include="$(IntDir)\libcrypto.lib;$(IntDir)\libcrypto-*.dll;$(IntDir)\libcrypto-*.pdb" /> +- <_Built Include="$(IntDir)\libssl.lib;$(IntDir)\libssl-*.dll;$(IntDir)\libssl-*.pdb" /> +- <_Include Include="$(opensslDir)\Include\openssl\*.h" /> +- <_Include Include="$(IntDir)\include\openssl\*.h" /> +- +- +- +- +- +- +- +- +- +- +- +- +- + + + +diff --git a/PCbuild/python.props b/PCbuild/python.props +index da503ca0348..253aa66f477 100644 +--- a/PCbuild/python.props ++++ b/PCbuild/python.props +@@ -68,6 +68,7 @@ + + + $(EXTERNALS_DIR) ++ $(LIBRARY_PREFIX)\ + $([System.IO.Path]::GetFullPath(`$(PySourcePath)externals`)) + $(ExternalsDir)\ + +@@ -75,20 +76,8 @@ + + + +- $(ExternalsDir)sqlite-3.50.4.0\ +- $(ExternalsDir)bzip2-1.0.8\ +- $(ExternalsDir)xz-5.2.5\ +- $(ExternalsDir)libffi-3.4.4\ +- $(libffiDir)$(ArchName)\ +- $(libffiOutDir)include + $(ExternalsDir)\mpdecimal-4.0.0\ +- $(ExternalsDir)openssl-3.0.19\ +- $(ExternalsDir)openssl-bin-3.0.19\$(ArchName)\ +- $(opensslOutDir)include + $(ExternalsDir)\nasm-2.11.06\ +- $(ExternalsDir)\zlib-1.3.1\ +- $(ExternalsDir)\zlib-ng-2.2.4\ +- $(ExternalsDir)\zstd-1.5.7\ + + + +diff --git a/PCbuild/python.vcxproj b/PCbuild/python.vcxproj +index 70dabaa3c8b..ac5f96ebafc 100644 +--- a/PCbuild/python.vcxproj ++++ b/PCbuild/python.vcxproj +@@ -110,6 +110,9 @@ + + + ++ ++ _CRT_SECURE_NO_WARNINGS;$(PreprocessorDefinitions) ++ + + + +diff --git a/PCbuild/pythonw.vcxproj b/PCbuild/pythonw.vcxproj +index c6a5b8ce90a..74bd19144f9 100644 +--- a/PCbuild/pythonw.vcxproj ++++ b/PCbuild/pythonw.vcxproj +@@ -105,6 +105,9 @@ + + + ++ ++ _CRT_SECURE_NO_WARNINGS;$(PreprocessorDefinitions) ++ + + + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0006-Unvendor-sqlite3.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0006-Unvendor-sqlite3.patch new file mode 100644 index 0000000000000000000000000000000000000000..b5e6350f82d964e0d2991dd132c18fb09a8bbe0a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0006-Unvendor-sqlite3.patch @@ -0,0 +1,80 @@ +From f89df782ea930b7c8c8fa3a5cedf6984c68bbe26 Mon Sep 17 00:00:00 2001 +From: Nehal J Wani +Date: Tue, 5 Oct 2021 12:42:06 -0700 +Subject: [PATCH 06/26] Unvendor sqlite3 + +--- + PCbuild/_sqlite3.vcxproj | 11 +++++------ + PCbuild/pcbuild.sln | 2 -- + PCbuild/sqlite3.vcxproj | 12 ++++++------ + 3 files changed, 11 insertions(+), 14 deletions(-) + +diff --git a/PCbuild/_sqlite3.vcxproj b/PCbuild/_sqlite3.vcxproj +index 9ae0a0fc3a0..f482734ba1d 100644 +--- a/PCbuild/_sqlite3.vcxproj ++++ b/PCbuild/_sqlite3.vcxproj +@@ -93,9 +93,12 @@ + + + +- $(sqlite3Dir);%(AdditionalIncludeDirectories) ++ $(condaDir)\include;%(AdditionalIncludeDirectories) + PY_SQLITE_HAVE_SERIALIZE;PY_SQLITE_ENABLE_LOAD_EXTENSION;%(PreprocessorDefinitions) + ++ ++ $(condaDir)\lib\sqlite3.lib;%(AdditionalDependencies) ++ + + + +@@ -127,12 +130,8 @@ + {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} + false + +- +- {a1a295e5-463c-437f-81ca-1f32367685da} +- false +- + + + + +- +\ No newline at end of file ++ +diff --git a/PCbuild/pcbuild.sln b/PCbuild/pcbuild.sln +index 7296ea75301..9dd5e07ad8a 100644 +--- a/PCbuild/pcbuild.sln ++++ b/PCbuild/pcbuild.sln +@@ -72,8 +72,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_elementtree", "_elementtre + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_socket", "_socket.vcxproj", "{86937F53-C189-40EF-8CE8-8759D8E7D480}" + EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_sqlite3", "_sqlite3.vcxproj", "{13CECB97-4119-4316-9D42-8534019A5A44}" +-EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ssl", "_ssl.vcxproj", "{C6E20F84-3247-4AD6-B051-B073268F73BA}" + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testcapi", "_testcapi.vcxproj", "{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}" +diff --git a/PCbuild/sqlite3.vcxproj b/PCbuild/sqlite3.vcxproj +index f12ec348b37..f9e5e449a49 100644 +--- a/PCbuild/sqlite3.vcxproj ++++ b/PCbuild/sqlite3.vcxproj +@@ -88,12 +88,12 @@ + + + <_ProjectFileVersion>10.0.30319.1 +- <_SqliteVersion>$([System.Text.RegularExpressions.Regex]::Match(`$(sqlite3Dir)`, `((\d+)\.(\d+)\.(\d+)\.(\d+))\\?$`).Groups) +- $(_SqliteVersion.Split(`;`)[1]) +- $(_SqliteVersion.Split(`;`)[2]) +- $(_SqliteVersion.Split(`;`)[3]) +- $(_SqliteVersion.Split(`;`)[4]) +- $(_SqliteVersion.Split(`;`)[5]) ++ <_SqliteVersion>$(SQLITE3_VERSION) ++ $(_SqliteVersion) ++ $(_SqliteVersion.Split(`.`)[1]) ++ $(_SqliteVersion.Split(`.`)[2]) ++ $(_SqliteVersion.Split(`.`)[3]) ++ $(_SqliteVersion.Split(`.`)[4]) + + + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0007-Add-CondaEcosystemModifyDllSearchPath.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0007-Add-CondaEcosystemModifyDllSearchPath.patch new file mode 100644 index 0000000000000000000000000000000000000000..c4cd6b6b17f6b03a72d799491bc8c15cb34b06eb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0007-Add-CondaEcosystemModifyDllSearchPath.patch @@ -0,0 +1,154 @@ +From 853657f2bd5774cf51d88c95cf9f7cd27ceea315 Mon Sep 17 00:00:00 2001 +From: Ray Donnelly +Date: Tue, 24 Dec 2019 18:37:17 +0100 +Subject: [PATCH 07/26] Add CondaEcosystemModifyDllSearchPath() + + The python interpreter is modifed so that it works as if the python interpreter + was called with the following conda directories. + + os.add_dll_directory(join(sys.prefix, 'bin')) + os.add_dll_directory(join(sys.prefix, 'Scripts')) + os.add_dll_directory(join(sys.prefix, 'Library', 'bin')) + os.add_dll_directory(join(sys.prefix, 'Library', 'usr', 'bin')) + os.add_dll_directory(join(sys.prefix, 'Library', 'mingw-w64', 'bin')) + + Search order + - The directory that contains the DLL (if looking for a dependency) + - Application (python.exe) directory + - Directories added with os.add_dll_directory + - The 5 conda directories + - C:\Windows\System32 + + Note that the default behaviour changed in conda python 3.10 to + make os.add_dll_directory work in user code. + + Note that in conda python <3.11, there was an option + CONDA_DLL_SEARCH_MODIFICATION=1 to add directories in PATH to the search + order, but this was deprecated in 3.10 and removed in 3.11 in favour of using + AddDllDirectory + +Co-authored-by: Isuru Fernando +--- + Python/pylifecycle.c | 95 ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 95 insertions(+) + +diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c +index 6963635213a..1790d5aad25 100644 +--- a/Python/pylifecycle.c ++++ b/Python/pylifecycle.c +@@ -80,6 +80,10 @@ + + #ifdef MS_WINDOWS + # undef BYTE ++# include ++# include ++# include ++# include + #endif + + #define PUTS(fd, str) (void)_Py_write_noraise(fd, str, (int)strlen(str)) +@@ -114,6 +118,93 @@ GENERATE_DEBUG_SECTION(PyRuntime, _PyRuntimeState _PyRuntime) + = _PyRuntimeState_INIT(_PyRuntime, _Py_Debug_Cookie); + _Py_COMP_DIAG_POP + ++#ifdef MS_WINDOWS ++/* ++ This function will modify the DLL search path so that /Library\bin ++ and other conda PATHS are added to the front of the DLL search path. ++*/ ++ ++#if !defined(LOAD_LIBRARY_SEARCH_DEFAULT_DIRS) ++#define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS 0x00001000 ++#endif ++ ++typedef void (WINAPI *ADD)(PCWSTR NewDirectory); ++static ADD pAddDllDirectory = NULL; ++typedef struct ++{ ++ wchar_t *p_relative; ++ wchar_t *p_name; ++} CONDA_PATH; ++ ++#define NUM_CONDA_PATHS 5 ++ ++static CONDA_PATH condaPaths[NUM_CONDA_PATHS] = ++{ ++ {L"Library\\mingw-w64\\bin", NULL}, ++ {L"Library\\usr\\bin", NULL}, ++ {L"Library\\bin", NULL}, ++ {L"Scripts", NULL}, ++ {L"bin", NULL} ++}; ++static wchar_t sv_dll_dirname[1024]; ++ ++int CondaEcosystemModifyDllSearchPath_Init() ++{ ++ int debug_it = _wgetenv(L"CONDA_DLL_SEARCH_MODIFICATION_DEBUG") ? 1 : 0; ++ wchar_t* enable = _wgetenv(L"CONDA_DLL_SEARCH_MODIFICATION_ENABLE"); ++ int res = 0; ++ long long j; ++ CONDA_PATH *p_conda_path; ++ HMODULE dll_handle = NULL; ++ ++ if (pAddDllDirectory == NULL) ++ { ++ pAddDllDirectory = (ADD)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "AddDllDirectory"); ++ ++ /* Determine sv_dll_dirname */ ++ if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, ++ (LPCSTR) &CondaEcosystemModifyDllSearchPath_Init, &dll_handle) == 0) ++ { ++ // Getting the pythonxx.dll path failed. Fall back to relative path of python.exe ++ // assuming that the executable that is running this code is python.exe ++ dll_handle = NULL; ++ } ++ GetModuleFileNameW(dll_handle, &sv_dll_dirname[0], sizeof(sv_dll_dirname)/sizeof(sv_dll_dirname[0])-1); ++ sv_dll_dirname[sizeof(sv_dll_dirname)/sizeof(sv_dll_dirname[0])-1] = L'\0'; ++ if (wcsrchr(sv_dll_dirname, L'\\')) ++ *wcsrchr(sv_dll_dirname, L'\\') = L'\0'; ++ ++ for (p_conda_path = &condaPaths[0]; p_conda_path < &condaPaths[NUM_CONDA_PATHS]; ++p_conda_path) ++ { ++ size_t n_chars_dll_dirname = wcslen(sv_dll_dirname); ++ size_t n_chars_p_relative = wcslen(p_conda_path->p_relative); ++ p_conda_path->p_name = malloc(sizeof(wchar_t) * (n_chars_dll_dirname + n_chars_p_relative + 2)); ++ wcsncpy(p_conda_path->p_name, sv_dll_dirname, n_chars_dll_dirname+1); ++ wcsncat(p_conda_path->p_name, L"\\", 2); ++ wcsncat(p_conda_path->p_name, p_conda_path->p_relative, n_chars_p_relative+1); ++ } ++ ++ } ++ ++ if (pAddDllDirectory == NULL) ++ { ++ if (debug_it) ++ fwprintf(stderr, L"CondaEcosystemModifyDllSearchPath() :: WARNING :: Please install KB2533623 from http://go.microsoft.com/fwlink/p/?linkid=217865\n"\ ++ L"CondaEcosystemModifyDllSearchPath() :: WARNING :: to improve conda ecosystem DLL isolation"); ++ res = 2; ++ } ++ else { ++ for (j = NUM_CONDA_PATHS-1, p_conda_path = &condaPaths[NUM_CONDA_PATHS-1]; j > -1; --j, --p_conda_path) ++ { ++ if (debug_it) ++ fwprintf(stderr, L"CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(%ls - ExePrefix)\n", p_conda_path->p_name); ++ pAddDllDirectory(p_conda_path->p_name); ++ } ++ } ++ return res; ++} ++ ++#endif + + static int runtime_initialized = 0; + +@@ -131,6 +222,10 @@ _PyRuntime_Initialize(void) + } + runtime_initialized = 1; + ++#ifdef MS_WINDOWS ++ extern int CondaEcosystemModifyDllSearchPath_Init(); ++ CondaEcosystemModifyDllSearchPath_Init(); ++#endif + return _PyRuntimeState_Init(&_PyRuntime); + } + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0008-Doing-d1trimfile.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0008-Doing-d1trimfile.patch new file mode 100644 index 0000000000000000000000000000000000000000..ddc6d25b2fbe61c1b72c3c9842faf8c2c2f1c601 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0008-Doing-d1trimfile.patch @@ -0,0 +1,961 @@ +From a638bbff1f76630d0b85554018670b6745b6a64e Mon Sep 17 00:00:00 2001 +From: Ray Donnelly +Date: Tue, 31 Dec 2019 21:47:47 +0100 +Subject: [PATCH 08/26] Doing d1trimfile + +--- + PCbuild/_asyncio.vcxproj | 20 ++++++++++++++++++++ + PCbuild/_bz2.vcxproj | 6 +++++- + PCbuild/_ctypes.vcxproj | 4 ++++ + PCbuild/_ctypes_test.vcxproj | 20 ++++++++++++++++++++ + PCbuild/_decimal.vcxproj | 4 ++++ + PCbuild/_elementtree.vcxproj | 6 +++++- + PCbuild/_freeze_module.vcxproj | 4 ++++ + PCbuild/_hashlib.vcxproj | 12 ++++++++++++ + PCbuild/_lzma.vcxproj | 4 ++++ + PCbuild/_multiprocessing.vcxproj | 14 +++++++++++++- + PCbuild/_overlapped.vcxproj | 14 +++++++++++++- + PCbuild/_queue.vcxproj | 20 ++++++++++++++++++++ + PCbuild/_socket.vcxproj | 14 +++++++++++++- + PCbuild/_sqlite3.vcxproj | 4 ++++ + PCbuild/_ssl.vcxproj | 12 ++++++++++++ + PCbuild/_testbuffer.vcxproj | 22 +++++++++++++++++++++- + PCbuild/_testcapi.vcxproj | 20 ++++++++++++++++++++ + PCbuild/_testconsole.vcxproj | 6 +++++- + PCbuild/_testembed.vcxproj | 6 +++++- + PCbuild/_testimportmultiple.vcxproj | 20 ++++++++++++++++++++ + PCbuild/_testinternalcapi.vcxproj | 20 ++++++++++++++++++++ + PCbuild/_testmultiphase.vcxproj | 6 +++++- + PCbuild/_tkinter.vcxproj | 4 ++++ + PCbuild/liblzma.vcxproj | 4 ++++ + PCbuild/pyexpat.vcxproj | 4 ++++ + PCbuild/pylauncher.vcxproj | 4 ++++ + PCbuild/pyshellext.vcxproj | 6 +++++- + PCbuild/python.vcxproj | 4 ++++ + PCbuild/python3dll.vcxproj | 6 +++++- + PCbuild/python_uwp.vcxproj | 2 +- + PCbuild/pythoncore.vcxproj | 2 +- + PCbuild/pythonw.vcxproj | 14 +++++++++++++- + PCbuild/pythonw_uwp.vcxproj | 2 +- + PCbuild/pywlauncher.vcxproj | 6 +++++- + PCbuild/select.vcxproj | 14 +++++++++++++- + PCbuild/unicodedata.vcxproj | 22 +++++++++++++++++++++- + PCbuild/venvlauncher.vcxproj | 4 ++++ + PCbuild/venvwlauncher.vcxproj | 4 ++++ + PCbuild/winsound.vcxproj | 14 +++++++++++++- + PCbuild/xxlimited.vcxproj | 6 ++++++ + PCbuild/xxlimited_35.vcxproj | 6 ++++++ + 41 files changed, 367 insertions(+), 19 deletions(-) + +diff --git a/PCbuild/_asyncio.vcxproj b/PCbuild/_asyncio.vcxproj +index 76b0ffd660d..1402860e19b 100644 +--- a/PCbuild/_asyncio.vcxproj ++++ b/PCbuild/_asyncio.vcxproj +@@ -91,6 +91,26 @@ + + <_ProjectFileVersion>10.0.30319.1 + ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ + + + +diff --git a/PCbuild/_bz2.vcxproj b/PCbuild/_bz2.vcxproj +index e0dc6ec187a..30ad0dc4864 100644 +--- a/PCbuild/_bz2.vcxproj ++++ b/PCbuild/_bz2.vcxproj +@@ -97,6 +97,10 @@ + $(bz2Dir);%(AdditionalIncludeDirectories) + WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) + 4244;4267;%(DisableSpecificWarnings) ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + +@@ -125,4 +129,4 @@ + + + +- +\ No newline at end of file ++ +diff --git a/PCbuild/_ctypes.vcxproj b/PCbuild/_ctypes.vcxproj +index 63d5fa49cd4..6329f3d960f 100644 +--- a/PCbuild/_ctypes.vcxproj ++++ b/PCbuild/_ctypes.vcxproj +@@ -95,6 +95,10 @@ + + + USING_MALLOC_CLOSURE_DOT_C=1;%(PreprocessorDefinitions) ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + /EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions) +diff --git a/PCbuild/_ctypes_test.vcxproj b/PCbuild/_ctypes_test.vcxproj +index f15b80852e3..e565441ca4c 100644 +--- a/PCbuild/_ctypes_test.vcxproj ++++ b/PCbuild/_ctypes_test.vcxproj +@@ -93,6 +93,26 @@ + + <_ProjectFileVersion>10.0.30319.1 + ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ + + + +diff --git a/PCbuild/_decimal.vcxproj b/PCbuild/_decimal.vcxproj +index ee7421484b5..e9d60b4db1a 100644 +--- a/PCbuild/_decimal.vcxproj ++++ b/PCbuild/_decimal.vcxproj +@@ -99,6 +99,10 @@ + CONFIG_64;ANSI;%(PreprocessorDefinitions) + CONFIG_64;MASM;%(PreprocessorDefinitions) + ..\Modules\_decimal;..\Modules\_decimal\windows;$(mpdecimalDir)\libmpdec;%(AdditionalIncludeDirectories) ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + +diff --git a/PCbuild/_elementtree.vcxproj b/PCbuild/_elementtree.vcxproj +index 3eb9c89bcb6..920656f2ee2 100644 +--- a/PCbuild/_elementtree.vcxproj ++++ b/PCbuild/_elementtree.vcxproj +@@ -94,7 +94,11 @@ + + + ..\Modules\expat;%(AdditionalIncludeDirectories) +- _CRT_SECURE_NO_WARNINGS;XML_STATIC;%(PreprocessorDefinitions) ++ _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions) ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + +diff --git a/PCbuild/_freeze_module.vcxproj b/PCbuild/_freeze_module.vcxproj +index 5ceddf759b8..6b113ad8c2e 100644 +--- a/PCbuild/_freeze_module.vcxproj ++++ b/PCbuild/_freeze_module.vcxproj +@@ -93,6 +93,10 @@ + Disabled + false + %(AdditionalOptions) -fno-lto ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + Console +diff --git a/PCbuild/_hashlib.vcxproj b/PCbuild/_hashlib.vcxproj +index 2cd205224bc..1ff3a9cdeca 100644 +--- a/PCbuild/_hashlib.vcxproj ++++ b/PCbuild/_hashlib.vcxproj +@@ -96,6 +96,18 @@ + + ws2_32.lib;%(AdditionalDependencies) + ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ + + + +diff --git a/PCbuild/_lzma.vcxproj b/PCbuild/_lzma.vcxproj +index 40107d4b76c..321f41d8d27 100644 +--- a/PCbuild/_lzma.vcxproj ++++ b/PCbuild/_lzma.vcxproj +@@ -95,6 +95,10 @@ + + $(lzmaDir)src/liblzma/api;%(AdditionalIncludeDirectories) + WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + $(OutDir)liblzma$(PyDebugExt).lib;%(AdditionalDependencies) +diff --git a/PCbuild/_multiprocessing.vcxproj b/PCbuild/_multiprocessing.vcxproj +index a65397f532a..451ca375990 100644 +--- a/PCbuild/_multiprocessing.vcxproj ++++ b/PCbuild/_multiprocessing.vcxproj +@@ -95,6 +95,18 @@ + + ws2_32.lib;%(AdditionalDependencies) + ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ + + + +@@ -115,4 +127,4 @@ + + + +- +\ No newline at end of file ++ +diff --git a/PCbuild/_overlapped.vcxproj b/PCbuild/_overlapped.vcxproj +index 224bf05d530..f7efa63f562 100644 +--- a/PCbuild/_overlapped.vcxproj ++++ b/PCbuild/_overlapped.vcxproj +@@ -95,6 +95,18 @@ + + ws2_32.lib;%(AdditionalDependencies) + ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ + + + +@@ -111,4 +123,4 @@ + + + +- +\ No newline at end of file ++ +diff --git a/PCbuild/_queue.vcxproj b/PCbuild/_queue.vcxproj +index 80a1c3c6a4a..8d4555299ae 100644 +--- a/PCbuild/_queue.vcxproj ++++ b/PCbuild/_queue.vcxproj +@@ -91,6 +91,26 @@ + + <_ProjectFileVersion>10.0.30319.1 + ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ + + + +diff --git a/PCbuild/_socket.vcxproj b/PCbuild/_socket.vcxproj +index 41af0895921..45ecbcc4641 100644 +--- a/PCbuild/_socket.vcxproj ++++ b/PCbuild/_socket.vcxproj +@@ -95,6 +95,18 @@ + + ws2_32.lib;iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies) + ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ + + + +@@ -114,4 +126,4 @@ + + + +- +\ No newline at end of file ++ +diff --git a/PCbuild/_sqlite3.vcxproj b/PCbuild/_sqlite3.vcxproj +index f482734ba1d..70943daa021 100644 +--- a/PCbuild/_sqlite3.vcxproj ++++ b/PCbuild/_sqlite3.vcxproj +@@ -95,6 +95,10 @@ + + $(condaDir)\include;%(AdditionalIncludeDirectories) + PY_SQLITE_HAVE_SERIALIZE;PY_SQLITE_ENABLE_LOAD_EXTENSION;%(PreprocessorDefinitions) ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + $(condaDir)\lib\sqlite3.lib;%(AdditionalDependencies) +diff --git a/PCbuild/_ssl.vcxproj b/PCbuild/_ssl.vcxproj +index ce21f992ff8..34561515c12 100644 +--- a/PCbuild/_ssl.vcxproj ++++ b/PCbuild/_ssl.vcxproj +@@ -96,6 +96,18 @@ + + ws2_32.lib;crypt32.lib;%(AdditionalDependencies) + ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ + + + +diff --git a/PCbuild/_testbuffer.vcxproj b/PCbuild/_testbuffer.vcxproj +index 4e721e8ce09..3fec7516ed5 100644 +--- a/PCbuild/_testbuffer.vcxproj ++++ b/PCbuild/_testbuffer.vcxproj +@@ -92,6 +92,26 @@ + + <_ProjectFileVersion>10.0.40219.1 + ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ + + + +@@ -106,4 +126,4 @@ + + + +- +\ No newline at end of file ++ +diff --git a/PCbuild/_testcapi.vcxproj b/PCbuild/_testcapi.vcxproj +index a68f15d25aa..5c42f15c312 100644 +--- a/PCbuild/_testcapi.vcxproj ++++ b/PCbuild/_testcapi.vcxproj +@@ -92,6 +92,26 @@ + + <_ProjectFileVersion>10.0.30319.1 + ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ + + + +diff --git a/PCbuild/_testconsole.vcxproj b/PCbuild/_testconsole.vcxproj +index 69d312b17a5..bee3326ef8d 100644 +--- a/PCbuild/_testconsole.vcxproj ++++ b/PCbuild/_testconsole.vcxproj +@@ -92,6 +92,10 @@ + + + _CONSOLE;%(PreprocessorDefinitions) ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + Console +@@ -112,4 +116,4 @@ + + + +- +\ No newline at end of file ++ +diff --git a/PCbuild/_testembed.vcxproj b/PCbuild/_testembed.vcxproj +index a7ea8787e0c..e8edb3dd752 100644 +--- a/PCbuild/_testembed.vcxproj ++++ b/PCbuild/_testembed.vcxproj +@@ -89,6 +89,10 @@ + + + _CONSOLE;%(PreprocessorDefinitions) ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + Console +@@ -109,4 +113,4 @@ + + + +- +\ No newline at end of file ++ +diff --git a/PCbuild/_testimportmultiple.vcxproj b/PCbuild/_testimportmultiple.vcxproj +index c35ac83c1c7..c9d7f5d22b7 100644 +--- a/PCbuild/_testimportmultiple.vcxproj ++++ b/PCbuild/_testimportmultiple.vcxproj +@@ -92,6 +92,26 @@ + + <_ProjectFileVersion>10.0.30319.1 + ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ + + + +diff --git a/PCbuild/_testinternalcapi.vcxproj b/PCbuild/_testinternalcapi.vcxproj +index f7e050b7c74..58c3e10c0f0 100644 +--- a/PCbuild/_testinternalcapi.vcxproj ++++ b/PCbuild/_testinternalcapi.vcxproj +@@ -92,6 +92,26 @@ + + <_ProjectFileVersion>10.0.30319.1 + ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ + + + +diff --git a/PCbuild/_testmultiphase.vcxproj b/PCbuild/_testmultiphase.vcxproj +index e730fe308ab..a6f13ef31dc 100644 +--- a/PCbuild/_testmultiphase.vcxproj ++++ b/PCbuild/_testmultiphase.vcxproj +@@ -92,6 +92,10 @@ + + + _CONSOLE;%(PreprocessorDefinitions) ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + Console +@@ -112,4 +116,4 @@ + + + +- +\ No newline at end of file ++ +diff --git a/PCbuild/_tkinter.vcxproj b/PCbuild/_tkinter.vcxproj +index 87f6005fffc..de9358312ac 100644 +--- a/PCbuild/_tkinter.vcxproj ++++ b/PCbuild/_tkinter.vcxproj +@@ -97,6 +97,10 @@ + TCL_WITH_EXTERNAL_TOMMATH;%(PreprocessorDefinitions) + WITH_APPINIT;%(PreprocessorDefinitions) + Py_TCLTK_DIR="$(tcltkDir.TrimEnd('\').Replace('\', '\\'))";%(PreprocessorDefinitions) ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + $(tcltkLib);%(AdditionalDependencies) +diff --git a/PCbuild/liblzma.vcxproj b/PCbuild/liblzma.vcxproj +index 97938692328..212fb5e1ebc 100644 +--- a/PCbuild/liblzma.vcxproj ++++ b/PCbuild/liblzma.vcxproj +@@ -95,6 +95,10 @@ + $(lzmaDir)windows/vs2019;$(lzmaDir)src/liblzma/common;$(lzmaDir)src/common;$(lzmaDir)src/liblzma/api;$(lzmaDir)src/liblzma/check;$(lzmaDir)src/liblzma/delta;$(lzmaDir)src/liblzma/lz;$(lzmaDir)src/liblzma/lzma;$(lzmaDir)src/liblzma/rangecoder;$(lzmaDir)src/liblzma/simple;%(AdditionalIncludeDirectories) + 4244;4267;4996;%(DisableSpecificWarnings) + %(AdditionalOptions) -Wno-deprecated-declarations ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + +diff --git a/PCbuild/pyexpat.vcxproj b/PCbuild/pyexpat.vcxproj +index dc9161a8b29..3bcef600a3e 100644 +--- a/PCbuild/pyexpat.vcxproj ++++ b/PCbuild/pyexpat.vcxproj +@@ -92,6 +92,10 @@ + + $(PySourcePath)Modules\expat;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;XML_STATIC;%(PreprocessorDefinitions) ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + +diff --git a/PCbuild/pylauncher.vcxproj b/PCbuild/pylauncher.vcxproj +index ca422ef4d02..0c692649ed6 100644 +--- a/PCbuild/pylauncher.vcxproj ++++ b/PCbuild/pylauncher.vcxproj +@@ -93,6 +93,10 @@ + + _CONSOLE;%(PreprocessorDefinitions) + MultiThreaded ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + shell32.lib;pathcch.lib;%(AdditionalDependencies) +diff --git a/PCbuild/pyshellext.vcxproj b/PCbuild/pyshellext.vcxproj +index ea432d6bc9a..50397324a20 100644 +--- a/PCbuild/pyshellext.vcxproj ++++ b/PCbuild/pyshellext.vcxproj +@@ -92,6 +92,10 @@ + + + _CONSOLE;%(PreprocessorDefinitions) ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + version.lib;shlwapi.lib;%(AdditionalDependencies) +@@ -114,4 +118,4 @@ + + + +- +\ No newline at end of file ++ +diff --git a/PCbuild/python.vcxproj b/PCbuild/python.vcxproj +index ac5f96ebafc..3d0caa906cf 100644 +--- a/PCbuild/python.vcxproj ++++ b/PCbuild/python.vcxproj +@@ -92,6 +92,10 @@ + + + Py_BUILD_CORE;_CONSOLE;%(PreprocessorDefinitions) ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + Console +diff --git a/PCbuild/python3dll.vcxproj b/PCbuild/python3dll.vcxproj +index 235ea1cf9d3..d861f6c6a43 100644 +--- a/PCbuild/python3dll.vcxproj ++++ b/PCbuild/python3dll.vcxproj +@@ -93,6 +93,10 @@ + + PYTHON_DLL_NAME="$(PyDllName)";%(PreprocessorDefinitions) + false ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + true +@@ -107,4 +111,4 @@ + + + +- +\ No newline at end of file ++ +diff --git a/PCbuild/python_uwp.vcxproj b/PCbuild/python_uwp.vcxproj +index 3f8772d30b4..d80968e351a 100644 +--- a/PCbuild/python_uwp.vcxproj ++++ b/PCbuild/python_uwp.vcxproj +@@ -90,7 +90,7 @@ + + + %(PreprocessorDefinitions) +- /EHsc /std:c++17 %(AdditionalOptions) ++ /d1trimfile:%SRC_DIR% + + + windowsapp.lib;%(AdditionalDependencies) +diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj +index b911c938563..8e45967a83c 100644 +--- a/PCbuild/pythoncore.vcxproj ++++ b/PCbuild/pythoncore.vcxproj +@@ -99,7 +99,7 @@ + + + +- /Zm200 %(AdditionalOptions) ++ /d1trimfile:%SRC_DIR% + $(PySourcePath)Modules\_hacl;$(PySourcePath)Modules\_hacl\include;$(PySourcePath)Python;%(AdditionalIncludeDirectories) + $(zlibNgDir);$(GeneratedZlibNgDir);%(AdditionalIncludeDirectories) + $(GeneratedJitStencilsDir);%(AdditionalIncludeDirectories) +diff --git a/PCbuild/pythonw.vcxproj b/PCbuild/pythonw.vcxproj +index 74bd19144f9..6fea2e1f70c 100644 +--- a/PCbuild/pythonw.vcxproj ++++ b/PCbuild/pythonw.vcxproj +@@ -96,6 +96,18 @@ + + 3000000 + ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ + + + +@@ -118,4 +130,4 @@ + + + +- +\ No newline at end of file ++ +diff --git a/PCbuild/pythonw_uwp.vcxproj b/PCbuild/pythonw_uwp.vcxproj +index f548d022642..fa4e75f9712 100644 +--- a/PCbuild/pythonw_uwp.vcxproj ++++ b/PCbuild/pythonw_uwp.vcxproj +@@ -90,7 +90,7 @@ + + + PYTHONW;%(PreprocessorDefinitions) +- /EHsc /std:c++17 %(AdditionalOptions) ++ /d1trimfile:%SRC_DIR% + + + windowsapp.lib;%(AdditionalDependencies) +diff --git a/PCbuild/pywlauncher.vcxproj b/PCbuild/pywlauncher.vcxproj +index 1694548935a..9be580e2663 100644 +--- a/PCbuild/pywlauncher.vcxproj ++++ b/PCbuild/pywlauncher.vcxproj +@@ -93,6 +93,10 @@ + + _WINDOWS;%(PreprocessorDefinitions) + MultiThreaded ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + shell32.lib;pathcch.lib;%(AdditionalDependencies) +@@ -111,4 +115,4 @@ + + + +- +\ No newline at end of file ++ +diff --git a/PCbuild/select.vcxproj b/PCbuild/select.vcxproj +index d7448fd4d72..9fab5e8a638 100644 +--- a/PCbuild/select.vcxproj ++++ b/PCbuild/select.vcxproj +@@ -94,6 +94,18 @@ + + ws2_32.lib;%(AdditionalDependencies) + ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ + + + +@@ -110,4 +122,4 @@ + + + +- +\ No newline at end of file ++ +diff --git a/PCbuild/unicodedata.vcxproj b/PCbuild/unicodedata.vcxproj +index 781f938e2ab..3870c85adf7 100644 +--- a/PCbuild/unicodedata.vcxproj ++++ b/PCbuild/unicodedata.vcxproj +@@ -91,6 +91,26 @@ + + <_ProjectFileVersion>10.0.30319.1 + ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ + + + +@@ -110,4 +130,4 @@ + + + +- +\ No newline at end of file ++ +diff --git a/PCbuild/venvlauncher.vcxproj b/PCbuild/venvlauncher.vcxproj +index abaf3a979af..324aadcd782 100644 +--- a/PCbuild/venvlauncher.vcxproj ++++ b/PCbuild/venvlauncher.vcxproj +@@ -94,6 +94,10 @@ + + EXENAME=L"$(PyExeName)$(PyDebugExt).exe";_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + PY_ICON;%(PreprocessorDefinitions) +diff --git a/PCbuild/venvwlauncher.vcxproj b/PCbuild/venvwlauncher.vcxproj +index c58280deb8a..4dacf7f2724 100644 +--- a/PCbuild/venvwlauncher.vcxproj ++++ b/PCbuild/venvwlauncher.vcxproj +@@ -94,6 +94,10 @@ + + EXENAME=L"$(PyWExeName)$(PyDebugExt).exe";_WINDOWS;%(PreprocessorDefinitions) + MultiThreaded ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + PYW_ICON;%(PreprocessorDefinitions) +diff --git a/PCbuild/winsound.vcxproj b/PCbuild/winsound.vcxproj +index c26029b15a3..1e543b31c41 100644 +--- a/PCbuild/winsound.vcxproj ++++ b/PCbuild/winsound.vcxproj +@@ -96,6 +96,18 @@ + + winmm.lib;%(AdditionalDependencies) + ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ ++ ++ /d1trimfile:%SRC_DIR% ++ + + + +@@ -112,4 +124,4 @@ + + + +- +\ No newline at end of file ++ +diff --git a/PCbuild/xxlimited.vcxproj b/PCbuild/xxlimited.vcxproj +index 093e6920c0b..19dd43c19c2 100644 +--- a/PCbuild/xxlimited.vcxproj ++++ b/PCbuild/xxlimited.vcxproj +@@ -93,6 +93,12 @@ + <_ProjectFileVersion>10.0.30319.1 + + ++ ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ + + wsock32.lib;%(AdditionalDependencies) + +diff --git a/PCbuild/xxlimited_35.vcxproj b/PCbuild/xxlimited_35.vcxproj +index 3f4d4463f24..2572449ba0c 100644 +--- a/PCbuild/xxlimited_35.vcxproj ++++ b/PCbuild/xxlimited_35.vcxproj +@@ -93,6 +93,12 @@ + <_ProjectFileVersion>10.0.30319.1 + + ++ ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ + + wsock32.lib;%(AdditionalDependencies) + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0009-cross-compile-darwin.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0009-cross-compile-darwin.patch new file mode 100644 index 0000000000000000000000000000000000000000..f7341d9a32da785fa828f3187d0250eedb725824 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0009-cross-compile-darwin.patch @@ -0,0 +1,78 @@ +From 8b28429cdaf8b18f8a5f41b640c4c72c8e45897a Mon Sep 17 00:00:00 2001 +From: Ray Donnelly +Date: Fri, 2 Oct 2020 00:03:12 +0200 +Subject: [PATCH 09/26] cross compile darwin + +By Isuru Fernando. +--- + Lib/platform.py | 7 ++++++- + configure | 6 ++++++ + configure.ac | 6 ++++++ + 3 files changed, 18 insertions(+), 1 deletion(-) + +diff --git a/Lib/platform.py b/Lib/platform.py +index b017b841311..f7821ae7f28 100644 +--- a/Lib/platform.py ++++ b/Lib/platform.py +@@ -477,7 +477,12 @@ def win32_ver(release='', version='', csd='', ptype=''): + def _mac_ver_xml(): + fn = '/System/Library/CoreServices/SystemVersion.plist' + if not os.path.exists(fn): +- return None ++ if 'SDKROOT' in os.environ: ++ fn = os.environ['SDKROOT'] + fn ++ if not os.path.exists(fn): ++ return None ++ else: ++ return None + + try: + import plistlib +diff --git a/configure b/configure +index 8cfdda5a29b..be7e9c6713d 100755 +--- a/configure ++++ b/configure +@@ -4111,6 +4111,9 @@ then + *-*-linux*) + ac_sys_system=Linux + ;; ++ *-*-darwin*) ++ ac_sys_system=Darwin ++ ;; + *-*-cygwin*) + ac_sys_system=Cygwin + ;; +@@ -4590,6 +4593,9 @@ if test "$cross_compiling" = yes; then + _host_ident=$host_cpu + esac + ;; ++ *-*-darwin*) ++ _host_ident=$host_cpu ++ ;; + *-*-cygwin*) + _host_ident= + ;; +diff --git a/configure.ac b/configure.ac +index 1acb91fd27b..73fe005fa3d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -324,6 +324,9 @@ then + *-*-linux*) + ac_sys_system=Linux + ;; ++ *-*-darwin*) ++ ac_sys_system=Darwin ++ ;; + *-*-cygwin*) + ac_sys_system=Cygwin + ;; +@@ -771,6 +774,9 @@ if test "$cross_compiling" = yes; then + _host_ident=$host_cpu + esac + ;; ++ *-*-darwin*) ++ _host_ident=$host_cpu ++ ;; + *-*-cygwin*) + _host_ident= + ;; diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0010-Fix-TZPATH-on-windows.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0010-Fix-TZPATH-on-windows.patch new file mode 100644 index 0000000000000000000000000000000000000000..6aacbd362888d88d98dd60772412fcabfd8ec412 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0010-Fix-TZPATH-on-windows.patch @@ -0,0 +1,29 @@ +From f82fdb4890d33fa85807a8d9d8285df2c7580520 Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Wed, 7 Oct 2020 10:08:30 -0500 +Subject: [PATCH 10/26] Fix TZPATH on windows + +--- + Lib/sysconfig/__init__.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py +index faf8273bd0b..9e6d9257cf7 100644 +--- a/Lib/sysconfig/__init__.py ++++ b/Lib/sysconfig/__init__.py +@@ -175,6 +175,7 @@ def joinuser(*args): + _PY_VERSION = sys.version.split()[0] + _PY_VERSION_SHORT = f'{sys.version_info[0]}.{sys.version_info[1]}' + _PY_VERSION_SHORT_NO_DOT = f'{sys.version_info[0]}{sys.version_info[1]}' ++_PREFIX = os.path.normpath(sys.prefix) + _BASE_PREFIX = os.path.normpath(sys.base_prefix) + _BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix) + # Mutex guarding initialization of _CONFIG_VARS. +@@ -555,6 +556,7 @@ def _init_config_vars(): + if os.name == 'nt': + _init_non_posix(_CONFIG_VARS) + _CONFIG_VARS['VPATH'] = sys._vpath ++ _CONFIG_VARS['TZPATH'] = os.path.join(_PREFIX, "share", "zoneinfo") + if _HAS_USER_BASE: + # Setting 'userbase' is done below the call to the + # init function to enable using 'get_config_var' in diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0011-Make-dyld-search-work-with-SYSTEM_VERSION_COMPAT-1.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0011-Make-dyld-search-work-with-SYSTEM_VERSION_COMPAT-1.patch new file mode 100644 index 0000000000000000000000000000000000000000..c944159931f9caf7f6007734c4810b1893b0b3c7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0011-Make-dyld-search-work-with-SYSTEM_VERSION_COMPAT-1.patch @@ -0,0 +1,44 @@ +From 4bedca8871c1bbe2f5a5a90db8559791f6e9247b Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Mon, 25 Jan 2021 03:28:08 -0600 +Subject: [PATCH 11/26] Make dyld search work with SYSTEM_VERSION_COMPAT=1 + +In macOS Big Sur, if the executable was compiled with `MACOSX_DEPLOYMENT_TARGET=10.15` +or below, then SYSTEM_VERSION_COMPAT=1 is the default which means that Big Sur +reports itself as 10.16 which means that `__builtin_available(macOS 11.0)` will not be triggered. + +This can be observed by using the python 3.9.1 universal2 installer and using it on +x86_64 Big Sur or with Rossetta 2 on arm64 Big Sur. (Not an issue with native arm64 +as that part is compiled with `MACOSX_DEPLOYMENT_TARGET=11.0`) + +We also suppress a warning due to the mismatch between header using 11.0 +and this code using 10.16 +--- + Modules/_ctypes/callproc.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c +index 856b0376e5e..8d269ac5969 100644 +--- a/Modules/_ctypes/callproc.c ++++ b/Modules/_ctypes/callproc.c +@@ -1509,7 +1509,7 @@ copy_com_pointer(PyObject *self, PyObject *args) + #ifdef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH + # ifdef HAVE_BUILTIN_AVAILABLE + # define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME \ +- __builtin_available(macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0, *) ++ __builtin_available(macOS 10.16, iOS 14.0, tvOS 14.0, watchOS 7.0, *) + # else + # define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME \ + (_dyld_shared_cache_contains_path != NULL) +@@ -1552,8 +1552,10 @@ static PyObject *py_dyld_shared_cache_contains_path(PyObject *self, PyObject *ar + if (PyUnicode_FSConverter(name, &name2) == 0) + return NULL; + name_str = PyBytes_AS_STRING(name2); +- ++#pragma clang diagnostic push ++#pragma clang diagnostic ignored "-Wunguarded-availability-new" + r = _dyld_shared_cache_contains_path(name_str); ++#pragma clang diagnostic pop + Py_DECREF(name2); + + if (r) { diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0012-Unvendor-bzip2.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0012-Unvendor-bzip2.patch new file mode 100644 index 0000000000000000000000000000000000000000..cb3f8751d42f987f32bbdb7a9d2be2f7e537a48f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0012-Unvendor-bzip2.patch @@ -0,0 +1,94 @@ +From a29058e2c62aea787df5ae1bc3e7e7c3d9f4e153 Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Mon, 16 Aug 2021 02:56:27 -0700 +Subject: [PATCH 12/26] Unvendor bzip2 + +--- + PCbuild/_bz2.vcxproj | 15 +++++---------- + PCbuild/_bz2.vcxproj.filters | 28 ++-------------------------- + 2 files changed, 7 insertions(+), 36 deletions(-) + +diff --git a/PCbuild/_bz2.vcxproj b/PCbuild/_bz2.vcxproj +index 30ad0dc4864..1d46cc8198f 100644 +--- a/PCbuild/_bz2.vcxproj ++++ b/PCbuild/_bz2.vcxproj +@@ -94,7 +94,7 @@ + + + +- $(bz2Dir);%(AdditionalIncludeDirectories) ++ $(condaDir)\include;%(AdditionalIncludeDirectories) + WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) + 4244;4267;%(DisableSpecificWarnings) + /d1trimfile:%SRC_DIR% +@@ -102,20 +102,15 @@ + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% + ++ ++ $(condaDir)\lib\bzip2.lib;%(AdditionalDependencies) ++ + + + +- +- +- +- +- +- +- + + +- +- ++ + + + +diff --git a/PCbuild/_bz2.vcxproj.filters b/PCbuild/_bz2.vcxproj.filters +index 7c0b5162537..ed9510978f1 100644 +--- a/PCbuild/_bz2.vcxproj.filters ++++ b/PCbuild/_bz2.vcxproj.filters +@@ -21,33 +21,9 @@ + + Source Files + +- +- Source Files\bzip2 +- +- +- Source Files\bzip2 +- +- +- Source Files\bzip2 +- +- +- Source Files\bzip2 +- +- +- Source Files\bzip2 +- +- +- Source Files\bzip2 +- +- +- Source Files\bzip2 +- + + +- +- Header Files\bzip2 +- +- ++ + Header Files\bzip2 + + +@@ -56,4 +32,4 @@ + Resource Files + + +- +\ No newline at end of file ++ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0013-Unvendor-libffi.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0013-Unvendor-libffi.patch new file mode 100644 index 0000000000000000000000000000000000000000..adbecf617375c49fcffe80e5a689e18bf32e5c3f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0013-Unvendor-libffi.patch @@ -0,0 +1,39 @@ +From 0d896e048d3b7994ebce253e3210fddc3a6a004b Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Mon, 16 Aug 2021 03:07:40 -0700 +Subject: [PATCH 13/26] Unvendor libffi + +--- + PCbuild/libffi.props | 17 ++++------------- + 1 file changed, 4 insertions(+), 13 deletions(-) + +diff --git a/PCbuild/libffi.props b/PCbuild/libffi.props +index 22c9550e2c0..40ddb08d2b0 100644 +--- a/PCbuild/libffi.props ++++ b/PCbuild/libffi.props +@@ -2,20 +2,11 @@ + + + +- $(libffiIncludeDir);%(AdditionalIncludeDirectories) ++ $(condaDir)\include;%(AdditionalIncludeDirectories) + + +- $(libffiOutDir);%(AdditionalLibraryDirectories) +- libffi-8.lib;%(AdditionalDependencies) ++ $(condaDir)\lib;%(AdditionalLibraryDirectories) ++ ffi.lib;%(AdditionalDependencies) + + +- +- <_LIBFFIDLL Include="$(libffiOutDir)\libffi-8.dll" /> +- +- +- +- +- +- +- +- +\ No newline at end of file ++ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0014-Unvendor-tcltk.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0014-Unvendor-tcltk.patch new file mode 100644 index 0000000000000000000000000000000000000000..090887176c7aaeb0064461a0acd8e4239c37565e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0014-Unvendor-tcltk.patch @@ -0,0 +1,49 @@ +From c5d8868e9c9862196d1f58eca51af9e6bf276a02 Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Fri, 20 Aug 2021 10:23:51 -0700 +Subject: [PATCH 14/26] Unvendor tcltk + +--- + PCbuild/_tkinter.vcxproj | 6 ------ + PCbuild/tcltk.props | 11 +++++------ + 2 files changed, 5 insertions(+), 12 deletions(-) + +diff --git a/PCbuild/_tkinter.vcxproj b/PCbuild/_tkinter.vcxproj +index de9358312ac..3fe2c29c823 100644 +--- a/PCbuild/_tkinter.vcxproj ++++ b/PCbuild/_tkinter.vcxproj +@@ -128,12 +128,6 @@ + + + +- +- +- +- +- +- + + + +diff --git a/PCbuild/tcltk.props b/PCbuild/tcltk.props +index d26b36ba98e..40327f181d8 100644 +--- a/PCbuild/tcltk.props ++++ b/PCbuild/tcltk.props +@@ -12,12 +12,11 @@ + $([System.Version]::Parse($(TkVersion)).Minor) + $([System.Version]::Parse($(TkVersion)).Build) + $([System.Version]::Parse($(TkVersion)).Revision) +- $(ExternalsDir)tcl-core-$(TclVersion)\ +- $(ExternalsDir)tk-$(TkVersion)\ +- $(ExternalsDir)tcltk-$(TclVersion)\$(ArchName)\ +- $(tcltkDir)\bin\tclsh$(TclMajorVersion)$(TclMinorVersion)t.exe +- $(tcltkDir)\..\win32\bin\tclsh$(TclMajorVersion)$(TclMinorVersion)t.exe +- TCL_WITH_EXTERNAL_TOMMATH; ++ $(condaDir) ++ $(condaDir) ++ $(condaDir) ++ $(condaDir) ++ $(condaDir)\bin\tclsh$(TclMajorVersion)$(TclMinorVersion)t.exe + + + t diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0015-unvendor-xz.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0015-unvendor-xz.patch new file mode 100644 index 0000000000000000000000000000000000000000..af29c9c2c1e81d40d85f8e75ad19b1ea249b4462 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0015-unvendor-xz.patch @@ -0,0 +1,43 @@ +From a6696e3a1910a1f70febf1dc65c7ae0ebb4e9da9 Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Sat, 25 Sep 2021 10:07:05 -0700 +Subject: [PATCH 15/26] unvendor xz + +--- + PCbuild/_lzma.vcxproj | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +diff --git a/PCbuild/_lzma.vcxproj b/PCbuild/_lzma.vcxproj +index 321f41d8d27..6811fd1709e 100644 +--- a/PCbuild/_lzma.vcxproj ++++ b/PCbuild/_lzma.vcxproj +@@ -93,15 +93,15 @@ + + + +- $(lzmaDir)src/liblzma/api;%(AdditionalIncludeDirectories) +- WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions) ++ $(condaDir)\include;%(AdditionalIncludeDirectories) ++ WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% + + +- $(OutDir)liblzma$(PyDebugExt).lib;%(AdditionalDependencies) ++ $(condaDir)\lib\lzma.lib;%(AdditionalDependencies) + + + +@@ -115,10 +115,6 @@ + {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} + false + +- +- {12728250-16eC-4dc6-94d7-e21dd88947f8} +- false +- + + + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0016-unvendor-zlib.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0016-unvendor-zlib.patch new file mode 100644 index 0000000000000000000000000000000000000000..30757e8016f0d0ffd730ff921b1dde08bcc5d35b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0016-unvendor-zlib.patch @@ -0,0 +1,140 @@ +From 5a3effe6f9518217a3343ff7f7aa17ec4a950f24 Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Wed, 29 Sep 2021 15:21:55 -0700 +Subject: [PATCH 16/26] unvendor zlib + +--- + PCbuild/pythoncore.vcxproj | 14 ++----- + PCbuild/pythoncore.vcxproj.filters | 66 ------------------------------ + 2 files changed, 4 insertions(+), 76 deletions(-) + +diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj +index 8e45967a83c..3674ca1b267 100644 +--- a/PCbuild/pythoncore.vcxproj ++++ b/PCbuild/pythoncore.vcxproj +@@ -82,7 +82,7 @@ + + true + true +- true ++ true + false + + +@@ -101,7 +101,7 @@ + + /d1trimfile:%SRC_DIR% + $(PySourcePath)Modules\_hacl;$(PySourcePath)Modules\_hacl\include;$(PySourcePath)Python;%(AdditionalIncludeDirectories) +- $(zlibNgDir);$(GeneratedZlibNgDir);%(AdditionalIncludeDirectories) ++ $(condaDir)\include;%(AdditionalIncludeDirectories) + $(GeneratedJitStencilsDir);%(AdditionalIncludeDirectories) + _USRDLL;Py_BUILD_CORE;Py_BUILD_CORE_BUILTIN;Py_ENABLE_SHARED;MS_DLL_ID="$(SysWinVer)";ZLIB_COMPAT;%(PreprocessorDefinitions) + _Py_HAVE_ZLIB;%(PreprocessorDefinitions) +@@ -112,8 +112,8 @@ + Py_REMOTE_DEBUG;%(PreprocessorDefinitions) + + +- version.lib;ws2_32.lib;pathcch.lib;bcrypt.lib;%(AdditionalDependencies) +- zlib-ng$(PyDebugExt).lib;%(AdditionalDependencies) ++ version.lib;ws2_32.lib;pathcch.lib;bcrypt.lib;zlib.lib;%(AdditionalDependencies) ++ $(condaDir)\lib;%(AdditionalLibraryDirectories) + + + +@@ -681,12 +681,6 @@ + + + +- +- +- {fb91c8b2-6fbc-3a01-b644-1637111f902d} +- false +- +- + + + +diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters +index 0e6d42cc959..144a0e3425a 100644 +--- a/PCbuild/pythoncore.vcxproj.filters ++++ b/PCbuild/pythoncore.vcxproj.filters +@@ -900,39 +900,6 @@ + + Include\internal\mimalloc + +- +- Modules\zlib +- +- +- Modules\zlib +- +- +- Modules\zlib +- +- +- Modules\zlib +- +- +- Modules\zlib +- +- +- Modules\zlib +- +- +- Modules\zlib +- +- +- Modules\zlib +- +- +- Modules\zlib +- +- +- Modules\zlib +- +- +- Modules\zlib +- + + Include\internal + +@@ -1580,39 +1547,6 @@ + + Objects + +- +- Modules\zlib +- +- +- Modules\zlib +- +- +- Modules\zlib +- +- +- Modules\zlib +- +- +- Modules\zlib +- +- +- Modules\zlib +- +- +- Modules\zlib +- +- +- Modules\zlib +- +- +- Modules\zlib +- +- +- Modules\zlib +- +- +- Modules\zlib +- + + Python + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0017-Do-not-pass-g-to-GCC-when-not-Py_DEBUG.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0017-Do-not-pass-g-to-GCC-when-not-Py_DEBUG.patch new file mode 100644 index 0000000000000000000000000000000000000000..7180c8c8714a5ddf4b5872bb3328ea0b936a76ff --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0017-Do-not-pass-g-to-GCC-when-not-Py_DEBUG.patch @@ -0,0 +1,49 @@ +From b10930f94b1032084975cfe5e38c2678932e88de Mon Sep 17 00:00:00 2001 +From: Ray Donnelly +Date: Wed, 16 Aug 2017 11:45:28 +0100 +Subject: [PATCH 17/26] Do not pass -g to GCC when not Py_DEBUG + +This bloats our exe and our modules a lot. +--- + configure | 6 +++--- + configure.ac | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/configure b/configure +index be7e9c6713d..62acbe693c6 100755 +--- a/configure ++++ b/configure +@@ -5795,9 +5795,9 @@ if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS + elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then +- CFLAGS="-g -O2" ++ CFLAGS="-O2" + else +- CFLAGS="-g" ++ CFLAGS= + fi + else + if test "$GCC" = yes; then +@@ -9625,7 +9625,7 @@ then + if test "$Py_DEBUG" = 'true' ; then + OPT="-g $PYDEBUG_CFLAGS -Wall" + else +- OPT="-g -O3 -Wall" ++ OPT="-O3 -Wall" + fi + ;; + *) +diff --git a/configure.ac b/configure.ac +index 73fe005fa3d..da7353cd686 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2317,7 +2317,7 @@ then + if test "$Py_DEBUG" = 'true' ; then + OPT="-g $PYDEBUG_CFLAGS -Wall" + else +- OPT="-g -O3 -Wall" ++ OPT="-O3 -Wall" + fi + ;; + *) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0018-Unvendor-expat.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0018-Unvendor-expat.patch new file mode 100644 index 0000000000000000000000000000000000000000..c433b567e076add7a1d17117ff3fce6af2916450 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0018-Unvendor-expat.patch @@ -0,0 +1,200 @@ +From 71fa4441a757e1e9dad7ae3ffaeb252700a86106 Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Wed, 29 Mar 2023 23:07:10 -0500 +Subject: [PATCH 18/26] Unvendor expat + +--- + PCbuild/_elementtree.vcxproj | 24 ++---------- + PCbuild/_elementtree.vcxproj.filters | 55 +--------------------------- + PCbuild/pyexpat.vcxproj | 12 ++---- + PCbuild/pyexpat.vcxproj.filters | 19 +--------- + 4 files changed, 10 insertions(+), 100 deletions(-) + +diff --git a/PCbuild/_elementtree.vcxproj b/PCbuild/_elementtree.vcxproj +index 920656f2ee2..f47bcd8e4e6 100644 +--- a/PCbuild/_elementtree.vcxproj ++++ b/PCbuild/_elementtree.vcxproj +@@ -93,35 +93,19 @@ + + + +- ..\Modules\expat;%(AdditionalIncludeDirectories) ++ $(condaDir)\include;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions) + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% + ++ ++ $(condaDir)\lib\expat.lib;%(AdditionalDependencies) ++ + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- + + +- +- +- + + + +diff --git a/PCbuild/_elementtree.vcxproj.filters b/PCbuild/_elementtree.vcxproj.filters +index a5368024cce..7cc8e9a3b9b 100644 +--- a/PCbuild/_elementtree.vcxproj.filters ++++ b/PCbuild/_elementtree.vcxproj.filters +@@ -17,67 +17,14 @@ + {f99990ba-cd06-40cc-8f28-d2d424ec13be} + + +- +- +- Header Files\expat +- +- +- Header Files\expat +- +- +- Header Files\expat +- +- +- Header Files\expat +- +- +- Header Files\expat +- +- +- Header Files\expat +- +- +- Header Files\expat +- +- +- Header Files\expat +- +- +- Header Files\expat +- +- +- Header Files\expat +- +- +- Header Files\expat +- +- +- Header Files\expat +- +- +- Header Files\expat +- +- +- Header Files\expat +- +- + + + Source Files + +- +- Source Files\expat +- +- +- Source Files\expat +- +- +- Source Files\expat +- + + + + Resource Files + + +- +\ No newline at end of file ++ +diff --git a/PCbuild/pyexpat.vcxproj b/PCbuild/pyexpat.vcxproj +index 3bcef600a3e..ec5d4b64b3c 100644 +--- a/PCbuild/pyexpat.vcxproj ++++ b/PCbuild/pyexpat.vcxproj +@@ -90,23 +90,19 @@ + + + +- $(PySourcePath)Modules\expat;%(AdditionalIncludeDirectories) ++ $(condaDir)\include;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;XML_STATIC;%(PreprocessorDefinitions) + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% + ++ ++ $(condaDir)\lib\expat.lib;%(AdditionalDependencies) ++ + +- +- +- +- + + +- +- +- + + + +diff --git a/PCbuild/pyexpat.vcxproj.filters b/PCbuild/pyexpat.vcxproj.filters +index fd22fc8c477..41c73b434b9 100644 +--- a/PCbuild/pyexpat.vcxproj.filters ++++ b/PCbuild/pyexpat.vcxproj.filters +@@ -11,31 +11,14 @@ + {f1dbbdb5-41e5-4a88-bf8e-13da010c0ce4} + + +- +- +- Header Files +- +- +- Header Files +- +- + + + Source Files + +- +- Source Files +- +- +- Source Files +- +- +- Source Files +- + + + + Resource Files + + +- +\ No newline at end of file ++ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0019-Remove-unused-readelf.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0019-Remove-unused-readelf.patch new file mode 100644 index 0000000000000000000000000000000000000000..8267177a6aa7949c8cb8c4588f35110211f7ec45 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0019-Remove-unused-readelf.patch @@ -0,0 +1,28 @@ +From d22b97f0708600e81541f2b7b6a1167ee5036c00 Mon Sep 17 00:00:00 2001 +From: Charles Bousseau +Date: Thu, 25 May 2023 17:56:53 -0400 +Subject: [PATCH 19/26] Remove unused readelf + +readelf has been dropped. +.. date: 2022-11-02-10-56-40 +.. gh-issue: 98949 +.. nonce: 3SRD8C +.. section: Build + +Drop unused build dependency on ``readelf``. +--- + Makefile.pre.in | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 80a1b590c2f..0b3e988571d 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -38,7 +38,6 @@ CC= @CC@ + CXX= @CXX@ + LINKCC= @LINKCC@ + AR= @AR@ +-READELF= @READELF@ + SOABI= @SOABI@ + ABIFLAGS= @ABIFLAGS@ + ABI_THREAD= @ABI_THREAD@ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0020-Don-t-checksharedmods-if-cross-compiling.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0020-Don-t-checksharedmods-if-cross-compiling.patch new file mode 100644 index 0000000000000000000000000000000000000000..1dbd309dc37a71a2189644926eb1a4b2fbee8ebe --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0020-Don-t-checksharedmods-if-cross-compiling.patch @@ -0,0 +1,40 @@ +From 3feeb1c1d8a5f839f917784a163b74392722cebe Mon Sep 17 00:00:00 2001 +From: "Uwe L. Korn" +Date: Fri, 1 Sep 2023 23:32:14 +0200 +Subject: [PATCH 20/26] Don't checksharedmods if cross-compiling + +--- + Makefile.pre.in | 2 +- + if_runnable.sh | 10 ++++++++++ + 2 files changed, 11 insertions(+), 1 deletion(-) + create mode 100755 if_runnable.sh + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 0b3e988571d..20f6c243f4c 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1597,7 +1597,7 @@ sharedmods: $(SHAREDMODS) pybuilddir.txt + # dependency on BUILDPYTHON ensures that the target is run last + .PHONY: checksharedmods + checksharedmods: sharedmods $(PYTHON_FOR_BUILD_DEPS) $(BUILDPYTHON) +- @$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/Tools/build/check_extension_modules.py ++ @$(RUNSHARED) $(srcdir)/if_runnable.sh $(PYTHON_FOR_BUILD) $(srcdir)/Tools/build/check_extension_modules.py + + .PHONY: rundsymutil + rundsymutil: sharedmods $(PYTHON_FOR_BUILD_DEPS) $(BUILDPYTHON) +diff --git a/if_runnable.sh b/if_runnable.sh +new file mode 100755 +index 00000000000..dcfde5b751e +--- /dev/null ++++ b/if_runnable.sh +@@ -0,0 +1,10 @@ ++#!/bin/bash ++ ++if [[ "${target_platform}" == "${build_platform}" || "${CROSSCOMPILING_EMULATOR:-}" != "" ]]; then ++ if [[ "$1" == "./"* ]]; then ++ exec $@ ++ else ++ export ${@:1:$#-2} ++ exec ${@: -2} ++ fi ++fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0021-Override-configure-LIBFFI.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0021-Override-configure-LIBFFI.patch new file mode 100644 index 0000000000000000000000000000000000000000..ed6214204ddf68cba75735dfe71bd190e3c9f885 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0021-Override-configure-LIBFFI.patch @@ -0,0 +1,22 @@ +From fe59652c1d2b368168c8b0b2d99239b634774661 Mon Sep 17 00:00:00 2001 +From: "Uwe L. Korn" +Date: Tue, 5 Sep 2023 21:51:31 +0200 +Subject: [PATCH 21/26] Override configure LIBFFI + +--- + configure | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure b/configure +index 62acbe693c6..966aaf6a29d 100755 +--- a/configure ++++ b/configure +@@ -15304,7 +15304,7 @@ if test "x$ac_cv_lib_ffi_ffi_call" = xyes + then : + + have_libffi=yes +- LIBFFI_CFLAGS="-I${SDKROOT}/usr/include/ffi -DUSING_APPLE_OS_LIBFFI=1" ++ LIBFFI_CFLAGS="-I${PREFIX}/include -DUSING_APPLE_OS_LIBFFI=0" + LIBFFI_LIBS="-lffi" + + fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0022-Unvendor-libmpdec.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0022-Unvendor-libmpdec.patch new file mode 100644 index 0000000000000000000000000000000000000000..1e2d04b82147bdea81db39558be5a8c8c85760d8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0022-Unvendor-libmpdec.patch @@ -0,0 +1,85 @@ +From 65928acddcde36a49500e3d002e69d2ee8f77c1a Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Fri, 16 Aug 2024 21:34:43 -0500 +Subject: [PATCH 22/26] Unvendor libmpdec + +--- + PCbuild/_decimal.vcxproj | 50 +++++----------------------------------- + 1 file changed, 6 insertions(+), 44 deletions(-) + +diff --git a/PCbuild/_decimal.vcxproj b/PCbuild/_decimal.vcxproj +index e9d60b4db1a..0f49d7923f5 100644 +--- a/PCbuild/_decimal.vcxproj ++++ b/PCbuild/_decimal.vcxproj +@@ -93,65 +93,27 @@ + + + +- BUILD_LIBMPDEC;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ++ _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + CONFIG_32;PPRO;MASM;%(PreprocessorDefinitions) + CONFIG_32;ANSI;%(PreprocessorDefinitions) + CONFIG_64;ANSI;%(PreprocessorDefinitions) + CONFIG_64;MASM;%(PreprocessorDefinitions) +- ..\Modules\_decimal;..\Modules\_decimal\windows;$(mpdecimalDir)\libmpdec;%(AdditionalIncludeDirectories) ++ ..\Modules\_decimal;$(condaDir)\include;%(AdditionalIncludeDirectories) + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% + ++ ++ $(condaDir)\lib;%(AdditionalLibraryDirectories) ++ mpdec.lib;%(AdditionalDependencies) ++ + + +- +- +- +- +- +- + +- +- +- +- +- +- +- +- +- +- +- +- +- + + + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- true +- true +- true +- ml64 /nologo /c /Zi /Fo "$(IntDir)vcdiv64.obj" "%(FullPath)" +- $(IntDir)vcdiv64.obj;%(Outputs) +- + + + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0023-Brand-conda-forge.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0023-Brand-conda-forge.patch new file mode 100644 index 0000000000000000000000000000000000000000..8b643c27e410316132a071c4f2206893c5d13107 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0023-Brand-conda-forge.patch @@ -0,0 +1,38 @@ +From 42032895b96cd9ec5cba9e81544dd2684cf11f7c Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Wed, 28 Aug 2024 11:12:22 -0500 +Subject: [PATCH 23/26] Brand conda-forge + +--- + Lib/platform.py | 1 + + Python/getversion.c | 4 ++-- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Lib/platform.py b/Lib/platform.py +index f7821ae7f28..628af468297 100644 +--- a/Lib/platform.py ++++ b/Lib/platform.py +@@ -1215,6 +1215,7 @@ def _sys_version(sys_version=None): + cpython_sys_version_parser = re.compile( + r'([\w.+]+)\s*' # "version" + r'(?:free-threading build\s+)?' # "free-threading-build" ++ r'(?:\| packaged by conda-forge \|\s+)?' # "| packaged by conda-forge |" + r'\(#?([^,]+)' # "(#buildno" + r'(?:,\s*([\w ]*)' # ", builddate" + r'(?:,\s*([\w :]*))?)?\)\s*' # ", buildtime)" +diff --git a/Python/getversion.c b/Python/getversion.c +index 8d8bc6ea700..2fc5c13dbfb 100644 +--- a/Python/getversion.c ++++ b/Python/getversion.c +@@ -15,9 +15,9 @@ void _Py_InitVersion(void) + } + initialized = 1; + #ifdef Py_GIL_DISABLED +- const char *buildinfo_format = "%.80s free-threading build (%.80s) %.80s"; ++ const char *buildinfo_format = "%.80s free-threading build | packaged by conda-forge | (%.80s) %.80s"; + #else +- const char *buildinfo_format = "%.80s (%.80s) %.80s"; ++ const char *buildinfo_format = "%.80s | packaged by conda-forge | (%.80s) %.80s"; + #endif + PyOS_snprintf(version, sizeof(version), buildinfo_format, + PY_VERSION, Py_GetBuildInfo(), Py_GetCompiler()); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0024-Do-not-define-pid_t-as-it-might-conflict-with-the-ac.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0024-Do-not-define-pid_t-as-it-might-conflict-with-the-ac.patch new file mode 100644 index 0000000000000000000000000000000000000000..5629123aafac017999397c9ff672cd4e212a2c71 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0024-Do-not-define-pid_t-as-it-might-conflict-with-the-ac.patch @@ -0,0 +1,115 @@ +From 8b136967da9cfa41060e54e64ad4ee0ebe9a048e Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Sun, 12 Jan 2025 10:37:29 +0530 +Subject: [PATCH 24/26] Do not define pid_t as it might conflict with the + actual definition + +--- + Modules/_testcapi/long.c | 4 ++++ + Modules/_testcapimodule.c | 4 ++++ + Modules/_testlimitedcapi/long.c | 4 ++++ + Modules/clinic/posixmodule.c.h | 4 ++++ + Modules/posixmodule.c | 1 + + PC/pyconfig.h | 2 -- + Python/remote_debug.h | 3 +++ + 7 files changed, 20 insertions(+), 2 deletions(-) + +diff --git a/Modules/_testcapi/long.c b/Modules/_testcapi/long.c +index 6313abf5485..bc8169e2f68 100644 +--- a/Modules/_testcapi/long.c ++++ b/Modules/_testcapi/long.c +@@ -6,6 +6,10 @@ + #include "util.h" + #include "clinic/long.c.h" + ++#ifdef _MSC_VER ++typedef int pid_t; ++#endif ++ + /*[clinic input] + module _testcapi + [clinic start generated code]*/ +diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c +index 53f630832f8..8cc5b40a8d0 100644 +--- a/Modules/_testcapimodule.c ++++ b/Modules/_testcapimodule.c +@@ -23,6 +23,10 @@ + # include // W_STOPCODE + #endif + ++#ifdef _MSC_VER ++typedef int pid_t; ++#endif ++ + #ifdef bool + # error "The public headers should not include , see gh-48924" + #endif +diff --git a/Modules/_testlimitedcapi/long.c b/Modules/_testlimitedcapi/long.c +index 34bc7331da9..abae4b19bf0 100644 +--- a/Modules/_testlimitedcapi/long.c ++++ b/Modules/_testlimitedcapi/long.c +@@ -8,6 +8,10 @@ + #include "util.h" + #include "clinic/long.c.h" + ++#ifdef _MSC_VER ++typedef int pid_t; ++#endif ++ + /*[clinic input] + module _testlimitedcapi + [clinic start generated code]*/ +diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h +index 1c7a860e1ec..64bdbdf23db 100644 +--- a/Modules/clinic/posixmodule.c.h ++++ b/Modules/clinic/posixmodule.c.h +@@ -10,6 +10,10 @@ preserve + #include "pycore_long.h" // _PyLong_UnsignedInt_Converter() + #include "pycore_modsupport.h" // _PyArg_UnpackKeywords() + ++#if (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_APP) || defined(MS_WINDOWS_SYSTEM)) ++typedef int pid_t; ++#endif ++ + PyDoc_STRVAR(os_stat__doc__, + "stat($module, /, path, *, dir_fd=None, follow_symlinks=True)\n" + "--\n" +diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c +index 31b2d28200c..cc7e40c0283 100644 +--- a/Modules/posixmodule.c ++++ b/Modules/posixmodule.c +@@ -219,6 +219,7 @@ + # if defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM) + # define HAVE_SYMLINK + # endif /* MS_WINDOWS_DESKTOP | MS_WINDOWS_SYSTEM */ ++typedef int pid_t; + #endif + + +diff --git a/PC/pyconfig.h b/PC/pyconfig.h +index 710a737ebcc..92d327b1e35 100644 +--- a/PC/pyconfig.h ++++ b/PC/pyconfig.h +@@ -235,8 +235,6 @@ typedef _W64 int Py_ssize_t; + #endif + #endif /* MS_WIN32 && !MS_WIN64 */ + +-typedef int pid_t; +- + /* define some ANSI types that are not defined in earlier Win headers */ + #if _MSC_VER >= 1200 + /* This file only exists in VC 6.0 or higher */ +diff --git a/Python/remote_debug.h b/Python/remote_debug.h +index df1225f2eda..93b11c59309 100644 +--- a/Python/remote_debug.h ++++ b/Python/remote_debug.h +@@ -28,6 +28,9 @@ extern "C" { + #endif + + #include "pyconfig.h" ++#ifdef _WIN32 ++typedef int pid_t; ++#endif + #include "internal/pycore_ceval.h" + + #ifdef __linux__ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0025-Unvendor-zstd.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0025-Unvendor-zstd.patch new file mode 100644 index 0000000000000000000000000000000000000000..5394f086dc2988b12ce98995ca5918811463d648 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0025-Unvendor-zstd.patch @@ -0,0 +1,268 @@ +From 9fbb5ed9fcf079c56d8cb68c82bff97d7ca47735 Mon Sep 17 00:00:00 2001 +From: "Uwe L. Korn" +Date: Tue, 22 Jul 2025 18:07:54 +0200 +Subject: [PATCH 25/26] Unvendor zstd + +--- + PCbuild/_zstd.vcxproj | 58 +------------ + PCbuild/_zstd.vcxproj.filters | 157 +--------------------------------- + 2 files changed, 6 insertions(+), 209 deletions(-) + +diff --git a/PCbuild/_zstd.vcxproj b/PCbuild/_zstd.vcxproj +index 6f91b8d05cc..cc6f99cb002 100644 +--- a/PCbuild/_zstd.vcxproj ++++ b/PCbuild/_zstd.vcxproj +@@ -95,72 +95,22 @@ + + + WIN32;ZSTD_MULTITHREAD=1;%(PreprocessorDefinitions) +- $(zstdDir)lib\;$(zstdDir)lib\common;$(zstdDir)lib\compress;$(zstdDir)lib\decompress;$(zstdDir)lib\dictBuilder;%(AdditionalIncludeDirectories) ++ $(condaDir)\include;%(AdditionalIncludeDirectories) + ++ ++ $(condaDir)\lib\zstd.lib;%(AdditionalDependencies) ++ + + + + + + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- + + + + + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- + + + +diff --git a/PCbuild/_zstd.vcxproj.filters b/PCbuild/_zstd.vcxproj.filters +index eec666e5eaf..5028bb5592d 100644 +--- a/PCbuild/_zstd.vcxproj.filters ++++ b/PCbuild/_zstd.vcxproj.filters +@@ -30,96 +30,6 @@ + + Source Files + +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- +- +- Source Files\zstd +- + + + +@@ -131,73 +41,10 @@ + + Header Files + +- ++ + Header Files\zstd + +- +- Header Files\zstd +- +- +- Header Files\zstd +- +- +- Header Files\zstd +- +- +- Header Files\zstd +- +- +- Header Files\zstd +- +- +- Header Files\zstd +- +- +- Header Files\zstd +- +- +- Header Files\zstd +- +- +- Header Files\zstd +- +- +- Header Files\zstd +- +- +- Header Files\zstd +- +- +- Header Files\zstd +- +- +- Header Files\zstd +- +- +- Header Files\zstd +- +- +- Header Files\zstd +- +- +- Header Files\zstd +- +- +- Header Files\zstd +- +- +- Header Files\zstd +- +- +- Header Files\zstd +- +- +- Header Files\zstd +- +- +- Header Files\zstd +- +- ++ + Header Files\zstd + + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0026-Set-Py_GIL_DISABLED-in-windows-to-match-unix.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0026-Set-Py_GIL_DISABLED-in-windows-to-match-unix.patch new file mode 100644 index 0000000000000000000000000000000000000000..eb9639088729af71e9c9e4ee6ceedd0447686fb6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/0026-Set-Py_GIL_DISABLED-in-windows-to-match-unix.patch @@ -0,0 +1,25 @@ +From 9fc166d6187fd4dc1be91b3e42b84840acf05bfc Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Tue, 2 Dec 2025 09:46:56 -0800 +Subject: [PATCH 26/26] Set Py_GIL_DISABLED in windows to match unix + +This is not set upstream because the windows distribution supports +free-threaded and default builds at the same time. We have the +luxury of not having to do that. +--- + PC/pyconfig.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/PC/pyconfig.h b/PC/pyconfig.h +index 92d327b1e35..ed0d9c0592b 100644 +--- a/PC/pyconfig.h ++++ b/PC/pyconfig.h +@@ -105,6 +105,8 @@ WIN32 is still required for the locale module. + #if Py_GIL_DISABLED == 0 + #undef Py_GIL_DISABLED + #endif ++#else ++#define Py_GIL_DISABLED 1 + #endif + + /* Compiler specific defines */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/README.md b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/README.md new file mode 100644 index 0000000000000000000000000000000000000000..29825132aa481ab0e85d35776541719e5683f7d9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/README.md @@ -0,0 +1,24 @@ +### How to re-generate patches +```bash +old=v3.9.6 +new=v3.10.0 +git clone git@github.com:python/cpython && cd cpython +git reset --hard $old +for f in ../recipe/patches/*.patch; do + git am $f; +done +head=$(git rev-parse HEAD) +git reset --hard $new +git cherry-pick $old...$head # fix conflicts and make sure the editor doesn't add end of file line ending +git format-patch --no-signature $new +for f in *.patch; do + python ../recipe/patches/make-mixed-crlf-patch.py $f; +done +cp 00*.patch ../recipe/patches/ +``` + +On windows, the last loop can be done as follows (once the patches +have been copied; executed within the `recipe/patch` folder): +```bash +for /f %f in ('dir /b /S .') do python make-mixed-crlf-patch.py %f +``` diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/make-mixed-crlf-patch.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/make-mixed-crlf-patch.py new file mode 100644 index 0000000000000000000000000000000000000000..d52b6be27282cbad8e8358afb2ac80f01760b417 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/patches/make-mixed-crlf-patch.py @@ -0,0 +1,52 @@ +import sys +import re +import tempfile +import shutil + + +# Reads from argv[1] line-by-line, writes to same file. The patch +# header lines are given LF line endings and the rest CRLF line endings. +# Does not currently deal with the prelude (up to the -- in git patches). + +def main(argv): + filename = argv[1] + lines = [] + with open(filename, 'rb') as fi: + try: + for line in fi: + line = line.decode('utf-8').strip('\n').strip('\r\n') + lines.append(line) + except: + pass + is_git_diff = False + for line in lines: + if line.startswith('diff --git'): + is_git_diff = True + in_real_patch = False if is_git_diff else True + + text = "\n".join(lines) + + if ".bat" not in text and ".vcxproj" not in text and ".props" not in text: + return + + with open(filename, 'wb') as fo: + for i, line in enumerate(lines): + if not in_real_patch: + fo.write((line + '\n').encode('utf-8')) + if line.startswith('diff --git'): + in_real_patch = True + else: + if line.startswith('diff ') or \ + line.startswith('diff --git') or \ + line.startswith('--- ') or \ + line.startswith('+++ ') or \ + line.startswith('@@ ') or \ + line.startswith('index ') or \ + (i < len(lines) - 1 and lines[i+1].startswith(r"\ No newline at end of file")): + fo.write((line + '\n').encode('utf-8')) + else: + fo.write((line + '\r\n').encode('utf-8')) + + +if __name__ == '__main__': + main(sys.argv) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/recipe-license.txt b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/recipe-license.txt new file mode 100644 index 0000000000000000000000000000000000000000..0490acc59477931de4af397ddbbe87ea7ddf8af0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/recipe-license.txt @@ -0,0 +1,28 @@ +This recipe is based upon the python-3.5 recipe from +https://github.com/ContinuumIO/anaconda-recipes +which is released under the following BSD license: + +(c) 2016 Continuum Analytics, Inc. / http://continuum.io +All Rights Reserved + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Continuum Analytics, Inc. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL CONTINUUM ANALYTICS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/recipe-scripts-license.txt b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/recipe-scripts-license.txt new file mode 100644 index 0000000000000000000000000000000000000000..37f86184003c2b95ccdf45542a54b3629fb46a3f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/recipe-scripts-license.txt @@ -0,0 +1,26 @@ +BSD-3-Clause license +Copyright (c) 2015-2026, conda-forge contributors + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/replace-word-pairs.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/replace-word-pairs.py new file mode 100644 index 0000000000000000000000000000000000000000..9093d79f5fe377c9b05f34079f711ecab74d03fd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/replace-word-pairs.py @@ -0,0 +1,29 @@ +import sys +import re + +# Reads from stdin line by line, writes to stdout line by line replacing +# each odd argument with the subsequent even argument. + +def pairs(it): + it = iter(it) + try: + while True: + yield next(it), next(it) + except StopIteration: + return + +def main(): + rep_dict = dict() + for fro, to in pairs(sys.argv[1:]): + rep_dict[fro] = to + if len(rep_dict): + regex = re.compile("(%s)" % "|".join(map(re.escape, rep_dict.keys()))) + for line in iter(sys.stdin.readline, ''): + sys.stdout.write(regex.sub(lambda mo: rep_dict[mo.string[mo.start():mo.end()]], line)) + else: + for line in iter(sys.stdin.readline, ''): + sys.stdout.write(line) + + +if __name__ == '__main__': + main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/run_test.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/run_test.py new file mode 100644 index 0000000000000000000000000000000000000000..e4fb0302210bf2adc0044c2465281cfd70b24ff1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/run_test.py @@ -0,0 +1,109 @@ +import os +import platform +import sys +import subprocess + +armv6l = bool(platform.machine() == 'armv6l') +armv7l = bool(platform.machine() == 'armv7l') +ppc64le = bool(platform.machine() == 'ppc64le') +if sys.platform == 'darwin': + osx105 = b'10.5.' in subprocess.check_output('sw_vers') +else: + osx105 = False + +print('sys.version:', sys.version) +print('sys.platform:', sys.platform) +print('tuple.__itemsize__:', tuple.__itemsize__) +if sys.platform == 'win32': + assert 'MSC v.19' in sys.version +if hasattr(sys, "abiflags"): + print('sys.abiflags', sys.abiflags) +print('sys.maxunicode:', sys.maxunicode) +print('platform.architecture:', platform.architecture()) +print('platform.python_version:', platform.python_version()) + +import _bisect +import _codecs_cn +import _codecs_hk +import _codecs_iso2022 +import _codecs_jp +import _codecs_kr +import _codecs_tw +import _collections +import _csv +import _ctypes +import _ctypes_test +import _decimal +import _elementtree +import _functools +import _hashlib +import _heapq +import _io +import _json +import _locale +import _lsprof +import _lzma +import _multibytecodec +import _multiprocessing +import _random +import _socket +import _sqlite3 +import _ssl +import _struct +import _testcapi +import array +import binascii +import bz2 +import cmath +import compression.zstd +import datetime +import itertools +import lzma +import math +import mmap +import operator +import pyexpat +import select +import time +import test +import test.support +import unicodedata +import zlib +from os import urandom +import os + +t = 100 * b'Foo ' +assert lzma.decompress(lzma.compress(t)) == t + +if sys.platform != 'win32': + if not (ppc64le or armv7l): + import _curses + import _curses_panel + import fcntl + import grp + import readline + import resource + import syslog + import termios + +if os.getenv('PY_INTERP_DEBUG') == 'yes': + if sys.platform != 'win32': + assert 'd' in sys.abiflags + assert 'gettotalrefcount' in dir(sys) + +if not (armv6l or armv7l or ppc64le or osx105): + import tkinter + import turtle + import _tkinter + print('TK_VERSION: %s' % _tkinter.TK_VERSION) + print('TCL_VERSION: %s' % _tkinter.TCL_VERSION) + TCLTK_VER = os.getenv('tk') + assert _tkinter.TK_VERSION == _tkinter.TCL_VERSION == TCLTK_VER + +import ssl +print('OPENSSL_VERSION:', ssl.OPENSSL_VERSION) +CONDA_OPENSSL_VERSION = os.getenv('openssl').split(".")[0] +assert CONDA_OPENSSL_VERSION in ssl.OPENSSL_VERSION + +# See https://github.com/conda-forge/python-feedstock/issues/718 for context: +assert sys.hash_info.algorithm.startswith("siphash") diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/scripts/activate.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/scripts/activate.bat new file mode 100644 index 0000000000000000000000000000000000000000..6b77adc305b8d57b66441bd8fd2898c302fe25a2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/scripts/activate.bat @@ -0,0 +1,3 @@ +@echo off +set "PYTHON_JIT_CONDA_BACKUP=%PYTHON_JIT%" +set "PYTHON_JIT=1" diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/scripts/activate.sh b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/scripts/activate.sh new file mode 100644 index 0000000000000000000000000000000000000000..df79e7e7a339cf659a8817b6c33d4b6b490315e5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/scripts/activate.sh @@ -0,0 +1,4 @@ +if [ "${PYTHON_JIT+x}" ] ; then + export PYTHON_JIT_CONDA_BACKUP="${PYTHON_JIT}" +fi +export PYTHON_JIT=1 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/scripts/deactivate.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/scripts/deactivate.bat new file mode 100644 index 0000000000000000000000000000000000000000..44d9649ada90fab32f2087ec353fcf2f304f5e6a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/scripts/deactivate.bat @@ -0,0 +1,3 @@ +@echo off +set "PYTHON_JIT=%PYTHON_JIT_CONDA_BACKUP%" +set "PYTHON_JIT_CONDA_BACKUP=" diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/scripts/deactivate.sh b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/scripts/deactivate.sh new file mode 100644 index 0000000000000000000000000000000000000000..61f6082f76481b9526f362eda6d0ba6a9b6202c6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/scripts/deactivate.sh @@ -0,0 +1,4 @@ +if [ "${PYTHON_JIT_CONDA_BACKUP+x}" ] ; then + export PYTHON_JIT=$PYTHON_JIT_CONDA_BACKUP + unset PYTHON_JIT_CONDA_BACKUP +fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/sitecustomize.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/sitecustomize.py new file mode 100644 index 0000000000000000000000000000000000000000..22b9e1176cac9cb332360d621fb5dcc8ed09d557 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/sitecustomize.py @@ -0,0 +1,25 @@ +import site, sys, os + +dirs_to_add = [] +# Workaround for https://github.com/conda/conda/issues/14053 +# Older conda versions install noarch: python packages in wrong places. +# For example python3.1 because older conda assumed python minor version +# will have only one digit. noarhc pkgs for freethreading builds are supposed +# to be installed into /lib/python3.13t/site-packages, but conda +# installs them to /lib/python3.13/site-packages. +# The workaround is to add all these wrong paths to sys.path using +# site.addsitedir so that cpython and other tools like pip know about these +# locations to check when importing packages and uninstalling packages. +# When installing packages, pip will use the correct location +# /lib/python3.13t/site-packages. +if 't' in sys.abiflags: + dirs_to_add.append(os.path.join(sys.prefix, 'lib', f'python3.{sys.version_info[1]}', 'site-packages')) +# Workaround for https://github.com/conda/conda/issues/10969 +dirs_to_add.append(os.path.join(sys.prefix, 'lib', f'python3.1', 'site-packages')) +# A python version independent directory that ABI3 and noarch packages can use. +# This is unused at the moment, but keeping it here for experimentation. +dirs_to_add.append(os.path.join(sys.prefix, 'lib', f'python', 'site-packages')) + +for d in dirs_to_add: + if os.path.exists(d): + site.addsitedir(d) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/tests/cmake/CMakeLists.txt b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/tests/cmake/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..6acf308527499136444198477edf824b788868a3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/tests/cmake/CMakeLists.txt @@ -0,0 +1,16 @@ +# https://martinopilia.com/posts/2018/09/15/building-python-extension.html +# FindPythonInterp and FindPythonLibs are deprecated since cmake 3.12 +# These can be replaced by find_package(Python ${PY_VER} REQUIRED) +# But these are still used by other packages, so we keep them. + +cmake_minimum_required(VERSION 3.10) +enable_language(C) +project(mymath) + +option(PY_VER, "Python version to use") + +find_package(PythonInterp ${PY_VER} REQUIRED) +# PATHS $ENV{CONDA_PREFIX} + +# This goes after, since it uses PythonInterp as hint +find_package(PythonLibs ${PY_VER} REQUIRED) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/tests/distutils.cext/foo.c b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/tests/distutils.cext/foo.c new file mode 100644 index 0000000000000000000000000000000000000000..b9c9b180a4aa814039aafa2d63a981954be18c18 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/tests/distutils.cext/foo.c @@ -0,0 +1,36 @@ +#include + +static PyObject * +greet_name(PyObject *self, PyObject *args) +{ + const char *name; + + if (!PyArg_ParseTuple(args, "s", &name)) + { + return NULL; + } + + printf("Hello %s!\n", name); + + Py_RETURN_NONE; +} + +static PyMethodDef GreetMethods[] = { + {"greet", greet_name, METH_VARARGS, "Greet an entity."}, + {NULL, NULL, 0, NULL} +}; + +static struct PyModuleDef greet = +{ + PyModuleDef_HEAD_INIT, + "greet", /* name of module */ + "", /* module documentation, may be NULL */ + -1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */ + GreetMethods +}; + +PyMODINIT_FUNC PyInit_greet(void) +{ + return PyModule_Create(&greet); +} + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/tests/distutils.cext/foo.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/tests/distutils.cext/foo.py new file mode 100644 index 0000000000000000000000000000000000000000..913de8f4ada0b6b40311bda55879081553cf9b66 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/tests/distutils.cext/foo.py @@ -0,0 +1,7 @@ +import greet + +def main(): + greet.greet('World') + +if __name__ == "__main__": + main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/tests/distutils.cext/setup.py.do_not_run_me_on_0_releases b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/tests/distutils.cext/setup.py.do_not_run_me_on_0_releases new file mode 100644 index 0000000000000000000000000000000000000000..3135045d3ed913300238e51382c6fbdb5ef3ab2f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/tests/distutils.cext/setup.py.do_not_run_me_on_0_releases @@ -0,0 +1,14 @@ +from setuptools import setup, Extension + + +setup( + name='greet', + version='1.0', + description='Python Package with Hello World C Extension', + ext_modules=[ + Extension( + 'greet', + sources=['foo.c'], + py_limited_api=True) + ], +) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/tests/prefix-replacement/a.c b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/tests/prefix-replacement/a.c new file mode 100644 index 0000000000000000000000000000000000000000..861bbb055f73cd92b510a3067281756421def361 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/tests/prefix-replacement/a.c @@ -0,0 +1,23 @@ +#define PY_SSIZE_T_CLEAN +#include + +int +main(int argc, char *argv[]) +{ + wchar_t *program = Py_DecodeLocale(argv[0], NULL); + if (program == NULL) { + fprintf(stderr, "Fatal error: cannot decode argv[0]\n"); + exit(1); + } + // Removed in Python 3.13 and needs to be replaced with https://docs.python.org/3.13/c-api/init_config.html#c.PyConfig.program_name + // Py_SetProgramName(program); /* optional but recommended */ + Py_Initialize(); + PyRun_SimpleString("from time import time,ctime\n" + "print('Today is', ctime(time()))\n"); + if (Py_FinalizeEx() < 0) { + exit(120); + } + PyMem_RawFree(program); + return 0; +} + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/tests/prefix-replacement/build-and-test.sh b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/tests/prefix-replacement/build-and-test.sh new file mode 100644 index 0000000000000000000000000000000000000000..acd3bf8bbd9ed797968040ba50ea0f0da703c845 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/recipe/parent/tests/prefix-replacement/build-and-test.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +set -ex + +if [[ "$PKG_NAME" == "libpython-static" ]]; then + # see bpo44182 for why -L${CONDA_PREFIX}/lib is added + ${CC} a.c $(python3-config --cflags) $(python3-config --embed --ldflags) -L${CONDA_PREFIX}/lib -o ${CONDA_PREFIX}/bin/embedded-python-static + if [[ "$target_platform" == linux-* ]]; then + if ${READELF} -d ${CONDA_PREFIX}/bin/embedded-python-static | rg libpython; then + echo "ERROR :: Embedded python linked to shared python library. It is expected to link to the static library." + fi + elif [[ "$target_platform" == osx-* ]]; then + if ${OTOOL} -l ${CONDA_PREFIX}/bin/embedded-python-static | rg libpython; then + echo "ERROR :: Embedded python linked to shared python library. It is expected to link to the static library." + fi + fi + ${CONDA_PREFIX}/bin/embedded-python-static + + # I thought this would prefer the shared library for Python. I was wrong: + # EMBED_LDFLAGS=$(python3-config --ldflags) + # re='^(.*)(-lpython[^ ]*)(.*)$' + # if [[ ${EMBED_LDFLAGS} =~ $re ]]; then + # EMBED_LDFLAGS="${BASH_REMATCH[1]} ${BASH_REMATCH[3]} -Wl,-Bdynamic ${BASH_REMATCH[2]}" + # fi + # ${CC} a.c $(python3-config --cflags) ${EMBED_LDFLAGS} -o ${CONDA_PREFIX}/bin/embedded-python-shared + + # Brute-force way of linking to the shared library, sorry! + rm -rf ${CONDA_PREFIX}/lib/libpython*.a +fi + +${CC} a.c $(python3-config --cflags) \ + $(python3-config --embed --ldflags) \ + -L${CONDA_PREFIX}/lib -Wl,-rpath,${CONDA_PREFIX}/lib \ + -o ${CONDA_PREFIX}/bin/embedded-python-shared + +if [[ "$target_platform" == linux-* ]]; then + if ! ${READELF} -d ${CONDA_PREFIX}/bin/embedded-python-shared | rg libpython; then + echo "ERROR :: Embedded python linked to static python library. We tried to force it to use the shared library." + fi +elif [[ "$target_platform" == osx-* ]]; then + if ! ${OTOOL} -l ${CONDA_PREFIX}/bin/embedded-python-shared | rg libpython; then + echo "ERROR :: Embedded python linked to static python library. We tried to force it to use the shared library." + fi +fi +${CONDA_PREFIX}/bin/embedded-python-shared + +set +x diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/test/run_test.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/test/run_test.bat new file mode 100644 index 0000000000000000000000000000000000000000..5f2451b1779c4a120dc816e9804223d38d335961 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/test/run_test.bat @@ -0,0 +1,65 @@ + + +@echo on + +echo on +IF %ERRORLEVEL% NEQ 0 exit /B 1 +set +IF %ERRORLEVEL% NEQ 0 exit /B 1 +python -V +IF %ERRORLEVEL% NEQ 0 exit /B 1 +pydoc -h +IF %ERRORLEVEL% NEQ 0 exit /B 1 +set "PIP_NO_BUILD_ISOLATION=False" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +set "PIP_NO_DEPENDENCIES=True" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +set "PIP_IGNORE_INSTALLED=True" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +set "PIP_NO_INDEX=True" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +set "PIP_CACHE_DIR=%CONDA_PREFIX%/pip_cache" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +set "TEMP=%CONDA_PREFIX%/tmp" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +mkdir "%TEMP%" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +python -Im ensurepip --upgrade --default-pip +IF %ERRORLEVEL% NEQ 0 exit /B 1 +python -c "from zoneinfo import ZoneInfo; from datetime import datetime; dt = datetime(2020, 10, 31, 12, tzinfo=ZoneInfo('America/Los_Angeles')); print(dt.tzname())" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +python -m venv test-venv +IF %ERRORLEVEL% NEQ 0 exit /B 1 +test-venv\\Scripts\\python.exe -c "import ctypes" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %PREFIX%\\libs\\python3t.lib exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %PREFIX%\\libs\\python314t.lib exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if exist %PREFIX%\\Scripts\\pydoc exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if exist %PREFIX%\\Scripts\\idle exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %PREFIX%\\Scripts\\pydoc-script.py exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %PREFIX%\\Scripts\\idle-script.py exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %PREFIX%\\Scripts\\idle.exe exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %PREFIX%\\Scripts\\pydoc.exe exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %PREFIX%\\include\\pyconfig.h exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +pushd tests +IF %ERRORLEVEL% NEQ 0 exit /B 1 +pushd cmake +IF %ERRORLEVEL% NEQ 0 exit /B 1 +popd +IF %ERRORLEVEL% NEQ 0 exit /B 1 +popd +IF %ERRORLEVEL% NEQ 0 exit /B 1 +python run_test.py +IF %ERRORLEVEL% NEQ 0 exit /B 1 +python -c "from ctypes import CFUNCTYPE; CFUNCTYPE(None)(id)" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +exit /B 0 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/test/run_test.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/test/run_test.py new file mode 100644 index 0000000000000000000000000000000000000000..e4fb0302210bf2adc0044c2465281cfd70b24ff1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/test/run_test.py @@ -0,0 +1,109 @@ +import os +import platform +import sys +import subprocess + +armv6l = bool(platform.machine() == 'armv6l') +armv7l = bool(platform.machine() == 'armv7l') +ppc64le = bool(platform.machine() == 'ppc64le') +if sys.platform == 'darwin': + osx105 = b'10.5.' in subprocess.check_output('sw_vers') +else: + osx105 = False + +print('sys.version:', sys.version) +print('sys.platform:', sys.platform) +print('tuple.__itemsize__:', tuple.__itemsize__) +if sys.platform == 'win32': + assert 'MSC v.19' in sys.version +if hasattr(sys, "abiflags"): + print('sys.abiflags', sys.abiflags) +print('sys.maxunicode:', sys.maxunicode) +print('platform.architecture:', platform.architecture()) +print('platform.python_version:', platform.python_version()) + +import _bisect +import _codecs_cn +import _codecs_hk +import _codecs_iso2022 +import _codecs_jp +import _codecs_kr +import _codecs_tw +import _collections +import _csv +import _ctypes +import _ctypes_test +import _decimal +import _elementtree +import _functools +import _hashlib +import _heapq +import _io +import _json +import _locale +import _lsprof +import _lzma +import _multibytecodec +import _multiprocessing +import _random +import _socket +import _sqlite3 +import _ssl +import _struct +import _testcapi +import array +import binascii +import bz2 +import cmath +import compression.zstd +import datetime +import itertools +import lzma +import math +import mmap +import operator +import pyexpat +import select +import time +import test +import test.support +import unicodedata +import zlib +from os import urandom +import os + +t = 100 * b'Foo ' +assert lzma.decompress(lzma.compress(t)) == t + +if sys.platform != 'win32': + if not (ppc64le or armv7l): + import _curses + import _curses_panel + import fcntl + import grp + import readline + import resource + import syslog + import termios + +if os.getenv('PY_INTERP_DEBUG') == 'yes': + if sys.platform != 'win32': + assert 'd' in sys.abiflags + assert 'gettotalrefcount' in dir(sys) + +if not (armv6l or armv7l or ppc64le or osx105): + import tkinter + import turtle + import _tkinter + print('TK_VERSION: %s' % _tkinter.TK_VERSION) + print('TCL_VERSION: %s' % _tkinter.TCL_VERSION) + TCLTK_VER = os.getenv('tk') + assert _tkinter.TK_VERSION == _tkinter.TCL_VERSION == TCLTK_VER + +import ssl +print('OPENSSL_VERSION:', ssl.OPENSSL_VERSION) +CONDA_OPENSSL_VERSION = os.getenv('openssl').split(".")[0] +assert CONDA_OPENSSL_VERSION in ssl.OPENSSL_VERSION + +# See https://github.com/conda-forge/python-feedstock/issues/718 for context: +assert sys.hash_info.algorithm.startswith("siphash") diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/test/test_time_dependencies.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/test/test_time_dependencies.json new file mode 100644 index 0000000000000000000000000000000000000000..f79f5e10b490ebcb59738c6fee140b0331157f8c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/test/test_time_dependencies.json @@ -0,0 +1 @@ +["cmake", "ninja", "ripgrep", "vs_win-64", "vs2022_win-64"] \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/test/tests/cmake/CMakeLists.txt b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/test/tests/cmake/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..6acf308527499136444198477edf824b788868a3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/test/tests/cmake/CMakeLists.txt @@ -0,0 +1,16 @@ +# https://martinopilia.com/posts/2018/09/15/building-python-extension.html +# FindPythonInterp and FindPythonLibs are deprecated since cmake 3.12 +# These can be replaced by find_package(Python ${PY_VER} REQUIRED) +# But these are still used by other packages, so we keep them. + +cmake_minimum_required(VERSION 3.10) +enable_language(C) +project(mymath) + +option(PY_VER, "Python version to use") + +find_package(PythonInterp ${PY_VER} REQUIRED) +# PATHS $ENV{CONDA_PREFIX} + +# This goes after, since it uses PythonInterp as hint +find_package(PythonLibs ${PY_VER} REQUIRED) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/test/tests/prefix-replacement/a.c b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/test/tests/prefix-replacement/a.c new file mode 100644 index 0000000000000000000000000000000000000000..861bbb055f73cd92b510a3067281756421def361 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/test/tests/prefix-replacement/a.c @@ -0,0 +1,23 @@ +#define PY_SSIZE_T_CLEAN +#include + +int +main(int argc, char *argv[]) +{ + wchar_t *program = Py_DecodeLocale(argv[0], NULL); + if (program == NULL) { + fprintf(stderr, "Fatal error: cannot decode argv[0]\n"); + exit(1); + } + // Removed in Python 3.13 and needs to be replaced with https://docs.python.org/3.13/c-api/init_config.html#c.PyConfig.program_name + // Py_SetProgramName(program); /* optional but recommended */ + Py_Initialize(); + PyRun_SimpleString("from time import time,ctime\n" + "print('Today is', ctime(time()))\n"); + if (Py_FinalizeEx() < 0) { + exit(120); + } + PyMem_RawFree(program); + return 0; +} + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/test/tests/prefix-replacement/build-and-test.sh b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/test/tests/prefix-replacement/build-and-test.sh new file mode 100644 index 0000000000000000000000000000000000000000..acd3bf8bbd9ed797968040ba50ea0f0da703c845 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/info/test/tests/prefix-replacement/build-and-test.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +set -ex + +if [[ "$PKG_NAME" == "libpython-static" ]]; then + # see bpo44182 for why -L${CONDA_PREFIX}/lib is added + ${CC} a.c $(python3-config --cflags) $(python3-config --embed --ldflags) -L${CONDA_PREFIX}/lib -o ${CONDA_PREFIX}/bin/embedded-python-static + if [[ "$target_platform" == linux-* ]]; then + if ${READELF} -d ${CONDA_PREFIX}/bin/embedded-python-static | rg libpython; then + echo "ERROR :: Embedded python linked to shared python library. It is expected to link to the static library." + fi + elif [[ "$target_platform" == osx-* ]]; then + if ${OTOOL} -l ${CONDA_PREFIX}/bin/embedded-python-static | rg libpython; then + echo "ERROR :: Embedded python linked to shared python library. It is expected to link to the static library." + fi + fi + ${CONDA_PREFIX}/bin/embedded-python-static + + # I thought this would prefer the shared library for Python. I was wrong: + # EMBED_LDFLAGS=$(python3-config --ldflags) + # re='^(.*)(-lpython[^ ]*)(.*)$' + # if [[ ${EMBED_LDFLAGS} =~ $re ]]; then + # EMBED_LDFLAGS="${BASH_REMATCH[1]} ${BASH_REMATCH[3]} -Wl,-Bdynamic ${BASH_REMATCH[2]}" + # fi + # ${CC} a.c $(python3-config --cflags) ${EMBED_LDFLAGS} -o ${CONDA_PREFIX}/bin/embedded-python-shared + + # Brute-force way of linking to the shared library, sorry! + rm -rf ${CONDA_PREFIX}/lib/libpython*.a +fi + +${CC} a.c $(python3-config --cflags) \ + $(python3-config --embed --ldflags) \ + -L${CONDA_PREFIX}/lib -Wl,-rpath,${CONDA_PREFIX}/lib \ + -o ${CONDA_PREFIX}/bin/embedded-python-shared + +if [[ "$target_platform" == linux-* ]]; then + if ! ${READELF} -d ${CONDA_PREFIX}/bin/embedded-python-shared | rg libpython; then + echo "ERROR :: Embedded python linked to static python library. We tried to force it to use the shared library." + fi +elif [[ "$target_platform" == osx-* ]]; then + if ! ${OTOOL} -l ${CONDA_PREFIX}/bin/embedded-python-shared | rg libpython; then + echo "ERROR :: Embedded python linked to static python library. We tried to force it to use the shared library." + fi +fi +${CONDA_PREFIX}/bin/embedded-python-shared + +set +x