File tree Expand file tree Collapse file tree 3 files changed +27
-5
lines changed
Expand file tree Collapse file tree 3 files changed +27
-5
lines changed Original file line number Diff line number Diff line change 2323
2424 - name : Set up poetry
2525 uses : Gr1N/setup-poetry@v9
26+ with :
27+ poetry-version : " 2.1.1"
2628
2729 - name : Configure poetry
2830 run : poetry config virtualenvs.in-project true
Original file line number Diff line number Diff line change @@ -6,12 +6,13 @@ sphinx:
66formats : all
77
88build :
9- os : ubuntu-20 .04
9+ os : ubuntu-24 .04
1010 tools :
1111 python : " 3.10"
1212 jobs :
1313 post_create_environment :
14- - pip install poetry
14+ - pip install " poetry==2.1.1"
1515 - poetry config virtualenvs.create false
1616 post_install :
17- - poetry install --with docs
17+ - poetry install --with docs --no-interaction --no-ansi
18+ - python -m pip install --no-cache-dir "sphinx-immaterial>=0.11,<0.14"
Original file line number Diff line number Diff line change 1- import openapi_schema_validator
1+ import re
2+ import sys
3+ from pathlib import Path
4+
5+ ROOT_DIR = Path (__file__ ).resolve ().parents [1 ]
6+ sys .path .insert (0 , str (ROOT_DIR ))
7+
8+
9+ def _read_project_version () -> str :
10+ pyproject_path = ROOT_DIR / "pyproject.toml"
11+ pyproject_content = pyproject_path .read_text (encoding = "utf-8" )
12+ match = re .search (
13+ r"\[tool\.poetry\][\s\S]*?^version\s*=\s*\"([^\"]+)\"" ,
14+ pyproject_content ,
15+ re .MULTILINE ,
16+ )
17+ if match is None :
18+ return "unknown"
19+ return match .group (1 )
20+
221
322project = "openapi-schema-validator"
423copyright = "2023, Artur Maciag"
524author = "Artur Maciag"
625
7- release = openapi_schema_validator . __version__
26+ release = _read_project_version ()
827
928extensions = [
1029 "sphinx.ext.autodoc" ,
You can’t perform that action at this time.
0 commit comments