Skip to content

Commit ec52be5

Browse files
authored
Merge branch 'main' into update-linux-package-managers
2 parents 7f12858 + 5a5f5e3 commit ec52be5

9 files changed

Lines changed: 128 additions & 56 deletions

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/guides/distributing-packages-using-setuptools.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -666,9 +666,9 @@ both installed and editable in project form.
666666

667667
Assuming you're in the root of your project directory, then run:
668668

669-
::
669+
.. code-block:: bash
670670
671-
python -m pip install -e .
671+
python -m pip install -e .
672672
673673
674674
Although somewhat cryptic, ``-e`` is short for ``--editable``, and ``.`` refers
@@ -698,7 +698,9 @@ Otherwise, the dependency will be fulfilled from PyPI, due to the installation o
698698
<pip:Requirements Files>` section in the pip docs. For more on VCS installs,
699699
see the :ref:`VCS Support <pip:VCS Support>` section of the pip docs.
700700

701-
Lastly, if you don't want to install any dependencies at all, you can run::
701+
Lastly, if you don't want to install any dependencies at all, you can run:
702+
703+
.. code-block:: bash
702704
703705
python -m pip install -e . --no-deps
704706
@@ -880,9 +882,11 @@ distribution file(s) to upload.
880882
directive). **Before** trying to upload your distribution, you should check
881883
to see if your brief / long descriptions provided in :file:`setup.py` are
882884
valid. You can do this by running :std:doc:`twine check <index>` on
883-
your package files::
885+
your package files:
886+
887+
.. code-block:: bash
884888
885-
twine check dist/*
889+
twine check dist/*
886890
887891
Create an account
888892
-----------------

source/guides/dropping-older-python-versions.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ Within a Python source package (the zip or the tar-gz file you download) is a te
105105
This file is generated by Distutils or :ref:`setuptools` when it generates the source package.
106106
The file contains a set of keys and values, the list of keys is part of the PyPa standard metadata format.
107107

108-
You can see the contents of the generated file like this::
108+
You can see the contents of the generated file like this:
109+
110+
.. code-block:: bash
109111
110112
tar xfO dist/my-package-1.0.0.tar.gz my-package-1.0.0/PKG-INFO
111113

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ cached copies of :term:`packages <Distribution Package>`:
3535
those downloaded files instead of going to PyPI.
3636
2. A variation on the above which pre-builds the installation files for
3737
the requirements using `python -m pip wheel
38-
<https://pip.readthedocs.io/en/latest/reference/pip_wheel.html>`_::
38+
<https://pip.readthedocs.io/en/latest/reference/pip_wheel.html>`_:
3939

40-
python -m pip wheel --wheel-dir=/tmp/wheelhouse SomeProject
41-
python -m pip install --no-index --find-links=/tmp/wheelhouse SomeProject
40+
.. code-block:: bash
41+
42+
python -m pip wheel --wheel-dir=/tmp/wheelhouse SomeProject
43+
python -m pip install --no-index --find-links=/tmp/wheelhouse SomeProject
4244
4345
4446
Caching with devpi
Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,55 @@
11
Installing stand alone command line tools
22
=========================================
33

4-
Many packages have command line entry points. Examples of this type of application are
4+
Many packages provide command line applications. Examples of such packages are
55
`mypy <https://github.com/python/mypy>`_,
66
`flake8 <https://github.com/PyCQA/flake8>`_,
7-
:ref:`pipenv`,and
8-
`black <https://github.com/ambv/black>`_.
7+
`black <https://github.com/psf/black>`_, and
8+
:ref:`pipenv`.
99

10-
Usually you want to be able to access these from anywhere,
11-
but installing packages and their dependencies to the same global environment
12-
can cause version conflicts and break dependencies the operating system has
13-
on Python packages.
10+
Usually you want to be able to access these applications from anywhere on your
11+
system, but installing packages and their dependencies to the same global
12+
environment can cause version conflicts and break dependencies the operating
13+
system has on Python packages.
1414

15-
:ref:`pipx` solves this by creating a virtual
16-
environment for each package, while also ensuring that package's applications
17-
are accessible through a directory that is on your ``$PATH``. This allows each
18-
package to be upgraded or uninstalled without causing conflicts with other
19-
packages, and allows you to safely run the program from anywhere.
15+
:ref:`pipx` solves this by creating a virtual environment for each package,
16+
while also ensuring that its applications are accessible through a directory
17+
that is on your ``$PATH``. This allows each package to be upgraded or
18+
uninstalled without causing conflicts with other packages, and allows you to
19+
safely run the applications from anywhere.
2020

2121
.. note:: pipx only works with Python 3.6+.
2222

23-
``pipx`` is installed with ``pip``:
23+
pipx is installed with pip:
2424

2525
.. tab:: Unix/macOS
2626

2727
.. code-block:: bash
2828
2929
python3 -m pip install --user pipx
30-
31-
python3 -m pipx ensurepath # ensures the path of the CLI application directory is on your $PATH
30+
python3 -m pipx ensurepath
3231
3332
.. tab:: Windows
3433

