diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 093e3b06d..a5b7dc892 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -22,7 +22,9 @@ jobs: python-version: '3.9' - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + fetch-depth: 0 # fetch the complete repo history (for setuptools-scm) - name: Cache pip uses: actions/cache@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 136255918..985ea75f0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # fetch the complete repo history (for setuptools-scm) - uses: actions/setup-python@v4 with: python-version: '3.12' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 199585de7..db138c458 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,7 +31,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Cache pip uses: actions/cache@v3 @@ -78,7 +78,7 @@ jobs: python-version: '3.12' - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Cache pip uses: actions/cache@v3 @@ -112,7 +112,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: '3.12' diff --git a/docs/conf.py b/docs/conf.py index a8135af75..7b7eb9293 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -10,13 +10,14 @@ from datetime import datetime import os.path -import re import sys import warnings import plotly.io as pio from plotly.io._sg_scraper import plotly_sg_scraper +import fastf1 + sys.path.append(os.path.abspath('extensions')) @@ -33,16 +34,10 @@ # -- Project information ----------------------------------------------------- -# load version number from file in sources dir without importing -with open('../fastf1/version.py') as vfobj: - vstring = str(vfobj.read()) - version = re.search(r"(\d+.\d+.\d+[-\w]*)", vstring)[0] - - project = 'FastF1' # copyright = 'MIT' # author = 'Oehrly' -version = version +version = fastf1.__version__ release = version copyright = f'{datetime.now().year}, theOehrly' html_title = f"{project} {release}" diff --git a/fastf1/ergast/sphinx.py b/fastf1/ergast/sphinx.py index e007071cc..2e880f53d 100644 --- a/fastf1/ergast/sphinx.py +++ b/fastf1/ergast/sphinx.py @@ -4,9 +4,9 @@ import json from typing import get_type_hints +from fastf1 import __version__ from fastf1.ergast.interface import ErgastResultFrame import fastf1.ergast.structure -from fastf1.version import __version__ class ApiMappingDirective(Directive):