# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python en Español # package. # FIRST AUTHOR , 2024. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python en Español 3.13\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-11-21 16:38-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: es\n" "Language-Team: es \n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.16.0\n" #: ../Doc/using/ios.rst:5 msgid "Using Python on iOS" msgstr "" #: ../Doc/using/ios.rst msgid "Authors" msgstr "" #: ../Doc/using/ios.rst:8 msgid "Russell Keith-Magee (2024-03)" msgstr "" #: ../Doc/using/ios.rst:10 msgid "" "Python on iOS is unlike Python on desktop platforms. On a desktop platform, " "Python is generally installed as a system resource that can be used by any " "user of that computer. Users then interact with Python by running a :program:" "`python` executable and entering commands at an interactive prompt, or by " "running a Python script." msgstr "" #: ../Doc/using/ios.rst:16 msgid "" "On iOS, there is no concept of installing as a system resource. The only " "unit of software distribution is an \"app\". There is also no console where " "you could run a :program:`python` executable, or interact with a Python REPL." msgstr "" #: ../Doc/using/ios.rst:20 msgid "" "As a result, the only way you can use Python on iOS is in embedded mode - " "that is, by writing a native iOS application, and embedding a Python " "interpreter using ``libPython``, and invoking Python code using the :ref:" "`Python embedding API `. The full Python interpreter, the " "standard library, and all your Python code is then packaged as a standalone " "bundle that can be distributed via the iOS App Store." msgstr "" #: ../Doc/using/ios.rst:27 msgid "" "If you're looking to experiment for the first time with writing an iOS app " "in Python, projects such as `BeeWare `__ and `Kivy " "`__ will provide a much more approachable user experience. " "These projects manage the complexities associated with getting an iOS " "project running, so you only need to deal with the Python code itself." msgstr "" #: ../Doc/using/ios.rst:34 msgid "Python at runtime on iOS" msgstr "" #: ../Doc/using/ios.rst:37 msgid "iOS version compatibility" msgstr "" #: ../Doc/using/ios.rst:39 msgid "" "The minimum supported iOS version is specified at compile time, using the :" "option:`--host` option to ``configure``. By default, when compiled for iOS, " "Python will be compiled with a minimum supported iOS version of 13.0. To use " "a different minimum iOS version, provide the version number as part of the :" "option:`!--host` argument - for example, ``--host=arm64-apple-ios15.4-" "simulator`` would compile an ARM64 simulator build with a deployment target " "of 15.4." msgstr "" #: ../Doc/using/ios.rst:48 msgid "Platform identification" msgstr "" #: ../Doc/using/ios.rst:50 msgid "" "When executing on iOS, ``sys.platform`` will report as ``ios``. This value " "will be returned on an iPhone or iPad, regardless of whether the app is " "running on the simulator or a physical device." msgstr "" #: ../Doc/using/ios.rst:54 msgid "" "Information about the specific runtime environment, including the iOS " "version, device model, and whether the device is a simulator, can be " "obtained using :func:`platform.ios_ver`. :func:`platform.system` will report " "``iOS`` or ``iPadOS``, depending on the device." msgstr "" #: ../Doc/using/ios.rst:59 msgid "" ":func:`os.uname` reports kernel-level details; it will report a name of " "``Darwin``." msgstr "" #: ../Doc/using/ios.rst:63 msgid "Standard library availability" msgstr "" #: ../Doc/using/ios.rst:65 msgid "" "The Python standard library has some notable omissions and restrictions on " "iOS. See the :ref:`API availability guide for iOS ` for " "details." msgstr "" #: ../Doc/using/ios.rst:70 msgid "Binary extension modules" msgstr "" #: ../Doc/using/ios.rst:72 msgid "" "One notable difference about iOS as a platform is that App Store " "distribution imposes hard requirements on the packaging of an application. " "One of these requirements governs how binary extension modules are " "distributed." msgstr "" #: ../Doc/using/ios.rst:76 msgid "" "The iOS App Store requires that *all* binary modules in an iOS app must be " "dynamic libraries, contained in a framework with appropriate metadata, " "stored in the ``Frameworks`` folder of the packaged app. There can be only a " "single binary per framework, and there can be no executable binary material " "outside the ``Frameworks`` folder." msgstr "" #: ../Doc/using/ios.rst:82 msgid "" "This conflicts with the usual Python approach for distributing binaries, " "which allows a binary extension module to be loaded from any location on " "``sys.path``. To ensure compliance with App Store policies, an iOS project " "must post-process any Python packages, converting ``.so`` binary modules " "into individual standalone frameworks with appropriate metadata and signing. " "For details on how to perform this post-processing, see the guide for :ref:" "`adding Python to your project `." msgstr "" #: ../Doc/using/ios.rst:90 msgid "" "To help Python discover binaries in their new location, the original ``.so`` " "file on ``sys.path`` is replaced with a ``.fwork`` file. This file is a text " "file containing the location of the framework binary, relative to the app " "bundle. To allow the framework to resolve back to the original location, the " "framework must contain a ``.origin`` file that contains the location of the " "``.fwork`` file, relative to the app bundle." msgstr "" #: ../Doc/using/ios.rst:97 msgid "" "For example, consider the case of an import ``from foo.bar import _whiz``, " "where ``_whiz`` is implemented with the binary module ``sources/foo/bar/" "_whiz.abi3.so``, with ``sources`` being the location registered on ``sys." "path``, relative to the application bundle. This module *must* be " "distributed as ``Frameworks/foo.bar._whiz.framework/foo.bar._whiz`` " "(creating the framework name from the full import path of the module), with " "an ``Info.plist`` file in the ``.framework`` directory identifying the " "binary as a framework. The ``foo.bar._whiz`` module would be represented in " "the original location with a ``sources/foo/bar/_whiz.abi3.fwork`` marker " "file, containing the path ``Frameworks/foo.bar._whiz/foo.bar._whiz``. The " "framework would also contain ``Frameworks/foo.bar._whiz.framework/foo.bar." "_whiz.origin``, containing the path to the ``.fwork`` file." msgstr "" #: ../Doc/using/ios.rst:110 msgid "" "When running on iOS, the Python interpreter will install an :class:" "`~importlib.machinery.AppleFrameworkLoader` that is able to read and import " "``.fwork`` files. Once imported, the ``__file__`` attribute of the binary " "module will report as the location of the ``.fwork`` file. However, the :" "class:`~importlib.machinery.ModuleSpec` for the loaded module will report " "the ``origin`` as the location of the binary in the framework folder." msgstr "" #: ../Doc/using/ios.rst:118 msgid "Compiler stub binaries" msgstr "" #: ../Doc/using/ios.rst:120 msgid "" "Xcode doesn't expose explicit compilers for iOS; instead, it uses an " "``xcrun`` script that resolves to a full compiler path (e.g., ``xcrun --sdk " "iphoneos clang`` to get the ``clang`` for an iPhone device). However, using " "this script poses two problems:" msgstr "" #: ../Doc/using/ios.rst:125 msgid "" "The output of ``xcrun`` includes paths that are machine specific, resulting " "in a sysconfig module that cannot be shared between users; and" msgstr "" #: ../Doc/using/ios.rst:128 msgid "" "It results in ``CC``/``CPP``/``LD``/``AR`` definitions that include spaces. " "There is a lot of C ecosystem tooling that assumes that you can split a " "command line at the first space to get the path to the compiler executable; " "this isn't the case when using ``xcrun``." msgstr "" #: ../Doc/using/ios.rst:133 msgid "" "To avoid these problems, Python provided stubs for these tools. These stubs " "are shell script wrappers around the underingly ``xcrun`` tools, distributed " "in a ``bin`` folder distributed alongside the compiled iOS framework. These " "scripts are relocatable, and will always resolve to the appropriate local " "system paths. By including these scripts in the bin folder that accompanies " "a framework, the contents of the ``sysconfig`` module becomes useful for end-" "users to compile their own modules. When compiling third-party Python " "modules for iOS, you should ensure these stub binaries are on your path." msgstr "" #: ../Doc/using/ios.rst:143 msgid "Installing Python on iOS" msgstr "" #: ../Doc/using/ios.rst:146 msgid "Tools for building iOS apps" msgstr "" #: ../Doc/using/ios.rst:148 msgid "" "Building for iOS requires the use of Apple's Xcode tooling. It is strongly " "recommended that you use the most recent stable release of Xcode. This will " "require the use of the most (or second-most) recently released macOS " "version, as Apple does not maintain Xcode for older macOS versions. The " "Xcode Command Line Tools are not sufficient for iOS development; you need a " "*full* Xcode install." msgstr "" #: ../Doc/using/ios.rst:155 msgid "" "If you want to run your code on the iOS simulator, you'll also need to " "install an iOS Simulator Platform. You should be prompted to select an iOS " "Simulator Platform when you first run Xcode. Alternatively, you can add an " "iOS Simulator Platform by selecting from the Platforms tab of the Xcode " "Settings panel." msgstr "" #: ../Doc/using/ios.rst:163 msgid "Adding Python to an iOS project" msgstr "" #: ../Doc/using/ios.rst:165 msgid "" "Python can be added to any iOS project, using either Swift or Objective C. " "The following examples will use Objective C; if you are using Swift, you may " "find a library like `PythonKit `__ to " "be helpful." msgstr "" #: ../Doc/using/ios.rst:170 msgid "To add Python to an iOS Xcode project:" msgstr "" #: ../Doc/using/ios.rst:172 msgid "" "Build or obtain a Python ``XCFramework``. See the instructions in :source:" "`iOS/README.rst` (in the CPython source distribution) for details on how to " "build a Python ``XCFramework``. At a minimum, you will need a build that " "supports ``arm64-apple-ios``, plus one of either ``arm64-apple-ios-" "simulator`` or ``x86_64-apple-ios-simulator``." msgstr "" #: ../Doc/using/ios.rst:178 msgid "" "Drag the ``XCframework`` into your iOS project. In the following " "instructions, we'll assume you've dropped the ``XCframework`` into the root " "of your project; however, you can use any other location that you want by " "adjusting paths as needed." msgstr "" #: ../Doc/using/ios.rst:183 msgid "" "Drag the ``iOS/Resources/dylib-Info-template.plist`` file into your project, " "and ensure it is associated with the app target." msgstr "" #: ../Doc/using/ios.rst:186 msgid "" "Add your application code as a folder in your Xcode project. In the " "following instructions, we'll assume that your user code is in a folder " "named ``app`` in the root of your project; you can use any other location by " "adjusting paths as needed. Ensure that this folder is associated with your " "app target." msgstr "" #: ../Doc/using/ios.rst:192 msgid "" "Select the app target by selecting the root node of your Xcode project, then " "the target name in the sidebar that appears." msgstr "" #: ../Doc/using/ios.rst:195 msgid "" "In the \"General\" settings, under \"Frameworks, Libraries and Embedded " "Content\", add ``Python.xcframework``, with \"Embed & Sign\" selected." msgstr "" #: ../Doc/using/ios.rst:198 msgid "In the \"Build Settings\" tab, modify the following:" msgstr "" #: ../Doc/using/ios.rst:200 msgid "Build Options" msgstr "" #: ../Doc/using/ios.rst:202 msgid "User Script Sandboxing: No" msgstr "" #: ../Doc/using/ios.rst:203 msgid "Enable Testability: Yes" msgstr "" #: ../Doc/using/ios.rst:205 msgid "Search Paths" msgstr "" #: ../Doc/using/ios.rst:207 msgid "Framework Search Paths: ``$(PROJECT_DIR)``" msgstr "" #: ../Doc/using/ios.rst:208 msgid "" "Header Search Paths: ``\"$(BUILT_PRODUCTS_DIR)/Python.framework/Headers\"``" msgstr "" #: ../Doc/using/ios.rst:210 msgid "Apple Clang - Warnings - All languages" msgstr "" #: ../Doc/using/ios.rst:212 msgid "Quoted Include In Framework Header: No" msgstr "" #: ../Doc/using/ios.rst:214 msgid "" "Add a build step that copies the Python standard library into your app. In " "the \"Build Phases\" tab, add a new \"Run Script\" build step *before* the " "\"Embed Frameworks\" step, but *after* the \"Copy Bundle Resources\" step. " "Name the step \"Install Target Specific Python Standard Library\", disable " "the \"Based on dependency analysis\" checkbox, and set the script content to:" msgstr "" #: ../Doc/using/ios.rst:220 msgid "" "set -e\n" "\n" "mkdir -p \"$CODESIGNING_FOLDER_PATH/python/lib\"\n" "if [ \"$EFFECTIVE_PLATFORM_NAME\" = \"-iphonesimulator\" ]; then\n" " echo \"Installing Python modules for iOS Simulator\"\n" " rsync -au --delete \"$PROJECT_DIR/Python.xcframework/ios-arm64_x86_64-" "simulator/lib/\" \"$CODESIGNING_FOLDER_PATH/python/lib/\"\n" "else\n" " echo \"Installing Python modules for iOS Device\"\n" " rsync -au --delete \"$PROJECT_DIR/Python.xcframework/ios-arm64/lib/\" " "\"$CODESIGNING_FOLDER_PATH/python/lib/\"\n" "fi" msgstr "" #: ../Doc/using/ios.rst:233 msgid "" "Note that the name of the simulator \"slice\" in the XCframework may be " "different, depending the CPU architectures your ``XCFramework`` supports." msgstr "" #: ../Doc/using/ios.rst:236 msgid "" "Add a second build step that processes the binary extension modules in the " "standard library into \"Framework\" format. Add a \"Run Script\" build step " "*directly after* the one you added in step 8, named \"Prepare Python Binary " "Modules\". It should also have \"Based on dependency analysis\" unchecked, " "with the following script content:" msgstr "" #: ../Doc/using/ios.rst:242 msgid "" "set -e\n" "\n" "install_dylib () {\n" " INSTALL_BASE=$1\n" " FULL_EXT=$2\n" "\n" " # The name of the extension file\n" " EXT=$(basename \"$FULL_EXT\")\n" " # The location of the extension file, relative to the bundle\n" " RELATIVE_EXT=${FULL_EXT#$CODESIGNING_FOLDER_PATH/}\n" " # The path to the extension file, relative to the install base\n" " PYTHON_EXT=${RELATIVE_EXT/$INSTALL_BASE/}\n" " # The full dotted name of the extension module, constructed from the " "file path.\n" " FULL_MODULE_NAME=$(echo $PYTHON_EXT | cut -d \".\" -f 1 | tr \"/\" \"." "\");\n" " # A bundle identifier; not actually used, but required by Xcode " "framework packaging\n" " FRAMEWORK_BUNDLE_ID=$(echo $PRODUCT_BUNDLE_IDENTIFIER.$FULL_MODULE_NAME " "| tr \"_\" \"-\")\n" " # The name of the framework folder.\n" " FRAMEWORK_FOLDER=\"Frameworks/$FULL_MODULE_NAME.framework\"\n" "\n" " # If the framework folder doesn't exist, create it.\n" " if [ ! -d \"$CODESIGNING_FOLDER_PATH/$FRAMEWORK_FOLDER\" ]; then\n" " echo \"Creating framework for $RELATIVE_EXT\"\n" " mkdir -p \"$CODESIGNING_FOLDER_PATH/$FRAMEWORK_FOLDER\"\n" " cp \"$CODESIGNING_FOLDER_PATH/dylib-Info-template.plist\" " "\"$CODESIGNING_FOLDER_PATH/$FRAMEWORK_FOLDER/Info.plist\"\n" " plutil -replace CFBundleExecutable -string \"$FULL_MODULE_NAME\" " "\"$CODESIGNING_FOLDER_PATH/$FRAMEWORK_FOLDER/Info.plist\"\n" " plutil -replace CFBundleIdentifier -string \"$FRAMEWORK_BUNDLE_ID\" " "\"$CODESIGNING_FOLDER_PATH/$FRAMEWORK_FOLDER/Info.plist\"\n" " fi\n" "\n" " echo \"Installing binary for $FRAMEWORK_FOLDER/$FULL_MODULE_NAME\"\n" " mv \"$FULL_EXT\" \"$CODESIGNING_FOLDER_PATH/$FRAMEWORK_FOLDER/" "$FULL_MODULE_NAME\"\n" " # Create a placeholder .fwork file where the .so was\n" " echo \"$FRAMEWORK_FOLDER/$FULL_MODULE_NAME\" > ${FULL_EXT%.so}.fwork\n" " # Create a back reference to the .so file location in the framework\n" " echo \"${RELATIVE_EXT%.so}.fwork\" > \"$CODESIGNING_FOLDER_PATH/" "$FRAMEWORK_FOLDER/$FULL_MODULE_NAME.origin\"\n" " }\n" "\n" " PYTHON_VER=$(ls -1 \"$CODESIGNING_FOLDER_PATH/python/lib\")\n" " echo \"Install Python $PYTHON_VER standard library extension modules...\"\n" " find \"$CODESIGNING_FOLDER_PATH/python/lib/$PYTHON_VER/lib-dynload\" -name " "\"*.so\" | while read FULL_EXT; do\n" " install_dylib python/lib/$PYTHON_VER/lib-dynload/ \"$FULL_EXT\"\n" " done\n" "\n" " # Clean up dylib template\n" " rm -f \"$CODESIGNING_FOLDER_PATH/dylib-Info-template.plist\"\n" "\n" " echo \"Signing frameworks as $EXPANDED_CODE_SIGN_IDENTITY_NAME " "($EXPANDED_CODE_SIGN_IDENTITY)...\"\n" " find \"$CODESIGNING_FOLDER_PATH/Frameworks\" -name \"*.framework\" -exec /" "usr/bin/codesign --force --sign \"$EXPANDED_CODE_SIGN_IDENTITY\" " "${OTHER_CODE_SIGN_FLAGS:-} -o runtime --timestamp=none --preserve-" "metadata=identifier,entitlements,flags --generate-entitlement-der \"{}\" \\;" msgstr "" #: ../Doc/using/ios.rst:292 msgid "" "Add Objective C code to initialize and use a Python interpreter in embedded " "mode. You should ensure that:" msgstr "" #: ../Doc/using/ios.rst:295 msgid ":c:member:`UTF-8 mode ` is *enabled*;" msgstr "" #: ../Doc/using/ios.rst:296 msgid ":c:member:`Buffered stdio ` is *disabled*;" msgstr "" #: ../Doc/using/ios.rst:297 msgid ":c:member:`Writing bytecode ` is *disabled*;" msgstr "" #: ../Doc/using/ios.rst:298 msgid "" ":c:member:`Signal handlers ` are *enabled*;" msgstr "" #: ../Doc/using/ios.rst:299 msgid "" "``PYTHONHOME`` for the interpreter is configured to point at the ``python`` " "subfolder of your app's bundle; and" msgstr "" #: ../Doc/using/ios.rst:301 msgid "The ``PYTHONPATH`` for the interpreter includes:" msgstr "" #: ../Doc/using/ios.rst:303 msgid "the ``python/lib/python3.X`` subfolder of your app's bundle," msgstr "" #: ../Doc/using/ios.rst:304 msgid "" "the ``python/lib/python3.X/lib-dynload`` subfolder of your app's bundle, and" msgstr "" #: ../Doc/using/ios.rst:305 msgid "the ``app`` subfolder of your app's bundle" msgstr "" #: ../Doc/using/ios.rst:307 msgid "" "Your app's bundle location can be determined using ``[[NSBundle mainBundle] " "resourcePath]``." msgstr "" #: ../Doc/using/ios.rst:310 msgid "" "Steps 8, 9 and 10 of these instructions assume that you have a single folder " "of pure Python application code, named ``app``. If you have third-party " "binary modules in your app, some additional steps will be required:" msgstr "" #: ../Doc/using/ios.rst:314 msgid "" "You need to ensure that any folders containing third-party binaries are " "either associated with the app target, or copied in as part of step 8. Step " "8 should also purge any binaries that are not appropriate for the platform a " "specific build is targeting (i.e., delete any device binaries if you're " "building an app targeting the simulator)." msgstr "" #: ../Doc/using/ios.rst:320 msgid "" "Any folders that contain third-party binaries must be processed into " "framework form by step 9. The invocation of ``install_dylib`` that processes " "the ``lib-dynload`` folder can be copied and adapted for this purpose." msgstr "" #: ../Doc/using/ios.rst:324 msgid "" "If you're using a separate folder for third-party packages, ensure that " "folder is included as part of the ``PYTHONPATH`` configuration in step 10." msgstr "" #: ../Doc/using/ios.rst:328 msgid "App Store Compliance" msgstr "" #: ../Doc/using/ios.rst:330 msgid "" "The only mechanism for distributing apps to third-party iOS devices is to " "submit the app to the iOS App Store; apps submitted for distribution must " "pass Apple's app review process. This process includes a set of automated " "validation rules that inspect the submitted application bundle for " "problematic code." msgstr "" #: ../Doc/using/ios.rst:335 msgid "" "The Python standard library contains some code that is known to violate " "these automated rules. While these violations appear to be false positives, " "Apple's review rules cannot be challenged; so, it is necessary to modify the " "Python standard library for an app to pass App Store review." msgstr "" #: ../Doc/using/ios.rst:340 msgid "" "The Python source tree contains :source:`a patch file ` that will remove all code that is known to cause " "issues with the App Store review process. This patch is applied " "automatically when building for iOS." msgstr ""