C-Achard commited on
Commit
935b48a
Β·
1 Parent(s): e189412

Add pyproject and pre-commit config

Browse files

Introduce a `pyproject.toml` with project metadata, runtime dependencies, and Ruff/pyproject-fmt settings, and add a matching `.pre-commit-config.yaml` to enforce basic file checks, pyproject validation, and formatting/linting. Also normalize `.gitignore` with a trailing newline.

Files changed (3) hide show
  1. .gitignore +2 -1
  2. .pre-commit-config.yaml +28 -0
  3. pyproject.toml +33 -0
.gitignore CHANGED
@@ -1,3 +1,4 @@
1
  # Byte-compiled / optimized / DLL files
2
  __pycache__/
3
- model/__pycache__/
 
 
1
  # Byte-compiled / optimized / DLL files
2
  __pycache__/
3
+ model/__pycache__/
4
+ .vscode/settings.json
.pre-commit-config.yaml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Adapted from DeepLabCut's .pre-commit-config.yaml.
2
+ repos:
3
+ - repo: https://github.com/pre-commit/pre-commit-hooks
4
+ rev: v6.0.0
5
+ hooks:
6
+ - id: check-added-large-files
7
+ - id: check-yaml
8
+ - id: check-toml
9
+ - id: check-merge-conflict
10
+ - id: end-of-file-fixer
11
+ - id: trailing-whitespace
12
+
13
+ - repo: https://github.com/tox-dev/pyproject-fmt
14
+ rev: v2.19.0
15
+ hooks:
16
+ - id: pyproject-fmt
17
+
18
+ - repo: https://github.com/abravalheri/validate-pyproject
19
+ rev: v0.25
20
+ hooks:
21
+ - id: validate-pyproject
22
+
23
+ - repo: https://github.com/astral-sh/ruff-pre-commit
24
+ rev: v0.15.6
25
+ hooks:
26
+ - id: ruff-check
27
+ args: [--fix, --unsafe-fixes]
28
+ - id: ruff-format
pyproject.toml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [project]
2
+ name = "deeplabcut-modelzoo-superanimals"
3
+ version = "0.1.0"
4
+ description = "Gradio Space for the DeepLabCut Model Zoo SuperAnimal models"
5
+ readme = "README.md"
6
+ requires-python = ">=3.12,<3.13"
7
+ classifiers = [
8
+ "Programming Language :: Python :: 3 :: Only",
9
+ "Programming Language :: Python :: 3.12",
10
+ ]
11
+ # Hugging Face Spaces install from requirements.txt only: keep both lists in sync.
12
+ dependencies = [
13
+ "deeplabcut[modelzoo,tf]==3.0.2",
14
+ "deeplabcut-live",
15
+ "dlclibrary",
16
+ "gitpython>=3.1.30",
17
+ "gradio",
18
+ "humanfriendly",
19
+ "psutil",
20
+ "ruamel-yaml==0.17.21",
21
+ "seaborn",
22
+ "ultralytics",
23
+ ]
24
+
25
+ [tool.ruff]
26
+ target-version = "py312"
27
+ line-length = 120
28
+ format.docstring-code-format = true
29
+ lint.select = [ "B", "E", "F", "I", "PIE", "UP" ]
30
+ lint.ignore = [ "B007", "E741" ]
31
+
32
+ [tool.pyproject-fmt]
33
+ max_supported_python = "3.12"