Skip to content

Commit 219530d

Browse files
authored
Merge pull request #293 from bskinn/release-2.3.2
Release v2.3.1.1
2 parents 7367f7b + 385e484 commit 219530d

Some content is hidden

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

54 files changed

+435
-489
lines changed

.github/workflows/ci_tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ on: push
44

55
jobs:
66
all_checks:
7-
name: Run all tests, lints, etc. (Python 3.10)
7+
name: Run all tests, lints, etc. (Python 3.11)
88
runs-on: ubuntu-latest
99
if: "!contains(github.event.head_commit.message, '[skip ci]')"
1010

1111
steps:
1212
- name: Check out repo
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414

1515
- name: Install Python
16-
uses: actions/setup-python@v4
16+
uses: actions/setup-python@v5
1717
with:
18-
python-version: '3.10'
18+
python-version: '3.11'
1919
cache: 'pip'
2020
cache-dependency-path: |
2121
requirements-ci.txt
@@ -63,15 +63,15 @@ jobs:
6363
runs-on: ubuntu-latest
6464
strategy:
6565
matrix:
66-
python: ['3.7', '3.8', '3.9', '3.11']
66+
python: ['3.8', '3.9', '3.10', '3.12']
6767
if: "!contains(github.event.head_commit.message, '[skip ci]')"
6868

6969
steps:
7070
- name: Check out repo
71-
uses: actions/checkout@v3
71+
uses: actions/checkout@v4
7272

7373
- name: Install Python
74-
uses: actions/setup-python@v4
74+
uses: actions/setup-python@v5
7575
with:
7676
python-version: ${{ matrix.python }}
7777
cache: 'pip'

