Skip to content

Commit 0e6d3c4

Browse files
authored
Merge branch 'main' into use-python3.9
2 parents 2e80e84 + cc488ec commit 0e6d3c4

8 files changed

Lines changed: 134 additions & 88 deletions

File tree

.github/workflows/translation.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Translation
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- Test
7+
branches:
8+
- main
9+
types:
10+
- completed
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Grab the repo src
18+
uses: actions/checkout@v2
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: 3.9
24+
25+
- name: Install Python tooling
26+
run: python -m pip install --upgrade nox virtualenv
27+
28+
- name: Generate a fresh POT file out of RST documents
29+
run: python -m nox -s translation
30+
31+
- name: Commit the POT file to Git
32+
run: |
33+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
34+
git config --local user.name "github-actions[bot]"
35+
git_hash=$(git rev-parse --short "${GITHUB_SHA}")
36+
git commit -m "Update messages.pot as of version ${git_hash}" locales/messages.pot
37+
38+
- name: Check if any sources have changed since the last update
39+
if: failure()
40+
run: echo "There are no changes to the RST sources since the last update. Nothing to do."
41+
42+
- name: >-
43+
Push the updated POT file back to
44+
${{ github.repository }}@${{ github.event.repository.default_branch }}
45+
on GitHub
46+
run: |
47+
git push --atomic origin HEAD:${{ github.event.repository.default_branch }}

source/discussions/deploying-python-applications.rst

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Deploying Python applications
44
=============================
55

66
:Page Status: Incomplete
7-
:Last Reviewed: 2014-11-11
7+
:Last Reviewed: 2021-8-24
88

99
.. contents:: Contents
1010
:local:
@@ -83,9 +83,50 @@ Application bundles
8383

8484
FIXME
8585

86-
- py2exe/py2app/PEX
8786
- wheels kinda/sorta
8887

88+
Windows
89+
-------
90+
91+
py2exe
92+
^^^^^^
93+
94+
`py2exe <https://pypi.org/project/py2exe/>`__ is a distutils extension which
95+
allows to build standalone Windows executable programs (32-bit and 64-bit)
96+
from Python scripts. Python versions included in the official development
97+
cycle are supported (refers to `Status of Python branches`__). py2exe can
98+
build console executables and windows (GUI) executables. Building windows
99+
services, and DLL/EXE COM servers might work but it is not actively supported.
100+
The distutils extension is released under the MIT-licence and Mozilla
101+
Public License 2.0.
102+
103+
.. __: https://devguide.python.org/#status-of-python-branches
104+
105+
macOS
106+
-----
107+
108+
py2app
109+
^^^^^^
110+
111+
`py2app <https://pypi.org/project/py2app/>`__ is a Python setuptools
112+
command which will allow you to make standalone macOS application
113+
bundles and plugins from Python scripts. Note that py2app MUST be used
114+
on macOS to build applications, it cannot create Mac applications on other
115+
platforms. py2app is released under the MIT-license.
116+
117+
Unix (including Linux and macOS)
118+
-----------------------------------
119+
120+
pex
121+
^^^
122+
123+
`pex <https://pypi.org/project/pex/>`__ is a library for generating .pex
124+
(Python EXecutable) files which are executable Python environments in the
125+
spirit of virtualenvs. pex is an expansion upon the ideas outlined in :pep:`441`
126+
and makes the deployment of Python applications as simple as cp. pex files may
127+
even include multiple platform-specific Python distributions, meaning that a
128+
single pex file can be portable across Linux and macOS. pex is released under the
129+
Apache License 2.0.
89130

90131
Configuration management
91132
========================

source/guides/index-mirrors-and-caches.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ cached copies of :term:`packages <Distribution Package>`:
3434
by downloading all the requirements for a project and then pointing pip at
3535
those downloaded files instead of going to PyPI.
3636
2. A variation on the above which pre-builds the installation files for
37-
the requirements using `python -m pip wheel
38-
<https://pip.readthedocs.io/en/latest/reference/pip_wheel.html>`_:
37+
the requirements using :ref:`python -m pip wheel <pip:pip wheel>`:
3938

4039
.. code-block:: bash
4140

source/guides/installing-using-linux-tools.rst

Lines changed: 31 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ Installing pip/setuptools/wheel with Linux Package Managers
55
===========================================================
66

77
:Page Status: Incomplete
8-
:Last Reviewed: 2015-09-17
8+
:Last Reviewed: 2021-07-26
99

10+
.. contents:: Contents
11+
:local:
1012

1113
This section covers how to install :ref:`pip`, :ref:`setuptools`, and
1214
:ref:`wheel` using Linux package managers.
@@ -31,33 +33,16 @@ versions. When this is known, we will make note of it below.
3133
Fedora
3234
~~~~~~
3335

