Skip to content

Commit

Permalink
MNT: internal version from setuptools_scm
Browse files Browse the repository at this point in the history
  • Loading branch information
theOehrly committed Dec 27, 2023
1 parent 435bc99 commit 2456252
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ dist/
build/
fastf1.egg-info/

# version info dynamically created by setuptools-scm
fastf1/_version.py

# temporary testrun directories
fastf1/tests/testenv/
fastf1/tests/mpl-results/
Expand Down
9 changes: 8 additions & 1 deletion fastf1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@
For more information see :ref:`logging`.
"""
try:
from . import _version
except ImportError:
_version = None

__version__ = getattr(_version, 'version', 'UNKNOWN')


from typing import Dict

from fastf1.events import (get_session, # noqa: F401
Expand All @@ -94,7 +102,6 @@
from fastf1.logger import set_log_level # noqa: F401

from fastf1.req import Cache, RateLimitExceededError # noqa: F401
from fastf1.version import __version__ # noqa: F401


_DRIVER_TEAM_MAPPING: Dict[str, Dict[str, str]] = {
Expand Down
2 changes: 1 addition & 1 deletion fastf1/ergast/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import json
from typing import List, Literal, Optional, Union

from fastf1 import __version__
from fastf1.req import Cache
import fastf1.ergast.structure as API
from fastf1.version import __version__


import pandas as pd
Expand Down
3 changes: 1 addition & 2 deletions fastf1/mvapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

from typing import Optional

from fastf1 import __version__
from fastf1.mvapi.internals import _logger
from fastf1.req import Cache
from fastf1.version import __version__


PROTO = "https"
HOST = "api.multiviewer.app"
Expand Down
1 change: 0 additions & 1 deletion fastf1/version.py

This file was deleted.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ exclude = ["fastf1/testing*"]
namespaces = false

[tool.setuptools_scm]
write_to = "fastf1/_version.py"

[tool.ruff]
line-length = 79
Expand Down

0 comments on commit 2456252

Please sign in to comment.