mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-04-28 16:48:30 -05:00
Fix physx test path and add pint dependency to pre-commit
- test_units.py: Use absolute path based on script location - .pre-commit-config.yaml: Add pint to additional_dependencies
This commit is contained in:
@@ -239,6 +239,7 @@ repos:
|
||||
name: "Book: PhysX unit checks"
|
||||
entry: python book/quarto/physx/test_units.py
|
||||
language: python
|
||||
additional_dependencies: [pint]
|
||||
pass_filenames: false
|
||||
files: ^book/quarto/contents/.*\.qmd$
|
||||
|
||||
|
||||
@@ -12,7 +12,12 @@ registered in pint's registry, not just a Python variable.
|
||||
"""
|
||||
|
||||
import sys
|
||||
sys.path.insert(0, "book/quarto")
|
||||
import os
|
||||
|
||||
# Add book/quarto to path (works from any working directory)
|
||||
_script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
_quarto_dir = os.path.dirname(_script_dir)
|
||||
sys.path.insert(0, _quarto_dir)
|
||||
|
||||
from physx.constants import *
|
||||
from physx.formulas import *
|
||||
|
||||
Reference in New Issue
Block a user