Skip to content

Commit

Permalink
Merge pull request #1071 from gboeing/docs
Browse files Browse the repository at this point in the history
move docs source files into a source subfolder
  • Loading branch information
gboeing authored Oct 16, 2023
2 parents c833332 + 0b59406 commit ecfee9f
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Test docs
run: |
make -C ./docs html
python -m sphinx -b linkcheck docs/ _build/linkcheck
python -m sphinx -b linkcheck docs/source build/linkcheck
- name: Test code
run: pytest --cov=./osmnx --cov-report=xml --cov-report=term-missing --verbose
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Test docs
run: |
make -C ./docs html
python -m sphinx -b linkcheck docs/ _build/linkcheck
python -m sphinx -b linkcheck docs/source build/linkcheck
- name: Test code
run: pytest --cov=./osmnx --cov-report=term-missing --verbose
2 changes: 1 addition & 1 deletion docs/.readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ python:
- requirements: docs/requirements.txt

sphinx:
configuration: docs/conf.py
configuration: docs/source/conf.py
fail_on_warning: true
4 changes: 2 additions & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
Expand Down
4 changes: 2 additions & 2 deletions docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
furo
sphinx == 7.* # same value as needs_sphinx in /docs/conf.py
sphinx == 7.* # same value as needs_sphinx in /docs/source/conf.py
6 changes: 3 additions & 3 deletions docs/conf.py → docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
import sys
from pathlib import Path

# go up one level from /docs/ to the package root
sys.path.insert(0, str(Path().resolve().parent))
# go up two levels from /docs/source to the package root
sys.path.insert(0, str(Path().resolve().parent.parent))

author = "Geoff Boeing"
copyright = "2016-2023, Geoff Boeing" # noqa: A001
project = "OSMnx"

# dynamically load version from /osmnx/_version.py
with Path.open(Path("../osmnx/_version.py")) as f:
with Path.open(Path("../../osmnx/_version.py")) as f:
version = release = f.read().split(" = ")[1].replace('"', "")

# mock import all required + optional dependency packages because readthedocs
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions tests/lint_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@
set -e

# delete temp files and folders
rm -r -f .pytest_cache .temp ./dist/ ./docs/_build osmnx/__pycache__ tests/__pycache__
rm -r -f .pytest_cache .temp ./dist/ ./docs/build osmnx/__pycache__ tests/__pycache__
find . -type f -name "*.vrt" -delete
find . -type f -name ".coverage*" -delete

# lint
pre-commit run --all-files

# test building and validating the package
#hatch build --clean
#twine check --strict ./dist/*
hatch build --clean
twine check --strict ./dist/*

# build the docs
# make -C ./docs html
# python -m sphinx -b linkcheck docs/ docs/_build/linkcheck
make -C ./docs html
python -m sphinx -b linkcheck docs/source docs/build/linkcheck

# run the tests and report the test coverage
pytest --cov=./osmnx --cov-report=term-missing --verbose

# delete temp files and folders
rm -r -f .pytest_cache .temp ./dist/ ./docs/_build osmnx/__pycache__ tests/__pycache__
rm -r -f .pytest_cache .temp ./dist/ ./docs/build osmnx/__pycache__ tests/__pycache__
find . -type f -name "*.vrt" -delete
find . -type f -name ".coverage*" -delete

0 comments on commit ecfee9f

Please sign in to comment.