Skip to content

Commit

Permalink
Merge branch 'release-2.0.1' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
bskinn committed Jan 27, 2020
2 parents f9c3301 + 0fa14b5 commit a704c38
Show file tree
Hide file tree
Showing 112 changed files with 2,438 additions and 3,651 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ __pycache__/

# Distribution / packaging
.Python
env/
env*/
build/
develop-eggs/
dist/
Expand All @@ -23,6 +23,7 @@ var/
*.egg-info/
.installed.cfg
*.egg
pip-wheel-metadata/

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down Expand Up @@ -74,3 +75,6 @@ sphobjinv/test/scratch/*
# Doctest scratch
doc/scratch/*

# Mutmut
.mutmut-cache

22 changes: 22 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build with sphinx
sphinx:
configuration: doc/source/conf.py

# Build all the things
formats: all

# Python and requirements
python:
version: 3.7
install:
- requirements: requirements-rtd.txt
- method: pip
path: .

19 changes: 11 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
dist: xenial
install:
- PYTHON_MAJOR=$( python -c 'import sys; print(sys.version_info.major)' )
- PYTHON_MINOR=$( python -c 'import sys; print(sys.version_info.minor)' )
- pip install -U pip setuptools
- pip install -U --force-reinstall -r requirements-travis.txt
- pip install -e .
- if (( ( $PYTHON_MAJOR > 3 ) || ( $PYTHON_MAJOR == 3 && $PYTHON_MINOR >= 6 ) )); then pip install -r requirements-flake8.txt && flake8 --version; fi
- sh -c 'cd doc; make html; mkdir scratch'
language: python
python:
- 3.4
- 3.5
- 3.6
- 3.7-dev
- 3.7
- 3.8-dev
script:
- python --version
- pip list
- coverage run tests.py -a --testall
- do_rest=$( echo $TRAVIS_PYTHON_VERSION | grep -e '^3\.6' | wc -l )
- if [ $do_rest -gt 0 ]; then pip install black; black --check setup.py tests.py sphobjinv sphobjinv/test -l 79; else echo "No black."; fi
- if [ $do_rest -gt 0 ]; then sh -c 'cd doc; make doctest'; else echo "No doctest."; fi
- if [ $do_rest -gt 0 ]; then codecov; else echo "No codecov."; fi
- pytest --cov=src --testall --nonloc
- tox -e sdist_install
- if (( $PYTHON_MAJOR == 3 && $PYTHON_MINOR == 7 )); then tox -e flake8; else echo "No flake8."; fi
- if (( $PYTHON_MAJOR == 3 && $PYTHON_MINOR == 7 )); then sh -c 'cd doc; make doctest'; else echo "No doctest."; fi
- if (( $PYTHON_MAJOR == 3 && $PYTHON_MINOR == 7 )); then codecov; else echo "No codecov."; fi

23 changes: 23 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Credits
=======

`sphobjinv` is authored and maintained by Brian Skinn ([Blog](https://bskinn.github.io)) ([Twitter](https://twitter.com/btskinn)).

The idea for the project came about as I was starting to deepen my expertise with Sphinx, and found it
hugely frustrating to debug cross-references to objects in code. I discovered the `objects.inv` files
relatively quickly, but struggled with trying to get at the actual object information.
At the time (2016), the ability to [execute `sphinx.ext.intersphinx` as a module](https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#showing-all-links-of-an-intersphinx-mapping-file)
hadn't yet been documented (that happened in [2018](https://github.com/sphinx-doc/sphinx/commit/7aaba1758a4622298d15339fddd8556eb221af86)),
and a fair bit of searching didn't turn up anything promising.

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

While there are [a number](https://github.com/bskinn/sphobjinv/issues) of possible enhancements to the project,
I'm quite satisfied with its ease of use and usefulness, at least for my purposes, and thus consider it fully stable.
I'm always glad to receive feature requests and (especially) bug reports, though.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ and this project strives to adhere to
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).


### Unreleased Changes
### [2.0.1] - 2020-01-26

...
#### Fixed

* attr.s usage on Inventory changed to use eq=False where possible,
per the deprecation of the cmp argument
* URL inventory retrieval now sends a User-Agent header, to avoid
403 FORBIDDEN errors on some docs servers


### [2.0.1rc1] - 2019-02-01
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016-2019 Brian Skinn
Copyright (c) 2016-2020 Brian Skinn

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include LICENSE.txt README.rst CHANGELOG.md
include LICENSE.txt README.rst CHANGELOG.md pyproject.toml
52 changes: 27 additions & 25 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ sphobjinv: Manipulate and inspect Sphinx objects.inv files

**Current Development Version:**

.. image:: https://travis-ci.org/bskinn/sphobjinv.svg?branch=dev
:target: https://travis-ci.org/bskinn/sphobjinv
.. image:: https://img.shields.io/travis/com/bskinn/sphobjinv?label=travis-ci&logo=travis
:target: https://travis-ci.com/bskinn/sphobjinv

.. image:: https://codecov.io/gh/bskinn/sphobjinv/branch/dev/graph/badge.svg
.. image:: https://codecov.io/gh/bskinn/sphobjinv/branch/master/graph/badge.svg
:target: https://codecov.io/gh/bskinn/sphobjinv

**Most Recent Stable Release:**

.. image:: https://img.shields.io/pypi/v/sphobjinv.svg
.. image:: https://img.shields.io/pypi/v/sphobjinv.svg?logo=pypi
:target: https://pypi.org/project/sphobjinv

.. image:: https://img.shields.io/pypi/pyversions/sphobjinv.svg
.. image:: https://img.shields.io/pypi/pyversions/sphobjinv.svg?logo=python

**Info:**

.. image:: https://img.shields.io/readthedocs/sphobjinv/latest.svg
:target: http://sphobjinv.readthedocs.io/en/latest/

.. image:: https://img.shields.io/github/license/mashape/apistatus.svg
:target: https://github.com/bskinn/sphobjinv/blob/master/LICENSE.txt
:target: https://github.com/bskinn/sphobjinv/blob/stable/LICENSE.txt

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

----

Expand All @@ -48,14 +48,12 @@ For internal cross-references, locate ``objects.inv`` within ``build/html``::

$ sphobjinv suggest doc/build/html/objects.inv as_rst -st 50

Name Score
----------------------------------------------------------- -------
:py:attribute:`sphobjinv.data.SuperDataObj.as_rst` 60
:py:function:`sphobjinv.cmdline.getparser` 50
:py:attribute:`sphobjinv.data.DataObjBytes.as_str` 50
:py:attribute:`sphobjinv.data.DataObjStr.as_str` 50
:py:attribute:`sphobjinv.data.SuperDataObj.as_str` 50
:py:attribute:`sphobjinv.inventory.Inventory.objects_rst` 50
Name Score
-------------------------------------------------------- -------
:py:method:`sphobjinv.data.SuperDataObj.as_rst` 60
:py:function:`sphobjinv.cmdline.getparser` 50
:py:method:`sphobjinv.data.SuperDataObj.as_str` 50
:py:method:`sphobjinv.inventory.Inventory.objects_rst` 50

.. end shell command
Expand All @@ -66,19 +64,23 @@ changes the reporting threshold for the match score.
For external references, just find the documentation wherever it lives on the web,
and pass ``sphobjinv suggest`` a URL from within the documentation set
with the ``--url/-u`` flag. For example, say I need to know how to
cross-reference the ``redirect()`` function from Flask (see
`here <http://flask.pocoo.org/docs/1.0/api/?highlight=redirect#flask.redirect>`__)::
cross-reference the ``Axis`` class from matplotlib (see
`here <https://matplotlib.org/api/axis_api.html?highlight=axis#module-matplotlib.axis>`__)::

$ sphobjinv suggest http://flask.pocoo.org/docs/1.0/views/#method-hints redirect -su
$ sphobjinv suggest https://matplotlib.org/api/ticker_api.html axis -su

No inventory at provided URL.
Attempting "http://flask.pocoo.org/docs/1.0/views/objects.inv" ...
Attempting "http://flask.pocoo.org/docs/1.0/objects.inv" ...
Attempting "https://matplotlib.org/api/ticker_api.html/objects.inv" ...
Attempting "https://matplotlib.org/api/objects.inv" ...
Attempting "https://matplotlib.org/objects.inv" ...
Remote inventory found.

Name Score
------------------------------- -------
:py:function:`flask.redirect` 90

Name Score
------------------------------ -------
:py:module:`matplotlib.axis` 90
:std:doc:`api/axis_api` 90
:std:label:`axis-container` 90

.. end shell command
Expand Down Expand Up @@ -111,7 +113,7 @@ inventory creation/modification::
>>> import sphobjinv as soi
>>> inv = soi.Inventory('doc/build/html/objects.inv')
>>> print(inv)
<Inventory (fname_zlib): sphobjinv v2.0, 195 objects>
<Inventory (fname_zlib): sphobjinv v2.0, 181 objects>
>>> inv.project
'sphobjinv'
>>> inv.version
Expand All @@ -137,7 +139,7 @@ Source on `GitHub <https://github.com/bskinn/sphobjinv>`__. Bug reports
and feature requests are welcomed at the
`Issues <https://github.com/bskinn/sphobjinv/issues>`__ page there.

Copyright (c) Brian Skinn 2016-2019
Copyright (c) Brian Skinn 2016-2020

License: The MIT License. See `LICENSE.txt <https://github.com/bskinn/sphobjinv/blob/master/LICENSE.txt>`__
for full license terms.
4 changes: 0 additions & 4 deletions black

This file was deleted.

4 changes: 0 additions & 4 deletions black.bat

This file was deleted.

Loading

0 comments on commit a704c38

Please sign in to comment.