3534
.. code-block:: bat
3635
3736
py -m pip install --user pipx
38-
3937
py -m pipx ensurepath
4038
41-
.. Note:: You may need to restart your terminal for the path updates to take effect.
39+
.. note::
40+
41+
``ensurepath`` ensures that the application directory is on your ``$PATH``.
42+
You may need to restart your terminal for this update to take effect.
4243

43-
Now you can install packages with ``pipx install`` and access the package's entry point(s) from anywhere.
44+
Now you can install packages with ``pipx install`` and run the package's
45+
applications(s) from anywhere.
4446

4547
.. code-block:: console
4648
4749
$ pipx install PACKAGE
48-
$ ENTRYPOINT_OF_PACKAGE [ARGS]
50+
$ PACKAGE_APPLICATION [ARGS]
4951
50-
For example
52+
For example:
5153

5254
.. code-block:: console
5355
@@ -67,7 +69,8 @@ For example
6769
(__)\ )\/ ||----w |
6870
|| ||
6971
70-
To see a list of packages installed with pipx and which CLI applications are available, use ``pipx list``.
72+
To see a list of packages installed with pipx and which applications are
73+
available, use ``pipx list``:
7174

7275
.. code-block:: console
7376
@@ -87,14 +90,14 @@ To see a list of packages installed with pipx and which CLI applications are ava
8790
- nox
8891
- tox-to-nox
8992
90-
To upgrade or uninstall the package
93+
To upgrade or uninstall a package:
9194

9295
.. code-block:: bash
9396
9497
pipx upgrade PACKAGE
9598
pipx uninstall PACKAGE
9699
97-
``pipx`` can be upgraded or uninstalled with pip
100+
pipx can be upgraded or uninstalled with pip:
98101

99102
.. tab:: Unix/macOS
100103

@@ -109,25 +112,18 @@ To upgrade or uninstall the package
109112
110113
py -m pip install -U pipx
111114
py -m pip uninstall pipx
112-
113-
``pipx`` also allows you to install and run the latest version of a cli tool
114-
in a temporary, ephemeral environment.
115-
116-
.. code-block:: bash
117-
118-
pipx run PACKAGE [ARGS]
119115
120-
For example
116+
pipx also allows you to install and run the latest version of an application
117+
in a temporary, ephemeral environment. For example:
121118

122119
.. code-block:: bash
123120
124121
pipx run cowsay moooo
125122
126-
To see the full list of commands ``pipx`` offers, run
123+
To see the full list of commands pipx offers, run:
127124

128125
.. code-block:: bash
129126
130127
pipx --help
131128
132-
You can learn more about ``pipx`` at its homepage,
133-
https://github.com/pypa/pipx.
129+
You can learn more about pipx at https://pypa.github.io/pipx/.

source/guides/making-a-pypi-friendly-readme.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,11 @@ You can check your README for markup errors before uploading as follows:
122122
2. Build the sdist and wheel for your project as described under
123123
:ref:`Packaging Your Project`.
124124

125-
3. Run ``twine check`` on the sdist and wheel::
125+
3. Run ``twine check`` on the sdist and wheel:
126126

127-
twine check dist/*
127+
.. code-block:: bash
128+
129+
twine check dist/*
128130
129131
This command will report any problems rendering your README. If your markup
130132
renders fine, the command will output ``Checking distribution FILENAME:

source/guides/using-manifest-in.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ setuptools will automatically convert the slashes to the local platform's
9393
appropriate directory separator.
9494

9595
Commands are processed in the order they appear in the :file:`MANIFEST.in`
96-
file. For example, given the commands::
96+
file. For example, given the commands:
97+
98+
.. code-block:: bash
9799
98100
graft tests
99101
global-exclude *.py[cod]

source/specifications/source-distribution-format.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ specification.
2020

2121
Source distributions are also known as *sdists* for short.
2222

23+
Source trees
24+
============
25+
26+
A *source tree* is a collection of files and directories -- like a version
27+
control system checkout -- which contains a :file:`pyproject.toml` file that
28+
can be use to build a source distribution from the contained files and
29+
directories. :pep:`517` and :pep:`518` specify what is required to meet the
30+
definition of what :file:`pyproject.toml` must contain for something to be
31+
deemed a source tree.
32+
2333
Source distribution file name
2434
=============================
2535

source/tutorials/installing-packages.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,9 @@ In both of the above cases, Windows users should _not_ use the
281281
:command:`source` command, but should rather run the :command:`activate`
282282
script directly from the command shell like so:
283283

284-
::
284+
.. code-block:: bat
285285
286-
<DIR>\Scripts\activate
286+
<DIR>\Scripts\activate
287287
288288
289289
@@ -618,10 +618,10 @@ create a helper application that presents the data in a :pep:`503` compliant
618618
index format, and use the ``--extra-index-url`` flag to direct pip to use
619619
that index.
620620

621-
::
621+
.. code-block:: bash
622622
623-
./s3helper --port=7777
624-
python -m pip install --extra-index-url http://localhost:7777 SomeProject
623+
./s3helper --port=7777
624+
python -m pip install --extra-index-url http://localhost:7777 SomeProject
625625
626626
627627
Installing Prereleases

0 commit comments

Comments
 (0)