Skip to content

Commit f57b46c

Browse files
authored
Merge branch 'main' into add-sections
2 parents 7b620e6 + 34af15d commit f57b46c

14 files changed

Lines changed: 213 additions & 180 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: 51 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ taken from the `setup.py
160160

161161
.. _`setup() name`:
162162

163-
name
164-
~~~~
163+
``name``
164+
~~~~~~~~
165165

166166
::
167167

@@ -186,8 +186,8 @@ declare a dependency on it using any of the following spellings::
186186
CoOl__-.-__sTuFF
187187

188188

189-
version
190-
~~~~~~~
189+
``version``
190+
~~~~~~~~~~~
191191

192192
::
193193

@@ -210,8 +210,8 @@ rather not duplicate the value, there are a few ways to manage this. See the
210210

211211
.. _`description`:
212212

213-
description
214-
~~~~~~~~~~~
213+
``description``
214+
~~~~~~~~~~~~~~~
215215

216216
::
217217

@@ -241,8 +241,8 @@ to no formatting, `reStructuredText (reST)
241241
and the Github-flavored Markdown dialect of `Markdown
242242
<https://daringfireball.net/projects/markdown/>`_ respectively.
243243

244-
url
245-
~~~
244+
``url``
245+
~~~~~~~
246246

247247
::
248248

@@ -252,8 +252,8 @@ url
252252
Give a homepage URL for your project.
253253

254254

255-
author
256-
~~~~~~
255+
``author``
256+
~~~~~~~~~~
257257

258258
::
259259

@@ -263,8 +263,8 @@ author
263263
Provide details about the author.
264264

265265

266-
license
267-
~~~~~~~
266+
``license``
267+
~~~~~~~~~~~
268268

269269
::
270270

@@ -276,15 +276,15 @@ so if you want. If you're using a standard, well-known license, then
276276
your main indication can and should be via the ``classifiers``
277277
argument. Classifiers exist for all major open-source licenses.
278278

279-
The "license" argument is more typically used to indicate differences
279+
The ``license`` argument is more typically used to indicate differences
280280
from well-known licenses, or to include your own, unique license. As a
281281
general rule, it's a good idea to use a standard, well-known license,
282282
both to avoid confusion and because some organizations avoid software
283283
whose license is unapproved.
284284

285285

286-
classifiers
287-
~~~~~~~~~~~
286+
``classifiers``
287+
~~~~~~~~~~~~~~~
288288

289289
::
290290

@@ -323,8 +323,8 @@ Python versions a project can be installed on, use the :ref:`python_requires`
323323
argument.
324324

325325

326-
keywords
327-
~~~~~~~~
326+
``keywords``
327+
~~~~~~~~~~~~
328328

329329
::
330330

@@ -333,8 +333,8 @@ keywords
333333
List keywords that describe your project.
334334

335335

336-
project_urls
337-
~~~~~~~~~~~~
336+
``project_urls``
337+
~~~~~~~~~~~~~~~~
338338

339339
::
340340

@@ -351,8 +351,8 @@ bug trackers, source repositories, or where to support package development.
351351
The string of the key is the exact text that will be displayed on PyPI.
352352

353353

354-
packages
355-
~~~~~~~~
354+
``packages``
355+
~~~~~~~~~~~~
356356

357357
::
358358

@@ -366,8 +366,8 @@ packages. Use the ``exclude`` keyword argument to omit packages that are not
366366
intended to be released and installed.
367367

368368

369-
py_modules
370-
~~~~~~~~~~
369+
``py_modules``
370+
~~~~~~~~~~~~~~
371371

372372
::
373373

@@ -378,8 +378,8 @@ package, set ``py_modules`` to a list of the names of the modules (minus the
378378
``.py`` extension) in order to make :ref:`setuptools` aware of them.
379379

380380

381-
install_requires
382-
~~~~~~~~~~~~~~~~
381+
``install_requires``
382+
~~~~~~~~~~~~~~~~~~~~
383383

384384
::
385385

