Skip to content

Commit fa62ab0

Browse files
authored
Merge branch 'main' into manifest-add-remove
2 parents 9cd312e + b57d993 commit fa62ab0

48 files changed

Lines changed: 1692 additions & 498 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/test.yml‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- name: Set up Python
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: 3.9
16+
17+
- name: pip cache
18+
uses: actions/cache@v2
19+
with:
20+
path: ~/.cache/pip
21+
key:
22+
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('noxfile.py') }}
23+
restore-keys: |
24+
${{ matrix.os }}-${{ matrix.python-version }}-
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade nox virtualenv
29+
30+
- name: Nox build
31+
run: |
32+
python -m nox -s build

‎.travis.yml‎

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎README.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Code of Conduct
1414

1515
Everyone interacting in the Python Packaging User Guide project's codebases,
1616
issue trackers, chat rooms, and mailing lists are expected to follow the
17-
`PyPA Code of Conduct`_.
17+
`PSF Code of Conduct`_.
1818

19-
.. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/
19+
.. _PSF Code of Conduct: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md
2020

2121
Contributing
2222
------------

‎noxfile.py‎

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,31 @@
1010
@nox.session(py="3")
1111
def build(session, autobuild=False):
1212
session.install("-r", "requirements.txt")
13-
# Treat warnings as errors.
14-
session.env["SPHINXOPTS"] = "-W"
1513

16-
shutil.rmtree("build", ignore_errors=True)
14+
target_build_dir = "build"
15+
16+
shutil.rmtree(target_build_dir, ignore_errors=True)
1717

1818
if autobuild:
1919
command = "sphinx-autobuild"
2020
extra_args = "-H", "0.0.0.0"
2121
else:
2222
command = "sphinx-build"
23-
extra_args = ()
24-
25-
session.run(command, *extra_args, "-W", "-b", "html", "source", "build")
23+
extra_args = (
24+
"--color", # colorize the output, unsupported by autobuild
25+
)
26+
27+
session.run(
28+
command, *extra_args,
29+
# FIXME: uncomment once the theme is fixed
30+
# Ref: https://github.com/pypa/pypa-docs-theme/issues/17
31+
# "-j", "auto", # parallelize the build
32+
"-b", "html", # use HTML builder
33+
"-n", # nitpicky warn about all missing references
34+
"-W", # Treat warnings as errors.
35+
"source", # where the rst files are located
36+
target_build_dir, # where to put the html output
37+
)
2638

2739

2840
@nox.session(py="3")

‎requirements.txt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
sphinx==2.1.2
1+
sphinx==3.2.0
22
sphinx-autobuild==0.7.1
3+
sphinx-inline-tabs==2020.10.19b4
34
git+https://github.com/python/python-docs-theme.git#egg=python-docs-theme
45
git+https://github.com/pypa/pypa-docs-theme.git#egg=pypa-docs-theme

‎source/conf.py‎

Lines changed: 43 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@
3131
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3232
# ones.
3333
extensions = [
34+
'sphinx.ext.extlinks',
3435
'sphinx.ext.intersphinx',
3536
'sphinx.ext.todo',
37+
'sphinx_inline_tabs',
3638
]
3739

3840
# Add any paths that contain templates here, relative to this directory.
@@ -51,9 +53,19 @@
5153
# The master toctree document.
5254
master_doc = 'index'
5355

56+
# -- Project information -----------------------------------------------------
57+
58+
github_url = 'https://github.com'
59+
github_repo_org = 'pypa'
60+
github_repo_name = 'packaging.python.org'
61+
github_repo_slug = f'{github_repo_org}/{github_repo_name}'
62+
github_repo_url = f'{github_url}/{github_repo_slug}'
63+
github_repo_issues_url = f'{github_url}/{github_repo_slug}/issues'
64+
github_sponsors_url = f'{github_url}/sponsors'
65+
5466
# General information about the project.
5567
project = u'Python Packaging User Guide'
56-
copyright = u'2013–2019, PyPA'
68+
copyright = u'2013–2020, PyPA'
5769
author = 'Python Packaging Authority'
5870

