Skip to content

Free Motion Capture for Everyone πŸ’€βœ¨

TypeScript
10.0 KB
Raw Blame
[project]
name = "freemocap"
version = "2.0.0a25"  # bumpver
description = "A free and open source markerless motion capture system for everyone πŸ’€βœ¨"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
    #    "aniposelib>=0.7.0",
    "numba>=0.65.1",
    "libsass>=0.23.0",
    "opencv-contrib-python",#==4.10.*",
    "pyinstaller>=6.11.0",
    "requests>=2.32.3",
    "pydantic>=2.10.4",
    "numpydantic>=1.6.7",
    "scikit-learn>=1.7.2",
    "tomli-w>=1.2.0",
    "scipy-stubs~=1.17.1",
    "beartype>=0.19",
    "msgspec>=0.19",
    #sub-skellies
    "freemocap_blender_addon",
    "skellycam",
    "skellyforge",
    "skelly_synchronize",
    #skelly utils
    "skellylogs",
    "skellypings",
    #    "skellymodels",
]

# Published, pip-installable variant selection β€” for PyPI users, not `uv sync`
# (which gets skellytracker automatically via the "tracker-default" dependency
# group below; dependency-groups aren't part of a package's published metadata,
# so this is the only channel pip users have):
#   pip install freemocap[cuda]   (Windows/Linux, NVIDIA GPU acceleration)
#   pip install freemocap[cpu]    (macOS, or Windows/Linux without a supported GPU)
[project.optional-dependencies]
cuda = ["skellytracker[all-cuda]"]
cpu = ["skellytracker[all-cpu]"]

[tool.uv.sources]
skellycam = { git = "https://github.com/freemocap/skellycam", branch = "main" }
skellytracker = { git = "https://github.com/freemocap/skellytracker", branch = "main" }
skellyforge = { git = "https://github.com/freemocap/skellyforge", branch = "main" }
skelly_synchronize = { git = "https://github.com/freemocap/skellysync", branch = "philip/rewrite" }
freemocap_blender_addon = { git = "https://github.com/freemocap/freemocap_blender_addon", branch = "main" }

skellylogs = { git = "https://github.com/freemocap/skellylogs" }
skellypings = { git = "https://github.com/freemocap/skellypings" }
#skellymodels = { git = "https://github.com/freemocap/skellymodels" }

[project.scripts]
freemocap = "freemocap.__main__:run_main"
[tool.setuptools]
packages = ["freemocap"]

  [tool.uv]
  package = true
  environments = [
      "sys_platform == 'darwin'",
      "sys_platform == 'linux' and platform_machine == 'x86_64'",
      "sys_platform == 'win32' and platform_machine == 'AMD64'",
  ]
  # Plain `uv sync` always installs a working skellytracker via the "tracker-default"
  # group below, which platform-switches between CUDA (Windows/Linux) and CPU
  # (macOS) automatically. To force a specific variant regardless of platform β€”
  # e.g. the CI build matrix building a CPU installer on a Windows/Linux runner β€”
  # bypass the default and pick a group explicitly:
  #   uv sync --no-default-groups --group cuda
  #   uv sync --no-default-groups --group cpu
  # (--no-default-groups is required β€” cuda and cpu both ship skellytracker with a
  # different onnxruntime backend and can't coexist on disk, see the rtmlib note below.)
  default-groups = ["tracker-default"]
  override-dependencies = [
      "numpy>=2.3.4,<2.5",  # <2.5: NumPy 2.5 changed ScalarT internals, breaking beartype's NDArray introspection
      "pandas>=2.2.2,<3",  # pandas<2.2.2 wheels are built against the NumPy 1.x C ABI and crash importing against NumPy 2.x; <3 avoids the major-version jump
      "mediapipe==0.10.33; sys_platform != 'darwin' or platform_machine != 'x86_64'",
  ]

  # This project uses opencv-contrib-python (a superset of opencv-python); having
  # both installed causes a file-collision error.
  exclude-dependencies = ["opencv-python"]

  [[tool.uv.index]]
  name = "nvidia"
  url = "https://pypi.nvidia.com"

# rtmlib==0.0.14 hard-depends on the CPU `onnxruntime` package. skellytracker[all-cuda]
# pulls in `onnxruntime-gpu`. Both share the same top-level `onnxruntime` import and
# cannot coexist on disk β€” whichever installs last clobbers the other's
# `onnxruntime_pybind11_state.pyd`, so the CPU build wins and CUDA/TensorRT execution
# providers disappear from `onnxruntime.get_available_providers()`.
#
# `[[tool.uv.dependency-metadata]]` is only honored for the root project, so
# skellytracker's own copy of this override does not apply when freemocap resolves β€”
# it must be repeated here to strip rtmlib's onnxruntime dep from the resolution graph.
# rtmlib still imports fine at runtime because onnxruntime-gpu satisfies the import.
#
# [[tool.uv.dependency-metadata]] must come after all plain [tool.uv] keys because
# TOML array tables absorb subsequent sibling keys into their scope.
[[tool.uv.dependency-metadata]]
name = "rtmlib"
version = "0.0.14"
requires-dist = ["numpy", "opencv-contrib-python", "opencv-python", "tqdm"]

