Skip to content

Commit

Permalink
Merge branch 'main' into docs-for-utils-exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
brettcannon committed Aug 5, 2022
2 parents 7d04603 + 213cb95 commit c5a482c
Show file tree
Hide file tree
Showing 31 changed files with 1,669 additions and 1,552 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Expand Up @@ -20,9 +20,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- uses: actions/setup-python@v3
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: "3.9"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Expand Up @@ -22,9 +22,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- uses: actions/setup-python@v3
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: "3.9"
Expand All @@ -43,13 +43,13 @@ jobs:
needs: lint

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Build
run: pipx run build

- name: Archive files
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
13 changes: 4 additions & 9 deletions .github/workflows/test.yml
Expand Up @@ -23,21 +23,16 @@ jobs:
matrix:
os: [Ubuntu, Windows, macOS]
python_version:
["3.7", "3.8", "3.9", "3.10", "pypy-3.7", "pypy-3.8", "pypy-3.9"]
["3.7", "3.8", "3.9", "3.10", "pypy3.7", "pypy3.8", "pypy3.9"]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- uses: actions/setup-python@v3
- uses: actions/setup-python@v4
name: Install Python ${{ matrix.python_version }}
with:
python-version: ${{ matrix.python_version }}
cache: "pip"

- name: Run nox
run: |
# Need to fix-up PyPy. This can be removed once https://github.com/actions/setup-python/issues/346 lands.
INTERPRETER=${{ matrix.python_version }}
INTERPRETER=${INTERPRETER/-/} # remove the first '-' in "pypy-X.Y" -> "pypyX.Y" to match executable name
pipx run nox --error-on-missing-interpreters -s tests-${INTERPRETER}
shell: bash
run: pipx run nox --error-on-missing-interpreters -s tests-${{ matrix.python_version }}
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Expand Up @@ -31,7 +31,7 @@ repos:
hooks:
- id: isort

- repo: https://gitlab.com/PyCQA/flake8
- repo: https://github.com/PyCQA/flake8
rev: "3.9.2"
hooks:
- id: flake8
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.rst
Expand Up @@ -4,7 +4,10 @@ Changelog
*unreleased*
~~~~~~~~~~~~

No unreleased changes.
* ``Marker.evaluate`` will now assume evaluation environment with empty ``extra``.
Evaluating markers like ``"extra == 'xyz'"`` without passing any extra in the
``environment`` will no longer raise an exception.
* Remove dependency on ``pyparsing``, by replacing it with a hand-written parser. This package now has no runtime dependencies (:issue:`468`)

21.3 - 2021-11-17
~~~~~~~~~~~~~~~~~
Expand Down
Empty file removed docs/_static/.empty
Empty file.
109 changes: 33 additions & 76 deletions docs/conf.py
Expand Up @@ -3,14 +3,16 @@
# for complete details.

import os
import sys

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath("."))
# -- Project information loading ----------------------------------------------

ABOUT = {}
_BASE_DIR = os.path.join(os.path.dirname(__file__), os.pardir)
with open(os.path.join(_BASE_DIR, "packaging", "__about__.py")) as f:
exec(f.read(), ABOUT)

# -- General configuration ----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
Expand All @@ -19,93 +21,48 @@
"sphinx.ext.doctest",
"sphinx.ext.extlinks",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# The suffix of source filenames.
source_suffix = ".rst"

# The master toctree document.
master_doc = "index"

# General information about the project.
project = "Packaging"
version = ABOUT["__version__"]
release = ABOUT["__version__"]
copyright = ABOUT["__copyright__"]

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#

base_dir = os.path.join(os.path.dirname(__file__), os.pardir)
about = {}
with open(os.path.join(base_dir, "packaging", "__about__.py")) as f:
exec(f.read(), about)

version = release = about["__version__"]
copyright = about["__copyright__"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ["_build"]

extlinks = {
"issue": ("https://github.com/pypa/packaging/issues/%s", "#"),
"pull": ("https://github.com/pypa/packaging/pull/%s", "PR #"),
}
# -- Options for HTML output --------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.

html_theme = "furo"
html_title = "packaging"
html_title = project

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
# -- Options for autodoc ----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#configuration

# Output file base name for HTML help builder.
htmlhelp_basename = "packagingdoc"
autodoc_member_order = "bysource"
autodoc_preserve_defaults = True

# Automatically extract typehints when specified and place them in
# descriptions of the relevant function/method.
autodoc_typehints = "description"

# -- Options for LaTeX output -------------------------------------------------
# Don't show class signature with the class' name.
autodoc_class_signature = "separated"

latex_elements = {}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual])
latex_documents = [
("index", "packaging.tex", "Packaging Documentation", "Donald Stufft", "manual")
]
# -- Options for extlinks -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html#configuration

# -- Options for manual page output -------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [("index", "packaging", "Packaging Documentation", ["Donald Stufft"], 1)]

# -- Options for Texinfo output -----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(
"index",
"packaging",
"Packaging Documentation",
"Donald Stufft",
"packaging",
"Core utilities for Python packages",
"Miscellaneous",
)
]
extlinks = {
"issue": ("https://github.com/pypa/packaging/issues/%s", "#%s"),
"pull": ("https://github.com/pypa/packaging/pull/%s", "PR #%s"),
}

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {"https://docs.python.org/": None}
# -- Options for intersphinx ----------------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#configuration

epub_theme = "epub"
intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"pypug": ("https://packaging.python.org/", None),
}
1 change: 1 addition & 0 deletions docs/index.rst
Expand Up @@ -26,6 +26,7 @@ You can install packaging with ``pip``:
markers
requirements
tags
metadata
utils

.. toctree::
Expand Down
11 changes: 0 additions & 11 deletions docs/markers.rst
Expand Up @@ -34,17 +34,6 @@ Usage
>>> # Markers can be also used with extras, to pull in dependencies if
>>> # a certain extra is being installed
>>> extra = Marker('extra == "bar"')
>>> # Evaluating an extra marker with no environment is an error
>>> try:
... extra.evaluate()
... except UndefinedEnvironmentName:
... pass
>>> extra_environment = {'extra': ''}
>>> extra.evaluate(environment=extra_environment)
False
>>> extra_environment['extra'] = 'bar'
>>> extra.evaluate(environment=extra_environment)
True
>>> # You can do simple comparisons between marker objects:
>>> Marker("python_version > '3.6'") == Marker("python_version > '3.6'")
True
Expand Down
14 changes: 14 additions & 0 deletions docs/metadata.rst
@@ -0,0 +1,14 @@
Metadata
==========

A data representation for `core metadata`_.

.. _`core metadata`: https://packaging.python.org/en/latest/specifications/core-metadata/


Reference
---------

.. automodule:: packaging.metadata
:members:
:undoc-members:

0 comments on commit c5a482c

Please sign in to comment.