5971
# The version info for the project you're documenting, acts as replacement for
@@ -88,8 +100,8 @@
88100

89101
# The reST default role (used for this markup: `text`) to use for all
90102
# documents.
91-
#
92-
# default_role = None
103+
# Ref: python-attrs/attrs#571
104+
default_role = 'any' # makes single backticks autofind targets
93105

94106
# If true, '()' will be appended to :func: etc. cross-reference text.
95107
#
@@ -132,7 +144,7 @@
132144
'collapsiblesidebar': True,
133145
'externalrefs': True,
134146
'navigation_depth': 2,
135-
'issues_url': 'https://github.com/pypa/python-packaging-user-guide/issues'
147+
'issues_url': github_repo_issues_url,
136148
}
137149

138150
# Add any paths that contain custom themes here, relative to this directory.
@@ -185,8 +197,8 @@
185197

186198
# Custom sidebar templates, filenames relative to this file.
187199
html_sidebars = {
188-
'**': ['localtoc.html', 'relations.html'],
189-
'index': ['localtoc.html']
200+
'**': ['globaltoc.html', 'relations.html'],
201+
'index': ['globaltoc.html']
190202
}
191203

192204
# Additional templates that should be rendered to pages, maps page names to
@@ -350,10 +362,21 @@
350362
#
351363
# texinfo_no_detailmenu = False
352364

365+
# -- Options for extlinks extension ---------------------------------------
366+
extlinks = {
367+
'issue': (f'{github_repo_issues_url}/%s', '#'), # noqa: WPS323
368+
'pr': (f'{github_repo_url}/pull/%s', 'PR #'), # noqa: WPS323
369+
'commit': (f'{github_repo_url}/commit/%s', ''), # noqa: WPS323
370+
'gh': (f'{github_url}/%s', 'GitHub: '), # noqa: WPS323
371+
'user': (f'{github_sponsors_url}/%s', '@'), # noqa: WPS323
372+
}
373+
353374
# Example configuration for intersphinx: refer to the Python standard library.
354375
intersphinx_mapping = {
355-
'python': ('https://docs.python.org/3.6', None),
376+
'python': ('https://docs.python.org/3', None),
377+
'python2': ('https://docs.python.org/2', None),
356378
'pip': ('https://pip.pypa.io/en/latest/', None),
379+
'setuptools': ('https://setuptools.rtfd.io/en/latest/', None),
357380
}
358381

359382

@@ -362,30 +385,16 @@
362385

363386
todo_include_todos = True
364387

365-
# Configure the GitHub PR role to point to our project.
366-
367-
pr_role_github_org_and_project = 'pypa/python-packaging-user-guide'
368-
369-
#
370-
# Custom plugin code below.
371-
#
372-
373-
374-
def setup(app):
375-
app.add_config_value('pr_role_github_org_and_project', None, 'html')
376-
app.add_role('pr', pr_role)
377-
378-
379-
def pr_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
380-
"""Transforms ':pr:`number`'' to a hyperlink to the referenced pull request
381-
on GitHub."""
382-
from docutils import nodes
383-
384-
app = inliner.document.settings.env
385-
project = app.config.pr_role_github_org_and_project
386-
title = '#{}'.format(text)
387-
388-
uri = 'https://github.com/{}/pull/{}'.format(project, text)
389-
rn = nodes.reference(
390-
title, title, internal=False, refuri=uri, classes=['pr'])
391-
return [rn], []
388+
nitpicky = True
389+
390+
# NOTE: consider having a separate ignore file
391+
# Ref: https://stackoverflow.com/a/30624034/595220
392+
nitpick_ignore = [
393+
('envvar', 'PATH'),
394+
('py:func', 'find_packages'),
395+
('py:func', 'pkg_resources.iter_entry_points'),
396+
('py:func', 'setup'),
397+
('py:func', 'setuptools.find_namespace_packages'),
398+
('py:func', 'setuptools.find_packages'),
399+
('py:func', 'setuptools.setup'),
400+
]

