Skip to content

Commit 4a37615

Browse files
kwrkbclaude
andcommitted
Migrate to uv environment and bump version to 0.2.0
Major changes: - Migrate build backend from setuptools to hatchling - Add uv support with .python-version and uv.lock - Rename command from sqliteviewer to sqliteview - Update application name from "SQLite Viewer" to "SQLite View" - Add uv installation instructions to README (uv run, uv tool install) - Include GitHub direct install method for easy setup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3115176 commit 4a37615

8 files changed

Lines changed: 384 additions & 34 deletions

File tree

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10

README.md

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,51 @@ sudo apt-get install -y libxcb-cursor0 libxkbcommon-x11-0 libxcb-icccm4 libxcb-k
2323

2424
## Getting Started
2525

26+
### Option 1: Using uv (Recommended)
27+
28+
This project is set up to work with [uv](https://github.com/astral-sh/uv), a fast Python package manager.
29+
30+
#### Development Setup
31+
2632
```bash
27-
# create & activate a virtual environment
28-
python3 -m venv .venv
29-
source .venv/bin/activate
33+
# Install dependencies (creates .venv automatically)
34+
uv sync --dev
3035

31-
# install in editable mode with dev extras
32-
pip install --upgrade pip
33-
pip install -e ".[dev]"
36+
# Run the application locally
37+
uv run sqliteview /path/to/database.sqlite
38+
39+
# Or run without arguments to browse for a database
40+
uv run sqliteview
3441
```
35-
Keep the extras in quotes (the `".[dev]"` part) so shells like `zsh` don't treat it as a glob pattern.
3642

37-
If you prefer `uv`, install it beforehand (for example `pip install uv`) and then run `uv pip install -e ".[dev]"` inside the virtual environment.
43+
#### Global Installation
44+
45+
Install the tool globally to use it from anywhere:
46+
47+
```bash
48+
# Install from GitHub (easiest - no need to clone)
49+
uv tool install git+https://github.com/yugosasaki/SQLiteView.git
50+
51+
# Or install from local directory
52+
uv tool install .
3853

39-
Launch the viewer:
54+
# Now you can run it from anywhere
55+
sqliteview /path/to/database.sqlite
56+
```
57+
58+
### Option 2: Traditional pip Method
4059

4160
```bash
42-
sqliteviewer /path/to/database.sqlite
61+
# Create & activate a virtual environment
62+
python3 -m venv .venv
63+
source .venv/bin/activate
64+
65+
# Install in editable mode with dev extras
66+
pip install --upgrade pip
67+
pip install -e ".[dev]"
68+
69+
# Launch the viewer
70+
sqliteview /path/to/database.sqlite
4371
```
4472

4573
## Running Tests

README_ja.md

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,40 @@ sudo apt-get install -y libxcb-cursor0 libxkbcommon-x11-0 libxcb-icccm4 libxcb-k
2323

2424
## はじめに
2525

26+
### 方法1: uv を使う(推奨)
27+
28+
このプロジェクトは高速なPythonパッケージマネージャー [uv](https://github.com/astral-sh/uv) で動作するように設定されています。
29+
30+
#### 開発環境のセットアップ
31+
32+
```bash
33+
# 依存関係をインストール(自動的に .venv が作成されます)
34+
uv sync --dev
35+
36+
# アプリケーションをローカルで実行
37+
uv run sqliteview /path/to/database.sqlite
38+
39+
# または引数なしで実行してデータベースを選択
40+
uv run sqliteview
41+
```
42+
43+
#### グローバルインストール
44+
45+
ツールをグローバルにインストールして、どこからでも使用できるようにします:
46+
47+
```bash
48+
# GitHubから直接インストール(最も手軽 - クローン不要)
49+
uv tool install git+https://github.com/yugosasaki/SQLiteView.git
50+
51+
# またはローカルディレクトリからインストール
52+
uv tool install .
53+
54+
# これでどこからでも実行可能
55+
sqliteview /path/to/database.sqlite
56+
```
57+
58+
### 方法2: 従来の pip を使う方法
59+
2660
```bash
2761
# 仮想環境の作成と有効化
2862
python3 -m venv .venv
@@ -31,16 +65,9 @@ source .venv/bin/activate
3165
# 開発用追加機能と共に編集可能モードでインストール
3266
pip install --upgrade pip
3367
pip install -e ".[dev]"
34-
```
35-
36-
`zsh` などでは `".[dev]"` 部分をクォートしておくと、グロブ展開されずに extras 指定がそのまま渡せます。
37-
38-
`uv` を利用する場合は、事前に(例: `pip install uv`)インストールした上で、仮想環境内で `uv pip install -e ".[dev]"` を実行してください。
3968

40-
ビューアの起動:
41-
42-
```bash
43-
sqliteviewer /path/to/database.sqlite
69+
# ビューアの起動
70+
sqliteview /path/to/database.sqlite
4471
```
4572

4673
## テストの実行

pyproject.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[build-system]
2-
requires = ["setuptools>=65", "wheel"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
44

55
[project]
66
name = "sqliteviewer"
7-
version = "0.1.0"
8-
description = "PyQt6-based SQLite viewer for Ubuntu"
7+
version = "0.2.0"
8+
description = "PyQt6-based SQLite database browser for Ubuntu"
99
readme = "README.md"
1010
authors = [
1111
{ name = "SQLite Viewer Team", email = "dev@example.com" }
@@ -38,13 +38,13 @@ Homepage = "https://example.com/sqliteviewer"
3838
Repository = "https://example.com/sqliteviewer/repo"
3939

4040
[project.scripts]
41-
sqliteviewer = "sqliteviewer.__main__:main"
41+
sqliteview = "sqliteviewer.__main__:main"
4242

43-
[tool.setuptools.package-data]
44-
"sqliteviewer" = [
45-
"resources/icon.png",
46-
"resources/sqliteviewer.desktop"
47-
]
43+
[tool.hatch.build.targets.wheel]
44+
packages = ["src/sqliteviewer"]
45+
46+
[tool.hatch.build.targets.wheel.force-include]
47+
"src/sqliteviewer/resources" = "sqliteviewer/resources"
4848

4949
[tool.pytest.ini_options]
5050
testpaths = ["tests"]

src/sqliteviewer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""SQLite Viewer package."""
22

33
__all__ = ["__version__"]
4-
__version__ = "0.1.0"
4+
__version__ = "0.2.0"

src/sqliteviewer/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111

1212

1313
def build_parser() -> argparse.ArgumentParser:
14-
parser = argparse.ArgumentParser(description="SQLite Viewer application")
14+
parser = argparse.ArgumentParser(description="SQLite View application")
1515
parser.add_argument("database", nargs="?", help="Path to a SQLite database to open")
1616
parser.add_argument(
1717
"--version",
1818
action="version",
19-
version=f"SQLite Viewer {__version__}",
19+
version=f"SQLite View {__version__}",
2020
)
2121
return parser
2222

src/sqliteviewer/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ def run(initial_path: Optional[str] = None) -> int:
1818
owns_app = False
1919
if app is None:
2020
app = QApplication(sys.argv)
21-
app.setApplicationName("SQLite Viewer")
22-
app.setOrganizationName("SQLiteViewer")
21+
app.setApplicationName("SQLite View")
22+
app.setOrganizationName("SQLiteView")
2323
app.setOrganizationDomain("example.com")
2424
owns_app = True
2525

0 commit comments

Comments
 (0)