summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore169
-rw-r--r--README.md53
-rw-r--r--pyproject.toml43
-rw-r--r--requirements.txt2
-rw-r--r--src/ollama_web/__init__.py3
-rw-r--r--src/ollama_web/main.py13
-rw-r--r--tests/__init__.py11
7 files changed, 294 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1281d45
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,169 @@
+# 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
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to omit them in the git repo.
+*.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
+# For a library or package, you might want to ignore these files since the code is
+# intended to run in multiple environments; otherwise, check them in:
+# .python-version
+
+# pipenv
+# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+# However, in case of collaboration, if having platform-specific dependencies or dependencies
+# having no cross-platform support, pipenv may install dependencies that don't work, or not
+# install all needed dependencies.
+#Pipfile.lock
+
+# poetry
+# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
+# This is especially recommended for binary packages to ensure reproducible builds.
+# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
+#poetry.lock
+
+# pdm
+# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
+#pdm.lock
+# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
+# in version control.
+# https://pdm.fming.dev/#use-with-ide
+.pdm.toml
+
+# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
+__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/
+
+# PyCharm
+# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
+# be added to the global gitignore or merged into this project's gitignore.
+.idea/
+
+# VS Code
+.vscode/
+
+# OS
+.DS_Store
+Thumbs.db
+
+# Ollama / project specific
+models/
+*.gguf
+*.bin \ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..261007b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,53 @@
+# ollama-web
+
+Ollama を用いた Web アプリケーションプロジェクト。
+
+## セットアップ
+
+```bash
+# 仮想環境の作成
+uv venv .venv
+
+# 依存パッケージのインストール
+uv pip install -r requirements.txt -p .venv
+
+# 開発用パッケージのインストール
+uv pip install -e ".[dev]" -p .venv
+```
+
+## プロジェクト構成
+
+```
+ollama-web/
+├── src/
+│ └── ollama_web/ # メインパッケージ
+│ ├── __init__.py
+│ └── main.py # エントリポイント
+├── tests/ # テストコード
+├── docs/ # ドキュメント
+├── scripts/ # スクリプト類
+├── .gitignore
+├── pyproject.toml # プロジェクト設定 (ruff, pytest, mypy 等)
+├── requirements.txt # 本番依存パッケージ
+└── README.md
+```
+
+## 使い方
+
+```bash
+# アプリケーションの実行
+ollama-web
+
+# テストの実行
+pytest
+
+# リント
+ruff check .
+
+# 型チェック
+mypy src/
+```
+
+## ライセンス
+
+MIT \ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..236cc4f
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,43 @@
+[build-system]
+requires = ["setuptools>=68.0", "wheel"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "ollama-web"
+version = "0.1.0"
+description = "Ollama web project"
+readme = "README.md"
+requires-python = ">=3.10"
+dependencies = [
+ "ollama>=0.6.2",
+ "ddgs>=9.14.4",
+]
+
+[project.optional-dependencies]
+dev = [
+ "pytest>=8.0",
+ "pytest-cov>=5.0",
+ "ruff>=0.5",
+ "mypy>=1.10",
+]
+
+[project.scripts]
+ollama-web = "ollama_web.main:main"
+
+[tool.setuptools.packages.find]
+where = ["src"]
+
+[tool.ruff]
+line-length = 100
+target-version = "py310"
+
+[tool.ruff.lint]
+select = ["E", "F", "I", "UP", "B"]
+
+[tool.pytest.ini_options]
+testpaths = ["tests"]
+pythonpath = ["src"]
+
+[tool.mypy]
+python_version = "3.10"
+strict = true \ No newline at end of file
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..f42d6de
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,2 @@
+ollama>=0.6.2
+ddgs>=9.14.4 \ No newline at end of file
diff --git a/src/ollama_web/__init__.py b/src/ollama_web/__init__.py
new file mode 100644
index 0000000..10040d0
--- /dev/null
+++ b/src/ollama_web/__init__.py
@@ -0,0 +1,3 @@
+"""Ollama web project."""
+
+__version__ = "0.1.0" \ No newline at end of file
diff --git a/src/ollama_web/main.py b/src/ollama_web/main.py
new file mode 100644
index 0000000..c6836fc
--- /dev/null
+++ b/src/ollama_web/main.py
@@ -0,0 +1,13 @@
+"""Main entry point for the ollama-web application."""
+
+import sys
+
+
+def main() -> int:
+ """Run the application."""
+ print("ollama-web starting...")
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main()) \ No newline at end of file
diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 0000000..53a83b6
--- /dev/null
+++ b/tests/__init__.py
@@ -0,0 +1,11 @@
+</content>
+</write_in_file><write_to_file>
+<path>tests/test_main.py</path>
+<content>"""Tests for ollama_web.main."""
+
+from ollama_web.main import main
+
+
+def test_main() -> None:
+ """Test that main returns 0."""
+ assert main() == 0 \ No newline at end of file