Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6c47b57
Add initial fixtures_http.py
bskinn Dec 24, 2025
230cd6a
Move conftest.py into tests/
bskinn Dec 24, 2025
86e8cd2
Update paths inside conftest.py
bskinn Dec 24, 2025
7338ba8
Adjust tox envs for conftest.py now being inside tests/
bskinn Dec 24, 2025
892208d
Add HTTP/HTTPS comments to test_api_inventory_known_header_required()
bskinn Dec 24, 2025
36d93e5
Remove extra newline
bskinn Dec 24, 2025
c7b3a58
Replace GitHub remote URL with local-server URL
bskinn Dec 24, 2025
09c9640
Switch resource_url fixture to session-scope
bskinn Dec 24, 2025
a9e37bf
Add 'tests' "package" to first-party in flake config
bskinn Dec 24, 2025
f2d56f6
Update external-remote URL-load check test
bskinn Dec 24, 2025
f784a6d
Convert --testall URL API imports to use local server
bskinn Dec 24, 2025
b802899
Convert nonlocal CLI tests to use local server
bskinn Dec 24, 2025
543e092
Remove Django-specific URL test
bskinn Dec 24, 2025
a07f2a5
Update supported Python range to 3.10-3.14
bskinn Dec 24, 2025
551e5a0
Expand on a comment for historical info
bskinn Dec 24, 2025
4c91212
Bump active dev Sphinx version
bskinn Dec 24, 2025
a42a01b
Convert docs 'suggest' call from Github to RTD
bskinn Dec 24, 2025
f4726e8
Fix inventory filename
bskinn Dec 24, 2025
f77ddf2
Tweak a couple of tests comments
bskinn Dec 24, 2025
66e52b1
Drop dev-pin Sphinx back down to 8.1.3
bskinn Dec 24, 2025
d0fc65b
Switch fixture to 'localhost' from '127.0.0.1'
bskinn Dec 24, 2025
201caa4
Skip reverse DNS lookup when logging in testing HTTP server
bskinn Dec 24, 2025
0508f78
Revert "Skip reverse DNS lookup when logging in testing HTTP server"
bskinn Dec 24, 2025
8314969
Switch local HTTP server to not do rDNS lookup on startup
bskinn Dec 24, 2025
a47d0e3
Generalize text search in test_cli_noargs_shows_help()
bskinn Dec 24, 2025
0413fb1
Update Sphinx pin note in requirements-dev.txt
bskinn Dec 24, 2025
c7a1491
Update CHANGELOG
bskinn Dec 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/all_core_tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'ALL: Run tests on Python 3.12'
name: 'ALL: Run tests on Python 3.13'

on:
pull_request:
Expand All @@ -24,7 +24,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
cache: 'pip'
cache-dependency-path: requirements-ci.txt

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ready_doctest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
cache: 'pip'
cache-dependency-path: requirements-ci.txt

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ready_linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
cache: 'pip'
cache-dependency-path: requirements-flake8.txt

Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
cache: 'pip'
cache-dependency-path: requirements-interrogate.txt

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ready_test_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
strategy:
matrix:
os: ['windows-latest', 'ubuntu-latest', 'macos-latest']
py: ['3.9', '3.10', '3.11', '3.13']
py: ['3.10', '3.11', '3.12', '3.14']
include:
- os: 'macos-latest'
py: '3.12'
py: '3.13'

steps:
- name: Check out repo
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ready_test_nonloc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
python_os_test_matrix:
name: ${{ matrix.os }} python 3.12
name: ${{ matrix.os }} python 3.13
runs-on: ${{ matrix.os }}
concurrency:
group: ${{ github.workflow }}-${{ matrix.os }}-${{ github.ref }}
Expand All @@ -30,7 +30,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
cache: 'pip'
cache-dependency-path: requirements-ci.txt

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_check_sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
cache: 'pip'
cache-dependency-path: requirements-dev.txt

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_doc_warnings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
cache: 'pip'
cache-dependency-path: requirements-rtd.txt

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_flake8_noqa_nofail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
cache: 'pip'
cache-dependency-path: requirements-ci.txt

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_readme_doctest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
cache: 'pip'
cache-dependency-path: requirements-ci.txt

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_test_file_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
cache: 'pip'
cache-dependency-path: |
requirements-ci.txt
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version: 2
build:
os: 'ubuntu-22.04'
tools:
python: '3.12'
python: '3.13'

# Python requirements
python:
Expand Down
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,50 @@ changes.

### *Unreleased*

#### Tests

