Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
cdc0857
adding things
MrSir Jan 15, 2026
db3a2b7
add blank line
MrSir Jan 15, 2026
7b1cb33
update
MrSir Jan 15, 2026
17641cc
use poetry
MrSir Jan 15, 2026
98af5a9
fix uses
MrSir Jan 15, 2026
6bc6410
updated coverage
MrSir Jan 15, 2026
20e65ea
show results
MrSir Jan 15, 2026
731ad39
fix syntax
MrSir Jan 15, 2026
cf6af1c
fix uses
MrSir Jan 15, 2026
4d86769
add proper test
MrSir Jan 15, 2026
8ec215d
try with new coverage
MrSir Jan 15, 2026
d36b9dd
updated poetry lock
MrSir Jan 15, 2026
862e942
try some different coverage runs
MrSir Jan 15, 2026
a5e6c55
adding permissions
MrSir Jan 15, 2026
52a7f26
split jobs
MrSir Jan 15, 2026
3e3d44f
fix path
MrSir Jan 15, 2026
4038b89
fix path
MrSir Jan 15, 2026
9cb04a1
use absolute path
MrSir Jan 15, 2026
760b5e5
split and hopefully fix
MrSir Jan 15, 2026
043d107
remove cache
MrSir Jan 15, 2026
d4fe24f
change artifact name
MrSir Jan 15, 2026
a1b3d25
use newer upload
MrSir Jan 15, 2026
e82bc12
bump download artifact
MrSir Jan 15, 2026
62817f5
debug
MrSir Jan 15, 2026
ec1c5bf
add poetry installation
MrSir Jan 15, 2026
e1894c3
use poetry action
MrSir Jan 15, 2026
0297200
install as non root
MrSir Jan 15, 2026
6fe02a8
activate .venv
MrSir Jan 15, 2026
1786527
no need for poetry run pytest direct
MrSir Jan 15, 2026
72c3f4f
try without source
MrSir Jan 15, 2026
cda8804
chmod the venv dir
MrSir Jan 16, 2026
4e54cea
try again
MrSir Jan 16, 2026
0496862
run via poetry
MrSir Jan 16, 2026
d6a42d9
remove test init file
MrSir Jan 16, 2026
306f381
try without chmod
MrSir Jan 16, 2026
e020015
add chmod back
MrSir Jan 16, 2026
802d9bf
try using cache
MrSir Jan 16, 2026
93327da
linting and formatting
MrSir Jan 16, 2026
ec9b33a
cleanup test coverage settings
MrSir Jan 16, 2026
c8bb80a
moved app
MrSir Jan 16, 2026
abcb4d6
fix linter
MrSir Jan 16, 2026
c186b4f
main has to stay
MrSir Jan 16, 2026
109580d
add pipefail
MrSir Jan 16, 2026
1d607cf
change cov param
MrSir Jan 16, 2026
bbec282
always add new comment
MrSir Jan 16, 2026
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
153 changes: 153 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read # For checkout and comparing commits
pull-requests: write # For creating/updating PR comments

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.14'

- name: Install Poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: 2.2.1

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache/restore@v5
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
run: poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'

- name: Cache venv
id: cache-poetry-dependencies
uses: actions/cache/save@v5
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

lint:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.14'

- name: Install Poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: 2.2.1

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache/restore@v5
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
run: poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'

- name: Run linter
run: |
source ./.venv/bin/activate
poetry run ruff check --config=pyproject.toml

format:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.14'

- name: Install Poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: 2.2.1

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache/restore@v5
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
run: poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'

- name: Run linter
run: |
source ./.venv/bin/activate
poetry run ruff format --check --config=pyproject.toml

test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.14'

- name: Install Poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: 2.2.1

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache/restore@v5
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
run: poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'

- name: Run tests with coverage
run: |
source ./.venv/bin/activate
set -o pipefail
poetry run pytest ./tests --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=f1p | tee pytest-coverage.txt

- name: Pytest Coverage Comment
uses: MishaKav/pytest-coverage-comment@v1.2.0
with:
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml
github-token: ${{ secrets.GITHUB_TOKEN }}
create-new-comment: true
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ __pycache__/
*.py[codz]
*$py.class
.idea
.fastf1-cache
.fastf1-cache
.coverage
coverage.xml
190 changes: 95 additions & 95 deletions poetry.lock

Large diffs are not rendered by default.

21 changes: 16 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "F1 Player"
version = "0.0.1"
version = "0.0.4"
description = "A tool for watching F1 races from a data perspective."
authors = [
"Mitko Toshev <mr.sir88@gmail.com>"
Expand All @@ -9,15 +9,15 @@ readme = "README.md"
packages = [{include = "f1p", from = "src"}]

[tool.poetry.dependencies]
python = ">=3.13,<4.0"
python = ">=3.14,<4.0"
fastf1 = "^3.7.0"
panda3d = "^1.10.15"
pandas-stubs = "^2.3.3.251219"


[tool.poetry.group.dev.dependencies]
ruff = "^0.12.8"
pytest = "8.4.1"
coverage = "^7.13.1"
pytest-mock = "3.14.1"
pytest-cov = "6.2.1"
pytest-asyncio = "1.1.0"
Expand All @@ -30,13 +30,24 @@ requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
f1p = "f1p.main:app"
f1p = "f1p:app"

[tool.coverage.run]
branch = true
relative_files = true
omit = [
"tests/*",
"src/procedural3d",
]

[tool.ruff]
target-version = "py313"
target-version = "py314"
line-length = 120
src = ["src", "tests"]
preview = true
exclude = [
"src/procedural3d"
]

[tool.ruff.lint]
select = ["E", "F", "I", "W", "ARG", "A", "COM", "C4", "PIE", "T20", "PT"]
Expand Down
11 changes: 3 additions & 8 deletions src/f1p/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def register_ui_components(self) -> Self:
30,
self.symbols_font,
self.text_font,
self.data_extractor
self.data_extractor,
)

circuit_map = Map(self.render, self.data_extractor)
Expand All @@ -76,7 +76,7 @@ def register_ui_components(self) -> Self:
self.symbols_font,
self.text_font,
circuit_map,
self.data_extractor
self.data_extractor,
)

self.ui_components = [
Expand All @@ -90,9 +90,4 @@ def register_ui_components(self) -> Self:

app = F1PlayerApp()
app.disableMouse() # disable camera controls
(
app.configure_window()
.draw_menu()
.register_ui_components()
.run()
)
(app.configure_window().draw_menu().register_ui_components().run())
Loading