34-
* Fedora 21:
36+
.. code-block:: bash
3537
36-
* Python 2::
38+
sudo dnf install python3-pip python3-wheel
3739
38-
sudo yum upgrade python-setuptools
39-
sudo yum install python-pip python-wheel
40-
41-
* Python 3: ``sudo yum install python3 python3-wheel``
42-
43-
* Fedora 22:
44-
45-
* Python 2::
46-
47-
sudo dnf upgrade python-setuptools
48-
sudo dnf install python-pip python-wheel
49-
50-
* Python 3: ``sudo dnf install python3 python3-wheel``
51-
52-
53-
To get newer versions of pip, setuptools, and wheel for Python 2, you can enable
54-
the `PyPA Copr Repo <https://copr.fedoraproject.org/coprs/pypa/pypa/>`_ using
55-
the `Copr Repo instructions
56-
<https://fedorahosted.org/copr/wiki/HowToEnableRepo>`__, and then run::
57-
58-
sudo yum|dnf upgrade python-setuptools
59-
sudo yum|dnf install python-pip python-wheel
40+
To learn more about Python in Fedora, please visit the `official Fedora docs`_,
41+
`Python Classroom`_ or `Fedora Loves Python`_.
6042

43+
.. _official Fedora docs: https://developer.fedoraproject.org/tech/languages/python/python-installation.html
44+
.. _Python Classroom: https://labs.fedoraproject.org/en/python-classroom/
45+
.. _Fedora Loves Python: https://fedoralovespython.org
6146

6247
CentOS/RHEL
6348
~~~~~~~~~~~
@@ -69,14 +54,12 @@ To install pip and wheel for the system Python, there are two options:
6954

7055
1. Enable the `EPEL repository <https://fedoraproject.org/wiki/EPEL>`_ using
7156
`these instructions
72-
<https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F>`__. On
73-
EPEL 6 and EPEL7, you can install pip like so::
74-
75-
sudo yum install python-pip
57+
<https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F>`__.
58+
On EPEL 7, you can install pip and wheel like so:
7659

77-
On EPEL 7 (but not EPEL 6), you can install wheel like so::
60+
.. code-block:: bash
7861
79-
sudo yum install python-wheel
62+
sudo dnf install python3-pip python3-wheel
8063
8164
Since EPEL only offers extra, non-conflicting packages, EPEL does not offer
8265
setuptools, since it's in the core repository.
@@ -85,13 +68,17 @@ To install pip and wheel for the system Python, there are two options:
8568
2. Enable the `PyPA Copr Repo
8669
<https://copr.fedoraproject.org/coprs/pypa/pypa/>`_ using `these instructions
8770
<https://fedorahosted.org/copr/wiki/HowToEnableRepo>`__ [1]_. You can install
88-
pip and wheel like so::
71+
pip and wheel like so:
72+
73+
.. code-block:: bash
74+
75+
sudo dnf install python3-pip python3-wheel
8976
90-
sudo yum install python-pip python-wheel
77+
To additionally upgrade setuptools, run:
9178

92-
To additionally upgrade setuptools, run::
79+
.. code-block:: bash
9380
94-
sudo yum upgrade python-setuptools
81+
sudo dnf upgrade python3-setuptools
9582
9683
9784
To install pip, wheel, and setuptools, in a parallel, non-system environment
@@ -113,37 +100,29 @@ To install pip, wheel, and setuptools, in a parallel, non-system environment
113100
Pythons, along with pip, setuptools, and wheel, which are kept fairly up to
114101
date.
115102

116-
For example, for Python 3.4 on CentOS7/RHEL7::
103+
For example, for Python 3.4 on CentOS7/RHEL7:
104+
105+
.. code-block:: bash
117106
118107
sudo yum install python34u python34u-wheel
119108
120109
121110
openSUSE
122111
~~~~~~~~
123112

124-
* Python 2::
125-
126-
sudo zypper install python-pip python-setuptools python-wheel
127-
128-
129-
* Python 3::
113+
.. code-block:: bash
130114
131115
sudo zypper install python3-pip python3-setuptools python3-wheel
132116
133-
134117
Debian/Ubuntu
135118
~~~~~~~~~~~~~
136119

120+
Firstly, update and refresh repository lists by running this command:
137121

138-
* Python 2::
139-
140-
sudo apt install python-pip
141-
142-
143-
* Python 3::
144-
145-
sudo apt install python3-venv python3-pip
122+
.. code-block:: bash
146123
124+
sudo apt update
125+
sudo apt install python3-venv python3-pip
147126
148127
.. warning::
149128

@@ -155,11 +134,7 @@ Debian/Ubuntu
155134
Arch Linux
156135
~~~~~~~~~~
157136