@@ -394,8 +394,8 @@ For more on using "install_requires" see :ref:`install_requires vs Requirements
394394

395395
.. _python_requires:
396396

397-
python_requires
398-
~~~~~~~~~~~~~~~
397+
``python_requires``
398+
~~~~~~~~~~~~~~~~~~~
399399

400400
If your project only runs on certain Python versions, setting the
401401
``python_requires`` argument to the appropriate :pep:`440` version specifier
@@ -427,8 +427,8 @@ And so on.
427427

428428
.. _`Package Data`:
429429

430-
package_data
431-
~~~~~~~~~~~~
430+
``package_data``
431+
~~~~~~~~~~~~~~~~
432432

433433
::
434434

@@ -453,8 +453,8 @@ For more information, see :std:doc:`Including Data Files
453453

454454
.. _`Data Files`:
455455

456-
data_files
457-
~~~~~~~~~~
456+
``data_files``
457+
~~~~~~~~~~~~~~
458458

459459
::
460460

@@ -469,7 +469,7 @@ programs, which may be unaware of Python packages.
469469
Each ``(directory, files)`` pair in the sequence specifies the installation
470470
directory and the files to install there. The ``directory`` must be a relative
471471
path (although this may change in the future, see
472-
`wheel Issue #92 <https://github.com/pypa/wheel/issues/92>`_).
472+
`wheel Issue #92 <https://github.com/pypa/wheel/issues/92>`_),
473473
and it is interpreted relative to the installation prefix
474474
(Python’s ``sys.prefix`` for a default installation;
475475
``site.USER_BASE`` for a user installation).
@@ -487,17 +487,17 @@ For more information see the distutils section on `Installing Additional Files
487487
then you need to pass the ``--old-and-unmanageable`` option.
488488

489489

490-
scripts
491-
~~~~~~~
490+
``scripts``
491+
~~~~~~~~~~~
492492

493493
Although ``setup()`` supports a `scripts
494494
<http://docs.python.org/3/distutils/setupscript.html#installing-scripts>`_
495495
keyword for pointing to pre-made scripts to install, the recommended approach to
496496
achieve cross-platform compatibility is to use :ref:`console_scripts` entry
497497
points (see below).
498498

499-
entry_points
500-
~~~~~~~~~~~~
499+
``entry_points``
500+
~~~~~~~~~~~~~~~~
501501

502502
::
503503

@@ -517,8 +517,8 @@ The most commonly used entry point is "console_scripts" (see below).
517517

518518
.. _`console_scripts`:
519519

520-
console_scripts
521-
***************
520+
``console_scripts``
521+
*******************
522522

523523
::
524524

@@ -528,7 +528,7 @@ console_scripts
528528
],
529529
},
530530

531-
Use "console_script" `entry points
531+
Use ``console_script`` `entry points
532532
<https://setuptools.readthedocs.io/en/latest/setuptools.html#dynamic-discovery-of-services-and-plugins>`_
533533
to register your script interfaces. You can then let the toolchain handle the
534534
work of turning these interfaces into actual scripts [2]_. The scripts will be
@@ -666,16 +666,17 @@ 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
675675
to the current working directory, so together, it means to install the current
676676
directory (i.e. your project) in editable mode. This will also install any
677-
dependencies declared with "install_requires" and any scripts declared with
678-
"console_scripts". Dependencies will be installed in the usual, non-editable mode.
677+
dependencies declared with ``install_requires`` and any scripts declared with
678+
``console_scripts``. Dependencies will be installed in the usual, non-editable
679+
mode.
679680

680681
It's fairly common to also want to install some of your dependencies in editable
681682
mode as well. For example, supposing your project requires "foo" and "bar", but
@@ -698,7 +699,9 @@ Otherwise, the dependency will be fulfilled from PyPI, due to the installation o
698699
<pip:Requirements Files>` section in the pip docs. For more on VCS installs,
699700
see the :ref:`VCS Support <pip:VCS Support>` section of the pip docs.
700701

701-
Lastly, if you don't want to install any dependencies at all, you can run::
702+
Lastly, if you don't want to install any dependencies at all, you can run:
703+
704+
.. code-block:: bash
702705
703706
python -m pip install -e . --no-deps
704707
@@ -880,9 +883,11 @@ distribution file(s) to upload.
880883
directive). **Before** trying to upload your distribution, you should check
881884
to see if your brief / long descriptions provided in :file:`setup.py` are
882885
valid. You can do this by running :std:doc:`twine check <index>` on
883-
your package files::
886+
your package files:
887+
888+
.. code-block:: bash
884889
885-
twine check dist/*
890+
twine check dist/*
886891
887892
Create an account
888893
-----------------

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

0 commit comments

Comments
 (0)