Skip to content

Commit fef60ef

Browse files
authored
BREAK: deprecate sphinxcontrib-hep-pdgref package (#32)
* BREAK: add package name deprecation warning * DOC: add warning about package deprecation * MAINT: ignore deprecation warnings * MAINT: ignore `pkg_resources` deprecation warnings in `pytest`
1 parent 24c4d98 commit fef60ef

File tree

4 files changed

+15
-84
lines changed

4 files changed

+15
-84
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ repos:
4343
- repo: https://github.com/ComPWA/repo-maintenance
4444
rev: 0.0.192
4545
hooks:
46-
- id: check-dev-files
47-
args:
48-
- --repo-name=sphinxcontrib-hep-pdgref
49-
- --repo-title=sphinxcontrib.hep.pdgref
5046
- id: format-setup-cfg
5147

5248
- repo: https://github.com/psf/black
@@ -75,11 +71,6 @@ repos:
7571
.*\.py
7672
)$
7773
78-
- repo: https://github.com/igorshubovych/markdownlint-cli
79-
rev: v0.35.0
80-
hooks:
81-
- id: markdownlint
82-
8374
- repo: local
8475
hooks:
8576
- id: mypy

README.md

Lines changed: 1 addition & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,3 @@
11
# PDG role for Sphinx
22

3-
[![PyPI package](https://badge.fury.io/py/sphinxcontrib-hep-pdgref.svg)](https://pypi.org/project/sphinxcontrib-hep-pdgref)
4-
[![Supported Python versions](https://img.shields.io/pypi/pyversions/sphinxcontrib-hep-pdgref)](https://pypi.org/project/sphinxcontrib-hep-pdgref)
5-
[![BSD 3-Clause license](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
6-
[![Open in Visual Studio Code](https://img.shields.io/badge/vscode-open-blue?logo=visualstudiocode)](https://open.vscode.dev/ComPWA/sphinxcontrib-hep-pdgref)
7-
[![GitPod](https://img.shields.io/badge/gitpod-open-blue?logo=gitpod)](https://gitpod.io/#https://github.com/ComPWA/sphinxcontrib-hep-pdgref)
8-
[![Test coverage](https://codecov.io/gh/ComPWA/sphinxcontrib-hep-pdgref/branch/main/graph/badge.svg?token=SS8ZB8J11N)](https://codecov.io/gh/ComPWA/sphinxcontrib-hep-pdgref)
9-
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/dbe042deb2914f6098eb98586d3983fe)](https://www.codacy.com/gh/ComPWA/sphinxcontrib-hep-pdgref)
10-
[![CI status](https://github.com/ComPWA/sphinxcontrib-hep-pdgref/workflows/CI-tests/badge.svg)](https://github.com/ComPWA/sphinxcontrib-hep-pdgref/actions?query=branch%3Amain+workflow%3ACI-tests)
11-
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy.readthedocs.io)
12-
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/ComPWA/sphinxcontrib-hep-pdgref/main.svg)](https://results.pre-commit.ci/latest/github/ComPWA/sphinxcontrib-hep-pdgref/main)
13-
[![Spelling checked](https://img.shields.io/badge/cspell-checked-brightgreen.svg)](https://github.com/streetsidesoftware/cspell/tree/master/packages/cspell)
14-
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
15-
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
16-
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
17-
18-
This package is a
19-
[Sphinx extension](https://www.sphinx-doc.org/en/master/usage/extensions/index.html)
20-
that makes it easy to refer to PDF files of reviews and particle listings in the PDG.
21-
22-
## Installation
23-
24-
Just install through [PyPI](https://pypi.org) with `pip`:
25-
26-
```bash
27-
pip install sphinxcontrib-hep-pdgref
28-
```
29-
30-
Next, in your
31-
[Sphinx configuration file](https://www.sphinx-doc.org/en/master/usage/configuration.html)
32-
(`conf.py`), add `"sphinxcontrib.hep.pdgref"` to your `extensions`:
33-
34-
```python
35-
extensions = [
36-
# ...
37-
"sphinxcontrib.hep.pdgref",
38-
# ...
39-
]
40-
```
41-
42-
## Usage
43-
44-
There are two roles, one for the
45-
[particle listings](https://pdg.lbl.gov/2020/listings/contents_listings.html) and one
46-
for the [review](https://pdg.lbl.gov/2020/reviews/contents_sports.html). These roles can
47-
be used as follows:
48-
49-
```restructuredtext
50-
:pdg-listing:`K-zero`
51-
52-
:pdg-review:`Kinematics`
53-
54-
:pdg-review:`2014; Resonances`
55-
56-
:pdg-review:`Resonances; 2018; pp. 2-4, 7`
57-
58-
:pdg-review:`QCD; p5`
59-
60-
:pdg-review:`PDG2015; Quark Model; p.2`
61-
```
62-
63-
which will render in the HTML pages as:
64-
65-
> [PDG2020](https://pdg.lbl.gov/2020/listings/rpp2020-list-K-zero.pdf)
66-
>
67-
> [PDG2020, §Kinematics](https://pdg.lbl.gov/2020/reviews/rpp2020-rev-kinematics.pdf)
68-
>
69-
> [PDG2014, §Resonances](https://pdg.lbl.gov/2014/reviews/rpp2014-rev-resonances.pdf)
70-
>
71-
> [PDG2018, §Resonances, pp.2-4,7](https://pdg.lbl.gov/2018/reviews/rpp2018-rev-resonances.pdf#page=2)
72-
>
73-
> [PDG2020, §QCD, p.5](https://pdg.lbl.gov/2020/reviews/rpp2020-rev-qcd.pdf#page=5)
74-
>
75-
> [PDG2015, §Quark Model, p.2](https://pdg.lbl.gov/2015/reviews/rpp2015-rev-qcd.pdf#page=2)
76-
77-
_Note that the resulting links lead to the correct page as well!_
3+
_This package has been renamed to **[`sphinx-hep-pdgref`](https://pypi.org/project/sphinx-hep-pdgref)**! Please use that package instead._

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ addopts = """
9696
filterwarnings = [
9797
"error",
9898
"ignore:'imghdr' is deprecated and slated for removal in Python 3.13:DeprecationWarning",
99+
"ignore:.*:PendingDeprecationWarning",
100+
"ignore:.*pkg_resources.*:DeprecationWarning",
99101
"ignore:The distutils package is deprecated.*:DeprecationWarning",
102+
"ignore:The sphinxcontrib.hep.pdgref package is deprecated.*:DeprecationWarning",
100103
]
101104
markers = ["slow: marks tests as slow (deselect with '-m \"not slow\"')"]
102105
testpaths = [

src/sphinxcontrib/hep/pdgref/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
"""Link to PDG reviews and listings in Sphinx documentation."""
22

33
from typing import Any, Dict
4+
from warnings import warn
45

56
from sphinx.application import Sphinx
67

78
from .role import URLPattern, pdgref
89

10+
warn(
11+
(
12+
"The sphinxcontrib.hep.pdgref package is deprecated. Please install the"
13+
" [sphinx-hep-pdgref](https://pypi.org/project/sphinx-hep-pdgref) package and"
14+
" import `sphinx_hep_pdg` instead."
15+
),
16+
category=DeprecationWarning,
17+
stacklevel=2,
18+
)
19+
920

1021
def setup(app: Sphinx) -> Dict[str, Any]:
1122
app.add_role("pdg-listing", role=pdgref(pattern=URLPattern.LISTING))

0 commit comments

Comments
 (0)