Skip to content

Commit d5ce05f

Browse files
authored
Merge branch 'main' into fix-url-easy_install
2 parents d281ad4 + 72c1ceb commit d5ce05f

26 files changed

Lines changed: 356 additions & 243 deletions

.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/contribute.rst

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ including:
1111
* Reviewing new contributions
1212
* Revising existing content
1313
* Writing new content
14+
* Translate the guide
1415

1516
Most of the work on the |PyPUG| takes place on the
1617
`project's GitHub repository`__. To get started, check out the list of
@@ -67,7 +68,54 @@ an agreed-upon interface for interoperability between packaging tools.
6768
:doc:`example specification-style document <specifications/core-metadata>`.
6869

6970

71+
Translations
72+
============
7073

74+
We use `Weblate`_ to manage translations of this project.
75+
Please visit the `packaging.python.org`_ project on Weblate to contribute.
76+
77+
If you are experiencing issues while you are working on translations,
78+
please open an issue on `Github`_.
79+
80+
.. tip::
81+
82+
Any translations of this project should follow `reStructuredText syntax`_.
83+
84+
.. _Weblate: https://weblate.org/
85+
.. _packaging.python.org: https://hosted.weblate.org/projects/pypa/packaging-python-org/
86+
.. _Github: https://github.com/pypa/packaging.python.org/issues
87+
.. _reStructuredText syntax: https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
88+
89+
Adding a language
90+
-----------------
91+
92+
If your language is not listed on `packaging.python.org`_, click the button
93+
:guilabel:`Start new translation` at the bottom of the language list and add
94+
the language you want to translate.
95+
96+
Following reStructuredText syntax
97+
---------------------------------
98+
99+
If you are not familiar with reStructuredText (RST) syntax, please read `this guide`_
100+
before translating on Weblate.
101+
102+
**Do not translate the text in reference directly**
103+
104+
When translating the text in reference, please do not translate them directly.
105+
106+
| Wrong: Translate the following text directly:
107+
108+
.. code-block:: rst
109+
110+
`some ref`_ -> `TRANSLATED TEXT HERE`_
111+
112+
| Right: Translate the following text with your own language and add the original reference:
113+
114+
.. code-block:: rst
115+
116+
`some ref`_ -> `TRANSLATED TEXT HERE <some ref>`_
117+
118+
.. _this guide: https://docutils.sourceforge.io/docs/user/rst/quickref.html
71119

72120
Building the guide locally
73121
==========================
@@ -77,7 +125,9 @@ in order to test your changes. In order to build this guide locally, you'll
77125
need:
78126

79127
1. `Nox <https://nox.readthedocs.io/en/latest/>`_. You can install or upgrade
80-
nox using ``pip``::
128+
nox using ``pip``:
129+
130+
.. code-block:: bash
81131
82132
python -m pip install --user nox
83133
@@ -88,19 +138,23 @@ need:
88138
.. _Hitchhiker's Guide to Python installation instructions:
89139
http://docs.python-guide.org/en/latest/starting/installation/
90140

91-
To build the guide, run the following bash command in the source folder::
141+
To build the guide, run the following bash command in the source folder:
92142

93-
nox -s build
143+
.. code-block:: bash
144+
145+
nox -s build
94146
95147
After the process has completed you can find the HTML output in the
96148
``./build/html`` directory. You can open the ``index.html`` file to view the
97149
guide in web browser, but it's recommended to serve the guide using an HTTP
98150
server.
99151

100152
You can build the guide and serve it via an HTTP server using the following
101-
command::
153+
command:
154+
155+
.. code-block:: bash
102156
103-
nox -s preview
157+
nox -s preview
104158
105159
The guide will be browsable via http://localhost:8000.
106160

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/glossary.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ Glossary
4242
Egg
4343

4444
A :term:`Built Distribution` format introduced by :ref:`setuptools`,
45-
which is being replaced by :term:`Wheel`. For details, see `The
46-
Internal Structure of Python Eggs
47-
<https://setuptools.readthedocs.io/en/latest/deprecated/python_eggs.html>`_ and
45+
which is being replaced by :term:`Wheel`. For details, see `
46+
:doc:`The Internal Structure of Python Eggs <setuptools:deprecated/python_eggs>` and
4847
`Python Eggs <http://peak.telecommunity.com/DevCenter/PythonEggs>`_
4948

5049
Extension Module

source/guides/analyzing-pypi-package-downloads.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,13 @@ number of download for a package with the command ``pypinfo package_name``.
272272

273273
Install `pypinfo`_ using pip.
274274

275-
::
275+
.. code-block:: bash
276276
277277
python -m pip install pypinfo
278278
279279
Usage:
280280

281-
::
281+
.. code-block:: console
282282
283283
$ pypinfo requests
284284
Served from cache: False

0 commit comments

Comments
 (0)