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
161 changes: 161 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
Pipfile.lock

# poetry
# Note: Do NOT ignore poetry.lock - it should be committed
dist/

# PEP 582
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# IDEs
.idea/
.vscode/
*.swp
*.swo
*~
.DS_Store

# Claude settings
.claude/*

# Testing specific
test-results/
.benchmarks/

# Temporary files
*.tmp
*.temp
*.bak

# OS specific
Thumbs.db
ehthumbs.db
Desktop.ini
$RECYCLE.BIN/
*.lnk
27 changes: 27 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Project Context

This file contains important context and notes for Claude Code.

## Testing Commands
- Run tests: `poetry run test` or `poetry run tests`
- Run specific test: `poetry run pytest tests/path/to/test.py`
- Run with coverage: `poetry run pytest --cov`
- Run unit tests only: `poetry run pytest -m unit`
- Run integration tests only: `poetry run pytest -m integration`
- Run without slow tests: `poetry run pytest -m "not slow"`

## Linting Commands
- To be determined after setup

## Project Structure
- Tests are located in `tests/` directory
- Unit tests in `tests/unit/`
- Integration tests in `tests/integration/`
- Test configuration in `pyproject.toml`
- Shared fixtures in `tests/conftest.py`

## Package Management
- Using Poetry for dependency management
- Install dependencies: `poetry install`
- Add new dependency: `poetry add <package>`
- Add dev dependency: `poetry add --group dev <package>`
83 changes: 83 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
[tool.poetry]
name = "web-thinker"
version = "0.1.0"
description = "A project for web search and thinking capabilities"
authors = ["Your Name <you@example.com>"]
readme = "README.md"
packages = [{include = "scripts"}, {include = "demo"}]

[tool.poetry.dependencies]
python = "^3.9"
torch = "^2.5.0"
transformers = "^4.46.0"
sentencepiece = "^0.2.0"
# vllm = "0.6.4" # Commented out due to system dependencies
tqdm = "^4.67.0"
nltk = "^3.9.0"

[tool.poetry.group.dev.dependencies]
pytest = "^8.0.0"
pytest-cov = "^5.0.0"
pytest-mock = "^3.14.0"

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

[tool.pytest.ini_options]
minversion = "8.0"
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"--strict-markers",
"--verbose",
"--cov=scripts",
"--cov=demo",
"--cov-report=html",
"--cov-report=xml",
"--cov-report=term-missing",
# "--cov-fail-under=80", # Uncomment when actual tests are written
]
markers = [
"unit: Unit tests",
"integration: Integration tests",
"slow: Slow running tests",
]
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning",
]

[tool.coverage.run]
source = ["scripts", "demo"]
omit = [
"*/tests/*",
"*/__pycache__/*",
"*/test_*.py",
"*/*_test.py",
"*/conftest.py",
"*/setup.py",
]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if __name__ == .__main__.:",
"raise AssertionError",
"raise NotImplementedError",
"if TYPE_CHECKING:",
]
precision = 2
show_missing = true
skip_covered = false

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

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Tests package initialization
Loading