# ---- Version Bumping (bumpver) ----
# Run with: uv run poe bump-alpha   (see [tool.poe.tasks] in poe_tasks.toml)
#
# `current_version` below is the ONE canonical version. bumpver writes it to
# every file in the format that ecosystem requires:
#   - pyproject.toml `version`               PEP 440,  e.g. 2.0.0a2        (pip/uv)
#   - freemocap/__init__.py `__version__`     display,  e.g. v2.0.0-alpha.2 (Python runtime)
#   - freemocap-ui/package.json `version`     npm semver, e.g. 2.0.0-alpha.2 (Electron)
#   - freemocap-docs .../downloads.ts         display,  e.g. 2.0.0-alpha.2  (docs site)
#
# The v2 rewrite lives on `development`, which branched before the v1.5+ tags,
# so `git describe` still resolves to v1.4.7. Every bump command therefore passes
# --ignore-vcs-tag to bypass those stale VCS tags (baked into the poe tasks).
[tool.bumpver]
current_version = "v2.0.0-alpha.25"
version_pattern = "vMAJOR.MINOR.PATCH[-TAG.NUM]"
commit_message = "Bump version {old_version} -> {new_version}"
commit = true
tag = true
push = true

[tool.bumpver.file_patterns]
# current_version (the canonical field in [tool.bumpver] above) MUST be listed here
# explicitly: bumpver only auto-updates current_version when the config file is
# ABSENT from file_patterns. pyproject.toml is present (for the [project] version
# line below), which suppresses that auto-update β€” so without the first pattern here,
# current_version never advances and every bump recomputes the same already-released
# version, producing an empty diff ("nothing to commit") and a duplicate tag.
"pyproject.toml" = [
    'current_version = "{version}"',
    # The `# bumpver` marker pins this to the [project] version line ONLY β€” a bare
    # `version = "..."` pattern also matches the rtmlib [[tool.uv.dependency-metadata]]
    # pin above and clobbers it. (Both the marker and that pin go away when rtmlib does.)
    'version = "{pep440_version}"  # bumpver',
]
"freemocap/__init__.py" = ['__version__ = "{version}"']
"freemocap-ui/package.json" = ['"version": "MAJOR.MINOR.PATCH[-TAG.NUM]"']
# freemocap-docs is a separate repo (not tracked here), so bumpver can't git-add it
# β€” its DEFAULT_VERSION is bumped in that repo, not from freemocap.




# =============================================================================
# Dev dependencies
# =============================================================================
# Install with:  uv sync --group dev
# =============================================================================

[dependency-groups]
# skellytracker's CUDA vs. CPU onnxruntime backend β€” mutually exclusive, select
# exactly one via --group (see the default-groups note under [tool.uv] above).
cuda = ["skellytracker[all-cuda]"]
cpu = ["skellytracker[all-cpu]"]
# Platform-switched default used by plain `uv sync` (via [tool.uv] default-groups):
# CUDA on Windows/Linux, CPU on macOS β€” mirrors the old sys_platform-marker setup.
tracker-default = [
    "skellytracker[all-cuda]; sys_platform != 'darwin'",
    "skellytracker[all-cpu]; sys_platform == 'darwin'",
]
pyceres = [
    "pyceres>=2.5",
]
dev = [
    "bumpver",
    "pip-tools",
    "pytest>=8.4.0",
    "pytest-asyncio>=1.0.0",
    "pytest-timeout>=2.0.0",
    "httpx>=0.28.0",
    "pyinstaller>=6.15.0",
    "ruff>=0.9.0",
    "poethepoet>=0.32.0",
]
# Poe the Poet tasks live in poe_tasks.toml
# Run with:   uv run poe <task-name>       (e.g. uv run poe update)
# List all:   uv run poe --help


# =============================================================================
# Pytest config
# =============================================================================

[tool.pytest.ini_options]
asyncio_mode = "auto"
log_cli = true
log_cli_level = "INFO"
log_cli_format = "%(asctime)s [%(levelname)s] %(name)s: %(message)s"
log_cli_date_format = "%H:%M:%S"
markers = [
    "e2e: end-to-end tests that run real pipelines against on-disk test data (freemocap_test_data)",
    "slow: slow tests (e.g. realtime full-skeleton RTMPose inference over all frames)",
]


# =============================================================================
# Ruff linter config
# =============================================================================
# TC rules move imports that are ONLY used in type annotations behind an
# `if TYPE_CHECKING:` block, so they don't execute at runtime. This makes
# multiprocessing child process spawns faster (fewer files to import).
#
# Ruff automatically detects and preserves imports used in:
#   - isinstance() / issubclass() calls
#   - Base classes
#   - Default values and runtime expressions
#   - Pydantic field types (via runtime-evaluated-base-classes below)
#   - Dataclass field types (via runtime-evaluated-decorators below)
#
# If ruff incorrectly flags an import that IS needed at runtime,
# add  # noqa: TC003  (or TC001/TC002) to that import line.
# =============================================================================

[tool.ruff.lint]
select = [
    "TC",    # flake8-type-checking: move type-only imports behind TYPE_CHECKING
]

[tool.ruff.lint.flake8-type-checking]
# Pydantic evaluates field type annotations at runtime for validation/serialization.
# Imports used as field types on these base classes must NOT be moved behind
# TYPE_CHECKING or Pydantic will fail at class creation.
runtime-evaluated-base-classes = [
    "pydantic.BaseModel",
    "pydantic.BaseSettings",
]
runtime-evaluated-decorators = [
    "dataclasses.dataclass",
]
exempt-modules = ["typing", "typing_extensions"]