Skip to content

Commit f699541

Browse files
authored
Merge pull request #221 from bskinn/release-2.2
Merge v2.2 release to stable
2 parents d62beb4 + 9872c1a commit f699541

Some content is hidden

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

62 files changed

+1059
-280
lines changed

.coveragerc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
[run]
2-
omit =
3-
# Don't do coverage on test code
4-
sphobjinv/test/*
5-
tests.py
2+
source =
3+
src
64

7-
# Don't cover code in the env (Termux only?)
8-
env/*
5+
omit =
6+
# Don't worry about covering vendored libraries
7+
src/sphobjinv/_vendored/*
98

109
[report]
1110
exclude_lines =
1211
pragma: no cover
1312
^\s*pass\s*$
13+
14+
show_missing = True

.github/workflows/ci_tests.yml

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

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

@@ -15,7 +15,7 @@ jobs:
1515
- name: Install Python
1616
uses: actions/setup-python@v2
1717
with:
18-
python-version: 3.9
18+
python-version: '3.10'
1919

2020
- name: Update pip & setuptools
2121
run: python -m pip install -U pip setuptools
@@ -32,9 +32,9 @@ jobs:
3232
make html
3333
mkdir scratch
3434
35-
- name: Run tests
35+
- name: Run tests & report source coverage
3636
run: |
37-
pytest --cov=src --testall --nonloc
37+
pytest --cov --testall --nonloc
3838
tox -e sdist_install
3939
4040
- name: Run doctests
@@ -59,7 +59,7 @@ jobs:
5959
runs-on: ubuntu-latest
6060
strategy:
6161
matrix:
62-
python: ['3.6', '3.7', '3.8']
62+
python: ['3.6', '3.7', '3.8', '3.9']
6363
if: "!contains(github.event.head_commit.message, '[skip ci]')"
6464

6565
steps:
@@ -86,8 +86,7 @@ jobs:
8686
make html
8787
mkdir scratch
8888
89-
- name: Run tests
89+
- name: Run tests & report source coverage
9090
run: |
91-
pytest --cov=src --testall --nonloc
91+
pytest --cov --testall --nonloc
9292
tox -e sdist_install
93-

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: 'v3.2.0'
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- repo: https://github.com/psf/black
12+
rev: '22.1.0'
13+
hooks:
14+
- id: black

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ formats: all
1414

1515
# Python and requirements
1616
python:
17-
version: 3.8
17+
version: '3.8'
1818
install:
1919
- requirements: requirements-rtd.txt
2020
- method: pip

AUTHORS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ hadn't yet been documented (that happened in [2018](https://github.com/sphinx-do
1111
and a fair bit of searching didn't turn up anything promising.
1212

1313
Once I dug into the Sphinx code to figure out how to zlib-decompress the object data, it was relatively straightforward
14-
to put together the initial v1.0 of `sphobjinv`, which could only (de)compress objects.inv files to/from plaintext.
14+
to put together the initial v1.0 of `sphobjinv`, which could only (de)compress `objects.inv` files to/from plaintext.
1515
As I started to use it regularly in my own documentation work, it became clear that there would be significant advantages
1616
from also implementing functionality to assist with object searches, especially in large documentation sets.
1717
Also, it seemed likely that a robust API for creation/manipulation of inventory contents would be useful, in order to
18-
assist with things like scraping a non-Sphinx website to generate an objects.inv for cross-referencing in other docs.
18+
assist with things like scraping a non-Sphinx website to generate an `objects.inv` for cross-referencing in other docs.
1919
This led to the current object-oriented API of `sphobjinv` v2.x.
2020

2121
While there are [numerous](https://github.com/bskinn/sphobjinv/issues) possible enhancements to the project,
2222
I'm quite satisfied with its ease of use and usefulness, at least for my purposes, and thus consider it fully stable.
23-
I'm always glad to receive feature requests and (especially) bug reports, though.
23+
I'm always glad to receive feature requests and bug reports, though.

CHANGELOG.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,51 @@ and this project strives to adhere to
77
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).
88

99

10+
### [2.2] - 2022-01-30
11+
12+
#### Administrative
13+
14+
* The project documentation has been updated to reflect the deprecation
15+
of the `python-Levenshtein` speedup.
16+
17+
* `pre-commit` has been added to the project, primarily to automate
18+
`black` code formatting on every commit.
19+
20+
* The default trailing-whitespace, end-of-file, YAML syntax, and
21+
large-file-prevention hooks have also been added.
22+
23+
#### Internal
24+
25+
* `sphinx-removed-in` was added as a dev and RTD dependency, to provide
26+
the `versionremoved` Sphinx directive.
27+
28+
29+
### [2.2b1] - 2021-12-23
30+
31+
#### Removed
32+
33+
* Acceleration of the `suggest` functionality via use of `python-Levenshtein`
34+
is no longer possible due to the vendoring of an early, MIT-licensed version
35+
of `fuzzywuzzy`, as noted below. The `speedup` install extra is now obsolete,
36+
and has been removed.
37+
38+
#### Internal
39+
40+
* The `fuzzywuzzy` string matcher was vendored into the project from a point
41+
in its development history before the `python-Levenshtein` dependency,
42+
and its corresponding GPL encumbrance, was introduced.
43+
44+
#### Administrative
45+
46+
* Project default branch migrated to `main` from `master`.
47+
48+
* Standard development Python version bumped to 3.10.
49+
50+
* Standard development Sphinx version bumped to 4.3.1.
51+
52+
* Active support for Python 3.11 added.
53+
54+
1055
### [2.1] - 2021-04-14
1156

1257
#### Added
@@ -246,4 +291,3 @@ and this project strives to adhere to
246291
* Programmatic conversion via API is available, but
247292
potentially buggy due to poor segregation of cmdline
248293
behaviors. This is to be fixed.
249-

CONTRIBUTING.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ in whatever location you prefer. Any Python interpreter 3.6+ *should* work fine.
4343
I prefer to use `virtualenv` and create in `./env`:
4444

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

4949
Activate the environment:
@@ -63,6 +63,12 @@ The next step is to upgrade/install the development requirements:
6363
(sphobjinv) $ pip install -r requirements-dev.txt
6464
```
6565

66+
Then, install the pre-commit hooks:
67+
68+
```
69+
(sphobjinv) $ pre-commit install
70+
```
71+
6672
Finally, you'll need to build the Sphinx docs,
6773
as some of the tests interact with them:
6874

@@ -84,21 +90,21 @@ $ git checkout -b description-of-change
8490
```
8591

8692
This makes it a lot simpler to get your repo fork up to date
87-
after `master` receives further commits.
93+
after `main` receives further commits.
8894

89-
To bring your fork's `master` up to date, you first need to
95+
To bring your fork's `main` up to date, you first need to
9096
add the main repo as a new git remote (one-time task):
9197

9298
```
9399
$ git remote add upstream https://github.com/bskinn/sphobjinv
94100
```
95101

96-
Then, any time you need to refresh the fork's master:
102+
Then, any time you need to refresh the fork's `main`:
97103

98104
```
99105
$ git fetch --all
100-
$ git checkout master
101-
$ git merge upstream/master # (should merge without incident)
106+
$ git checkout main
107+
$ git merge upstream/main # (should merge without incident)
102108
$ git push # (should push to your fork without incident)
103109
```
104110

@@ -128,6 +134,9 @@ please go beyond this and add tests that check potential edge cases,
128134
bad/malformed/invalid inputs, etc. For bugfixes, add one or more
129135
focused regression tests that cover the bug behavior being fixed.
130136

137+
PRs that add [xfail tests for existing bugs](https://blog.ganssle.io/articles/2021/11/pytest-xfail.html)
138+
are also welcomed.
139+
131140
There are some situations where it may make sense to use a
132141
`# pragma: no cover` to ignore coverage on certain line(s) of code.
133142
Please start a discussion in the issue or PR comments before
@@ -138,7 +147,7 @@ configured for the project, it is **not** set up to be an everyday test runner.
138147
Instead, it's used to execute a matrix of test environments
139148
checking for the compatibility of different Python and dependency
140149
versions. You can run it if you want, but you'll need
141-
working versions of all of Python 3.6 through 3.10
150+
working versions of all of Python 3.6 through 3.11
142151
installed and on `PATH` as `python3.6`, `python3.7`, etc.
143152
The nonlocal test suite is run for each `tox` environment, so
144153
it's best to use at most two parallel sub-processes to avoid oversaturating
@@ -159,7 +168,7 @@ To run the lints locally, it's easiest to use `tox`:
159168
$ tox -e flake8
160169
```
161170

162-
In some limited circumstances, it may be necessary to add
171+
In some limited circumstances, it may be necessary to add
163172
[`# noqa`](https://flake8.pycqa.org/en/stable/user/violations.html#in-line-ignoring-errors)
164173
or [`per_file_ignores`](https://flake8.pycqa.org/en/stable/user/options.html#cmdoption-flake8-per-file-ignores)
165174
exclusions to the `flake8` lints.
@@ -239,20 +248,20 @@ and the link validity checker with `make linkcheck`.
239248
Both Github Actions and Azure Pipelines are set up for the project,
240249
and should run on any forks of the repository.
241250

242-
Github Actions runs the test suite on Linux for Python 3.6 through 3.9,
251+
Github Actions runs the test suite on Linux for Python 3.6 through 3.10,
243252
as well as the `flake8` lints and the Sphinx doctests and link-validity testing,
244253
and is configured to run on all commits. The workflow can be skipped
245254
per-commit by including `[skip ci]` in the commit message.
246255

247256
The Azure Pipelines CI runs an extensive matrix of cross-platform and
248257
cross-Python-version tests, as well as numerous other checks.
249258
Due to its length, it is configured to run only on release branches
250-
and PRs to `master` or `stable`. It cannot be skipped.
259+
and PRs to `main` or `stable`. It cannot be skipped.
251260

252261

253262
## CHANGELOG
254263

255-
The project [`CHANGELOG`](https://github.com/bskinn/sphobjinv/blob/master/CHANGELOG.md)
264+
The project [`CHANGELOG`](https://github.com/bskinn/sphobjinv/blob/main/CHANGELOG.md)
256265
should be updated for the majority of contributions. No tooling is in place
257266
(e.g., [`towncrier`](https://github.com/twisted/towncrier)) for automated collation
258267
of news items into `CHANGELOG`;
@@ -278,4 +287,3 @@ you want to create, though, then don't use them.
278287
## License
279288

280289
All contributions will take on the MIT License of the project at large.
281-

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-2021 Brian Skinn
3+
Copyright (c) 2016-2022 Brian Skinn
44

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

README.rst

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sphobjinv: Manipulate and inspect Sphinx objects.inv files
77
:alt: GitHub Workflow Status
88
:target: https://github.com/bskinn/sphobjinv/actions
99

10-
.. image:: https://codecov.io/gh/bskinn/sphobjinv/branch/master/graph/badge.svg
10+
.. image:: https://codecov.io/gh/bskinn/sphobjinv/branch/main/graph/badge.svg
1111
:target: https://codecov.io/gh/bskinn/sphobjinv
1212

1313
**Most Recent Stable Release:**
@@ -22,12 +22,19 @@ sphobjinv: Manipulate and inspect Sphinx objects.inv files
2222
.. image:: https://img.shields.io/readthedocs/sphobjinv/latest.svg
2323
:target: http://sphobjinv.readthedocs.io/en/latest/
2424

25+
.. image:: https://badges.gitter.im/sphobjinv/community.svg
26+
:alt: Join the chat at https://gitter.im/sphobjinv/community
27+
:target: https://gitter.im/sphobjinv/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
28+
2529
.. image:: https://img.shields.io/github/license/mashape/apistatus.svg
2630
:target: https://github.com/bskinn/sphobjinv/blob/stable/LICENSE.txt
2731

2832
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
2933
:target: https://github.com/psf/black
3034

35+
.. image:: https://pepy.tech/badge/sphobjinv/month
36+
:target: https://pepy.tech/project/sphobjinv?versions=2.1b1&versions=2.2b1&versions=2.2&versions=2.1&versions=2.0.1
37+
3138
----
3239

3340
**Using Sphinx?**
@@ -47,15 +54,21 @@ to cross-reference into, and pass it to ``sphobjinv suggest``.
4754

4855
For internal cross-references, locate ``objects.inv`` within ``build/html``::
4956

50-
$ sphobjinv suggest doc/build/html/objects.inv as_rst -st 50
51-
52-
Name Score
53-
-------------------------------------------------------- -------
54-
:py:method:`sphobjinv.data.SuperDataObj.as_rst` 60
55-
:std:doc:`cli/implementation/parser` 57
56-
:py:module:`sphobjinv.cli.parser` 50
57-
:py:method:`sphobjinv.data.SuperDataObj.as_str` 50
58-
:py:method:`sphobjinv.inventory.Inventory.objects_rst` 50
57+
$ sphobjinv suggest doc/build/html/objects.inv as_rst -st 58
58+
59+
Name Score
60+
--------------------------------------------------- -------
61+
:py:property:`sphobjinv.data.SuperDataObj.as_rst` 60
62+
:py:class:`sphobjinv.cli.parser.PrsConst` 59
63+
:py:class:`sphobjinv.data.DataFields` 59
64+
:py:class:`sphobjinv.data.DataObjBytes` 59
65+
:py:class:`sphobjinv.data.DataObjStr` 59
66+
:py:class:`sphobjinv.data.SuperDataObj` 59
67+
:py:class:`sphobjinv.enum.HeaderFields` 59
68+
:py:class:`sphobjinv.enum.SourceTypes` 59
69+
:py:function:`sphobjinv.fileops.writebytes` 59
70+
:py:function:`sphobjinv.fileops.writejson` 59
71+
:py:class:`sphobjinv.inventory.Inventory` 59
5972

6073
.. end shell command
6174
@@ -120,11 +133,11 @@ inventory creation/modification::
120133
>>> import sphobjinv as soi
121134
>>> inv = soi.Inventory('doc/build/html/objects.inv')
122135
>>> print(inv)
123-
<Inventory (fname_zlib): sphobjinv v2.1, 205 objects>
136+
<Inventory (fname_zlib): sphobjinv v2.2, 205 objects>
124137
>>> inv.project
125138
'sphobjinv'
126139
>>> inv.version
127-
'2.1'
140+
'2.2'
128141
>>> inv.objects[0]
129142
DataObjStr(name='sphobjinv.cli.core', domain='py', role='module', priority='0', uri='cli/implementation/core.html#module-$', dispname='-')
130143

@@ -146,7 +159,7 @@ Source on `GitHub <https://github.com/bskinn/sphobjinv>`__. Bug reports
146159
and feature requests are welcomed at the
147160
`Issues <https://github.com/bskinn/sphobjinv/issues>`__ page there.
148161

149-
Copyright (c) Brian Skinn 2016-2021
162+
Copyright (c) Brian Skinn 2016-2022
150163

151-
License: The MIT License. See `LICENSE.txt <https://github.com/bskinn/sphobjinv/blob/master/LICENSE.txt>`__
164+
License: The MIT License. See `LICENSE.txt <https://github.com/bskinn/sphobjinv/blob/main/LICENSE.txt>`__
152165
for full license terms.

0 commit comments

Comments
 (0)