From d90a975fb4978ce2cb579e462441a333f4b94a3b Mon Sep 17 00:00:00 2001 From: meowmeowcat <68463158+meowmeowmeowcat@users.noreply.github.com> Date: Fri, 9 Jul 2021 15:21:43 +0800 Subject: [PATCH 1/8] Change to `text` from `bash` & update the version of pip --- locales/messages.pot | 140 ++++++++++-------- ...distributing-packages-using-setuptools.rst | 10 +- .../guides/dropping-older-python-versions.rst | 2 +- source/guides/hosting-your-own-index.rst | 2 +- ...ing-using-pip-and-virtual-environments.rst | 46 +++--- .../guides/making-a-pypi-friendly-readme.rst | 4 +- source/guides/using-testpypi.rst | 4 +- source/tutorials/creating-documentation.rst | 2 +- source/tutorials/installing-packages.rst | 44 +++--- source/tutorials/managing-dependencies.rst | 2 +- source/tutorials/packaging-projects.rst | 14 +- 11 files changed, 144 insertions(+), 126 deletions(-) diff --git a/locales/messages.pot b/locales/messages.pot index 5ea4b3276..3aa6bf543 100644 --- a/locales/messages.pot +++ b/locales/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python Packaging User Guide \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-07-06 19:32+0800\n" +"POT-Creation-Date: 2021-07-09 15:01+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2722,201 +2722,201 @@ msgstr "" msgid "Afterwards, you should have the newest pip installed in your user site:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:46 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:49 msgid "The Python installers for Windows include pip. You should be able to access pip using:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:54 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:60 msgid "You can make sure that pip is up-to-date by running:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:62 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:68 msgid "Installing virtualenv" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:64 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:70 msgid "If you are using Python 3.3 or newer, the :mod:`venv` module is the preferred way to create and manage virtual environments. venv is included in the Python standard library and requires no additional installation. If you are using venv, you may skip this section." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:70 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:76 msgid ":ref:`virtualenv` is used to manage Python packages for different projects. Using virtualenv allows you to avoid installing Python packages globally which could break system tools or other projects. You can install virtualenv using pip." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:91 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:97 msgid "Creating a virtual environment" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:93 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:99 msgid ":ref:`venv` (for Python 3) and :ref:`virtualenv` (for Python 2) allow you to manage separate package installations for different projects. They essentially allow you to create a \"virtual\" isolated Python installation and install packages into that virtual installation. When you switch projects, you can simply create a new virtual environment and not have to worry about breaking the packages installed in the other environments. It is always recommended to use a virtual environment while developing Python applications." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:102 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:108 msgid "To create a virtual environment, go to your project's directory and run venv. If you are using Python 2, replace ``venv`` with ``virtualenv`` in the below commands." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:118 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:124 msgid "The second argument is the location to create the virtual environment. Generally, you can just create this in your project and call it ``env``." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:121 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:127 msgid "venv will create a virtual Python installation in the ``env`` folder." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:123 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:129 msgid "You should exclude your virtual environment directory from your version control system using ``.gitignore`` or similar." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:128 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:134 msgid "Activating a virtual environment" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:130 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:136 msgid "Before you can start installing or using packages in your virtual environment you'll need to *activate* it. Activating a virtual environment will put the virtual environment-specific ``python`` and ``pip`` executables into your shell's ``PATH``." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:147 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:153 msgid "You can confirm you're in the virtual environment by checking the location of your Python interpreter, it should point to the ``env`` directory." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:164 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:170 msgid "As long as your virtual environment is activated pip will install packages into that specific environment and you'll be able to import and use packages in your Python application." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:170 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:176 msgid "Leaving the virtual environment" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:172 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:178 msgid "If you want to switch projects or otherwise leave your virtual environment, simply run:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:178 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:184 msgid "If you want to re-enter the virtual environment just follow the same instructions above about activating a virtual environment. There's no need to re-create the virtual environment." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:183 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:189 msgid "Installing packages" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:185 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:191 msgid "Now that you're in your virtual environment you can install packages. Let's install the `Requests`_ library from the :term:`Python Package Index (PyPI)`:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:200 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:206 msgid "pip should download requests and all of its dependencies and install them:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:221 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:227 msgid "Installing specific versions" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:223 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:229 msgid "pip allows you to specify which version of a package to install using :term:`version specifiers `. For example, to install a specific version of ``requests``:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:239 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:245 msgid "To install the latest ``2.x`` release of requests:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:253 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:259 msgid "To install pre-release versions of packages, use the ``--pre`` flag:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:269 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:275 msgid "Installing extras" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:271 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:277 msgid "Some packages have optional `extras`_. You can tell pip to install these by specifying the extra in brackets:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:291 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:297 msgid "Installing from source" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:293 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:299 msgid "pip can install a package directly from source, for example:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:309 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:315 msgid "Additionally, pip can install packages from source in `development mode`_, meaning that changes to the source directory will immediately affect the installed package without needing to re-install:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:330 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:336 msgid "Installing from version control systems" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:332 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:338 msgid "pip can install packages directly from their version control system. For example, you can install directly from a git repository:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:339 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:345 msgid "For more information on supported version control systems and syntax, see pip's documentation on :ref:`VCS Support `." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:344 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:350 #: ../source/tutorials/installing-packages.rst:569 msgid "Installing from local archives" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:346 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:352 msgid "If you have a local copy of a :term:`Distribution Package`'s archive (a zip, wheel, or tar file) you can install it directly with pip:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:361 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:367 msgid "If you have a directory containing archives of multiple packages, you can tell pip to look for packages there and not to use the :term:`Python Package Index (PyPI)` at all:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:377 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:383 msgid "This is useful if you are installing packages on a system with limited connectivity or if you want to strictly control the origin of distribution packages." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:383 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:389 msgid "Using other package indexes" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:385 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:391 msgid "If you want to download packages from a different index than the :term:`Python Package Index (PyPI)`, you can use the ``--index-url`` flag:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:400 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:406 msgid "If you want to allow packages from both the :term:`Python Package Index (PyPI)` and a separate index, you can use the ``--extra-index-url`` flag instead:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:417 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:423 #: ../source/tutorials/installing-packages.rst:389 msgid "Upgrading packages" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:419 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:425 msgid "pip can upgrade packages in-place using the ``--upgrade`` flag. For example, to install the latest version of ``requests`` and all of its dependencies:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:435 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:441 msgid "Using requirements files" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:437 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:443 msgid "Instead of installing packages individually, pip allows you to declare all dependencies in a :ref:`Requirements File `. For example you could create a :file:`requirements.txt` file containing:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:446 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:452 msgid "And tell pip to install all of the packages in this file using the ``-r`` flag:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:461 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:467 msgid "Freezing dependencies" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:463 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:469 msgid "Pip can export a list of all installed packages and their versions using the ``freeze`` command:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:478 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:484 msgid "Which will output a list of package specifiers such as:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:494 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:500 msgid "This is useful for creating :ref:`pip:Requirements Files` that can re-create the exact versions of all packages installed in an environment." msgstr "" @@ -4166,54 +4166,58 @@ msgid "Packaging tool recommendations" msgstr "" #: ../source/guides/tool-recommendations.rst:49 -msgid "Use :ref:`setuptools` to define projects and create :term:`Source Distributions `. [5]_ [6]_" +msgid "Use :ref:`setuptools` to define projects. [5]_ [6]_" +msgstr "" + +#: ../source/guides/tool-recommendations.rst:51 +msgid "Use :ref:`build` to create :term:`Source Distributions ` and :term:`wheels `." msgstr "" -#: ../source/guides/tool-recommendations.rst:52 -msgid "Use the ``bdist_wheel`` :ref:`setuptools` extension available from the :ref:`wheel project ` to create :term:`wheels `. This is especially beneficial, if your project contains binary extensions." +#: ../source/guides/tool-recommendations.rst:54 +msgid "If you have binary extensions and want to distribute wheels for multiple platforms, use :ref:`cibuildwheel` as part of your CI setup to build distributable wheels." msgstr "" -#: ../source/guides/tool-recommendations.rst:56 +#: ../source/guides/tool-recommendations.rst:58 msgid "Use `twine `_ for uploading distributions to :term:`PyPI `." msgstr "" -#: ../source/guides/tool-recommendations.rst:61 +#: ../source/guides/tool-recommendations.rst:63 msgid "Publishing platform migration" msgstr "" -#: ../source/guides/tool-recommendations.rst:63 +#: ../source/guides/tool-recommendations.rst:65 msgid "The original Python Package Index implementation (previously hosted at `pypi.python.org `_) has been phased out in favour of an updated implementation hosted at `pypi.org `_." msgstr "" -#: ../source/guides/tool-recommendations.rst:67 +#: ../source/guides/tool-recommendations.rst:69 msgid "See :ref:`Migrating to PyPI.org` for more information on the status of the migration, and what settings to change in your clients." msgstr "" -#: ../source/guides/tool-recommendations.rst:72 +#: ../source/guides/tool-recommendations.rst:74 msgid "There are some cases where you might choose to use ``easy_install`` (from :ref:`setuptools`), e.g. if you need to install from :term:`Eggs ` (which pip doesn't support). For a detailed breakdown, see :ref:`pip vs easy_install`." msgstr "" -#: ../source/guides/tool-recommendations.rst:77 +#: ../source/guides/tool-recommendations.rst:79 msgid "The acceptance of :pep:`453` means that :ref:`pip` will be available by default in most installations of Python 3.4 or later. See the :pep:`rationale section <453#rationale>` from :pep:`453` as for why pip was chosen." msgstr "" -#: ../source/guides/tool-recommendations.rst:82 +#: ../source/guides/tool-recommendations.rst:84 msgid "`get-pip.py `_ and :ref:`virtualenv` install :ref:`wheel`, whereas :ref:`ensurepip` and :ref:`venv ` do not currently. Also, the common \"python-pip\" package that's found in various linux distros, does not depend on \"python-wheel\" currently." msgstr "" -#: ../source/guides/tool-recommendations.rst:88 +#: ../source/guides/tool-recommendations.rst:90 msgid "Beginning with Python 3.4, ``venv`` will create virtualenv environments with ``pip`` installed, thereby making it an equal alternative to :ref:`virtualenv`. However, using :ref:`virtualenv` will still be recommended for users that need cross-version consistency." msgstr "" -#: ../source/guides/tool-recommendations.rst:93 +#: ../source/guides/tool-recommendations.rst:95 msgid "Although you can use pure ``distutils`` for many projects, it does not support defining dependencies on other projects and is missing several convenience utilities for automatically populating distribution metadata correctly that are provided by ``setuptools``. Being outside the standard library, ``setuptools`` also offers a more consistent feature set across different versions of Python, and (unlike ``distutils``), recent versions of ``setuptools`` support all of the modern metadata fields described in :ref:`core-metadata`." msgstr "" -#: ../source/guides/tool-recommendations.rst:102 +#: ../source/guides/tool-recommendations.rst:104 msgid "Even for projects that do choose to use ``distutils``, when :ref:`pip` installs such projects directly from source (rather than installing from a prebuilt :term:`wheel ` file), it will actually build your project using :ref:`setuptools` instead." msgstr "" -#: ../source/guides/tool-recommendations.rst:107 +#: ../source/guides/tool-recommendations.rst:109 msgid "`distribute`_ (a fork of setuptools) was merged back into :ref:`setuptools` in June 2013, thereby making setuptools the default choice for packaging." msgstr "" @@ -5732,6 +5736,10 @@ msgstr "" msgid "Python and PyPI make it easy to upload both wheels and sdists together. Just follow the :doc:`tutorials/packaging-projects` tutorial." msgstr "" +#: ../source/overview.rst:148 +msgid "A summary of Python's packaging capabilities for tools and libraries." +msgstr "" + #: ../source/overview.rst:148 msgid "Python's recommended built-in library and tool packaging technologies. Excerpted from `The Packaging Gradient (2017) `_." msgstr "" @@ -6044,6 +6052,10 @@ msgstr "" msgid "Embed your code on an `Adafruit `_, `MicroPython `_, or more-powerful hardware running Python, then ship it to the datacenter or your users' homes. They plug and play, and you can call it a day." msgstr "" +#: ../source/overview.rst:389 +msgid "A summary of technologies used to package Python applications." +msgstr "" + #: ../source/overview.rst:389 msgid "The simplified gamut of technologies used to package Python applications." msgstr "" diff --git a/source/guides/distributing-packages-using-setuptools.rst b/source/guides/distributing-packages-using-setuptools.rst index 3a0ba8018..7f55c3e1a 100644 --- a/source/guides/distributing-packages-using-setuptools.rst +++ b/source/guides/distributing-packages-using-setuptools.rst @@ -36,7 +36,7 @@ Requirements for packaging and distributing .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install twine @@ -728,7 +728,7 @@ Before you can build wheels and sdists for your project, you'll need to install .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install build @@ -747,7 +747,7 @@ Minimally, you should create a :term:`Source Distribution =2.0.0,<3.0.0 @@ -260,7 +266,7 @@ To install pre-release versions of packages, use the ``--pre`` flag: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --pre requests @@ -279,7 +285,7 @@ specifying the extra in brackets: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install requests[security] @@ -301,7 +307,7 @@ pip can install a package directly from source, for example: .. tab:: Windows - .. code-block:: bash + .. code-block:: text cd google-auth py -m pip install . @@ -318,7 +324,7 @@ installed package without needing to re-install: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --editable . @@ -354,7 +360,7 @@ wheel, or tar file) you can install it directly with pip: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install requests-2.18.4.tar.gz @@ -370,7 +376,7 @@ pip to look for packages there and not to use the .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --no-index --find-links=/local/dir/ requests @@ -393,7 +399,7 @@ If you want to download packages from a different index than the .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --index-url http://index.example.com/simple/ SomeProject @@ -409,7 +415,7 @@ and a separate index, you can use the ``--extra-index-url`` flag instead: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --extra-index-url http://index.example.com/simple/ SomeProject @@ -427,7 +433,7 @@ install the latest version of ``requests`` and all of its dependencies: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --upgrade requests @@ -453,7 +459,7 @@ And tell pip to install all of the packages in this file using the ``-r`` flag: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install -r requirements.txt @@ -471,7 +477,7 @@ Pip can export a list of all installed packages and their versions using the .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip freeze diff --git a/source/guides/making-a-pypi-friendly-readme.rst b/source/guides/making-a-pypi-friendly-readme.rst index 04fdce648..977942f89 100644 --- a/source/guides/making-a-pypi-friendly-readme.rst +++ b/source/guides/making-a-pypi-friendly-readme.rst @@ -53,7 +53,7 @@ such as ``text/plain``, ``text/x-rst`` (for reStructuredText), or ``text/markdow .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --user --upgrade setuptools wheel twine @@ -115,7 +115,7 @@ You can check your README for markup errors before uploading as follows: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --upgrade twine diff --git a/source/guides/using-testpypi.rst b/source/guides/using-testpypi.rst index 7f03d38fb..4ff3601bc 100644 --- a/source/guides/using-testpypi.rst +++ b/source/guides/using-testpypi.rst @@ -49,7 +49,7 @@ specifying the ``--index-url`` flag .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --index-url https://test.pypi.org/simple/ your-package @@ -65,7 +65,7 @@ you're testing has dependencies: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple your-package diff --git a/source/tutorials/creating-documentation.rst b/source/tutorials/creating-documentation.rst index 685e703d4..7673ae841 100644 --- a/source/tutorials/creating-documentation.rst +++ b/source/tutorials/creating-documentation.rst @@ -21,7 +21,7 @@ Use ``pip`` to install Sphinx: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install -U sphinx diff --git a/source/tutorials/installing-packages.rst b/source/tutorials/installing-packages.rst index 63420c70e..042c43277 100644 --- a/source/tutorials/installing-packages.rst +++ b/source/tutorials/installing-packages.rst @@ -45,7 +45,7 @@ version is available from your command line. You can check this by running: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py --version @@ -109,7 +109,7 @@ check this by running: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip --version @@ -132,7 +132,7 @@ standard library: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m ensurepip --default-pip @@ -180,7 +180,7 @@ but here's the basic `venv`_ [3]_ command to use on a typical Linux system: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m venv tutorial_env tutorial_env\Scripts\activate @@ -240,7 +240,7 @@ Using `venv`_: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m venv \Scripts\activate @@ -256,7 +256,7 @@ Using :ref:`virtualenv`: .. tab:: Windows - .. code-block:: bash + .. code-block:: text virtualenv \Scripts\activate @@ -314,7 +314,7 @@ To install the latest version of "SomeProject": .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install "SomeProject" @@ -328,7 +328,7 @@ To install a specific version: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install "SomeProject==1.4" @@ -342,7 +342,7 @@ To install greater than or equal to one version and less than another: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install "SomeProject>=1,<2" @@ -358,7 +358,7 @@ with a certain version: [4]_ .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install "SomeProject~=1.4.2" @@ -398,7 +398,7 @@ Upgrade an already installed ``SomeProject`` to the latest from PyPI. .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --upgrade SomeProject @@ -418,7 +418,7 @@ current user, use the ``--user`` flag: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --user SomeProject @@ -470,7 +470,7 @@ Install a list of requirements specified in a :ref:`Requirements File .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install -r requirements.txt @@ -491,7 +491,7 @@ syntax, see pip's section on :ref:`VCS Support `. .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install -e git+https://git.repo/some_pkg.git#egg=SomeProject # from git py -m pip install -e hg+https://hg.repo/some_pkg#egg=SomeProject # from mercurial @@ -511,7 +511,7 @@ Install from an alternate index .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --index-url http://my.package.repo/simple/ SomeProject @@ -526,7 +526,7 @@ Package Index (PyPI)>` .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --extra-index-url http://my.package.repo/simple SomeProject @@ -547,7 +547,7 @@ still editable from the src tree. .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install -e @@ -561,7 +561,7 @@ You can also install normally from src .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install @@ -578,7 +578,7 @@ Install a particular source archive file. .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install ./downloads/SomeProject-1.0.4.tar.gz @@ -595,7 +595,7 @@ Install from a local directory containing archives (and don't check :term:`PyPI .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --no-index --find-links=file:///local/dir/ SomeProject py -m pip install --no-index --find-links=/local/dir/ SomeProject @@ -629,7 +629,7 @@ default, pip only finds stable versions. .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --pre SomeProject @@ -648,7 +648,7 @@ Install `setuptools extras`_. .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install SomePackage[PDF] py -m pip install SomePackage[PDF]==3.0 diff --git a/source/tutorials/managing-dependencies.rst b/source/tutorials/managing-dependencies.rst index 96430d8a6..89c042a5e 100644 --- a/source/tutorials/managing-dependencies.rst +++ b/source/tutorials/managing-dependencies.rst @@ -45,7 +45,7 @@ Use ``pip`` to install Pipenv: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --user pipenv diff --git a/source/tutorials/packaging-projects.rst b/source/tutorials/packaging-projects.rst index db65eb097..7d48f8541 100644 --- a/source/tutorials/packaging-projects.rst +++ b/source/tutorials/packaging-projects.rst @@ -26,7 +26,7 @@ sure you have the latest version installed: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --upgrade pip @@ -415,7 +415,7 @@ Make sure you have the latest version of PyPA's :ref:`build` installed: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --upgrade build @@ -432,7 +432,7 @@ Now run this command from the same directory where :file:`pyproject.toml` is loc .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m build @@ -485,7 +485,7 @@ distribution packages. You'll need to install Twine: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --upgrade twine @@ -499,7 +499,7 @@ Once installed, run Twine to upload all of the archives under :file:`dist`: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m twine upload --repository testpypi dist/* @@ -539,7 +539,7 @@ and install your package from TestPyPI: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py -m pip install --index-url https://test.pypi.org/simple/ --no-deps example-pkg-YOUR-USERNAME-HERE @@ -573,7 +573,7 @@ Make sure you're still in your virtual environment, then run Python: .. tab:: Windows - .. code-block:: bash + .. code-block:: text py From ede3fed7c2f78cc756ff5b5818a62f8f7a1336c2 Mon Sep 17 00:00:00 2001 From: meowmeowcat <68463158+meowmeowmeowcat@users.noreply.github.com> Date: Fri, 9 Jul 2021 15:41:10 +0800 Subject: [PATCH 2/8] Remove `messages.pot` from this PR --- locales/messages.pot | 140 ++++++++++++++++++++----------------------- 1 file changed, 64 insertions(+), 76 deletions(-) diff --git a/locales/messages.pot b/locales/messages.pot index 3aa6bf543..5ea4b3276 100644 --- a/locales/messages.pot +++ b/locales/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python Packaging User Guide \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-07-09 15:01+0800\n" +"POT-Creation-Date: 2021-07-06 19:32+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2722,201 +2722,201 @@ msgstr "" msgid "Afterwards, you should have the newest pip installed in your user site:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:49 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:46 msgid "The Python installers for Windows include pip. You should be able to access pip using:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:60 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:54 msgid "You can make sure that pip is up-to-date by running:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:68 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:62 msgid "Installing virtualenv" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:70 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:64 msgid "If you are using Python 3.3 or newer, the :mod:`venv` module is the preferred way to create and manage virtual environments. venv is included in the Python standard library and requires no additional installation. If you are using venv, you may skip this section." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:76 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:70 msgid ":ref:`virtualenv` is used to manage Python packages for different projects. Using virtualenv allows you to avoid installing Python packages globally which could break system tools or other projects. You can install virtualenv using pip." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:97 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:91 msgid "Creating a virtual environment" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:99 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:93 msgid ":ref:`venv` (for Python 3) and :ref:`virtualenv` (for Python 2) allow you to manage separate package installations for different projects. They essentially allow you to create a \"virtual\" isolated Python installation and install packages into that virtual installation. When you switch projects, you can simply create a new virtual environment and not have to worry about breaking the packages installed in the other environments. It is always recommended to use a virtual environment while developing Python applications." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:108 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:102 msgid "To create a virtual environment, go to your project's directory and run venv. If you are using Python 2, replace ``venv`` with ``virtualenv`` in the below commands." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:124 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:118 msgid "The second argument is the location to create the virtual environment. Generally, you can just create this in your project and call it ``env``." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:127 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:121 msgid "venv will create a virtual Python installation in the ``env`` folder." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:129 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:123 msgid "You should exclude your virtual environment directory from your version control system using ``.gitignore`` or similar." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:134 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:128 msgid "Activating a virtual environment" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:136 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:130 msgid "Before you can start installing or using packages in your virtual environment you'll need to *activate* it. Activating a virtual environment will put the virtual environment-specific ``python`` and ``pip`` executables into your shell's ``PATH``." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:153 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:147 msgid "You can confirm you're in the virtual environment by checking the location of your Python interpreter, it should point to the ``env`` directory." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:170 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:164 msgid "As long as your virtual environment is activated pip will install packages into that specific environment and you'll be able to import and use packages in your Python application." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:176 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:170 msgid "Leaving the virtual environment" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:178 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:172 msgid "If you want to switch projects or otherwise leave your virtual environment, simply run:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:184 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:178 msgid "If you want to re-enter the virtual environment just follow the same instructions above about activating a virtual environment. There's no need to re-create the virtual environment." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:189 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:183 msgid "Installing packages" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:191 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:185 msgid "Now that you're in your virtual environment you can install packages. Let's install the `Requests`_ library from the :term:`Python Package Index (PyPI)`:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:206 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:200 msgid "pip should download requests and all of its dependencies and install them:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:227 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:221 msgid "Installing specific versions" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:229 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:223 msgid "pip allows you to specify which version of a package to install using :term:`version specifiers `. For example, to install a specific version of ``requests``:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:245 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:239 msgid "To install the latest ``2.x`` release of requests:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:259 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:253 msgid "To install pre-release versions of packages, use the ``--pre`` flag:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:275 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:269 msgid "Installing extras" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:277 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:271 msgid "Some packages have optional `extras`_. You can tell pip to install these by specifying the extra in brackets:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:297 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:291 msgid "Installing from source" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:299 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:293 msgid "pip can install a package directly from source, for example:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:315 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:309 msgid "Additionally, pip can install packages from source in `development mode`_, meaning that changes to the source directory will immediately affect the installed package without needing to re-install:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:336 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:330 msgid "Installing from version control systems" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:338 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:332 msgid "pip can install packages directly from their version control system. For example, you can install directly from a git repository:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:345 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:339 msgid "For more information on supported version control systems and syntax, see pip's documentation on :ref:`VCS Support `." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:350 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:344 #: ../source/tutorials/installing-packages.rst:569 msgid "Installing from local archives" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:352 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:346 msgid "If you have a local copy of a :term:`Distribution Package`'s archive (a zip, wheel, or tar file) you can install it directly with pip:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:367 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:361 msgid "If you have a directory containing archives of multiple packages, you can tell pip to look for packages there and not to use the :term:`Python Package Index (PyPI)` at all:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:383 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:377 msgid "This is useful if you are installing packages on a system with limited connectivity or if you want to strictly control the origin of distribution packages." msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:389 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:383 msgid "Using other package indexes" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:391 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:385 msgid "If you want to download packages from a different index than the :term:`Python Package Index (PyPI)`, you can use the ``--index-url`` flag:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:406 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:400 msgid "If you want to allow packages from both the :term:`Python Package Index (PyPI)` and a separate index, you can use the ``--extra-index-url`` flag instead:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:423 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:417 #: ../source/tutorials/installing-packages.rst:389 msgid "Upgrading packages" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:425 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:419 msgid "pip can upgrade packages in-place using the ``--upgrade`` flag. For example, to install the latest version of ``requests`` and all of its dependencies:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:441 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:435 msgid "Using requirements files" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:443 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:437 msgid "Instead of installing packages individually, pip allows you to declare all dependencies in a :ref:`Requirements File `. For example you could create a :file:`requirements.txt` file containing:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:452 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:446 msgid "And tell pip to install all of the packages in this file using the ``-r`` flag:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:467 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:461 msgid "Freezing dependencies" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:469 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:463 msgid "Pip can export a list of all installed packages and their versions using the ``freeze`` command:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:484 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:478 msgid "Which will output a list of package specifiers such as:" msgstr "" -#: ../source/guides/installing-using-pip-and-virtual-environments.rst:500 +#: ../source/guides/installing-using-pip-and-virtual-environments.rst:494 msgid "This is useful for creating :ref:`pip:Requirements Files` that can re-create the exact versions of all packages installed in an environment." msgstr "" @@ -4166,58 +4166,54 @@ msgid "Packaging tool recommendations" msgstr "" #: ../source/guides/tool-recommendations.rst:49 -msgid "Use :ref:`setuptools` to define projects. [5]_ [6]_" -msgstr "" - -#: ../source/guides/tool-recommendations.rst:51 -msgid "Use :ref:`build` to create :term:`Source Distributions ` and :term:`wheels `." +msgid "Use :ref:`setuptools` to define projects and create :term:`Source Distributions `. [5]_ [6]_" msgstr "" -#: ../source/guides/tool-recommendations.rst:54 -msgid "If you have binary extensions and want to distribute wheels for multiple platforms, use :ref:`cibuildwheel` as part of your CI setup to build distributable wheels." +#: ../source/guides/tool-recommendations.rst:52 +msgid "Use the ``bdist_wheel`` :ref:`setuptools` extension available from the :ref:`wheel project ` to create :term:`wheels `. This is especially beneficial, if your project contains binary extensions." msgstr "" -#: ../source/guides/tool-recommendations.rst:58 +#: ../source/guides/tool-recommendations.rst:56 msgid "Use `twine `_ for uploading distributions to :term:`PyPI `." msgstr "" -#: ../source/guides/tool-recommendations.rst:63 +#: ../source/guides/tool-recommendations.rst:61 msgid "Publishing platform migration" msgstr "" -#: ../source/guides/tool-recommendations.rst:65 +#: ../source/guides/tool-recommendations.rst:63 msgid "The original Python Package Index implementation (previously hosted at `pypi.python.org `_) has been phased out in favour of an updated implementation hosted at `pypi.org `_." msgstr "" -#: ../source/guides/tool-recommendations.rst:69 +#: ../source/guides/tool-recommendations.rst:67 msgid "See :ref:`Migrating to PyPI.org` for more information on the status of the migration, and what settings to change in your clients." msgstr "" -#: ../source/guides/tool-recommendations.rst:74 +#: ../source/guides/tool-recommendations.rst:72 msgid "There are some cases where you might choose to use ``easy_install`` (from :ref:`setuptools`), e.g. if you need to install from :term:`Eggs ` (which pip doesn't support). For a detailed breakdown, see :ref:`pip vs easy_install`." msgstr "" -#: ../source/guides/tool-recommendations.rst:79 +#: ../source/guides/tool-recommendations.rst:77 msgid "The acceptance of :pep:`453` means that :ref:`pip` will be available by default in most installations of Python 3.4 or later. See the :pep:`rationale section <453#rationale>` from :pep:`453` as for why pip was chosen." msgstr "" -#: ../source/guides/tool-recommendations.rst:84 +#: ../source/guides/tool-recommendations.rst:82 msgid "`get-pip.py `_ and :ref:`virtualenv` install :ref:`wheel`, whereas :ref:`ensurepip` and :ref:`venv ` do not currently. Also, the common \"python-pip\" package that's found in various linux distros, does not depend on \"python-wheel\" currently." msgstr "" -#: ../source/guides/tool-recommendations.rst:90 +#: ../source/guides/tool-recommendations.rst:88 msgid "Beginning with Python 3.4, ``venv`` will create virtualenv environments with ``pip`` installed, thereby making it an equal alternative to :ref:`virtualenv`. However, using :ref:`virtualenv` will still be recommended for users that need cross-version consistency." msgstr "" -#: ../source/guides/tool-recommendations.rst:95 +#: ../source/guides/tool-recommendations.rst:93 msgid "Although you can use pure ``distutils`` for many projects, it does not support defining dependencies on other projects and is missing several convenience utilities for automatically populating distribution metadata correctly that are provided by ``setuptools``. Being outside the standard library, ``setuptools`` also offers a more consistent feature set across different versions of Python, and (unlike ``distutils``), recent versions of ``setuptools`` support all of the modern metadata fields described in :ref:`core-metadata`." msgstr "" -#: ../source/guides/tool-recommendations.rst:104 +#: ../source/guides/tool-recommendations.rst:102 msgid "Even for projects that do choose to use ``distutils``, when :ref:`pip` installs such projects directly from source (rather than installing from a prebuilt :term:`wheel ` file), it will actually build your project using :ref:`setuptools` instead." msgstr "" -#: ../source/guides/tool-recommendations.rst:109 +#: ../source/guides/tool-recommendations.rst:107 msgid "`distribute`_ (a fork of setuptools) was merged back into :ref:`setuptools` in June 2013, thereby making setuptools the default choice for packaging." msgstr "" @@ -5736,10 +5732,6 @@ msgstr "" msgid "Python and PyPI make it easy to upload both wheels and sdists together. Just follow the :doc:`tutorials/packaging-projects` tutorial." msgstr "" -#: ../source/overview.rst:148 -msgid "A summary of Python's packaging capabilities for tools and libraries." -msgstr "" - #: ../source/overview.rst:148 msgid "Python's recommended built-in library and tool packaging technologies. Excerpted from `The Packaging Gradient (2017) `_." msgstr "" @@ -6052,10 +6044,6 @@ msgstr "" msgid "Embed your code on an `Adafruit `_, `MicroPython `_, or more-powerful hardware running Python, then ship it to the datacenter or your users' homes. They plug and play, and you can call it a day." msgstr "" -#: ../source/overview.rst:389 -msgid "A summary of technologies used to package Python applications." -msgstr "" - #: ../source/overview.rst:389 msgid "The simplified gamut of technologies used to package Python applications." msgstr "" From d1ee5f6ed7c5b4ad729da196f8bef1327672f364 Mon Sep 17 00:00:00 2001 From: meowmeowcat <68463158+meowmeowmeowcat@users.noreply.github.com> Date: Sat, 10 Jul 2021 10:40:56 +0800 Subject: [PATCH 3/8] Update source/guides/installing-using-pip-and-virtual-environments.rst Co-authored-by: Brian Rutledge --- source/guides/installing-using-pip-and-virtual-environments.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/guides/installing-using-pip-and-virtual-environments.rst b/source/guides/installing-using-pip-and-virtual-environments.rst index b8de5f703..9d8ca2b28 100644 --- a/source/guides/installing-using-pip-and-virtual-environments.rst +++ b/source/guides/installing-using-pip-and-virtual-environments.rst @@ -38,7 +38,7 @@ installed. python3 -m pip --version - .. code-block:: bash + .. code-block:: text pip 21.1.3 from $HOME/.local/lib/python3.9/site-packages (python 3.9) From d1795e5d483ada07bce3c4cc1e162f413cbacfab Mon Sep 17 00:00:00 2001 From: meowmeowcat <68463158+meowmeowmeowcat@users.noreply.github.com> Date: Sat, 10 Jul 2021 10:53:49 +0800 Subject: [PATCH 4/8] separate the command from its output --- .../installing-using-pip-and-virtual-environments.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/guides/installing-using-pip-and-virtual-environments.rst b/source/guides/installing-using-pip-and-virtual-environments.rst index 9d8ca2b28..ff9dcbcd6 100644 --- a/source/guides/installing-using-pip-and-virtual-environments.rst +++ b/source/guides/installing-using-pip-and-virtual-environments.rst @@ -158,6 +158,9 @@ Python interpreter, it should point to the ``env`` directory. .. code-block:: bash which python + + .. code-block:: text + .../env/bin/python .. tab:: Windows @@ -165,6 +168,9 @@ Python interpreter, it should point to the ``env`` directory. .. code-block:: text where python + + .. code-block:: text + ...\env\Scripts\python.exe As long as your virtual environment is activated pip will install packages into that From 1394c76749587f45495b96d1961722f0c1ad2614 Mon Sep 17 00:00:00 2001 From: Brian Rutledge Date: Sat, 10 Jul 2021 09:37:54 -0400 Subject: [PATCH 5/8] Split which/where output --- ...lling-using-pip-and-virtual-environments.rst | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/source/guides/installing-using-pip-and-virtual-environments.rst b/source/guides/installing-using-pip-and-virtual-environments.rst index ff9dcbcd6..ddf449958 100644 --- a/source/guides/installing-using-pip-and-virtual-environments.rst +++ b/source/guides/installing-using-pip-and-virtual-environments.rst @@ -151,17 +151,13 @@ virtual environment-specific .\env\Scripts\activate You can confirm you're in the virtual environment by checking the location of your -Python interpreter, it should point to the ``env`` directory. +Python interpreter: .. tab:: Unix/macOS .. code-block:: bash which python - - .. code-block:: text - - .../env/bin/python .. tab:: Windows @@ -169,10 +165,21 @@ Python interpreter, it should point to the ``env`` directory. where python +It should be in the ``env`` directory: + +.. tab:: Unix/macOS + + .. code-block:: text + + .../env/bin/python + +.. tab:: Windows + .. code-block:: text ...\env\Scripts\python.exe + As long as your virtual environment is activated pip will install packages into that specific environment and you'll be able to import and use packages in your Python application. From 4e4adfd3c8035e66c4ba43f0653e4c3f5291bea0 Mon Sep 17 00:00:00 2001 From: Brian Rutledge Date: Sat, 10 Jul 2021 09:43:34 -0400 Subject: [PATCH 6/8] Rework installing pip section --- ...ing-using-pip-and-virtual-environments.rst | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/source/guides/installing-using-pip-and-virtual-environments.rst b/source/guides/installing-using-pip-and-virtual-environments.rst index ddf449958..cc334dbd8 100644 --- a/source/guides/installing-using-pip-and-virtual-environments.rst +++ b/source/guides/installing-using-pip-and-virtual-environments.rst @@ -21,8 +21,8 @@ installed. .. tab:: Unix/macOS - Debian and most other distributions include a `python-pip`_ package, if you - want to use the Linux distribution-provided versions of pip see + Debian and most other distributions include a `python-pip`_ package; if you + want to use the Linux distribution-provided versions of pip, see :doc:`/guides/installing-using-linux-tools`. You can also install pip yourself to ensure you have the latest version. It's @@ -32,12 +32,11 @@ installed. python3 -m pip install --user --upgrade pip - Afterwards, you should have the newest pip installed in your user site: - - .. code-block:: bash - python3 -m pip --version + Afterwards, you should have the latest version of pip installed in your + user site: + .. code-block:: text pip 21.1.3 from $HOME/.local/lib/python3.9/site-packages (python 3.9) @@ -46,22 +45,21 @@ installed. .. tab:: Windows - The Python installers for Windows include pip. You should be able to access - pip using: + The Python installers for Windows include pip. You can make sure that pip is + up-to-date by running: .. code-block:: text + py -m pip install --upgrade pip + py -m pip --version + Afterwards, you should have the latest version of pip: + .. code-block:: text pip 21.1.3 from c:\python39\lib\site-packages (Python 3.9.4) - You can make sure that pip is up-to-date by running: - - .. code-block:: text - - py -m pip install --upgrade pip Installing virtualenv From ee40d83d805039d5f4278f36bb8c375747387b7f Mon Sep 17 00:00:00 2001 From: Brian Rutledge Date: Sun, 11 Jul 2021 15:31:43 -0400 Subject: [PATCH 7/8] Use bat for Windows input --- ...distributing-packages-using-setuptools.rst | 10 ++--- .../guides/dropping-older-python-versions.rst | 2 +- source/guides/hosting-your-own-index.rst | 2 +- ...ing-using-pip-and-virtual-environments.rst | 40 ++++++++--------- .../guides/making-a-pypi-friendly-readme.rst | 4 +- source/guides/using-testpypi.rst | 4 +- source/tutorials/creating-documentation.rst | 2 +- source/tutorials/installing-packages.rst | 44 +++++++++---------- source/tutorials/managing-dependencies.rst | 2 +- source/tutorials/packaging-projects.rst | 14 +++--- 10 files changed, 62 insertions(+), 62 deletions(-) diff --git a/source/guides/distributing-packages-using-setuptools.rst b/source/guides/distributing-packages-using-setuptools.rst index 7f55c3e1a..1614a8c77 100644 --- a/source/guides/distributing-packages-using-setuptools.rst +++ b/source/guides/distributing-packages-using-setuptools.rst @@ -36,7 +36,7 @@ Requirements for packaging and distributing .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install twine @@ -728,7 +728,7 @@ Before you can build wheels and sdists for your project, you'll need to install .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install build @@ -747,7 +747,7 @@ Minimally, you should create a :term:`Source Distribution =2.0.0,<3.0.0 @@ -277,7 +277,7 @@ To install pre-release versions of packages, use the ``--pre`` flag: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --pre requests @@ -296,7 +296,7 @@ specifying the extra in brackets: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install requests[security] @@ -318,7 +318,7 @@ pip can install a package directly from source, for example: .. tab:: Windows - .. code-block:: text + .. code-block:: bat cd google-auth py -m pip install . @@ -335,7 +335,7 @@ installed package without needing to re-install: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --editable . @@ -371,7 +371,7 @@ wheel, or tar file) you can install it directly with pip: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install requests-2.18.4.tar.gz @@ -387,7 +387,7 @@ pip to look for packages there and not to use the .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --no-index --find-links=/local/dir/ requests @@ -410,7 +410,7 @@ If you want to download packages from a different index than the .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --index-url http://index.example.com/simple/ SomeProject @@ -426,7 +426,7 @@ and a separate index, you can use the ``--extra-index-url`` flag instead: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --extra-index-url http://index.example.com/simple/ SomeProject @@ -444,7 +444,7 @@ install the latest version of ``requests`` and all of its dependencies: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --upgrade requests @@ -470,7 +470,7 @@ And tell pip to install all of the packages in this file using the ``-r`` flag: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install -r requirements.txt @@ -488,7 +488,7 @@ Pip can export a list of all installed packages and their versions using the .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip freeze diff --git a/source/guides/making-a-pypi-friendly-readme.rst b/source/guides/making-a-pypi-friendly-readme.rst index 977942f89..32e8f2f09 100644 --- a/source/guides/making-a-pypi-friendly-readme.rst +++ b/source/guides/making-a-pypi-friendly-readme.rst @@ -53,7 +53,7 @@ such as ``text/plain``, ``text/x-rst`` (for reStructuredText), or ``text/markdow .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --user --upgrade setuptools wheel twine @@ -115,7 +115,7 @@ You can check your README for markup errors before uploading as follows: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --upgrade twine diff --git a/source/guides/using-testpypi.rst b/source/guides/using-testpypi.rst index 4ff3601bc..e8676fc25 100644 --- a/source/guides/using-testpypi.rst +++ b/source/guides/using-testpypi.rst @@ -49,7 +49,7 @@ specifying the ``--index-url`` flag .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --index-url https://test.pypi.org/simple/ your-package @@ -65,7 +65,7 @@ you're testing has dependencies: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple your-package diff --git a/source/tutorials/creating-documentation.rst b/source/tutorials/creating-documentation.rst index 7673ae841..392220f31 100644 --- a/source/tutorials/creating-documentation.rst +++ b/source/tutorials/creating-documentation.rst @@ -21,7 +21,7 @@ Use ``pip`` to install Sphinx: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install -U sphinx diff --git a/source/tutorials/installing-packages.rst b/source/tutorials/installing-packages.rst index 042c43277..3e567d416 100644 --- a/source/tutorials/installing-packages.rst +++ b/source/tutorials/installing-packages.rst @@ -45,7 +45,7 @@ version is available from your command line. You can check this by running: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py --version @@ -109,7 +109,7 @@ check this by running: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip --version @@ -132,7 +132,7 @@ standard library: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m ensurepip --default-pip @@ -180,7 +180,7 @@ but here's the basic `venv`_ [3]_ command to use on a typical Linux system: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m venv tutorial_env tutorial_env\Scripts\activate @@ -240,7 +240,7 @@ Using `venv`_: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m venv \Scripts\activate @@ -256,7 +256,7 @@ Using :ref:`virtualenv`: .. tab:: Windows - .. code-block:: text + .. code-block:: bat virtualenv \Scripts\activate @@ -314,7 +314,7 @@ To install the latest version of "SomeProject": .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install "SomeProject" @@ -328,7 +328,7 @@ To install a specific version: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install "SomeProject==1.4" @@ -342,7 +342,7 @@ To install greater than or equal to one version and less than another: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install "SomeProject>=1,<2" @@ -358,7 +358,7 @@ with a certain version: [4]_ .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install "SomeProject~=1.4.2" @@ -398,7 +398,7 @@ Upgrade an already installed ``SomeProject`` to the latest from PyPI. .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --upgrade SomeProject @@ -418,7 +418,7 @@ current user, use the ``--user`` flag: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --user SomeProject @@ -470,7 +470,7 @@ Install a list of requirements specified in a :ref:`Requirements File .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install -r requirements.txt @@ -491,7 +491,7 @@ syntax, see pip's section on :ref:`VCS Support `. .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install -e git+https://git.repo/some_pkg.git#egg=SomeProject # from git py -m pip install -e hg+https://hg.repo/some_pkg#egg=SomeProject # from mercurial @@ -511,7 +511,7 @@ Install from an alternate index .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --index-url http://my.package.repo/simple/ SomeProject @@ -526,7 +526,7 @@ Package Index (PyPI)>` .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --extra-index-url http://my.package.repo/simple SomeProject @@ -547,7 +547,7 @@ still editable from the src tree. .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install -e @@ -561,7 +561,7 @@ You can also install normally from src .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install @@ -578,7 +578,7 @@ Install a particular source archive file. .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install ./downloads/SomeProject-1.0.4.tar.gz @@ -595,7 +595,7 @@ Install from a local directory containing archives (and don't check :term:`PyPI .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --no-index --find-links=file:///local/dir/ SomeProject py -m pip install --no-index --find-links=/local/dir/ SomeProject @@ -629,7 +629,7 @@ default, pip only finds stable versions. .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --pre SomeProject @@ -648,7 +648,7 @@ Install `setuptools extras`_. .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install SomePackage[PDF] py -m pip install SomePackage[PDF]==3.0 diff --git a/source/tutorials/managing-dependencies.rst b/source/tutorials/managing-dependencies.rst index 89c042a5e..99b889ca1 100644 --- a/source/tutorials/managing-dependencies.rst +++ b/source/tutorials/managing-dependencies.rst @@ -45,7 +45,7 @@ Use ``pip`` to install Pipenv: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --user pipenv diff --git a/source/tutorials/packaging-projects.rst b/source/tutorials/packaging-projects.rst index 7d48f8541..bfc094436 100644 --- a/source/tutorials/packaging-projects.rst +++ b/source/tutorials/packaging-projects.rst @@ -26,7 +26,7 @@ sure you have the latest version installed: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --upgrade pip @@ -415,7 +415,7 @@ Make sure you have the latest version of PyPA's :ref:`build` installed: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --upgrade build @@ -432,7 +432,7 @@ Now run this command from the same directory where :file:`pyproject.toml` is loc .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m build @@ -485,7 +485,7 @@ distribution packages. You'll need to install Twine: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --upgrade twine @@ -499,7 +499,7 @@ Once installed, run Twine to upload all of the archives under :file:`dist`: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m twine upload --repository testpypi dist/* @@ -539,7 +539,7 @@ and install your package from TestPyPI: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py -m pip install --index-url https://test.pypi.org/simple/ --no-deps example-pkg-YOUR-USERNAME-HERE @@ -573,7 +573,7 @@ Make sure you're still in your virtual environment, then run Python: .. tab:: Windows - .. code-block:: text + .. code-block:: bat py From 4e01f462cf905ad4c3f8460cd0ee63139fccabde Mon Sep 17 00:00:00 2001 From: Brian Rutledge Date: Sun, 11 Jul 2021 15:32:49 -0400 Subject: [PATCH 8/8] Use bash for Unix input --- source/guides/distributing-packages-using-setuptools.rst | 2 +- source/guides/installing-using-pip-and-virtual-environments.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/guides/distributing-packages-using-setuptools.rst b/source/guides/distributing-packages-using-setuptools.rst index 1614a8c77..c6e7ebf41 100644 --- a/source/guides/distributing-packages-using-setuptools.rst +++ b/source/guides/distributing-packages-using-setuptools.rst @@ -930,7 +930,7 @@ it will be automatically created when the first release is uploaded. For the second and subsequent releases, PyPI only requires that the version number of the new release differ from any previous releases. -.. code-block:: text +.. code-block:: bash twine upload dist/* diff --git a/source/guides/installing-using-pip-and-virtual-environments.rst b/source/guides/installing-using-pip-and-virtual-environments.rst index edc715e57..1a369763b 100644 --- a/source/guides/installing-using-pip-and-virtual-environments.rst +++ b/source/guides/installing-using-pip-and-virtual-environments.rst @@ -167,7 +167,7 @@ It should be in the ``env`` directory: .. tab:: Unix/macOS - .. code-block:: text + .. code-block:: bash .../env/bin/python