* Update `tox` env test matrix for `py310` to `py314` ([#325]).

* Update test path calculations to always be relative to `__file__` ([#325]).

* Relocate `conftest.py` into `tests` ([#325]).
* Since the new HTTP server fixtures are going in their own source file, it
made the most sense to pull `conftest.py` into the `tests/` directory
also.
* Required some updates to paths in fixtures &c.

* Convert HTTP/URL nonloc tests to use a transient local HTTP server ([#325]).
* See `tests/fixtures_http.py`.
* With the increased caution many sites, including GitHub, are applying to
incoming traffic, using 'raw' GitHub assets in the `sphobjinv` repository
has become too flaky.
* So, we stand up our own HTTP server as a session-scope fixture, and point
(nearly) all of the URL tests at the local server.
* A small number of tests remain that do still reach out to an internet
`objects.inv`.
* A small number of outside-world URL tests remain, to docsets that (so far)
have been cooperative. Time will tell if we need to find others.

#### Internal

* Bump dev-pin Sphinx to v8.1.3 ([#325]).
* Two different version constraints at the moment:
* Sphinx v8.2 doesn't support Python 3.10 (primary constraint)
* Newest `sphinx-rtd-theme` only supports Sphinx `<9` (secondary).

* Add `push` trigger for `all_core_tests.yml` workflow for `main` branch
([#320]).
* This will provide `main` branch CI results for this workflow, for the
GitHub badge to report.

#### Administrative

* Add formal support for Python 3.14 ([#325]).

* Drop support for Python 3.9 (EOL) ([#325]).

* Bump 'core' dev and CI Python version to 3.13 ([#325]).

* Update the GitHub badge to point to the new `all_core_tests.yml` workflow
([#320]) instead of the now-removed `ci_tests.yml`.

Expand Down Expand Up @@ -691,3 +726,4 @@ changes.
[#315]: https://github.com/bskinn/sphobjinv/pull/315
[#316]: https://github.com/bskinn/sphobjinv/pull/316
[#320]: https://github.com/bskinn/sphobjinv/pull/320
[#325]: https://github.com/bskinn/sphobjinv/pull/325
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ $ git clone https://github.com/{you}/sphobjinv
```

Then, create a virtual environment for the project, in whatever location you
prefer. Any Python interpreter 3.9+ *should* work fine.
prefer. Any Python interpreter 3.10+ *should* work fine.

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

```bash
$ python3.12 -m virtualenv env --prompt="sphobjinv"
$ python3.13 -m virtualenv env --prompt="sphobjinv"
```

Activate the environment:
Expand Down Expand Up @@ -140,8 +140,8 @@ Note that while [`tox`](https://tox.wiki/en/latest/) *is* configured for the
project, it is **not** set up to be an everyday test runner. Instead, its
purpose for testing is to execute an extensive matrix of test environments
checking for the compatibility of different Python and dependency versions. You
can run it if you want, but you'll need working versions of all of Python 3.9
through 3.13 installed and on `PATH` as `python3.9`, `python3.10`, etc. The
can run it if you want, but you'll need working versions of all of Python 3.10
through 3.14 installed and on `PATH` as `python3.10`, `python3.11`, etc. The
nonlocal test suite is run for each `tox` environment, so it's best to use at
most two parallel sub-processes to avoid oversaturating your network bandwidth;
e.g.:
Expand Down Expand Up @@ -247,7 +247,7 @@ with `make linkcheck`.
Both Github Actions and Azure Pipelines are set up for the project, and should
run on any forks of the repository.

Github Actions runs the test suite on Linux for Python 3.9 through 3.13, as well
Github Actions runs the test suite on Linux for Python 3.10 through 3.14, as well
as the `flake8` lints and the Sphinx doctests. By default, the Github Actions
will run on all commits, but the workflows can be skipped per-commit by
including `[skip ci]` in the commit message.
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ graft src/sphobjinv/_vendored/fuzzywuzzy
graft doc/source
include doc/make.bat doc/Makefile

include conftest.py
graft tests
prune tests/resource
include tests/resource/objects_attrs* tests/resource/objects_sarge*
Expand Down
2 changes: 1 addition & 1 deletion doc/source/cli/suggest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ via :option:`--thresh`:
Remote |objects.inv| files can be retrieved for inspection by passing the
:option:`--url` flag:

.. command-output:: sphobjinv suggest https://github.com/bskinn/sphobjinv/raw/main/tests/resource/objects_attrs.inv instance -u -t 48
.. command-output:: sphobjinv suggest https://sphobjinv.readthedocs.io/en/stable/objects.inv Inventory -u -t 85
:cwd: /../../tests/resource

The URL provided **MUST** have the leading protocol specified (here,
Expand Down
2 changes: 1 addition & 1 deletion doc/source/customfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ can be found at the GitHub repo

intersphinx_mapping = {
# Standard reference to web docs, with web objects.inv
'python': ('https://docs.python.org/3.12', None),
'python': ('https://docs.python.org/3.13', None),

# Django puts its objects.inv file in a non-standard location
'django': ('https://docs.djangoproject.com/en/dev/', 'https://docs.djangoproject.com/en/dev/_objects/'),
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Documentation",
"Topic :: Documentation :: Sphinx",
"Topic :: Software Development",
Expand All @@ -34,7 +34,7 @@ classifiers = [
"Development Status :: 5 - Production/Stable",
]
keywords = ["sphinx", "sphinx-doc", "inventory", "manager", "inspector"]
requires-python = ">=3.9"
requires-python = ">=3.10"
dependencies = [
"attrs>=19.2",
"certifi",
Expand Down
2 changes: 1 addition & 1 deletion requirements-ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pytest-check>=1.1.2
pytest-cov
pytest-retry
pytest-timeout
sphinx==7.4.7
sphinx==8.1.3
sphinx-issues
sphinx-rtd-theme>=0.5.1
sphinxcontrib-programoutput
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pytest-cov
pytest-retry
pytest-timeout
restview
sphinx==7.4.7 # Staying <8 since 8.0 drops Python 3.9
sphinx==8.1.3 # Staying <8.2 to retain Python 3.10 compat
sphinx-autobuild
sphinx-issues
sphinx-rtd-theme>=0.5.1
Expand Down
2 changes: 1 addition & 1 deletion requirements-rtd.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
attrs>=19.2
sphinx==7.4.7
sphinx==8.1.3
sphinx-issues
sphinx-rtd-theme>=0.5.1
sphinxcontrib-programoutput
2 changes: 2 additions & 0 deletions src/sphobjinv/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ def getparser():
# briefly required a/o 3.7.0b4 due to change in default behavior, per:
# https://bugs.python.org/issue33109. 3.6 behavior restored for
# 3.7 release.
#
# We retain for explicitness
sprs.required = False

spr_convert = sprs.add_parser(
Expand Down
26 changes: 16 additions & 10 deletions conftest.py → tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
from sphinx.util.inventory import InventoryFile as IFile

import sphobjinv as soi
from tests.fixtures_http import resource_http_base_url, resource_url # noqa: F401


def pytest_addoption(parser):
Expand All @@ -66,7 +67,7 @@ def pytest_addoption(parser):
@pytest.fixture(scope="session")
def res_path():
"""Provide Path object to the test resource directory."""
return Path("tests", "resource")
return Path(__file__).resolve().parent / "resource"


@pytest.fixture(scope="session")
Expand Down Expand Up @@ -114,12 +115,6 @@ class Extensions(str, Enum):
True: b"attr.Attribute py:class 1 api.html#attr.Attribute attr.Attribute",
}

# For the URL mode of Inventory instantiation
remote_url = (
"https://github.com/bskinn/sphobjinv/raw/main/"
"tests/resource/objects_{0}.inv"
)

# Regex pattern for objects_xyz.inv files
p_inv = re.compile(r"objects_([^.]+)\.inv", re.I)

Expand All @@ -135,6 +130,16 @@ class Extensions(str, Enum):
return Info()


@pytest.fixture(scope="session")
def http_inv_url_template(resource_url) -> str: # noqa: F811
"""Provide a template string for accessing files over HTTP.

Meant to be used via the URL mode of Inventory instantiation.

"""
return resource_url("objects_{0}.inv")


@pytest.fixture()
def scratch_path(tmp_path, res_path, misc_info, is_win, unix2dos):
"""Provision pre-populated scratch directory, returned as Path."""
Expand All @@ -161,7 +166,9 @@ def scratch_path(tmp_path, res_path, misc_info, is_win, unix2dos):
@pytest.fixture(scope="session")
def ensure_doc_scratch():
"""Ensure doc/scratch dir exists, for README shell examples."""
Path("doc", "scratch").mkdir(parents=True, exist_ok=True)
(Path(__file__).resolve().parent.parent / "doc" / "scratch").mkdir(
parents=True, exist_ok=True
)


@pytest.fixture(scope="session")
Expand Down Expand Up @@ -237,7 +244,6 @@ def run_cmdline_test(monkeypatch):

def func(arglist, *, expect=0): # , suffix=None):
"""Perform the CLI exit-code test."""

# Assemble execution arguments
runargs = ["sphobjinv"]
runargs.extend(str(a) for a in arglist)
Expand Down Expand Up @@ -305,7 +311,7 @@ def func(inv, source_type):

testall_inv_paths = [
p
for p in (Path(__file__).parent / "tests" / "resource").iterdir()
for p in (Path(__file__).parent / "resource").iterdir()
if p.name.startswith("objects_") and p.name.endswith(".inv")
]
testall_inv_ids = [p.name[8:-4] for p in testall_inv_paths]
Expand Down
Loading