‎source/contribute.rst‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@ the guide, please read the :ref:`style guide <contributing_style_guide>`.
2121
.. __: https://github.com/pypa/python-packaging-user-guide/issues
2222
.. __: https://github.com/pypa/python-packaging-user-guide/pulls
2323

24-
By contributing to the |PyPUG|, you're expected to follow the Python Packaging
25-
Authority's `Contributor Code of Conduct`__. Harassment, personal attacks, and
26-
other unprofessional conduct is not acceptable.
24+
By contributing to the |PyPUG|, you're expected to follow the PSF's
25+
`Code of Conduct`__.
2726

28-
.. __: https://www.pypa.io/en/latest/code-of-conduct/
27+
.. __: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md
2928

3029

3130
Documentation types
@@ -64,7 +63,7 @@ Specifications
6463
--------------
6564

6665
Specifications are reference documention focused on comprehensively documenting
67-
an agreed-upon iterface for interoperability between packaging tools.
66+
an agreed-upon interface for interoperability between packaging tools.
6867
:doc:`example specification-style document <specifications/core-metadata>`.
6968

7069

@@ -80,7 +79,7 @@ need:
8079
1. `Nox <https://nox.readthedocs.io/en/latest/>`_. You can install or upgrade
8180
nox using ``pip``::
8281

83-
pip install --user nox
82+
python -m pip install --user nox
8483

8584
2. Python 3.6. Our build scripts are designed to work with Python 3.6 only.
8685
See the `Hitchhiker's Guide to Python installation instructions`_ to install

‎source/discussions/install-requires-vs-requirements.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ packages. [1]_
8383

8484
Whereas ``install_requires`` metadata is automatically analyzed by pip during an
8585
install, requirements files are not, and only are used when a user specifically
86-
installs them using ``pip install -r``.
86+
installs them using ``python -m pip install -r``.
8787

8888
----
8989

‎source/discussions/pip-vs-easy-install.rst‎

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ pip vs easy_install
66
===================
77

88

9-
`easy_install` was released in 2004, as part of :ref:`setuptools`. It was
9+
:ref:`easy_install <easy_install>` was released in 2004, as part of :ref:`setuptools`. It was
1010
notable at the time for installing :term:`packages <Distribution Package>` from
1111
:term:`PyPI <Python Package Index (PyPI)>` using requirement specifiers, and
1212
automatically installing dependencies.
1313