CHANGELOG.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,32 @@
33
All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6-
and this project strives to adhere to
7-
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6+
and this project follows an extension of
7+
[Semantic Versioning](http://semver.org/spec/v2.0.0.html), where a bump in a
8+
fourth number represents an administrative maintenance release with no code
9+
changes.
10+
11+
### [2.3.1.1] - 2024-05-21
12+
13+
#### Tests
14+
15+
* Update test machinery for the shell examples in the README, downstream of
16+
the conversion to Markdown ([#289]).
17+
18+
#### Administrative
19+
20+
* Added formal support for Python 3.12.
21+
22+
* Removed formal support for Python 3.7, which is end-of-life.
23+
24+
* Bump `checkout` and `setup-python` GitHub Actions versions ([#289]).
25+
26+
* Convert README from reST to Markdown ([#289], fixes [#287]).
27+
28+
* Fix some broken/redirecting docs links ([#289]).
29+
30+
* Adjust `flake8` configuration to account for some new lint warnings/errors
31+
([#289]).
832

933

1034
### [2.3.1] - 2022-11-29
@@ -534,3 +558,7 @@ and this project strives to adhere to
534558
* Programmatic conversion via API is available, but
535559
potentially buggy due to poor segregation of cmdline
536560
behaviors. This is to be fixed.
561+
562+
563+
[#287]: https://github.com/bskinn/sphobjinv/issues/287
564+
[#289]: https://github.com/bskinn/sphobjinv/pull/289

CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Thanks for your interest in contributing to `sphobjinv`!
55
The aim of this document is to provide the information you need
66
to get started smoothly on a contribution.
77

8-
If you have any questions, please drop me a line on Twitter
9-
([@btskinn](https://twitter.com/btskinn)) or open an
8+
If you have any questions, please drop me a line on Mastodon
9+
([@btskinn@fosstodon.org](https://fosstodon.org/@btskinn)) or open an
1010
[issue](https://github.com/bskinn/sphobjinv/issues).
1111

1212

@@ -38,12 +38,12 @@ $ git clone https://github.com/{you}/sphobjinv
3838
```
3939

4040
Then, create a virtual environment for the project, in whatever location you
41-
prefer. Any Python interpreter 3.7+ *should* work fine.
41+
prefer. Any Python interpreter 3.8+ *should* work fine.
4242

4343
I prefer to use `virtualenv` and create in `./env`:
4444

4545
```
46-
$ python3.10 -m virtualenv env --prompt="sphobjinv"
46+
$ python3.11 -m virtualenv env --prompt="sphobjinv"
4747
```
4848

4949
Activate the environment:
@@ -153,8 +153,8 @@ Note that while [`tox`](https://tox.wiki/en/latest/) *is* configured for the
153153
project, it is **not** set up to be an everyday test runner. Instead, it's used
154154
to execute an extensive matrix of test environments checking for the
155155
compatibility of different Python and dependency versions. You can run it if you
156-
want, but you'll need working versions of all of Python 3.7 through 3.11
157-
installed and on `PATH` as `python3.7`, `python3.8`, etc. The nonlocal test
156+
want, but you'll need working versions of all of Python 3.8 through 3.12
157+
installed and on `PATH` as `python3.8`, `python3.9`, etc. The nonlocal test
158158
suite is run for each `tox` environment, so it's best to use at most two
159159
parallel sub-processes to avoid oversaturating your network bandwidth; e.g.:
160160

@@ -250,7 +250,7 @@ with `make linkcheck`.
250250
Both Github Actions and Azure Pipelines are set up for the project, and should
251251
run on any forks of the repository.
252252

253-
Github Actions runs the test suite on Linux for Python 3.7 through 3.11, as well
253+
Github Actions runs the test suite on Linux for Python 3.8 through 3.12, as well
254254
as the `flake8` lints and the Sphinx doctests and link-validity testing, and is
255255
configured to run on all commits. The workflow can be skipped per-commit by
256256
including `[skip ci]` in the commit message.

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016-2022 Brian Skinn and community contributors
3+
Copyright (c) 2016-2024 Brian Skinn and community contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of
66
this software and associated documentation files (the "Software"), to deal in

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
include AUTHORS.md CHANGELOG.md CONTRIBUTING.md LICENSE.txt pyproject.toml
2-
include README.rst requirements-dev.txt requirements-flake8.txt tox.ini
2+
include README.md requirements-dev.txt requirements-flake8.txt tox.ini
33

44
graft src/sphobjinv/_vendored/fuzzywuzzy
55

README.md

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
## sphobjinv: Manipulate and inspect Sphinx objects.inv files
2+
3+
4+
#### Current Development Version
5+
6+
[![GitHub Workflow Status][workflow badge]][workflow link target]
7+
[![Codecov Coverage][codecov badge]][codecov target]
8+
9+
#### Most Recent Stable Release
10+
11+
[![PyPI Version][pypi badge]][pypi link target]
12+
![Python Versions][python versions badge]
13+
14+
#### Info
15+
16+
[![ReadTheDocs status][readthedocs badge]][readthedocs link target]
17+
[![gitter chat][gitter badge]][gitter link target]
18+
19+
[![MIT License][license badge]][license link target]
20+
[![black formatted][black badge]][black link target]
21+
[![PePY stats][pepy badge]][pepy link target]
22+
23+
----
24+
25+
### Using Sphinx?
26+
27+
#### Having trouble writing cross-references?
28+
29+
`sphobjinv` (short for '**sph**inx **obj**ects.**inv**') can help!
30+
31+
The syntax required for a functional Sphinx cross-reference is highly
32+
non-obvious in many cases. Sometimes Sphinx can guess correctly what
33+
you mean, but it's pretty hit-or-miss. The best approach is to provide
34+
Sphinx with a completely specified cross-reference, and that's where
35+
`sphobjinv` comes in.
36+
37+
After a `pip install sphobjinv` (or `pipx install sphobjinv`), find the
38+
documentation set you want to cross-reference into, and pass it to
39+
`sphobjinv suggest`.
40+
41+
For internal cross-references, locate `objects.inv` within `build/html`:
42+
43+
```none
44+
$ sphobjinv suggest doc/build/html/objects.inv as_rst -st 58
45+
46+
------------------------------------------------
47+
48+
Cannot infer intersphinx_mapping from a local objects.inv.
49+
50+
------------------------------------------------
51+
52+
Project: sphobjinv
53+
Version: 2.3
54+
55+
220 objects in inventory.
56+
57+
------------------------------------------------
58+
59+
11 results found at/above current threshold of 58.
60+
61+
62+
Name Score
63+
--------------------------------------------------- -------
64+
:py:property:`sphobjinv.data.SuperDataObj.as_rst` 60
65+
:py:class:`sphobjinv.cli.parser.PrsConst` 59
66+
:py:class:`sphobjinv.data.DataFields` 59
67+
:py:class:`sphobjinv.data.DataObjBytes` 59
68+
:py:class:`sphobjinv.data.DataObjStr` 59
69+
:py:class:`sphobjinv.data.SuperDataObj` 59
70+
:py:class:`sphobjinv.enum.HeaderFields` 59
71+
:py:class:`sphobjinv.enum.SourceTypes` 59
72+
:py:function:`sphobjinv.fileops.writebytes` 59
73+
:py:function:`sphobjinv.fileops.writejson` 59
74+
:py:class:`sphobjinv.inventory.Inventory` 59
75+
```
76+
77+
The `-s` argument in the above shell command indicates to print the
78+
`fuzzywuzzy` match score along with each search result, and `-t 50`
79+
changes the reporting threshold for the match score.
80+
81+
For external references, find the API documentation wherever it lives on
82+
the web, and pass `sphobjinv suggest` a URL from within the documentation set
83+
with the `--url/-u` flag. For example, say I need to know how to
84+
cross-reference the `linspace` function from numpy (see
85+
[here][numpy linspace]):
86+
87+
```none
88+
$ sphobjinv suggest https://numpy.org/doc/1.26/reference/index.html linspace -su
89+
90+
Attempting https://numpy.org/doc/1.26/reference/index.html ...
91+
... no recognized inventory.
92+
Attempting "https://numpy.org/doc/1.26/reference/index.html/objects.inv" ...
93+
... HTTP error: 404 Not Found.
94+
Attempting "https://numpy.org/doc/1.26/reference/objects.inv" ...
95+
... HTTP error: 404 Not Found.
96+
Attempting "https://numpy.org/doc/1.26/objects.inv" ...
97+
... inventory found.
98+
99+
----------------------------------------------------------------------------------
100+
101+
The intersphinx_mapping for this docset is LIKELY:
102+
103+
(https://numpy.org/doc/1.26/, None)
104+
105+
----------------------------------------------------------------------------------
106+
107+
Project: NumPy
108+
Version: 1.26
109+
110+
8152 objects in inventory.
111+
112+
----------------------------------------------------------------------------------
113+
114+
8 results found at/above current threshold of 75.
115+
116+
Name Score
117+
-------------------------------------------------------------- -------
118+
:py:function:`numpy.linspace` 90
119+
:py:method:`numpy.polynomial.chebyshev.Chebyshev.linspace` 90
120+
:py:method:`numpy.polynomial.hermite.Hermite.linspace` 90
121+
:py:method:`numpy.polynomial.hermite_e.HermiteE.linspace` 90
122+
:py:method:`numpy.polynomial.laguerre.Laguerre.linspace` 90
123+
:py:method:`numpy.polynomial.legendre.Legendre.linspace` 90
124+
:py:method:`numpy.polynomial.polynomial.Polynomial.linspace` 90
125+
:std:doc:`reference/generated/numpy.linspace` 90
126+
```
127+
128+
**NOTE** that the results from `sphobjinv suggest` are printed using the
129+
longer *block directives*, whereas cross-references must be composed using the
130+
*inline directives*. Thus, the above `linspace()` function must be
131+
cross-referenced as ``` :func:`numpy.linspace` ``` , **not**
132+
``` :function:`numpy.linspace` ```.
133+
134+
**Need to edit an inventory after it's created, or compose one from scratch?**
135+
136+
`sphobjinv` can help with that, too.
137+
138+
`objects.inv` files can be decompressed to plaintext at the commandline:
139+
140+
```none
141+
$ sphobjinv convert plain -o doc/build/html/objects.inv doc/scratch/
142+
Conversion completed.
143+
'...objects.inv' converted to '...objects.txt' (plain).
144+
```
145+
146+
JSON output is supported (`sphobjinv convert json ...`), and
147+
inventories can be re-compressed to the
148+
partially-zlib-compressed form that `intersphinx` reads
149+
(`sphobjinv convert zlib ...`).
150+
151+
Alternatively, `sphobjinv` exposes an API to enable automation of
152+
inventory creation/modification:
153+
154+
```python
155+
>>> import sphobjinv as soi
156+
>>> inv = soi.Inventory('doc/build/html/objects.inv')
157+
>>> print(inv)
158+
<Inventory (fname_zlib): sphobjinv v2.3, 220 objects>
159+
>>> inv.project
160+
'sphobjinv'
161+
>>> inv.version
162+
'2.3'
163+
>>> inv.objects[0]
164+
DataObjStr(name='sphobjinv.cli.convert', domain='py', role='module', priority='0', uri='cli/implementation/convert.html#module-$', dispname='-')
165+
166+
```
167+
168+
The API also enables straightforward re-export of an inventory, for subsequent
169+
use with `intersphinx` cross-references. See [the docs][soi docs inv export] for
170+
more details.
171+
172+
----
173+
174+
Full documentation is hosted at [Read The Docs][readthedocs link target].
175+
176+
Available on [PyPI][pypi link target] (`pip install sphobjinv`).
177+
178+
Source on [GitHub][github repo]. Bug reports and feature requests are welcomed
179+
at the [Issues][github issue tracker] page there.
180+
181+
Copyright (c) Brian Skinn 2016-2024
182+
183+
The `sphobjinv` documentation (including docstrings and README) is licensed
184+
under a [Creative Commons Attribution 4.0 International License][cc-by 4.0]
185+
(CC-BY). The `sphobjinv` codebase is released under the [MIT License]. See
186+
[`LICENSE.txt`][license link target] for full license terms.
187+
188+
189+
[black badge]: https://img.shields.io/badge/code%20style-black-000000.svg
190+
[black link target]: https://github.com/psf/black
191+
[cc-by 4.0]: http://creativecommons.org/licenses/by/4.0/
192+
[codecov badge]: https://codecov.io/gh/bskinn/sphobjinv/branch/main/graph/badge.svg
193+
[codecov target]: https://codecov.io/gh/bskinn/sphobjinv
194+
[soi docs inv export]: http://sphobjinv.readthedocs.io/en/latest/api_usage.html#exporting-an-inventory
195+
[github issue tracker]: https://github.com/bskinn/sphobjinv/issues
196+
[github repo]: https://github.com/bskinn/sphobjinv
197+
[gitter badge]: https://badges.gitter.im/sphobjinv/community.svg
198+
[gitter link target]: https://gitter.im/sphobjinv/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
199+
[license badge]: https://img.shields.io/github/license/mashape/apistatus.svg
200+
[license link target]: https://github.com/bskinn/sphobjinv/blob/stable/LICENSE.txt
201+
[mit license]: https://opensource.org/licenses/MIT
202+
[numpy linspace]: https://numpy.org/doc/1.26/reference/generated/numpy.linspace.html
203+
[pepy badge]: https://pepy.tech/badge/sphobjinv/month
204+
[pepy link target]: https://pepy.tech/project/sphobjinv?versions=2.0.1&versions=2.1&versions=2.2.2&versions=2.3&versions=2.3.1
205+
[pypi badge]: https://img.shields.io/pypi/v/sphobjinv.svg?logo=pypi]
206+
[pypi link target]: https://pypi.org/project/sphobjinv
207+
[python versions badge]: https://img.shields.io/pypi/pyversions/sphobjinv.svg?logo=python
208+
[readthedocs badge]: https://img.shields.io/readthedocs/sphobjinv/latest.svg
209+
[readthedocs link target]: http://sphobjinv.readthedocs.io/en/latest/
210+
[workflow badge]: https://img.shields.io/github/actions/workflow/status/bskinn/sphobjinv/ci_tests.yml?logo=github&branch=main
211+
[workflow link target]: https://github.com/bskinn/sphobjinv/actions

0 commit comments

Comments
 (0)