Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 18 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,21 @@ launch.py
*.qdrep
*.sqlite

.pytest*
# Testing
.pytest_cache/
.coverage
htmlcov/
coverage.xml
*.cover
*.py,cover
.hypothesis/
.tox/
.nox/

# Claude
.claude/*

# Poetry
dist/
*.egg-info/
.eggs/
43 changes: 43 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Claude Code - Project Commands

## Testing Commands

### Run all tests
```bash
poetry run pytest
```

### Run tests with coverage
```bash
poetry run pytest --cov
```

### Run specific test file
```bash
poetry run pytest tests/test_file.py
```

### Run tests by marker
```bash
poetry run pytest -m unit
poetry run pytest -m integration
poetry run pytest -m "not slow"
```

### Run tests with verbose output
```bash
poetry run pytest -v
```

## Linting & Type Checking

*Note: No linting or type checking tools are currently configured for this project.*

## Project Structure
- `tests/` - Test directory
- `conftest.py` - Shared pytest fixtures
- `unit/` - Unit tests
- `integration/` - Integration tests

## Dependencies
All dependencies are managed through Poetry. Use `poetry install` to install all dependencies including test dependencies.
92 changes: 92 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
[tool.poetry]
name = "ssod"
version = "0.0.1"
description = "Semi-Supervised Object Detection Benchmark"
authors = ["someone <someone@example.com>"]
readme = "README.md"
packages = [{include = "ssod"}]

[tool.poetry.dependencies]
python = "^3.8"
torch = "*"
torchvision = "*"
mmcv-full = "*"
wandb = "*"
prettytable = "*"

[tool.poetry.group.dev.dependencies]
pytest = "^7.4.0"
pytest-cov = "^4.1.0"
pytest-mock = "^3.11.1"

[tool.poetry.scripts]
test = "pytest"
tests = "pytest"

[tool.pytest.ini_options]
minversion = "7.0"
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
"--cov=ssod",
"--cov-branch",
"--cov-report=term-missing:skip-covered",
"--cov-report=html:htmlcov",
"--cov-report=xml:coverage.xml",
"--cov-fail-under=80",
]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
"unit: Unit tests",
"integration: Integration tests",
"slow: Slow running tests",
]
filterwarnings = [
"error",
"ignore::UserWarning",
"ignore::DeprecationWarning",
]

[tool.coverage.run]
source = ["ssod"]
branch = true
parallel = true
omit = [
"*/tests/*",
"*/test_*",
"*/__init__.py",
"*/setup.py",
"*/version.py",
]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if __name__ == .__main__.:",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if False:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
precision = 2
show_missing = true
skip_covered = false
skip_empty = true

[tool.coverage.html]
directory = "htmlcov"

[tool.coverage.xml]
output = "coverage.xml"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"