14-
:ref:`pip` came later in 2008, as alternative to `easy_install`, although still
14+
:ref:`pip` came later in 2008, as alternative to :ref:`easy_install <easy_install>`, although still
1515
largely built on top of :ref:`setuptools` components. It was notable at the
1616
time for *not* installing packages as :term:`Eggs <Egg>` or from :term:`Eggs <Egg>` (but
1717
rather simply as 'flat' packages from :term:`sdists <Source Distribution (or
@@ -21,49 +21,49 @@ environments.
2121

2222
Here's a breakdown of the important differences between pip and easy_install now:
2323

24-
+------------------------------+----------------------------------+-------------------------------+
25-
| | **pip** | **easy_install** |
26-
+------------------------------+----------------------------------+-------------------------------+
27-
|Installs from :term:`Wheels |Yes |No |
28-
|<Wheel>` | | |
29-
+------------------------------+----------------------------------+-------------------------------+
30-
|Uninstall Packages |Yes (``pip uninstall``) |No |
31-
+------------------------------+----------------------------------+-------------------------------+
32-
|Dependency Overrides |Yes (:ref:`Requirements Files |No |
33-
| |<pip:Requirements Files>`) | |
34-
+------------------------------+----------------------------------+-------------------------------+
35-
|List Installed Packages |Yes (``pip list`` and ``pip |No |
36-
| |freeze``) | |
37-
+------------------------------+----------------------------------+-------------------------------+
38-
|:pep:`438` |Yes |No |
39-
|Support | | |
40-
+------------------------------+----------------------------------+-------------------------------+
41-
|Installation format |'Flat' packages with `egg-info` | Encapsulated Egg format |
42-
| |metadata. | |
43-
+------------------------------+----------------------------------+-------------------------------+
44-
|sys.path modification |No |Yes |
45-
| | | |
46-
| | | |
47-
+------------------------------+----------------------------------+-------------------------------+
48-
|Installs from :term:`Eggs |No |Yes |
49-
|<Egg>` | | |
50-
+------------------------------+----------------------------------+-------------------------------+
51-
|`pylauncher support`_ |No |Yes [1]_ |
52-
| | | |
53-
+------------------------------+----------------------------------+-------------------------------+
54-
|:ref:`Multi-version Installs` |No |Yes |
55-
| | | |
56-
+------------------------------+----------------------------------+-------------------------------+
57-
|Exclude scripts during install|No |Yes |
58-
| | | |
59-
+------------------------------+----------------------------------+-------------------------------+
60-
|per project index |Only in virtualenv |Yes, via setup.cfg |
61-
| | | |
62-
+------------------------------+----------------------------------+-------------------------------+
24+
+------------------------------+--------------------------------------+-------------------------------+
25+
| | **pip** | **easy_install** |
26+
+------------------------------+--------------------------------------+-------------------------------+
27+
|Installs from :term:`Wheels |Yes |No |
28+
|<Wheel>` | | |
29+
+------------------------------+--------------------------------------+-------------------------------+
30+
|Uninstall Packages |Yes (``python -m pip uninstall``) |No |
31+
+------------------------------+--------------------------------------+-------------------------------+
32+
|Dependency Overrides |Yes (:ref:`Requirements Files |No |
33+
| |<pip:Requirements Files>`) | |
34+
+------------------------------+--------------------------------------+-------------------------------+
35+
|List Installed Packages |Yes (``python -m pip list`` and |No |
36+
| |``python -m pip freeze``) | |
37+
+------------------------------+--------------------------------------+-------------------------------+
38+
|:pep:`438` |Yes |No |
39+
|Support | | |
40+
+------------------------------+--------------------------------------+-------------------------------+
41+
|Installation format |'Flat' packages with :file:`egg-info` | Encapsulated Egg format |
42+
| |metadata. | |
43+
+------------------------------+--------------------------------------+-------------------------------+
44+
|sys.path modification |No |Yes |
45+
| | | |
46+
| | | |
47+
+------------------------------+--------------------------------------+-------------------------------+
48+
|Installs from :term:`Eggs |No |Yes |
49+
|<Egg>` | | |
50+
+------------------------------+--------------------------------------+-------------------------------+
51+
|`pylauncher support`_ |No |Yes [1]_ |
52+
| | | |
53+
+------------------------------+--------------------------------------+-------------------------------+
54+
|:ref:`Multi-version Installs` |No |Yes |
55+
| | | |
56+
+------------------------------+--------------------------------------+-------------------------------+
57+
|Exclude scripts during install|No |Yes |
58+
| | | |
59+
+------------------------------+--------------------------------------+-------------------------------+
60+
|per project index |Only in virtualenv |Yes, via setup.cfg |
61+
| | | |
62+
+------------------------------+--------------------------------------+-------------------------------+
6363

6464
----
6565

6666
.. [1] https://setuptools.readthedocs.io/en/latest/easy_install.html#natural-script-launcher
6767
6868
69-
.. _pylauncher support: https://bitbucket.org/pypa/pylauncher
69+
.. _pylauncher support: https://bitbucket.org/vinay.sajip/pylauncher

0 commit comments

Comments
 (0)