Skip to content

Commit 9c23522

Browse files
authored
Merge pull request #214 from bskinn/vendor-fuzz
Vendor fuzzywuzzy and update project infra
2 parents dd8b976 + 274f243 commit 9c23522

24 files changed

+883
-160
lines changed

.coveragerc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
[run]
22
omit =
3-
# Don't do coverage on test code
4-
sphobjinv/test/*
5-
tests.py
6-
7-
# Don't cover code in the env (Termux only?)
3+
# Don't cover code in the env (just in case)
84
env/*
5+
6+
# Don't worry about covering vendored libraries
7+
src/sphobjinv/_vendored/*
98

109
[report]
1110
exclude_lines =

.github/workflows/ci_tests.yml

Lines changed: 4 additions & 4 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
@@ -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:
@@ -90,4 +90,4 @@ jobs:
9090
run: |
9191
pytest --cov=src --testall --nonloc
9292
tox -e sdist_install
93-
93+

CHANGELOG.md

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

99

10-
### [unreleased]
10+
### [2.2b1] - *pending*
11+
12+
#### Removed
13+
14+
* Acceleration of the `suggest` functionality via use of `python-Levenshtein`
15+
is no longer possible due to the vendoring of an early, MIT-licensed version
16+
of `fuzzywuzzy`, as noted below. The `speedup` install extra is now obsolete,
17+
and has been removed.
18+
19+
#### Internal
20+
21+
* The `fuzzywuzzy` string matcher was vendored into the project from a point
22+
in its development history before the `python-Levenshtein` dependency,
23+
and its corresponding GPL encumbrance, was introduced.
1124

1225
#### Administrative
1326

1427
* Project default branch migrated to `main` from `master`.
1528

29+
* Standard development Python version bumped to 3.10.
30+
31+
* Standard development Sphinx version bumped to 4.3.1.
32+
33+
* Active support for Python 3.11 added.
34+
1635

1736
### [2.1] - 2021-04-14
1837

CONTRIBUTING.md

Lines changed: 3 additions & 3 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:
@@ -138,7 +138,7 @@ configured for the project, it is **not** set up to be an everyday test runner.
138138
Instead, it's used to execute a matrix of test environments
139139
checking for the compatibility of different Python and dependency
140140
versions. You can run it if you want, but you'll need
141-
working versions of all of Python 3.6 through 3.10
141+
working versions of all of Python 3.6 through 3.11
142142
installed and on `PATH` as `python3.6`, `python3.7`, etc.
143143
The nonlocal test suite is run for each `tox` environment, so
144144
it's best to use at most two parallel sub-processes to avoid oversaturating
@@ -239,7 +239,7 @@ and the link validity checker with `make linkcheck`.
239239
Both Github Actions and Azure Pipelines are set up for the project,
240240
and should run on any forks of the repository.
241241

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

README.rst

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,21 @@ to cross-reference into, and pass it to ``sphobjinv suggest``.
4747

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

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
50+
$ sphobjinv suggest doc/build/html/objects.inv as_rst -st 58
51+
52+
Name Score
53+
--------------------------------------------------- -------
54+
:py:property:`sphobjinv.data.SuperDataObj.as_rst` 60
55+
:py:class:`sphobjinv.cli.parser.PrsConst` 59
56+
:py:class:`sphobjinv.data.DataFields` 59
57+
:py:class:`sphobjinv.data.DataObjBytes` 59
58+
:py:class:`sphobjinv.data.DataObjStr` 59
59+
:py:class:`sphobjinv.data.SuperDataObj` 59
60+
:py:class:`sphobjinv.enum.HeaderFields` 59
61+
:py:class:`sphobjinv.enum.SourceTypes` 59
62+
:py:function:`sphobjinv.fileops.writebytes` 59
63+
:py:function:`sphobjinv.fileops.writejson` 59
64+
:py:class:`sphobjinv.inventory.Inventory` 59
5965

6066
.. end shell command
6167
@@ -120,11 +126,11 @@ inventory creation/modification::
120126
>>> import sphobjinv as soi
121127
>>> inv = soi.Inventory('doc/build/html/objects.inv')
122128
>>> print(inv)
123-
<Inventory (fname_zlib): sphobjinv v2.1, 205 objects>
129+
<Inventory (fname_zlib): sphobjinv v2.2b1, 205 objects>
124130
>>> inv.project
125131
'sphobjinv'
126132
>>> inv.version
127-
'2.1'
133+
'2.2b1'
128134
>>> inv.objects[0]
129135
DataObjStr(name='sphobjinv.cli.core', domain='py', role='module', priority='0', uri='cli/implementation/core.html#module-$', dispname='-')
130136

azure-pipelines.yml

Lines changed: 23 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ stages:
2121
steps:
2222
- task: UsePythonVersion@0
2323
inputs:
24-
versionSpec: '3.9'
24+
versionSpec: '3.10'
2525

2626
- script: pip install -U tox
2727
displayName: Install tox
@@ -43,7 +43,7 @@ stages:
4343
steps:
4444
- task: UsePythonVersion@0
4545
inputs:
46-
versionSpec: '3.9'
46+
versionSpec: '3.10'
4747

4848
- script: pip install interrogate
4949
displayName: Install interrogate
@@ -67,39 +67,24 @@ stages:
6767
spec: '3.8'
6868
py39:
6969
spec: '3.9'
70+
py310:
71+
spec: '3.10'
7072
pypy3:
7173
spec: 'pypy3'
72-
platforms: [linux, windows, macOs]
74+
platforms: [linux, windows]
7375

74-
- job: Levenshtein
75-
strategy:
76-
matrix:
77-
linux:
78-
platform: Ubuntu-latest
79-
macOs:
80-
platform: macOS-latest
81-
82-
pool:
83-
vmImage: $[ variables.platform ]
84-
85-
steps:
86-
- task: UsePythonVersion@0
87-
inputs:
88-
versionSpec: '3.9'
89-
architecture: 'x64'
90-
displayName: Use Python 3.9
91-
92-
- script: pip install -U --force-reinstall -r requirements-ci.txt -e .[speedup]
93-
displayName: Install CI requirements, plus python-Levenshtein
94-
95-
- script: pip list
96-
displayName: Show full environment contents
97-
98-
- script: cd doc; make html; mkdir scratch
99-
displayName: Build the documentation for tests to work against (Linux/macOs)
100-
101-
- script: pytest --nonloc -k "not readme"
102-
displayName: Run pytest without README tests
76+
- template: azure-coretest.yml
77+
parameters:
78+
pythons:
79+
py37:
80+
spec: '3.7'
81+
py38:
82+
spec: '3.8'
83+
py39:
84+
spec: '3.9'
85+
py310:
86+
spec: '3.10'
87+
platforms: [macOs]
10388

10489

10590
- stage: aux_tests
@@ -115,7 +100,7 @@ stages:
115100
steps:
116101
- task: UsePythonVersion@0
117102
inputs:
118-
versionSpec: '3.9'
103+
versionSpec: '3.10'
119104

120105
- script: pip install . -r requirements-rtd.txt
121106
displayName: Install project, plus docs requirements
@@ -133,7 +118,7 @@ stages:
133118
steps:
134119
- task: UsePythonVersion@0
135120
inputs:
136-
versionSpec: '3.9'
121+
versionSpec: '3.10'
137122

138123
- script: pip install -r requirements-dev.txt
139124
displayName: Install full dev requirements
@@ -150,7 +135,7 @@ stages:
150135
steps:
151136
- task: UsePythonVersion@0
152137
inputs:
153-
versionSpec: '3.9'
138+
versionSpec: '3.10'
154139

155140
- script: pip install . -r requirements-rtd.txt
156141
displayName: Install doc requirements and local project
@@ -168,7 +153,7 @@ stages:
168153
steps:
169154
- task: UsePythonVersion@0
170155
inputs:
171-
versionSpec: '3.9'
156+
versionSpec: '3.10'
172157

173158
- script: pip install -r requirements-dev.txt
174159
displayName: Install full dev requirements
@@ -191,7 +176,7 @@ stages:
191176
steps:
192177
- task: UsePythonVersion@0
193178
inputs:
194-
versionSpec: '3.9'
179+
versionSpec: '3.10'
195180

196181
- script: pip install -r requirements-ci.txt
197182
displayName: Install CI requirements
@@ -211,7 +196,7 @@ stages:
211196
steps:
212197
- task: UsePythonVersion@0
213198
inputs:
214-
versionSpec: '3.9'
199+
versionSpec: '3.10'
215200

216201
- script: pip install tox flake8-noqa -r requirements-flake8.txt
217202
displayName: Install requirements

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,11 @@ exclude = '''
1818
| ^/[.]
1919
| ^/doc
2020
| ^/env
21+
| ^/src/sphobjinv/_vendored
2122
)
2223
'''
24+
25+
[tool.interrogate]
26+
exclude = ["src/sphobjinv/_vendored"]
27+
fail-under = 100
28+
verbose = 1

requirements-ci.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ certifi
33
codecov
44
coverage
55
dictdiffer
6-
fuzzywuzzy>=0.3
76
jsonschema
87
md-toc
98
pytest>=4.4.0
109
pytest-check>=0.4
1110
pytest-cov
1211
pytest-ordering
1312
pytest-timeout
14-
sphinx==3.5.0
13+
sphinx==4.3.1
1514
sphinx-issues
1615
sphinx-rtd-theme
1716
sphinxcontrib-programoutput

requirements-dev.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ attrs>=17.4
22
certifi
33
coverage
44
dictdiffer
5-
fuzzywuzzy>=0.3
5+
interrogate
66
jsonschema
77
md-toc
88
pep517
@@ -13,7 +13,7 @@ pytest-ordering
1313
pytest-timeout
1414
restview
1515
rope
16-
sphinx==3.5.0
16+
sphinx==4.3.1
1717
sphinx-autobuild
1818
sphinx-issues
1919
sphinxcontrib-programoutput

requirements-rtd.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
attrs>=17.4
2-
sphinx==3.5.0
2+
sphinx==4.3.1
33
sphinx-issues
44
sphinx-rtd-theme
55
sphinxcontrib-programoutput

0 commit comments

Comments
 (0)