Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/bdist.py +138 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/bdist_dumb.py +123 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/bdist_rpm.py +579 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/build.py +157 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/build_clib.py +209 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/__init__.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/_encoded_words.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/_parseaddr.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/_policybase.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/base64mime.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/charset.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/contentmanager.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/encoders.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/errors.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/feedparser.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/generator.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/header.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/headerregistry.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/iterators.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/message.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/parser.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/policy.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/quoprimime.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/utils.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__init__.py +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/__init__.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/application.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/audio.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/base.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/image.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/message.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/multipart.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/nonmultipart.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/text.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/application.py +37 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/audio.py +100 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/base.py +29 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/image.py +152 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/message.py +33 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/multipart.py +47 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/nonmultipart.py +21 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/text.py +41 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/__init__.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/aliases.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/ascii.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/base64_codec.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/big5.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/big5hkscs.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/bz2_codec.cpython-311.pyc +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/charmap.cpython-311.pyc +0 -0
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/bdist.py
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""distutils.command.bdist
|
| 2 |
+
|
| 3 |
+
Implements the Distutils 'bdist' command (create a built [binary]
|
| 4 |
+
distribution)."""
|
| 5 |
+
|
| 6 |
+
import os
|
| 7 |
+
from distutils.core import Command
|
| 8 |
+
from distutils.errors import *
|
| 9 |
+
from distutils.util import get_platform
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def show_formats():
|
| 13 |
+
"""Print list of available formats (arguments to "--format" option).
|
| 14 |
+
"""
|
| 15 |
+
from distutils.fancy_getopt import FancyGetopt
|
| 16 |
+
formats = []
|
| 17 |
+
for format in bdist.format_commands:
|
| 18 |
+
formats.append(("formats=" + format, None,
|
| 19 |
+
bdist.format_command[format][1]))
|
| 20 |
+
pretty_printer = FancyGetopt(formats)
|
| 21 |
+
pretty_printer.print_help("List of available distribution formats:")
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
class bdist(Command):
|
| 25 |
+
|
| 26 |
+
description = "create a built (binary) distribution"
|
| 27 |
+
|
| 28 |
+
user_options = [('bdist-base=', 'b',
|
| 29 |
+
"temporary directory for creating built distributions"),
|
| 30 |
+
('plat-name=', 'p',
|
| 31 |
+
"platform name to embed in generated filenames "
|
| 32 |
+
"(default: %s)" % get_platform()),
|
| 33 |
+
('formats=', None,
|
| 34 |
+
"formats for distribution (comma-separated list)"),
|
| 35 |
+
('dist-dir=', 'd',
|
| 36 |
+
"directory to put final built distributions in "
|
| 37 |
+
"[default: dist]"),
|
| 38 |
+
('skip-build', None,
|
| 39 |
+
"skip rebuilding everything (for testing/debugging)"),
|
| 40 |
+
('owner=', 'u',
|
| 41 |
+
"Owner name used when creating a tar file"
|
| 42 |
+
" [default: current user]"),
|
| 43 |
+
('group=', 'g',
|
| 44 |
+
"Group name used when creating a tar file"
|
| 45 |
+
" [default: current group]"),
|
| 46 |
+
]
|
| 47 |
+
|
| 48 |
+
boolean_options = ['skip-build']
|
| 49 |
+
|
| 50 |
+
help_options = [
|
| 51 |
+
('help-formats', None,
|
| 52 |
+
"lists available distribution formats", show_formats),
|
| 53 |
+
]
|
| 54 |
+
|
| 55 |
+
# The following commands do not take a format option from bdist
|
| 56 |
+
no_format_option = ('bdist_rpm',)
|
| 57 |
+
|
| 58 |
+
# This won't do in reality: will need to distinguish RPM-ish Linux,
|
| 59 |
+
# Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS.
|
| 60 |
+
default_format = {'posix': 'gztar',
|
| 61 |
+
'nt': 'zip'}
|
| 62 |
+
|
| 63 |
+
# Establish the preferred order (for the --help-formats option).
|
| 64 |
+
format_commands = ['rpm', 'gztar', 'bztar', 'xztar', 'ztar', 'tar', 'zip']
|
| 65 |
+
|
| 66 |
+
# And the real information.
|
| 67 |
+
format_command = {'rpm': ('bdist_rpm', "RPM distribution"),
|
| 68 |
+
'gztar': ('bdist_dumb', "gzip'ed tar file"),
|
| 69 |
+
'bztar': ('bdist_dumb', "bzip2'ed tar file"),
|
| 70 |
+
'xztar': ('bdist_dumb', "xz'ed tar file"),
|
| 71 |
+
'ztar': ('bdist_dumb', "compressed tar file"),
|
| 72 |
+
'tar': ('bdist_dumb', "tar file"),
|
| 73 |
+
'zip': ('bdist_dumb', "ZIP file"),
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
def initialize_options(self):
|
| 77 |
+
self.bdist_base = None
|
| 78 |
+
self.plat_name = None
|
| 79 |
+
self.formats = None
|
| 80 |
+
self.dist_dir = None
|
| 81 |
+
self.skip_build = 0
|
| 82 |
+
self.group = None
|
| 83 |
+
self.owner = None
|
| 84 |
+
|
| 85 |
+
def finalize_options(self):
|
| 86 |
+
# have to finalize 'plat_name' before 'bdist_base'
|
| 87 |
+
if self.plat_name is None:
|
| 88 |
+
if self.skip_build:
|
| 89 |
+
self.plat_name = get_platform()
|
| 90 |
+
else:
|
| 91 |
+
self.plat_name = self.get_finalized_command('build').plat_name
|
| 92 |
+
|
| 93 |
+
# 'bdist_base' -- parent of per-built-distribution-format
|
| 94 |
+
# temporary directories (eg. we'll probably have
|
| 95 |
+
# "build/bdist.<plat>/dumb", "build/bdist.<plat>/rpm", etc.)
|
| 96 |
+
if self.bdist_base is None:
|
| 97 |
+
build_base = self.get_finalized_command('build').build_base
|
| 98 |
+
self.bdist_base = os.path.join(build_base,
|
| 99 |
+
'bdist.' + self.plat_name)
|
| 100 |
+
|
| 101 |
+
self.ensure_string_list('formats')
|
| 102 |
+
if self.formats is None:
|
| 103 |
+
try:
|
| 104 |
+
self.formats = [self.default_format[os.name]]
|
| 105 |
+
except KeyError:
|
| 106 |
+
raise DistutilsPlatformError(
|
| 107 |
+
"don't know how to create built distributions "
|
| 108 |
+
"on platform %s" % os.name)
|
| 109 |
+
|
| 110 |
+
if self.dist_dir is None:
|
| 111 |
+
self.dist_dir = "dist"
|
| 112 |
+
|
| 113 |
+
def run(self):
|
| 114 |
+
# Figure out which sub-commands we need to run.
|
| 115 |
+
commands = []
|
| 116 |
+
for format in self.formats:
|
| 117 |
+
try:
|
| 118 |
+
commands.append(self.format_command[format][0])
|
| 119 |
+
except KeyError:
|
| 120 |
+
raise DistutilsOptionError("invalid format '%s'" % format)
|
| 121 |
+
|
| 122 |
+
# Reinitialize and run each command.
|
| 123 |
+
for i in range(len(self.formats)):
|
| 124 |
+
cmd_name = commands[i]
|
| 125 |
+
sub_cmd = self.reinitialize_command(cmd_name)
|
| 126 |
+
if cmd_name not in self.no_format_option:
|
| 127 |
+
sub_cmd.format = self.formats[i]
|
| 128 |
+
|
| 129 |
+
# passing the owner and group names for tar archiving
|
| 130 |
+
if cmd_name == 'bdist_dumb':
|
| 131 |
+
sub_cmd.owner = self.owner
|
| 132 |
+
sub_cmd.group = self.group
|
| 133 |
+
|
| 134 |
+
# If we're going to need to run this command again, tell it to
|
| 135 |
+
# keep its temporary files around so subsequent runs go faster.
|
| 136 |
+
if cmd_name in commands[i+1:]:
|
| 137 |
+
sub_cmd.keep_temp = 1
|
| 138 |
+
self.run_command(cmd_name)
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/bdist_dumb.py
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""distutils.command.bdist_dumb
|
| 2 |
+
|
| 3 |
+
Implements the Distutils 'bdist_dumb' command (create a "dumb" built
|
| 4 |
+
distribution -- i.e., just an archive to be unpacked under $prefix or
|
| 5 |
+
$exec_prefix)."""
|
| 6 |
+
|
| 7 |
+
import os
|
| 8 |
+
from distutils.core import Command
|
| 9 |
+
from distutils.util import get_platform
|
| 10 |
+
from distutils.dir_util import remove_tree, ensure_relative
|
| 11 |
+
from distutils.errors import *
|
| 12 |
+
from distutils.sysconfig import get_python_version
|
| 13 |
+
from distutils import log
|
| 14 |
+
|
| 15 |
+
class bdist_dumb(Command):
|
| 16 |
+
|
| 17 |
+
description = "create a \"dumb\" built distribution"
|
| 18 |
+
|
| 19 |
+
user_options = [('bdist-dir=', 'd',
|
| 20 |
+
"temporary directory for creating the distribution"),
|
| 21 |
+
('plat-name=', 'p',
|
| 22 |
+
"platform name to embed in generated filenames "
|
| 23 |
+
"(default: %s)" % get_platform()),
|
| 24 |
+
('format=', 'f',
|
| 25 |
+
"archive format to create (tar, gztar, bztar, xztar, "
|
| 26 |
+
"ztar, zip)"),
|
| 27 |
+
('keep-temp', 'k',
|
| 28 |
+
"keep the pseudo-installation tree around after " +
|
| 29 |
+
"creating the distribution archive"),
|
| 30 |
+
('dist-dir=', 'd',
|
| 31 |
+
"directory to put final built distributions in"),
|
| 32 |
+
('skip-build', None,
|
| 33 |
+
"skip rebuilding everything (for testing/debugging)"),
|
| 34 |
+
('relative', None,
|
| 35 |
+
"build the archive using relative paths "
|
| 36 |
+
"(default: false)"),
|
| 37 |
+
('owner=', 'u',
|
| 38 |
+
"Owner name used when creating a tar file"
|
| 39 |
+
" [default: current user]"),
|
| 40 |
+
('group=', 'g',
|
| 41 |
+
"Group name used when creating a tar file"
|
| 42 |
+
" [default: current group]"),
|
| 43 |
+
]
|
| 44 |
+
|
| 45 |
+
boolean_options = ['keep-temp', 'skip-build', 'relative']
|
| 46 |
+
|
| 47 |
+
default_format = { 'posix': 'gztar',
|
| 48 |
+
'nt': 'zip' }
|
| 49 |
+
|
| 50 |
+
def initialize_options(self):
|
| 51 |
+
self.bdist_dir = None
|
| 52 |
+
self.plat_name = None
|
| 53 |
+
self.format = None
|
| 54 |
+
self.keep_temp = 0
|
| 55 |
+
self.dist_dir = None
|
| 56 |
+
self.skip_build = None
|
| 57 |
+
self.relative = 0
|
| 58 |
+
self.owner = None
|
| 59 |
+
self.group = None
|
| 60 |
+
|
| 61 |
+
def finalize_options(self):
|
| 62 |
+
if self.bdist_dir is None:
|
| 63 |
+
bdist_base = self.get_finalized_command('bdist').bdist_base
|
| 64 |
+
self.bdist_dir = os.path.join(bdist_base, 'dumb')
|
| 65 |
+
|
| 66 |
+
if self.format is None:
|
| 67 |
+
try:
|
| 68 |
+
self.format = self.default_format[os.name]
|
| 69 |
+
except KeyError:
|
| 70 |
+
raise DistutilsPlatformError(
|
| 71 |
+
"don't know how to create dumb built distributions "
|
| 72 |
+
"on platform %s" % os.name)
|
| 73 |
+
|
| 74 |
+
self.set_undefined_options('bdist',
|
| 75 |
+
('dist_dir', 'dist_dir'),
|
| 76 |
+
('plat_name', 'plat_name'),
|
| 77 |
+
('skip_build', 'skip_build'))
|
| 78 |
+
|
| 79 |
+
def run(self):
|
| 80 |
+
if not self.skip_build:
|
| 81 |
+
self.run_command('build')
|
| 82 |
+
|
| 83 |
+
install = self.reinitialize_command('install', reinit_subcommands=1)
|
| 84 |
+
install.root = self.bdist_dir
|
| 85 |
+
install.skip_build = self.skip_build
|
| 86 |
+
install.warn_dir = 0
|
| 87 |
+
|
| 88 |
+
log.info("installing to %s", self.bdist_dir)
|
| 89 |
+
self.run_command('install')
|
| 90 |
+
|
| 91 |
+
# And make an archive relative to the root of the
|
| 92 |
+
# pseudo-installation tree.
|
| 93 |
+
archive_basename = "%s.%s" % (self.distribution.get_fullname(),
|
| 94 |
+
self.plat_name)
|
| 95 |
+
|
| 96 |
+
pseudoinstall_root = os.path.join(self.dist_dir, archive_basename)
|
| 97 |
+
if not self.relative:
|
| 98 |
+
archive_root = self.bdist_dir
|
| 99 |
+
else:
|
| 100 |
+
if (self.distribution.has_ext_modules() and
|
| 101 |
+
(install.install_base != install.install_platbase)):
|
| 102 |
+
raise DistutilsPlatformError(
|
| 103 |
+
"can't make a dumb built distribution where "
|
| 104 |
+
"base and platbase are different (%s, %s)"
|
| 105 |
+
% (repr(install.install_base),
|
| 106 |
+
repr(install.install_platbase)))
|
| 107 |
+
else:
|
| 108 |
+
archive_root = os.path.join(self.bdist_dir,
|
| 109 |
+
ensure_relative(install.install_base))
|
| 110 |
+
|
| 111 |
+
# Make the archive
|
| 112 |
+
filename = self.make_archive(pseudoinstall_root,
|
| 113 |
+
self.format, root_dir=archive_root,
|
| 114 |
+
owner=self.owner, group=self.group)
|
| 115 |
+
if self.distribution.has_ext_modules():
|
| 116 |
+
pyversion = get_python_version()
|
| 117 |
+
else:
|
| 118 |
+
pyversion = 'any'
|
| 119 |
+
self.distribution.dist_files.append(('bdist_dumb', pyversion,
|
| 120 |
+
filename))
|
| 121 |
+
|
| 122 |
+
if not self.keep_temp:
|
| 123 |
+
remove_tree(self.bdist_dir, dry_run=self.dry_run)
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/bdist_rpm.py
ADDED
|
@@ -0,0 +1,579 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""distutils.command.bdist_rpm
|
| 2 |
+
|
| 3 |
+
Implements the Distutils 'bdist_rpm' command (create RPM source and binary
|
| 4 |
+
distributions)."""
|
| 5 |
+
|
| 6 |
+
import subprocess, sys, os
|
| 7 |
+
from distutils.core import Command
|
| 8 |
+
from distutils.debug import DEBUG
|
| 9 |
+
from distutils.file_util import write_file
|
| 10 |
+
from distutils.errors import *
|
| 11 |
+
from distutils.sysconfig import get_python_version
|
| 12 |
+
from distutils import log
|
| 13 |
+
|
| 14 |
+
class bdist_rpm(Command):
|
| 15 |
+
|
| 16 |
+
description = "create an RPM distribution"
|
| 17 |
+
|
| 18 |
+
user_options = [
|
| 19 |
+
('bdist-base=', None,
|
| 20 |
+
"base directory for creating built distributions"),
|
| 21 |
+
('rpm-base=', None,
|
| 22 |
+
"base directory for creating RPMs (defaults to \"rpm\" under "
|
| 23 |
+
"--bdist-base; must be specified for RPM 2)"),
|
| 24 |
+
('dist-dir=', 'd',
|
| 25 |
+
"directory to put final RPM files in "
|
| 26 |
+
"(and .spec files if --spec-only)"),
|
| 27 |
+
('python=', None,
|
| 28 |
+
"path to Python interpreter to hard-code in the .spec file "
|
| 29 |
+
"(default: \"python\")"),
|
| 30 |
+
('fix-python', None,
|
| 31 |
+
"hard-code the exact path to the current Python interpreter in "
|
| 32 |
+
"the .spec file"),
|
| 33 |
+
('spec-only', None,
|
| 34 |
+
"only regenerate spec file"),
|
| 35 |
+
('source-only', None,
|
| 36 |
+
"only generate source RPM"),
|
| 37 |
+
('binary-only', None,
|
| 38 |
+
"only generate binary RPM"),
|
| 39 |
+
('use-bzip2', None,
|
| 40 |
+
"use bzip2 instead of gzip to create source distribution"),
|
| 41 |
+
|
| 42 |
+
# More meta-data: too RPM-specific to put in the setup script,
|
| 43 |
+
# but needs to go in the .spec file -- so we make these options
|
| 44 |
+
# to "bdist_rpm". The idea is that packagers would put this
|
| 45 |
+
# info in setup.cfg, although they are of course free to
|
| 46 |
+
# supply it on the command line.
|
| 47 |
+
('distribution-name=', None,
|
| 48 |
+
"name of the (Linux) distribution to which this "
|
| 49 |
+
"RPM applies (*not* the name of the module distribution!)"),
|
| 50 |
+
('group=', None,
|
| 51 |
+
"package classification [default: \"Development/Libraries\"]"),
|
| 52 |
+
('release=', None,
|
| 53 |
+
"RPM release number"),
|
| 54 |
+
('serial=', None,
|
| 55 |
+
"RPM serial number"),
|
| 56 |
+
('vendor=', None,
|
| 57 |
+
"RPM \"vendor\" (eg. \"Joe Blow <joe@example.com>\") "
|
| 58 |
+
"[default: maintainer or author from setup script]"),
|
| 59 |
+
('packager=', None,
|
| 60 |
+
"RPM packager (eg. \"Jane Doe <jane@example.net>\") "
|
| 61 |
+
"[default: vendor]"),
|
| 62 |
+
('doc-files=', None,
|
| 63 |
+
"list of documentation files (space or comma-separated)"),
|
| 64 |
+
('changelog=', None,
|
| 65 |
+
"RPM changelog"),
|
| 66 |
+
('icon=', None,
|
| 67 |
+
"name of icon file"),
|
| 68 |
+
('provides=', None,
|
| 69 |
+
"capabilities provided by this package"),
|
| 70 |
+
('requires=', None,
|
| 71 |
+
"capabilities required by this package"),
|
| 72 |
+
('conflicts=', None,
|
| 73 |
+
"capabilities which conflict with this package"),
|
| 74 |
+
('build-requires=', None,
|
| 75 |
+
"capabilities required to build this package"),
|
| 76 |
+
('obsoletes=', None,
|
| 77 |
+
"capabilities made obsolete by this package"),
|
| 78 |
+
('no-autoreq', None,
|
| 79 |
+
"do not automatically calculate dependencies"),
|
| 80 |
+
|
| 81 |
+
# Actions to take when building RPM
|
| 82 |
+
('keep-temp', 'k',
|
| 83 |
+
"don't clean up RPM build directory"),
|
| 84 |
+
('no-keep-temp', None,
|
| 85 |
+
"clean up RPM build directory [default]"),
|
| 86 |
+
('use-rpm-opt-flags', None,
|
| 87 |
+
"compile with RPM_OPT_FLAGS when building from source RPM"),
|
| 88 |
+
('no-rpm-opt-flags', None,
|
| 89 |
+
"do not pass any RPM CFLAGS to compiler"),
|
| 90 |
+
('rpm3-mode', None,
|
| 91 |
+
"RPM 3 compatibility mode (default)"),
|
| 92 |
+
('rpm2-mode', None,
|
| 93 |
+
"RPM 2 compatibility mode"),
|
| 94 |
+
|
| 95 |
+
# Add the hooks necessary for specifying custom scripts
|
| 96 |
+
('prep-script=', None,
|
| 97 |
+
"Specify a script for the PREP phase of RPM building"),
|
| 98 |
+
('build-script=', None,
|
| 99 |
+
"Specify a script for the BUILD phase of RPM building"),
|
| 100 |
+
|
| 101 |
+
('pre-install=', None,
|
| 102 |
+
"Specify a script for the pre-INSTALL phase of RPM building"),
|
| 103 |
+
('install-script=', None,
|
| 104 |
+
"Specify a script for the INSTALL phase of RPM building"),
|
| 105 |
+
('post-install=', None,
|
| 106 |
+
"Specify a script for the post-INSTALL phase of RPM building"),
|
| 107 |
+
|
| 108 |
+
('pre-uninstall=', None,
|
| 109 |
+
"Specify a script for the pre-UNINSTALL phase of RPM building"),
|
| 110 |
+
('post-uninstall=', None,
|
| 111 |
+
"Specify a script for the post-UNINSTALL phase of RPM building"),
|
| 112 |
+
|
| 113 |
+
('clean-script=', None,
|
| 114 |
+
"Specify a script for the CLEAN phase of RPM building"),
|
| 115 |
+
|
| 116 |
+
('verify-script=', None,
|
| 117 |
+
"Specify a script for the VERIFY phase of the RPM build"),
|
| 118 |
+
|
| 119 |
+
# Allow a packager to explicitly force an architecture
|
| 120 |
+
('force-arch=', None,
|
| 121 |
+
"Force an architecture onto the RPM build process"),
|
| 122 |
+
|
| 123 |
+
('quiet', 'q',
|
| 124 |
+
"Run the INSTALL phase of RPM building in quiet mode"),
|
| 125 |
+
]
|
| 126 |
+
|
| 127 |
+
boolean_options = ['keep-temp', 'use-rpm-opt-flags', 'rpm3-mode',
|
| 128 |
+
'no-autoreq', 'quiet']
|
| 129 |
+
|
| 130 |
+
negative_opt = {'no-keep-temp': 'keep-temp',
|
| 131 |
+
'no-rpm-opt-flags': 'use-rpm-opt-flags',
|
| 132 |
+
'rpm2-mode': 'rpm3-mode'}
|
| 133 |
+
|
| 134 |
+
|
| 135 |
+
def initialize_options(self):
|
| 136 |
+
self.bdist_base = None
|
| 137 |
+
self.rpm_base = None
|
| 138 |
+
self.dist_dir = None
|
| 139 |
+
self.python = None
|
| 140 |
+
self.fix_python = None
|
| 141 |
+
self.spec_only = None
|
| 142 |
+
self.binary_only = None
|
| 143 |
+
self.source_only = None
|
| 144 |
+
self.use_bzip2 = None
|
| 145 |
+
|
| 146 |
+
self.distribution_name = None
|
| 147 |
+
self.group = None
|
| 148 |
+
self.release = None
|
| 149 |
+
self.serial = None
|
| 150 |
+
self.vendor = None
|
| 151 |
+
self.packager = None
|
| 152 |
+
self.doc_files = None
|
| 153 |
+
self.changelog = None
|
| 154 |
+
self.icon = None
|
| 155 |
+
|
| 156 |
+
self.prep_script = None
|
| 157 |
+
self.build_script = None
|
| 158 |
+
self.install_script = None
|
| 159 |
+
self.clean_script = None
|
| 160 |
+
self.verify_script = None
|
| 161 |
+
self.pre_install = None
|
| 162 |
+
self.post_install = None
|
| 163 |
+
self.pre_uninstall = None
|
| 164 |
+
self.post_uninstall = None
|
| 165 |
+
self.prep = None
|
| 166 |
+
self.provides = None
|
| 167 |
+
self.requires = None
|
| 168 |
+
self.conflicts = None
|
| 169 |
+
self.build_requires = None
|
| 170 |
+
self.obsoletes = None
|
| 171 |
+
|
| 172 |
+
self.keep_temp = 0
|
| 173 |
+
self.use_rpm_opt_flags = 1
|
| 174 |
+
self.rpm3_mode = 1
|
| 175 |
+
self.no_autoreq = 0
|
| 176 |
+
|
| 177 |
+
self.force_arch = None
|
| 178 |
+
self.quiet = 0
|
| 179 |
+
|
| 180 |
+
def finalize_options(self):
|
| 181 |
+
self.set_undefined_options('bdist', ('bdist_base', 'bdist_base'))
|
| 182 |
+
if self.rpm_base is None:
|
| 183 |
+
if not self.rpm3_mode:
|
| 184 |
+
raise DistutilsOptionError(
|
| 185 |
+
"you must specify --rpm-base in RPM 2 mode")
|
| 186 |
+
self.rpm_base = os.path.join(self.bdist_base, "rpm")
|
| 187 |
+
|
| 188 |
+
if self.python is None:
|
| 189 |
+
if self.fix_python:
|
| 190 |
+
self.python = sys.executable
|
| 191 |
+
else:
|
| 192 |
+
self.python = "python3"
|
| 193 |
+
elif self.fix_python:
|
| 194 |
+
raise DistutilsOptionError(
|
| 195 |
+
"--python and --fix-python are mutually exclusive options")
|
| 196 |
+
|
| 197 |
+
if os.name != 'posix':
|
| 198 |
+
raise DistutilsPlatformError("don't know how to create RPM "
|
| 199 |
+
"distributions on platform %s" % os.name)
|
| 200 |
+
if self.binary_only and self.source_only:
|
| 201 |
+
raise DistutilsOptionError(
|
| 202 |
+
"cannot supply both '--source-only' and '--binary-only'")
|
| 203 |
+
|
| 204 |
+
# don't pass CFLAGS to pure python distributions
|
| 205 |
+
if not self.distribution.has_ext_modules():
|
| 206 |
+
self.use_rpm_opt_flags = 0
|
| 207 |
+
|
| 208 |
+
self.set_undefined_options('bdist', ('dist_dir', 'dist_dir'))
|
| 209 |
+
self.finalize_package_data()
|
| 210 |
+
|
| 211 |
+
def finalize_package_data(self):
|
| 212 |
+
self.ensure_string('group', "Development/Libraries")
|
| 213 |
+
self.ensure_string('vendor',
|
| 214 |
+
"%s <%s>" % (self.distribution.get_contact(),
|
| 215 |
+
self.distribution.get_contact_email()))
|
| 216 |
+
self.ensure_string('packager')
|
| 217 |
+
self.ensure_string_list('doc_files')
|
| 218 |
+
if isinstance(self.doc_files, list):
|
| 219 |
+
for readme in ('README', 'README.txt'):
|
| 220 |
+
if os.path.exists(readme) and readme not in self.doc_files:
|
| 221 |
+
self.doc_files.append(readme)
|
| 222 |
+
|
| 223 |
+
self.ensure_string('release', "1")
|
| 224 |
+
self.ensure_string('serial') # should it be an int?
|
| 225 |
+
|
| 226 |
+
self.ensure_string('distribution_name')
|
| 227 |
+
|
| 228 |
+
self.ensure_string('changelog')
|
| 229 |
+
# Format changelog correctly
|
| 230 |
+
self.changelog = self._format_changelog(self.changelog)
|
| 231 |
+
|
| 232 |
+
self.ensure_filename('icon')
|
| 233 |
+
|
| 234 |
+
self.ensure_filename('prep_script')
|
| 235 |
+
self.ensure_filename('build_script')
|
| 236 |
+
self.ensure_filename('install_script')
|
| 237 |
+
self.ensure_filename('clean_script')
|
| 238 |
+
self.ensure_filename('verify_script')
|
| 239 |
+
self.ensure_filename('pre_install')
|
| 240 |
+
self.ensure_filename('post_install')
|
| 241 |
+
self.ensure_filename('pre_uninstall')
|
| 242 |
+
self.ensure_filename('post_uninstall')
|
| 243 |
+
|
| 244 |
+
# XXX don't forget we punted on summaries and descriptions -- they
|
| 245 |
+
# should be handled here eventually!
|
| 246 |
+
|
| 247 |
+
# Now *this* is some meta-data that belongs in the setup script...
|
| 248 |
+
self.ensure_string_list('provides')
|
| 249 |
+
self.ensure_string_list('requires')
|
| 250 |
+
self.ensure_string_list('conflicts')
|
| 251 |
+
self.ensure_string_list('build_requires')
|
| 252 |
+
self.ensure_string_list('obsoletes')
|
| 253 |
+
|
| 254 |
+
self.ensure_string('force_arch')
|
| 255 |
+
|
| 256 |
+
def run(self):
|
| 257 |
+
if DEBUG:
|
| 258 |
+
print("before _get_package_data():")
|
| 259 |
+
print("vendor =", self.vendor)
|
| 260 |
+
print("packager =", self.packager)
|
| 261 |
+
print("doc_files =", self.doc_files)
|
| 262 |
+
print("changelog =", self.changelog)
|
| 263 |
+
|
| 264 |
+
# make directories
|
| 265 |
+
if self.spec_only:
|
| 266 |
+
spec_dir = self.dist_dir
|
| 267 |
+
self.mkpath(spec_dir)
|
| 268 |
+
else:
|
| 269 |
+
rpm_dir = {}
|
| 270 |
+
for d in ('SOURCES', 'SPECS', 'BUILD', 'RPMS', 'SRPMS'):
|
| 271 |
+
rpm_dir[d] = os.path.join(self.rpm_base, d)
|
| 272 |
+
self.mkpath(rpm_dir[d])
|
| 273 |
+
spec_dir = rpm_dir['SPECS']
|
| 274 |
+
|
| 275 |
+
# Spec file goes into 'dist_dir' if '--spec-only specified',
|
| 276 |
+
# build/rpm.<plat> otherwise.
|
| 277 |
+
spec_path = os.path.join(spec_dir,
|
| 278 |
+
"%s.spec" % self.distribution.get_name())
|
| 279 |
+
self.execute(write_file,
|
| 280 |
+
(spec_path,
|
| 281 |
+
self._make_spec_file()),
|
| 282 |
+
"writing '%s'" % spec_path)
|
| 283 |
+
|
| 284 |
+
if self.spec_only: # stop if requested
|
| 285 |
+
return
|
| 286 |
+
|
| 287 |
+
# Make a source distribution and copy to SOURCES directory with
|
| 288 |
+
# optional icon.
|
| 289 |
+
saved_dist_files = self.distribution.dist_files[:]
|
| 290 |
+
sdist = self.reinitialize_command('sdist')
|
| 291 |
+
if self.use_bzip2:
|
| 292 |
+
sdist.formats = ['bztar']
|
| 293 |
+
else:
|
| 294 |
+
sdist.formats = ['gztar']
|
| 295 |
+
self.run_command('sdist')
|
| 296 |
+
self.distribution.dist_files = saved_dist_files
|
| 297 |
+
|
| 298 |
+
source = sdist.get_archive_files()[0]
|
| 299 |
+
source_dir = rpm_dir['SOURCES']
|
| 300 |
+
self.copy_file(source, source_dir)
|
| 301 |
+
|
| 302 |
+
if self.icon:
|
| 303 |
+
if os.path.exists(self.icon):
|
| 304 |
+
self.copy_file(self.icon, source_dir)
|
| 305 |
+
else:
|
| 306 |
+
raise DistutilsFileError(
|
| 307 |
+
"icon file '%s' does not exist" % self.icon)
|
| 308 |
+
|
| 309 |
+
# build package
|
| 310 |
+
log.info("building RPMs")
|
| 311 |
+
rpm_cmd = ['rpmbuild']
|
| 312 |
+
|
| 313 |
+
if self.source_only: # what kind of RPMs?
|
| 314 |
+
rpm_cmd.append('-bs')
|
| 315 |
+
elif self.binary_only:
|
| 316 |
+
rpm_cmd.append('-bb')
|
| 317 |
+
else:
|
| 318 |
+
rpm_cmd.append('-ba')
|
| 319 |
+
rpm_cmd.extend(['--define', '__python %s' % self.python])
|
| 320 |
+
if self.rpm3_mode:
|
| 321 |
+
rpm_cmd.extend(['--define',
|
| 322 |
+
'_topdir %s' % os.path.abspath(self.rpm_base)])
|
| 323 |
+
if not self.keep_temp:
|
| 324 |
+
rpm_cmd.append('--clean')
|
| 325 |
+
|
| 326 |
+
if self.quiet:
|
| 327 |
+
rpm_cmd.append('--quiet')
|
| 328 |
+
|
| 329 |
+
rpm_cmd.append(spec_path)
|
| 330 |
+
# Determine the binary rpm names that should be built out of this spec
|
| 331 |
+
# file
|
| 332 |
+
# Note that some of these may not be really built (if the file
|
| 333 |
+
# list is empty)
|
| 334 |
+
nvr_string = "%{name}-%{version}-%{release}"
|
| 335 |
+
src_rpm = nvr_string + ".src.rpm"
|
| 336 |
+
non_src_rpm = "%{arch}/" + nvr_string + ".%{arch}.rpm"
|
| 337 |
+
q_cmd = r"rpm -q --qf '%s %s\n' --specfile '%s'" % (
|
| 338 |
+
src_rpm, non_src_rpm, spec_path)
|
| 339 |
+
|
| 340 |
+
out = os.popen(q_cmd)
|
| 341 |
+
try:
|
| 342 |
+
binary_rpms = []
|
| 343 |
+
source_rpm = None
|
| 344 |
+
while True:
|
| 345 |
+
line = out.readline()
|
| 346 |
+
if not line:
|
| 347 |
+
break
|
| 348 |
+
l = line.strip().split()
|
| 349 |
+
assert(len(l) == 2)
|
| 350 |
+
binary_rpms.append(l[1])
|
| 351 |
+
# The source rpm is named after the first entry in the spec file
|
| 352 |
+
if source_rpm is None:
|
| 353 |
+
source_rpm = l[0]
|
| 354 |
+
|
| 355 |
+
status = out.close()
|
| 356 |
+
if status:
|
| 357 |
+
raise DistutilsExecError("Failed to execute: %s" % repr(q_cmd))
|
| 358 |
+
|
| 359 |
+
finally:
|
| 360 |
+
out.close()
|
| 361 |
+
|
| 362 |
+
self.spawn(rpm_cmd)
|
| 363 |
+
|
| 364 |
+
if not self.dry_run:
|
| 365 |
+
if self.distribution.has_ext_modules():
|
| 366 |
+
pyversion = get_python_version()
|
| 367 |
+
else:
|
| 368 |
+
pyversion = 'any'
|
| 369 |
+
|
| 370 |
+
if not self.binary_only:
|
| 371 |
+
srpm = os.path.join(rpm_dir['SRPMS'], source_rpm)
|
| 372 |
+
assert(os.path.exists(srpm))
|
| 373 |
+
self.move_file(srpm, self.dist_dir)
|
| 374 |
+
filename = os.path.join(self.dist_dir, source_rpm)
|
| 375 |
+
self.distribution.dist_files.append(
|
| 376 |
+
('bdist_rpm', pyversion, filename))
|
| 377 |
+
|
| 378 |
+
if not self.source_only:
|
| 379 |
+
for rpm in binary_rpms:
|
| 380 |
+
rpm = os.path.join(rpm_dir['RPMS'], rpm)
|
| 381 |
+
if os.path.exists(rpm):
|
| 382 |
+
self.move_file(rpm, self.dist_dir)
|
| 383 |
+
filename = os.path.join(self.dist_dir,
|
| 384 |
+
os.path.basename(rpm))
|
| 385 |
+
self.distribution.dist_files.append(
|
| 386 |
+
('bdist_rpm', pyversion, filename))
|
| 387 |
+
|
| 388 |
+
def _dist_path(self, path):
|
| 389 |
+
return os.path.join(self.dist_dir, os.path.basename(path))
|
| 390 |
+
|
| 391 |
+
def _make_spec_file(self):
|
| 392 |
+
"""Generate the text of an RPM spec file and return it as a
|
| 393 |
+
list of strings (one per line).
|
| 394 |
+
"""
|
| 395 |
+
# definitions and headers
|
| 396 |
+
spec_file = [
|
| 397 |
+
'%define name ' + self.distribution.get_name(),
|
| 398 |
+
'%define version ' + self.distribution.get_version().replace('-','_'),
|
| 399 |
+
'%define unmangled_version ' + self.distribution.get_version(),
|
| 400 |
+
'%define release ' + self.release.replace('-','_'),
|
| 401 |
+
'',
|
| 402 |
+
'Summary: ' + self.distribution.get_description(),
|
| 403 |
+
]
|
| 404 |
+
|
| 405 |
+
# Workaround for #14443 which affects some RPM based systems such as
|
| 406 |
+
# RHEL6 (and probably derivatives)
|
| 407 |
+
vendor_hook = subprocess.getoutput('rpm --eval %{__os_install_post}')
|
| 408 |
+
# Generate a potential replacement value for __os_install_post (whilst
|
| 409 |
+
# normalizing the whitespace to simplify the test for whether the
|
| 410 |
+
# invocation of brp-python-bytecompile passes in __python):
|
| 411 |
+
vendor_hook = '\n'.join([' %s \\' % line.strip()
|
| 412 |
+
for line in vendor_hook.splitlines()])
|
| 413 |
+
problem = "brp-python-bytecompile \\\n"
|
| 414 |
+
fixed = "brp-python-bytecompile %{__python} \\\n"
|
| 415 |
+
fixed_hook = vendor_hook.replace(problem, fixed)
|
| 416 |
+
if fixed_hook != vendor_hook:
|
| 417 |
+
spec_file.append('# Workaround for http://bugs.python.org/issue14443')
|
| 418 |
+
spec_file.append('%define __os_install_post ' + fixed_hook + '\n')
|
| 419 |
+
|
| 420 |
+
# put locale summaries into spec file
|
| 421 |
+
# XXX not supported for now (hard to put a dictionary
|
| 422 |
+
# in a config file -- arg!)
|
| 423 |
+
#for locale in self.summaries.keys():
|
| 424 |
+
# spec_file.append('Summary(%s): %s' % (locale,
|
| 425 |
+
# self.summaries[locale]))
|
| 426 |
+
|
| 427 |
+
spec_file.extend([
|
| 428 |
+
'Name: %{name}',
|
| 429 |
+
'Version: %{version}',
|
| 430 |
+
'Release: %{release}',])
|
| 431 |
+
|
| 432 |
+
# XXX yuck! this filename is available from the "sdist" command,
|
| 433 |
+
# but only after it has run: and we create the spec file before
|
| 434 |
+
# running "sdist", in case of --spec-only.
|
| 435 |
+
if self.use_bzip2:
|
| 436 |
+
spec_file.append('Source0: %{name}-%{unmangled_version}.tar.bz2')
|
| 437 |
+
else:
|
| 438 |
+
spec_file.append('Source0: %{name}-%{unmangled_version}.tar.gz')
|
| 439 |
+
|
| 440 |
+
spec_file.extend([
|
| 441 |
+
'License: ' + self.distribution.get_license(),
|
| 442 |
+
'Group: ' + self.group,
|
| 443 |
+
'BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot',
|
| 444 |
+
'Prefix: %{_prefix}', ])
|
| 445 |
+
|
| 446 |
+
if not self.force_arch:
|
| 447 |
+
# noarch if no extension modules
|
| 448 |
+
if not self.distribution.has_ext_modules():
|
| 449 |
+
spec_file.append('BuildArch: noarch')
|
| 450 |
+
else:
|
| 451 |
+
spec_file.append( 'BuildArch: %s' % self.force_arch )
|
| 452 |
+
|
| 453 |
+
for field in ('Vendor',
|
| 454 |
+
'Packager',
|
| 455 |
+
'Provides',
|
| 456 |
+
'Requires',
|
| 457 |
+
'Conflicts',
|
| 458 |
+
'Obsoletes',
|
| 459 |
+
):
|
| 460 |
+
val = getattr(self, field.lower())
|
| 461 |
+
if isinstance(val, list):
|
| 462 |
+
spec_file.append('%s: %s' % (field, ' '.join(val)))
|
| 463 |
+
elif val is not None:
|
| 464 |
+
spec_file.append('%s: %s' % (field, val))
|
| 465 |
+
|
| 466 |
+
|
| 467 |
+
if self.distribution.get_url() != 'UNKNOWN':
|
| 468 |
+
spec_file.append('Url: ' + self.distribution.get_url())
|
| 469 |
+
|
| 470 |
+
if self.distribution_name:
|
| 471 |
+
spec_file.append('Distribution: ' + self.distribution_name)
|
| 472 |
+
|
| 473 |
+
if self.build_requires:
|
| 474 |
+
spec_file.append('BuildRequires: ' +
|
| 475 |
+
' '.join(self.build_requires))
|
| 476 |
+
|
| 477 |
+
if self.icon:
|
| 478 |
+
spec_file.append('Icon: ' + os.path.basename(self.icon))
|
| 479 |
+
|
| 480 |
+
if self.no_autoreq:
|
| 481 |
+
spec_file.append('AutoReq: 0')
|
| 482 |
+
|
| 483 |
+
spec_file.extend([
|
| 484 |
+
'',
|
| 485 |
+
'%description',
|
| 486 |
+
self.distribution.get_long_description()
|
| 487 |
+
])
|
| 488 |
+
|
| 489 |
+
# put locale descriptions into spec file
|
| 490 |
+
# XXX again, suppressed because config file syntax doesn't
|
| 491 |
+
# easily support this ;-(
|
| 492 |
+
#for locale in self.descriptions.keys():
|
| 493 |
+
# spec_file.extend([
|
| 494 |
+
# '',
|
| 495 |
+
# '%description -l ' + locale,
|
| 496 |
+
# self.descriptions[locale],
|
| 497 |
+
# ])
|
| 498 |
+
|
| 499 |
+
# rpm scripts
|
| 500 |
+
# figure out default build script
|
| 501 |
+
def_setup_call = "%s %s" % (self.python,os.path.basename(sys.argv[0]))
|
| 502 |
+
def_build = "%s build" % def_setup_call
|
| 503 |
+
if self.use_rpm_opt_flags:
|
| 504 |
+
def_build = 'env CFLAGS="$RPM_OPT_FLAGS" ' + def_build
|
| 505 |
+
|
| 506 |
+
# insert contents of files
|
| 507 |
+
|
| 508 |
+
# XXX this is kind of misleading: user-supplied options are files
|
| 509 |
+
# that we open and interpolate into the spec file, but the defaults
|
| 510 |
+
# are just text that we drop in as-is. Hmmm.
|
| 511 |
+
|
| 512 |
+
install_cmd = ('%s install -O1 --root=$RPM_BUILD_ROOT '
|
| 513 |
+
'--record=INSTALLED_FILES') % def_setup_call
|
| 514 |
+
|
| 515 |
+
script_options = [
|
| 516 |
+
('prep', 'prep_script', "%setup -n %{name}-%{unmangled_version}"),
|
| 517 |
+
('build', 'build_script', def_build),
|
| 518 |
+
('install', 'install_script', install_cmd),
|
| 519 |
+
('clean', 'clean_script', "rm -rf $RPM_BUILD_ROOT"),
|
| 520 |
+
('verifyscript', 'verify_script', None),
|
| 521 |
+
('pre', 'pre_install', None),
|
| 522 |
+
('post', 'post_install', None),
|
| 523 |
+
('preun', 'pre_uninstall', None),
|
| 524 |
+
('postun', 'post_uninstall', None),
|
| 525 |
+
]
|
| 526 |
+
|
| 527 |
+
for (rpm_opt, attr, default) in script_options:
|
| 528 |
+
# Insert contents of file referred to, if no file is referred to
|
| 529 |
+
# use 'default' as contents of script
|
| 530 |
+
val = getattr(self, attr)
|
| 531 |
+
if val or default:
|
| 532 |
+
spec_file.extend([
|
| 533 |
+
'',
|
| 534 |
+
'%' + rpm_opt,])
|
| 535 |
+
if val:
|
| 536 |
+
with open(val) as f:
|
| 537 |
+
spec_file.extend(f.read().split('\n'))
|
| 538 |
+
else:
|
| 539 |
+
spec_file.append(default)
|
| 540 |
+
|
| 541 |
+
|
| 542 |
+
# files section
|
| 543 |
+
spec_file.extend([
|
| 544 |
+
'',
|
| 545 |
+
'%files -f INSTALLED_FILES',
|
| 546 |
+
'%defattr(-,root,root)',
|
| 547 |
+
])
|
| 548 |
+
|
| 549 |
+
if self.doc_files:
|
| 550 |
+
spec_file.append('%doc ' + ' '.join(self.doc_files))
|
| 551 |
+
|
| 552 |
+
if self.changelog:
|
| 553 |
+
spec_file.extend([
|
| 554 |
+
'',
|
| 555 |
+
'%changelog',])
|
| 556 |
+
spec_file.extend(self.changelog)
|
| 557 |
+
|
| 558 |
+
return spec_file
|
| 559 |
+
|
| 560 |
+
def _format_changelog(self, changelog):
|
| 561 |
+
"""Format the changelog correctly and convert it to a list of strings
|
| 562 |
+
"""
|
| 563 |
+
if not changelog:
|
| 564 |
+
return changelog
|
| 565 |
+
new_changelog = []
|
| 566 |
+
for line in changelog.strip().split('\n'):
|
| 567 |
+
line = line.strip()
|
| 568 |
+
if line[0] == '*':
|
| 569 |
+
new_changelog.extend(['', line])
|
| 570 |
+
elif line[0] == '-':
|
| 571 |
+
new_changelog.append(line)
|
| 572 |
+
else:
|
| 573 |
+
new_changelog.append(' ' + line)
|
| 574 |
+
|
| 575 |
+
# strip trailing newline inserted by first changelog entry
|
| 576 |
+
if not new_changelog[0]:
|
| 577 |
+
del new_changelog[0]
|
| 578 |
+
|
| 579 |
+
return new_changelog
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/build.py
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""distutils.command.build
|
| 2 |
+
|
| 3 |
+
Implements the Distutils 'build' command."""
|
| 4 |
+
|
| 5 |
+
import sys, os
|
| 6 |
+
from distutils.core import Command
|
| 7 |
+
from distutils.errors import DistutilsOptionError
|
| 8 |
+
from distutils.util import get_platform
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def show_compilers():
|
| 12 |
+
from distutils.ccompiler import show_compilers
|
| 13 |
+
show_compilers()
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
class build(Command):
|
| 17 |
+
|
| 18 |
+
description = "build everything needed to install"
|
| 19 |
+
|
| 20 |
+
user_options = [
|
| 21 |
+
('build-base=', 'b',
|
| 22 |
+
"base directory for build library"),
|
| 23 |
+
('build-purelib=', None,
|
| 24 |
+
"build directory for platform-neutral distributions"),
|
| 25 |
+
('build-platlib=', None,
|
| 26 |
+
"build directory for platform-specific distributions"),
|
| 27 |
+
('build-lib=', None,
|
| 28 |
+
"build directory for all distribution (defaults to either " +
|
| 29 |
+
"build-purelib or build-platlib"),
|
| 30 |
+
('build-scripts=', None,
|
| 31 |
+
"build directory for scripts"),
|
| 32 |
+
('build-temp=', 't',
|
| 33 |
+
"temporary build directory"),
|
| 34 |
+
('plat-name=', 'p',
|
| 35 |
+
"platform name to build for, if supported "
|
| 36 |
+
"(default: %s)" % get_platform()),
|
| 37 |
+
('compiler=', 'c',
|
| 38 |
+
"specify the compiler type"),
|
| 39 |
+
('parallel=', 'j',
|
| 40 |
+
"number of parallel build jobs"),
|
| 41 |
+
('debug', 'g',
|
| 42 |
+
"compile extensions and libraries with debugging information"),
|
| 43 |
+
('force', 'f',
|
| 44 |
+
"forcibly build everything (ignore file timestamps)"),
|
| 45 |
+
('executable=', 'e',
|
| 46 |
+
"specify final destination interpreter path (build.py)"),
|
| 47 |
+
]
|
| 48 |
+
|
| 49 |
+
boolean_options = ['debug', 'force']
|
| 50 |
+
|
| 51 |
+
help_options = [
|
| 52 |
+
('help-compiler', None,
|
| 53 |
+
"list available compilers", show_compilers),
|
| 54 |
+
]
|
| 55 |
+
|
| 56 |
+
def initialize_options(self):
|
| 57 |
+
self.build_base = 'build'
|
| 58 |
+
# these are decided only after 'build_base' has its final value
|
| 59 |
+
# (unless overridden by the user or client)
|
| 60 |
+
self.build_purelib = None
|
| 61 |
+
self.build_platlib = None
|
| 62 |
+
self.build_lib = None
|
| 63 |
+
self.build_temp = None
|
| 64 |
+
self.build_scripts = None
|
| 65 |
+
self.compiler = None
|
| 66 |
+
self.plat_name = None
|
| 67 |
+
self.debug = None
|
| 68 |
+
self.force = 0
|
| 69 |
+
self.executable = None
|
| 70 |
+
self.parallel = None
|
| 71 |
+
|
| 72 |
+
def finalize_options(self):
|
| 73 |
+
if self.plat_name is None:
|
| 74 |
+
self.plat_name = get_platform()
|
| 75 |
+
else:
|
| 76 |
+
# plat-name only supported for windows (other platforms are
|
| 77 |
+
# supported via ./configure flags, if at all). Avoid misleading
|
| 78 |
+
# other platforms.
|
| 79 |
+
if os.name != 'nt':
|
| 80 |
+
raise DistutilsOptionError(
|
| 81 |
+
"--plat-name only supported on Windows (try "
|
| 82 |
+
"using './configure --help' on your platform)")
|
| 83 |
+
|
| 84 |
+
plat_specifier = ".%s-%d.%d" % (self.plat_name, *sys.version_info[:2])
|
| 85 |
+
|
| 86 |
+
# Make it so Python 2.x and Python 2.x with --with-pydebug don't
|
| 87 |
+
# share the same build directories. Doing so confuses the build
|
| 88 |
+
# process for C modules
|
| 89 |
+
if hasattr(sys, 'gettotalrefcount'):
|
| 90 |
+
plat_specifier += '-pydebug'
|
| 91 |
+
|
| 92 |
+
# 'build_purelib' and 'build_platlib' just default to 'lib' and
|
| 93 |
+
# 'lib.<plat>' under the base build directory. We only use one of
|
| 94 |
+
# them for a given distribution, though --
|
| 95 |
+
if self.build_purelib is None:
|
| 96 |
+
self.build_purelib = os.path.join(self.build_base, 'lib')
|
| 97 |
+
if self.build_platlib is None:
|
| 98 |
+
self.build_platlib = os.path.join(self.build_base,
|
| 99 |
+
'lib' + plat_specifier)
|
| 100 |
+
|
| 101 |
+
# 'build_lib' is the actual directory that we will use for this
|
| 102 |
+
# particular module distribution -- if user didn't supply it, pick
|
| 103 |
+
# one of 'build_purelib' or 'build_platlib'.
|
| 104 |
+
if self.build_lib is None:
|
| 105 |
+
if self.distribution.ext_modules:
|
| 106 |
+
self.build_lib = self.build_platlib
|
| 107 |
+
else:
|
| 108 |
+
self.build_lib = self.build_purelib
|
| 109 |
+
|
| 110 |
+
# 'build_temp' -- temporary directory for compiler turds,
|
| 111 |
+
# "build/temp.<plat>"
|
| 112 |
+
if self.build_temp is None:
|
| 113 |
+
self.build_temp = os.path.join(self.build_base,
|
| 114 |
+
'temp' + plat_specifier)
|
| 115 |
+
if self.build_scripts is None:
|
| 116 |
+
self.build_scripts = os.path.join(self.build_base,
|
| 117 |
+
'scripts-%d.%d' % sys.version_info[:2])
|
| 118 |
+
|
| 119 |
+
if self.executable is None and sys.executable:
|
| 120 |
+
self.executable = os.path.normpath(sys.executable)
|
| 121 |
+
|
| 122 |
+
if isinstance(self.parallel, str):
|
| 123 |
+
try:
|
| 124 |
+
self.parallel = int(self.parallel)
|
| 125 |
+
except ValueError:
|
| 126 |
+
raise DistutilsOptionError("parallel should be an integer")
|
| 127 |
+
|
| 128 |
+
def run(self):
|
| 129 |
+
# Run all relevant sub-commands. This will be some subset of:
|
| 130 |
+
# - build_py - pure Python modules
|
| 131 |
+
# - build_clib - standalone C libraries
|
| 132 |
+
# - build_ext - Python extensions
|
| 133 |
+
# - build_scripts - (Python) scripts
|
| 134 |
+
for cmd_name in self.get_sub_commands():
|
| 135 |
+
self.run_command(cmd_name)
|
| 136 |
+
|
| 137 |
+
|
| 138 |
+
# -- Predicates for the sub-command list ---------------------------
|
| 139 |
+
|
| 140 |
+
def has_pure_modules(self):
|
| 141 |
+
return self.distribution.has_pure_modules()
|
| 142 |
+
|
| 143 |
+
def has_c_libraries(self):
|
| 144 |
+
return self.distribution.has_c_libraries()
|
| 145 |
+
|
| 146 |
+
def has_ext_modules(self):
|
| 147 |
+
return self.distribution.has_ext_modules()
|
| 148 |
+
|
| 149 |
+
def has_scripts(self):
|
| 150 |
+
return self.distribution.has_scripts()
|
| 151 |
+
|
| 152 |
+
|
| 153 |
+
sub_commands = [('build_py', has_pure_modules),
|
| 154 |
+
('build_clib', has_c_libraries),
|
| 155 |
+
('build_ext', has_ext_modules),
|
| 156 |
+
('build_scripts', has_scripts),
|
| 157 |
+
]
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/build_clib.py
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""distutils.command.build_clib
|
| 2 |
+
|
| 3 |
+
Implements the Distutils 'build_clib' command, to build a C/C++ library
|
| 4 |
+
that is included in the module distribution and needed by an extension
|
| 5 |
+
module."""
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
# XXX this module has *lots* of code ripped-off quite transparently from
|
| 9 |
+
# build_ext.py -- not surprisingly really, as the work required to build
|
| 10 |
+
# a static library from a collection of C source files is not really all
|
| 11 |
+
# that different from what's required to build a shared object file from
|
| 12 |
+
# a collection of C source files. Nevertheless, I haven't done the
|
| 13 |
+
# necessary refactoring to account for the overlap in code between the
|
| 14 |
+
# two modules, mainly because a number of subtle details changed in the
|
| 15 |
+
# cut 'n paste. Sigh.
|
| 16 |
+
|
| 17 |
+
import os
|
| 18 |
+
from distutils.core import Command
|
| 19 |
+
from distutils.errors import *
|
| 20 |
+
from distutils.sysconfig import customize_compiler
|
| 21 |
+
from distutils import log
|
| 22 |
+
|
| 23 |
+
def show_compilers():
|
| 24 |
+
from distutils.ccompiler import show_compilers
|
| 25 |
+
show_compilers()
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
class build_clib(Command):
|
| 29 |
+
|
| 30 |
+
description = "build C/C++ libraries used by Python extensions"
|
| 31 |
+
|
| 32 |
+
user_options = [
|
| 33 |
+
('build-clib=', 'b',
|
| 34 |
+
"directory to build C/C++ libraries to"),
|
| 35 |
+
('build-temp=', 't',
|
| 36 |
+
"directory to put temporary build by-products"),
|
| 37 |
+
('debug', 'g',
|
| 38 |
+
"compile with debugging information"),
|
| 39 |
+
('force', 'f',
|
| 40 |
+
"forcibly build everything (ignore file timestamps)"),
|
| 41 |
+
('compiler=', 'c',
|
| 42 |
+
"specify the compiler type"),
|
| 43 |
+
]
|
| 44 |
+
|
| 45 |
+
boolean_options = ['debug', 'force']
|
| 46 |
+
|
| 47 |
+
help_options = [
|
| 48 |
+
('help-compiler', None,
|
| 49 |
+
"list available compilers", show_compilers),
|
| 50 |
+
]
|
| 51 |
+
|
| 52 |
+
def initialize_options(self):
|
| 53 |
+
self.build_clib = None
|
| 54 |
+
self.build_temp = None
|
| 55 |
+
|
| 56 |
+
# List of libraries to build
|
| 57 |
+
self.libraries = None
|
| 58 |
+
|
| 59 |
+
# Compilation options for all libraries
|
| 60 |
+
self.include_dirs = None
|
| 61 |
+
self.define = None
|
| 62 |
+
self.undef = None
|
| 63 |
+
self.debug = None
|
| 64 |
+
self.force = 0
|
| 65 |
+
self.compiler = None
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
def finalize_options(self):
|
| 69 |
+
# This might be confusing: both build-clib and build-temp default
|
| 70 |
+
# to build-temp as defined by the "build" command. This is because
|
| 71 |
+
# I think that C libraries are really just temporary build
|
| 72 |
+
# by-products, at least from the point of view of building Python
|
| 73 |
+
# extensions -- but I want to keep my options open.
|
| 74 |
+
self.set_undefined_options('build',
|
| 75 |
+
('build_temp', 'build_clib'),
|
| 76 |
+
('build_temp', 'build_temp'),
|
| 77 |
+
('compiler', 'compiler'),
|
| 78 |
+
('debug', 'debug'),
|
| 79 |
+
('force', 'force'))
|
| 80 |
+
|
| 81 |
+
self.libraries = self.distribution.libraries
|
| 82 |
+
if self.libraries:
|
| 83 |
+
self.check_library_list(self.libraries)
|
| 84 |
+
|
| 85 |
+
if self.include_dirs is None:
|
| 86 |
+
self.include_dirs = self.distribution.include_dirs or []
|
| 87 |
+
if isinstance(self.include_dirs, str):
|
| 88 |
+
self.include_dirs = self.include_dirs.split(os.pathsep)
|
| 89 |
+
|
| 90 |
+
# XXX same as for build_ext -- what about 'self.define' and
|
| 91 |
+
# 'self.undef' ?
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
def run(self):
|
| 95 |
+
if not self.libraries:
|
| 96 |
+
return
|
| 97 |
+
|
| 98 |
+
# Yech -- this is cut 'n pasted from build_ext.py!
|
| 99 |
+
from distutils.ccompiler import new_compiler
|
| 100 |
+
self.compiler = new_compiler(compiler=self.compiler,
|
| 101 |
+
dry_run=self.dry_run,
|
| 102 |
+
force=self.force)
|
| 103 |
+
customize_compiler(self.compiler)
|
| 104 |
+
|
| 105 |
+
if self.include_dirs is not None:
|
| 106 |
+
self.compiler.set_include_dirs(self.include_dirs)
|
| 107 |
+
if self.define is not None:
|
| 108 |
+
# 'define' option is a list of (name,value) tuples
|
| 109 |
+
for (name,value) in self.define:
|
| 110 |
+
self.compiler.define_macro(name, value)
|
| 111 |
+
if self.undef is not None:
|
| 112 |
+
for macro in self.undef:
|
| 113 |
+
self.compiler.undefine_macro(macro)
|
| 114 |
+
|
| 115 |
+
self.build_libraries(self.libraries)
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
def check_library_list(self, libraries):
|
| 119 |
+
"""Ensure that the list of libraries is valid.
|
| 120 |
+
|
| 121 |
+
`library` is presumably provided as a command option 'libraries'.
|
| 122 |
+
This method checks that it is a list of 2-tuples, where the tuples
|
| 123 |
+
are (library_name, build_info_dict).
|
| 124 |
+
|
| 125 |
+
Raise DistutilsSetupError if the structure is invalid anywhere;
|
| 126 |
+
just returns otherwise.
|
| 127 |
+
"""
|
| 128 |
+
if not isinstance(libraries, list):
|
| 129 |
+
raise DistutilsSetupError(
|
| 130 |
+
"'libraries' option must be a list of tuples")
|
| 131 |
+
|
| 132 |
+
for lib in libraries:
|
| 133 |
+
if not isinstance(lib, tuple) and len(lib) != 2:
|
| 134 |
+
raise DistutilsSetupError(
|
| 135 |
+
"each element of 'libraries' must a 2-tuple")
|
| 136 |
+
|
| 137 |
+
name, build_info = lib
|
| 138 |
+
|
| 139 |
+
if not isinstance(name, str):
|
| 140 |
+
raise DistutilsSetupError(
|
| 141 |
+
"first element of each tuple in 'libraries' "
|
| 142 |
+
"must be a string (the library name)")
|
| 143 |
+
|
| 144 |
+
if '/' in name or (os.sep != '/' and os.sep in name):
|
| 145 |
+
raise DistutilsSetupError("bad library name '%s': "
|
| 146 |
+
"may not contain directory separators" % lib[0])
|
| 147 |
+
|
| 148 |
+
if not isinstance(build_info, dict):
|
| 149 |
+
raise DistutilsSetupError(
|
| 150 |
+
"second element of each tuple in 'libraries' "
|
| 151 |
+
"must be a dictionary (build info)")
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
def get_library_names(self):
|
| 155 |
+
# Assume the library list is valid -- 'check_library_list()' is
|
| 156 |
+
# called from 'finalize_options()', so it should be!
|
| 157 |
+
if not self.libraries:
|
| 158 |
+
return None
|
| 159 |
+
|
| 160 |
+
lib_names = []
|
| 161 |
+
for (lib_name, build_info) in self.libraries:
|
| 162 |
+
lib_names.append(lib_name)
|
| 163 |
+
return lib_names
|
| 164 |
+
|
| 165 |
+
|
| 166 |
+
def get_source_files(self):
|
| 167 |
+
self.check_library_list(self.libraries)
|
| 168 |
+
filenames = []
|
| 169 |
+
for (lib_name, build_info) in self.libraries:
|
| 170 |
+
sources = build_info.get('sources')
|
| 171 |
+
if sources is None or not isinstance(sources, (list, tuple)):
|
| 172 |
+
raise DistutilsSetupError(
|
| 173 |
+
"in 'libraries' option (library '%s'), "
|
| 174 |
+
"'sources' must be present and must be "
|
| 175 |
+
"a list of source filenames" % lib_name)
|
| 176 |
+
|
| 177 |
+
filenames.extend(sources)
|
| 178 |
+
return filenames
|
| 179 |
+
|
| 180 |
+
|
| 181 |
+
def build_libraries(self, libraries):
|
| 182 |
+
for (lib_name, build_info) in libraries:
|
| 183 |
+
sources = build_info.get('sources')
|
| 184 |
+
if sources is None or not isinstance(sources, (list, tuple)):
|
| 185 |
+
raise DistutilsSetupError(
|
| 186 |
+
"in 'libraries' option (library '%s'), "
|
| 187 |
+
"'sources' must be present and must be "
|
| 188 |
+
"a list of source filenames" % lib_name)
|
| 189 |
+
sources = list(sources)
|
| 190 |
+
|
| 191 |
+
log.info("building '%s' library", lib_name)
|
| 192 |
+
|
| 193 |
+
# First, compile the source code to object files in the library
|
| 194 |
+
# directory. (This should probably change to putting object
|
| 195 |
+
# files in a temporary build directory.)
|
| 196 |
+
macros = build_info.get('macros')
|
| 197 |
+
include_dirs = build_info.get('include_dirs')
|
| 198 |
+
objects = self.compiler.compile(sources,
|
| 199 |
+
output_dir=self.build_temp,
|
| 200 |
+
macros=macros,
|
| 201 |
+
include_dirs=include_dirs,
|
| 202 |
+
debug=self.debug)
|
| 203 |
+
|
| 204 |
+
# Now "link" the object files together into a static library.
|
| 205 |
+
# (On Unix at least, this isn't really linking -- it just
|
| 206 |
+
# builds an archive. Whatever.)
|
| 207 |
+
self.compiler.create_static_lib(objects, lib_name,
|
| 208 |
+
output_dir=self.build_clib,
|
| 209 |
+
debug=self.debug)
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/__init__.cpython-311.pyc
ADDED
|
Binary file (2.09 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/_encoded_words.cpython-311.pyc
ADDED
|
Binary file (9.1 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/_parseaddr.cpython-311.pyc
ADDED
|
Binary file (24.3 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/_policybase.cpython-311.pyc
ADDED
|
Binary file (19.7 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/base64mime.cpython-311.pyc
ADDED
|
Binary file (4.33 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/charset.cpython-311.pyc
ADDED
|
Binary file (16 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/contentmanager.cpython-311.pyc
ADDED
|
Binary file (13.8 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/encoders.cpython-311.pyc
ADDED
|
Binary file (2.37 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/errors.cpython-311.pyc
ADDED
|
Binary file (8.65 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/feedparser.cpython-311.pyc
ADDED
|
Binary file (21.5 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/generator.cpython-311.pyc
ADDED
|
Binary file (23 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/header.cpython-311.pyc
ADDED
|
Binary file (27 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/headerregistry.cpython-311.pyc
ADDED
|
Binary file (33.7 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/iterators.cpython-311.pyc
ADDED
|
Binary file (3.15 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/message.cpython-311.pyc
ADDED
|
Binary file (59 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/parser.cpython-311.pyc
ADDED
|
Binary file (7.37 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/policy.cpython-311.pyc
ADDED
|
Binary file (12.5 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/quoprimime.cpython-311.pyc
ADDED
|
Binary file (11.2 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/utils.cpython-311.pyc
ADDED
|
Binary file (19.3 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__init__.py
ADDED
|
File without changes
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/__init__.cpython-311.pyc
ADDED
|
Binary file (135 Bytes). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/application.cpython-311.pyc
ADDED
|
Binary file (1.81 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/audio.cpython-311.pyc
ADDED
|
Binary file (3.86 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/base.cpython-311.pyc
ADDED
|
Binary file (1.38 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/image.cpython-311.pyc
ADDED
|
Binary file (6.55 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/message.cpython-311.pyc
ADDED
|
Binary file (1.72 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/multipart.cpython-311.pyc
ADDED
|
Binary file (1.86 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/nonmultipart.cpython-311.pyc
ADDED
|
Binary file (970 Bytes). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/__pycache__/text.cpython-311.pyc
ADDED
|
Binary file (1.74 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/application.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) 2001-2006 Python Software Foundation
|
| 2 |
+
# Author: Keith Dart
|
| 3 |
+
# Contact: email-sig@python.org
|
| 4 |
+
|
| 5 |
+
"""Class representing application/* type MIME documents."""
|
| 6 |
+
|
| 7 |
+
__all__ = ["MIMEApplication"]
|
| 8 |
+
|
| 9 |
+
from email import encoders
|
| 10 |
+
from email.mime.nonmultipart import MIMENonMultipart
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class MIMEApplication(MIMENonMultipart):
|
| 14 |
+
"""Class for generating application/* MIME documents."""
|
| 15 |
+
|
| 16 |
+
def __init__(self, _data, _subtype='octet-stream',
|
| 17 |
+
_encoder=encoders.encode_base64, *, policy=None, **_params):
|
| 18 |
+
"""Create an application/* type MIME document.
|
| 19 |
+
|
| 20 |
+
_data contains the bytes for the raw application data.
|
| 21 |
+
|
| 22 |
+
_subtype is the MIME content type subtype, defaulting to
|
| 23 |
+
'octet-stream'.
|
| 24 |
+
|
| 25 |
+
_encoder is a function which will perform the actual encoding for
|
| 26 |
+
transport of the application data, defaulting to base64 encoding.
|
| 27 |
+
|
| 28 |
+
Any additional keyword arguments are passed to the base class
|
| 29 |
+
constructor, which turns them into parameters on the Content-Type
|
| 30 |
+
header.
|
| 31 |
+
"""
|
| 32 |
+
if _subtype is None:
|
| 33 |
+
raise TypeError('Invalid application MIME subtype')
|
| 34 |
+
MIMENonMultipart.__init__(self, 'application', _subtype, policy=policy,
|
| 35 |
+
**_params)
|
| 36 |
+
self.set_payload(_data)
|
| 37 |
+
_encoder(self)
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/audio.py
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) 2001-2007 Python Software Foundation
|
| 2 |
+
# Author: Anthony Baxter
|
| 3 |
+
# Contact: email-sig@python.org
|
| 4 |
+
|
| 5 |
+
"""Class representing audio/* type MIME documents."""
|
| 6 |
+
|
| 7 |
+
__all__ = ['MIMEAudio']
|
| 8 |
+
|
| 9 |
+
from io import BytesIO
|
| 10 |
+
from email import encoders
|
| 11 |
+
from email.mime.nonmultipart import MIMENonMultipart
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class MIMEAudio(MIMENonMultipart):
|
| 15 |
+
"""Class for generating audio/* MIME documents."""
|
| 16 |
+
|
| 17 |
+
def __init__(self, _audiodata, _subtype=None,
|
| 18 |
+
_encoder=encoders.encode_base64, *, policy=None, **_params):
|
| 19 |
+
"""Create an audio/* type MIME document.
|
| 20 |
+
|
| 21 |
+
_audiodata contains the bytes for the raw audio data. If this data
|
| 22 |
+
can be decoded as au, wav, aiff, or aifc, then the
|
| 23 |
+
subtype will be automatically included in the Content-Type header.
|
| 24 |
+
Otherwise, you can specify the specific audio subtype via the
|
| 25 |
+
_subtype parameter. If _subtype is not given, and no subtype can be
|
| 26 |
+
guessed, a TypeError is raised.
|
| 27 |
+
|
| 28 |
+
_encoder is a function which will perform the actual encoding for
|
| 29 |
+
transport of the image data. It takes one argument, which is this
|
| 30 |
+
Image instance. It should use get_payload() and set_payload() to
|
| 31 |
+
change the payload to the encoded form. It should also add any
|
| 32 |
+
Content-Transfer-Encoding or other headers to the message as
|
| 33 |
+
necessary. The default encoding is Base64.
|
| 34 |
+
|
| 35 |
+
Any additional keyword arguments are passed to the base class
|
| 36 |
+
constructor, which turns them into parameters on the Content-Type
|
| 37 |
+
header.
|
| 38 |
+
"""
|
| 39 |
+
if _subtype is None:
|
| 40 |
+
_subtype = _what(_audiodata)
|
| 41 |
+
if _subtype is None:
|
| 42 |
+
raise TypeError('Could not find audio MIME subtype')
|
| 43 |
+
MIMENonMultipart.__init__(self, 'audio', _subtype, policy=policy,
|
| 44 |
+
**_params)
|
| 45 |
+
self.set_payload(_audiodata)
|
| 46 |
+
_encoder(self)
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
_rules = []
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
# Originally from the sndhdr module.
|
| 53 |
+
#
|
| 54 |
+
# There are others in sndhdr that don't have MIME types. :(
|
| 55 |
+
# Additional ones to be added to sndhdr? midi, mp3, realaudio, wma??
|
| 56 |
+
def _what(data):
|
| 57 |
+
# Try to identify a sound file type.
|
| 58 |
+
#
|
| 59 |
+
# sndhdr.what() had a pretty cruddy interface, unfortunately. This is why
|
| 60 |
+
# we re-do it here. It would be easier to reverse engineer the Unix 'file'
|
| 61 |
+
# command and use the standard 'magic' file, as shipped with a modern Unix.
|
| 62 |
+
hdr = data[:512]
|
| 63 |
+
fakefile = BytesIO(hdr)
|
| 64 |
+
for testfn in _rules:
|
| 65 |
+
if res := testfn(hdr, fakefile):
|
| 66 |
+
return res
|
| 67 |
+
else:
|
| 68 |
+
return None
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
def rule(rulefunc):
|
| 72 |
+
_rules.append(rulefunc)
|
| 73 |
+
return rulefunc
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
@rule
|
| 77 |
+
def _aiff(h, f):
|
| 78 |
+
if not h.startswith(b'FORM'):
|
| 79 |
+
return None
|
| 80 |
+
if h[8:12] in {b'AIFC', b'AIFF'}:
|
| 81 |
+
return 'x-aiff'
|
| 82 |
+
else:
|
| 83 |
+
return None
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
@rule
|
| 87 |
+
def _au(h, f):
|
| 88 |
+
if h.startswith(b'.snd'):
|
| 89 |
+
return 'basic'
|
| 90 |
+
else:
|
| 91 |
+
return None
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
@rule
|
| 95 |
+
def _wav(h, f):
|
| 96 |
+
# 'RIFF' <len> 'WAVE' 'fmt ' <len>
|
| 97 |
+
if not h.startswith(b'RIFF') or h[8:12] != b'WAVE' or h[12:16] != b'fmt ':
|
| 98 |
+
return None
|
| 99 |
+
else:
|
| 100 |
+
return "x-wav"
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/base.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) 2001-2006 Python Software Foundation
|
| 2 |
+
# Author: Barry Warsaw
|
| 3 |
+
# Contact: email-sig@python.org
|
| 4 |
+
|
| 5 |
+
"""Base class for MIME specializations."""
|
| 6 |
+
|
| 7 |
+
__all__ = ['MIMEBase']
|
| 8 |
+
|
| 9 |
+
import email.policy
|
| 10 |
+
|
| 11 |
+
from email import message
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class MIMEBase(message.Message):
|
| 15 |
+
"""Base class for MIME specializations."""
|
| 16 |
+
|
| 17 |
+
def __init__(self, _maintype, _subtype, *, policy=None, **_params):
|
| 18 |
+
"""This constructor adds a Content-Type: and a MIME-Version: header.
|
| 19 |
+
|
| 20 |
+
The Content-Type: header is taken from the _maintype and _subtype
|
| 21 |
+
arguments. Additional parameters for this header are taken from the
|
| 22 |
+
keyword arguments.
|
| 23 |
+
"""
|
| 24 |
+
if policy is None:
|
| 25 |
+
policy = email.policy.compat32
|
| 26 |
+
message.Message.__init__(self, policy=policy)
|
| 27 |
+
ctype = '%s/%s' % (_maintype, _subtype)
|
| 28 |
+
self.add_header('Content-Type', ctype, **_params)
|
| 29 |
+
self['MIME-Version'] = '1.0'
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/image.py
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) 2001-2006 Python Software Foundation
|
| 2 |
+
# Author: Barry Warsaw
|
| 3 |
+
# Contact: email-sig@python.org
|
| 4 |
+
|
| 5 |
+
"""Class representing image/* type MIME documents."""
|
| 6 |
+
|
| 7 |
+
__all__ = ['MIMEImage']
|
| 8 |
+
|
| 9 |
+
from email import encoders
|
| 10 |
+
from email.mime.nonmultipart import MIMENonMultipart
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class MIMEImage(MIMENonMultipart):
|
| 14 |
+
"""Class for generating image/* type MIME documents."""
|
| 15 |
+
|
| 16 |
+
def __init__(self, _imagedata, _subtype=None,
|
| 17 |
+
_encoder=encoders.encode_base64, *, policy=None, **_params):
|
| 18 |
+
"""Create an image/* type MIME document.
|
| 19 |
+
|
| 20 |
+
_imagedata contains the bytes for the raw image data. If the data
|
| 21 |
+
type can be detected (jpeg, png, gif, tiff, rgb, pbm, pgm, ppm,
|
| 22 |
+
rast, xbm, bmp, webp, and exr attempted), then the subtype will be
|
| 23 |
+
automatically included in the Content-Type header. Otherwise, you can
|
| 24 |
+
specify the specific image subtype via the _subtype parameter.
|
| 25 |
+
|
| 26 |
+
_encoder is a function which will perform the actual encoding for
|
| 27 |
+
transport of the image data. It takes one argument, which is this
|
| 28 |
+
Image instance. It should use get_payload() and set_payload() to
|
| 29 |
+
change the payload to the encoded form. It should also add any
|
| 30 |
+
Content-Transfer-Encoding or other headers to the message as
|
| 31 |
+
necessary. The default encoding is Base64.
|
| 32 |
+
|
| 33 |
+
Any additional keyword arguments are passed to the base class
|
| 34 |
+
constructor, which turns them into parameters on the Content-Type
|
| 35 |
+
header.
|
| 36 |
+
"""
|
| 37 |
+
_subtype = _what(_imagedata) if _subtype is None else _subtype
|
| 38 |
+
if _subtype is None:
|
| 39 |
+
raise TypeError('Could not guess image MIME subtype')
|
| 40 |
+
MIMENonMultipart.__init__(self, 'image', _subtype, policy=policy,
|
| 41 |
+
**_params)
|
| 42 |
+
self.set_payload(_imagedata)
|
| 43 |
+
_encoder(self)
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
_rules = []
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
# Originally from the imghdr module.
|
| 50 |
+
def _what(data):
|
| 51 |
+
for rule in _rules:
|
| 52 |
+
if res := rule(data):
|
| 53 |
+
return res
|
| 54 |
+
else:
|
| 55 |
+
return None
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
def rule(rulefunc):
|
| 59 |
+
_rules.append(rulefunc)
|
| 60 |
+
return rulefunc
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
@rule
|
| 64 |
+
def _jpeg(h):
|
| 65 |
+
"""JPEG data with JFIF or Exif markers; and raw JPEG"""
|
| 66 |
+
if h[6:10] in (b'JFIF', b'Exif'):
|
| 67 |
+
return 'jpeg'
|
| 68 |
+
elif h[:4] == b'\xff\xd8\xff\xdb':
|
| 69 |
+
return 'jpeg'
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
@rule
|
| 73 |
+
def _png(h):
|
| 74 |
+
if h.startswith(b'\211PNG\r\n\032\n'):
|
| 75 |
+
return 'png'
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
@rule
|
| 79 |
+
def _gif(h):
|
| 80 |
+
"""GIF ('87 and '89 variants)"""
|
| 81 |
+
if h[:6] in (b'GIF87a', b'GIF89a'):
|
| 82 |
+
return 'gif'
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
@rule
|
| 86 |
+
def _tiff(h):
|
| 87 |
+
"""TIFF (can be in Motorola or Intel byte order)"""
|
| 88 |
+
if h[:2] in (b'MM', b'II'):
|
| 89 |
+
return 'tiff'
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
@rule
|
| 93 |
+
def _rgb(h):
|
| 94 |
+
"""SGI image library"""
|
| 95 |
+
if h.startswith(b'\001\332'):
|
| 96 |
+
return 'rgb'
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
@rule
|
| 100 |
+
def _pbm(h):
|
| 101 |
+
"""PBM (portable bitmap)"""
|
| 102 |
+
if len(h) >= 3 and \
|
| 103 |
+
h[0] == ord(b'P') and h[1] in b'14' and h[2] in b' \t\n\r':
|
| 104 |
+
return 'pbm'
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
@rule
|
| 108 |
+
def _pgm(h):
|
| 109 |
+
"""PGM (portable graymap)"""
|
| 110 |
+
if len(h) >= 3 and \
|
| 111 |
+
h[0] == ord(b'P') and h[1] in b'25' and h[2] in b' \t\n\r':
|
| 112 |
+
return 'pgm'
|
| 113 |
+
|
| 114 |
+
|
| 115 |
+
@rule
|
| 116 |
+
def _ppm(h):
|
| 117 |
+
"""PPM (portable pixmap)"""
|
| 118 |
+
if len(h) >= 3 and \
|
| 119 |
+
h[0] == ord(b'P') and h[1] in b'36' and h[2] in b' \t\n\r':
|
| 120 |
+
return 'ppm'
|
| 121 |
+
|
| 122 |
+
|
| 123 |
+
@rule
|
| 124 |
+
def _rast(h):
|
| 125 |
+
"""Sun raster file"""
|
| 126 |
+
if h.startswith(b'\x59\xA6\x6A\x95'):
|
| 127 |
+
return 'rast'
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
@rule
|
| 131 |
+
def _xbm(h):
|
| 132 |
+
"""X bitmap (X10 or X11)"""
|
| 133 |
+
if h.startswith(b'#define '):
|
| 134 |
+
return 'xbm'
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
@rule
|
| 138 |
+
def _bmp(h):
|
| 139 |
+
if h.startswith(b'BM'):
|
| 140 |
+
return 'bmp'
|
| 141 |
+
|
| 142 |
+
|
| 143 |
+
@rule
|
| 144 |
+
def _webp(h):
|
| 145 |
+
if h.startswith(b'RIFF') and h[8:12] == b'WEBP':
|
| 146 |
+
return 'webp'
|
| 147 |
+
|
| 148 |
+
|
| 149 |
+
@rule
|
| 150 |
+
def _exr(h):
|
| 151 |
+
if h.startswith(b'\x76\x2f\x31\x01'):
|
| 152 |
+
return 'exr'
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/message.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) 2001-2006 Python Software Foundation
|
| 2 |
+
# Author: Barry Warsaw
|
| 3 |
+
# Contact: email-sig@python.org
|
| 4 |
+
|
| 5 |
+
"""Class representing message/* MIME documents."""
|
| 6 |
+
|
| 7 |
+
__all__ = ['MIMEMessage']
|
| 8 |
+
|
| 9 |
+
from email import message
|
| 10 |
+
from email.mime.nonmultipart import MIMENonMultipart
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class MIMEMessage(MIMENonMultipart):
|
| 14 |
+
"""Class representing message/* MIME documents."""
|
| 15 |
+
|
| 16 |
+
def __init__(self, _msg, _subtype='rfc822', *, policy=None):
|
| 17 |
+
"""Create a message/* type MIME document.
|
| 18 |
+
|
| 19 |
+
_msg is a message object and must be an instance of Message, or a
|
| 20 |
+
derived class of Message, otherwise a TypeError is raised.
|
| 21 |
+
|
| 22 |
+
Optional _subtype defines the subtype of the contained message. The
|
| 23 |
+
default is "rfc822" (this is defined by the MIME standard, even though
|
| 24 |
+
the term "rfc822" is technically outdated by RFC 2822).
|
| 25 |
+
"""
|
| 26 |
+
MIMENonMultipart.__init__(self, 'message', _subtype, policy=policy)
|
| 27 |
+
if not isinstance(_msg, message.Message):
|
| 28 |
+
raise TypeError('Argument is not an instance of Message')
|
| 29 |
+
# It's convenient to use this base class method. We need to do it
|
| 30 |
+
# this way or we'll get an exception
|
| 31 |
+
message.Message.attach(self, _msg)
|
| 32 |
+
# And be sure our default type is set correctly
|
| 33 |
+
self.set_default_type('message/rfc822')
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/multipart.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) 2002-2006 Python Software Foundation
|
| 2 |
+
# Author: Barry Warsaw
|
| 3 |
+
# Contact: email-sig@python.org
|
| 4 |
+
|
| 5 |
+
"""Base class for MIME multipart/* type messages."""
|
| 6 |
+
|
| 7 |
+
__all__ = ['MIMEMultipart']
|
| 8 |
+
|
| 9 |
+
from email.mime.base import MIMEBase
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class MIMEMultipart(MIMEBase):
|
| 13 |
+
"""Base class for MIME multipart/* type messages."""
|
| 14 |
+
|
| 15 |
+
def __init__(self, _subtype='mixed', boundary=None, _subparts=None,
|
| 16 |
+
*, policy=None,
|
| 17 |
+
**_params):
|
| 18 |
+
"""Creates a multipart/* type message.
|
| 19 |
+
|
| 20 |
+
By default, creates a multipart/mixed message, with proper
|
| 21 |
+
Content-Type and MIME-Version headers.
|
| 22 |
+
|
| 23 |
+
_subtype is the subtype of the multipart content type, defaulting to
|
| 24 |
+
`mixed'.
|
| 25 |
+
|
| 26 |
+
boundary is the multipart boundary string. By default it is
|
| 27 |
+
calculated as needed.
|
| 28 |
+
|
| 29 |
+
_subparts is a sequence of initial subparts for the payload. It
|
| 30 |
+
must be an iterable object, such as a list. You can always
|
| 31 |
+
attach new subparts to the message by using the attach() method.
|
| 32 |
+
|
| 33 |
+
Additional parameters for the Content-Type header are taken from the
|
| 34 |
+
keyword arguments (or passed into the _params argument).
|
| 35 |
+
"""
|
| 36 |
+
MIMEBase.__init__(self, 'multipart', _subtype, policy=policy, **_params)
|
| 37 |
+
|
| 38 |
+
# Initialise _payload to an empty list as the Message superclass's
|
| 39 |
+
# implementation of is_multipart assumes that _payload is a list for
|
| 40 |
+
# multipart messages.
|
| 41 |
+
self._payload = []
|
| 42 |
+
|
| 43 |
+
if _subparts:
|
| 44 |
+
for p in _subparts:
|
| 45 |
+
self.attach(p)
|
| 46 |
+
if boundary:
|
| 47 |
+
self.set_boundary(boundary)
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/nonmultipart.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) 2002-2006 Python Software Foundation
|
| 2 |
+
# Author: Barry Warsaw
|
| 3 |
+
# Contact: email-sig@python.org
|
| 4 |
+
|
| 5 |
+
"""Base class for MIME type messages that are not multipart."""
|
| 6 |
+
|
| 7 |
+
__all__ = ['MIMENonMultipart']
|
| 8 |
+
|
| 9 |
+
from email import errors
|
| 10 |
+
from email.mime.base import MIMEBase
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class MIMENonMultipart(MIMEBase):
|
| 14 |
+
"""Base class for MIME non-multipart type messages."""
|
| 15 |
+
|
| 16 |
+
def attach(self, payload):
|
| 17 |
+
# The public API prohibits attaching multiple subparts to MIMEBase
|
| 18 |
+
# derived subtypes since none of them are, by definition, of content
|
| 19 |
+
# type multipart/*
|
| 20 |
+
raise errors.MultipartConversionError(
|
| 21 |
+
'Cannot attach additional subparts to non-multipart/*')
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/mime/text.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (C) 2001-2006 Python Software Foundation
|
| 2 |
+
# Author: Barry Warsaw
|
| 3 |
+
# Contact: email-sig@python.org
|
| 4 |
+
|
| 5 |
+
"""Class representing text/* type MIME documents."""
|
| 6 |
+
|
| 7 |
+
__all__ = ['MIMEText']
|
| 8 |
+
|
| 9 |
+
from email.charset import Charset
|
| 10 |
+
from email.mime.nonmultipart import MIMENonMultipart
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class MIMEText(MIMENonMultipart):
|
| 14 |
+
"""Class for generating text/* type MIME documents."""
|
| 15 |
+
|
| 16 |
+
def __init__(self, _text, _subtype='plain', _charset=None, *, policy=None):
|
| 17 |
+
"""Create a text/* type MIME document.
|
| 18 |
+
|
| 19 |
+
_text is the string for this message object.
|
| 20 |
+
|
| 21 |
+
_subtype is the MIME sub content type, defaulting to "plain".
|
| 22 |
+
|
| 23 |
+
_charset is the character set parameter added to the Content-Type
|
| 24 |
+
header. This defaults to "us-ascii". Note that as a side-effect, the
|
| 25 |
+
Content-Transfer-Encoding header will also be set.
|
| 26 |
+
"""
|
| 27 |
+
|
| 28 |
+
# If no _charset was specified, check to see if there are non-ascii
|
| 29 |
+
# characters present. If not, use 'us-ascii', otherwise use utf-8.
|
| 30 |
+
# XXX: This can be removed once #7304 is fixed.
|
| 31 |
+
if _charset is None:
|
| 32 |
+
try:
|
| 33 |
+
_text.encode('us-ascii')
|
| 34 |
+
_charset = 'us-ascii'
|
| 35 |
+
except UnicodeEncodeError:
|
| 36 |
+
_charset = 'utf-8'
|
| 37 |
+
|
| 38 |
+
MIMENonMultipart.__init__(self, 'text', _subtype, policy=policy,
|
| 39 |
+
**{'charset': str(_charset)})
|
| 40 |
+
|
| 41 |
+
self.set_payload(_text, _charset)
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/__init__.cpython-311.pyc
ADDED
|
Binary file (6.44 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/aliases.cpython-311.pyc
ADDED
|
Binary file (12.6 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/ascii.cpython-311.pyc
ADDED
|
Binary file (2.69 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/base64_codec.cpython-311.pyc
ADDED
|
Binary file (3.31 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/big5.cpython-311.pyc
ADDED
|
Binary file (2.12 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/big5hkscs.cpython-311.pyc
ADDED
|
Binary file (2.13 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/bz2_codec.cpython-311.pyc
ADDED
|
Binary file (4.83 kB). View file
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/encodings/__pycache__/charmap.cpython-311.pyc
ADDED
|
Binary file (4.1 kB). View file
|
|
|