158-
* Python 2::
159-
160-
sudo pacman -S python2-pip
161-
162-
* Python 3::
137+
.. code-block:: bash
163138
164139
sudo pacman -S python-pip
165140

source/guides/using-testpypi.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ Registering your account
1313
------------------------
1414

1515
Because TestPyPI has a separate database from the live PyPI, you'll need a
16-
separate user account for specifically for TestPyPI. Go to
16+
separate user account specifically for TestPyPI. Go to
1717
https://test.pypi.org/account/register/ to register your account.
1818

19-
.. Note:: The database for TestPyPI may be periodically pruned, so it is not
19+
.. note:: The database for TestPyPI may be periodically pruned, so it is not
2020
unusual for user accounts to be deleted.
2121

2222

2323
Using TestPyPI with Twine
2424
-------------------------
2525

2626
You can upload your distributions to TestPyPI using :ref:`twine` by specifying
27-
the ``--repository`` flag
27+
the ``--repository`` flag:
2828

2929
.. code-block:: bash
3030
@@ -38,8 +38,8 @@ your project to appear on the site.
3838
Using TestPyPI with pip
3939
-----------------------
4040

41-
You can tell pip to download packages from TestPyPI instead of PyPI by
42-
specifying the ``--index-url`` flag
41+
You can tell :ref:`pip` to download packages from TestPyPI instead of PyPI by
42+
specifying the ``--index-url`` flag:
4343

4444
.. tab:: Unix/macOS
4545

@@ -53,21 +53,21 @@ specifying the ``--index-url`` flag
5353
5454
py -m pip install --index-url https://test.pypi.org/simple/ your-package
5555
56-
If you want to allow pip to also pull other packages from PyPI you can
56+
If you want to allow pip to also download packages from PyPI, you can
5757
specify ``--extra-index-url`` to point to PyPI. This is useful when the package
5858
you're testing has dependencies:
5959

6060
.. tab:: Unix/macOS
6161

6262
.. code-block:: bash
6363
64-
python3 -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple your-package
64+
python3 -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ your-package
6565
6666
.. tab:: Windows
6767

6868
.. code-block:: bat
6969
70-
py -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple your-package
70+
py -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ your-package
7171
7272
Setting up TestPyPI in :file:`.pypirc`
7373
--------------------------------------

source/key_projects.rst

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -323,21 +323,6 @@ libraries in a package.
323323
Non-PyPA Projects
324324
#################
325325

326-
.. _bento:
327-
328-
bento
329-
=====
330-
331-
`Docs <http://cournape.github.io/Bento/>`__ |
332-
`Issues <https://github.com/cournape/Bento/issues>`__ |
333-
`GitHub <https://github.com/cournape/Bento>`__ |
334-
`PyPI <https://pypi.org/project/bento>`__
335-
336-
Bento is a packaging tool solution for Python software, targeted as an
337-
alternative to :ref:`distutils`, :ref:`setuptools`, etc.... Bento's
338-
philosophy is reproducibility, extensibility and simplicity (in that
339-
order).
340-
341326
.. _buildout:
342327

343328
buildout

source/tutorials/installing-packages.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,7 @@ Use pip for Installing
298298

299299
:ref:`pip` is the recommended installer. Below, we'll cover the most common
300300
usage scenarios. For more detail, see the `pip docs <https://pip.pypa.io>`_,
301-
which includes a complete `Reference Guide
302-
<https://pip.pypa.io/en/latest/reference/index.html>`_.
301+
which includes a complete :doc:`Reference Guide <pip:cli/index>`.
303302

304303

305304
Installing from PyPI
@@ -653,15 +652,15 @@ Install `setuptools extras`_.
653652
654653
python3 -m pip install SomePackage[PDF]
655654
python3 -m pip install SomePackage[PDF]==3.0
656-
python3 -m pip install -e .[PDF]==3.0 # editable project in current directory
655+
python3 -m pip install -e .[PDF] # editable project in current directory
657656
658657
.. tab:: Windows
659658

660659
.. code-block:: bat
661660
662661
py -m pip install SomePackage[PDF]
663662
py -m pip install SomePackage[PDF]==3.0
664-
py -m pip install -e .[PDF]==3.0 # editable project in current directory
663+
py -m pip install -e .[PDF] # editable project in current directory
665664
666665
----
667666

source/tutorials/packaging-projects.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ to build the package, and how to upload it to the Python Package Index.
77

88
.. tip::
99

10-
If you have trouble running the commands in this tutoral, please copy the command
10+
If you have trouble running the commands in this tutorial, please copy the command
1111
and its output, then `open an issue`_ on the `packaging-problems`_ repository on
1212
GitHub. We'll do our best to help you!
1313

0 commit comments

Comments
 (0)