phlo-pgweb 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- phlo_pgweb-0.1.0/PKG-INFO +15 -0
- phlo_pgweb-0.1.0/README.md +47 -0
- phlo_pgweb-0.1.0/pyproject.toml +41 -0
- phlo_pgweb-0.1.0/setup.cfg +4 -0
- phlo_pgweb-0.1.0/src/phlo_pgweb/__init__.py +0 -0
- phlo_pgweb-0.1.0/src/phlo_pgweb/plugin.py +29 -0
- phlo_pgweb-0.1.0/src/phlo_pgweb/service.yaml +23 -0
- phlo_pgweb-0.1.0/src/phlo_pgweb.egg-info/PKG-INFO +15 -0
- phlo_pgweb-0.1.0/src/phlo_pgweb.egg-info/SOURCES.txt +12 -0
- phlo_pgweb-0.1.0/src/phlo_pgweb.egg-info/dependency_links.txt +1 -0
- phlo_pgweb-0.1.0/src/phlo_pgweb.egg-info/entry_points.txt +2 -0
- phlo_pgweb-0.1.0/src/phlo_pgweb.egg-info/requires.txt +6 -0
- phlo_pgweb-0.1.0/src/phlo_pgweb.egg-info/top_level.txt +1 -0
- phlo_pgweb-0.1.0/tests/test_integration_pgweb.py +24 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: phlo-pgweb
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: pgweb service plugin for Phlo
|
|
5
|
+
Author-email: Phlo Team <team@phlo.dev>
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/plain
|
|
9
|
+
Requires-Dist: phlo>=0.1.0
|
|
10
|
+
Requires-Dist: pyyaml>=6.0.1
|
|
11
|
+
Provides-Extra: dev
|
|
12
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
13
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
14
|
+
|
|
15
|
+
pgweb service plugin for Phlo.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# phlo-pgweb
|
|
2
|
+
|
|
3
|
+
pgweb database browser service plugin for Phlo.
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
Web-based PostgreSQL database browser for exploring metadata, lineage store, and operational data.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install phlo-pgweb
|
|
13
|
+
# or
|
|
14
|
+
phlo plugin install pgweb
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Configuration
|
|
18
|
+
|
|
19
|
+
| Variable | Default | Description |
|
|
20
|
+
| ------------------- | ------- | ----------------- |
|
|
21
|
+
| `PGWEB_PORT` | `8081` | Web UI port |
|
|
22
|
+
| `POSTGRES_USER` | `phlo` | Database user |
|
|
23
|
+
| `POSTGRES_PASSWORD` | `phlo` | Database password |
|
|
24
|
+
| `POSTGRES_DB` | `phlo` | Database name |
|
|
25
|
+
|
|
26
|
+
## Auto-Configuration
|
|
27
|
+
|
|
28
|
+
This package is **fully auto-configured**:
|
|
29
|
+
|
|
30
|
+
| Feature | How It Works |
|
|
31
|
+
| ------------------------ | ------------------------------------------------------- |
|
|
32
|
+
| **Database Connection** | Auto-connects to Phlo's PostgreSQL using `DATABASE_URL` |
|
|
33
|
+
| **Service Dependencies** | Depends on `postgres` service |
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
phlo services start --service pgweb
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Dependencies
|
|
42
|
+
|
|
43
|
+
- postgres
|
|
44
|
+
|
|
45
|
+
## Endpoints
|
|
46
|
+
|
|
47
|
+
- **Web UI**: `http://localhost:8081`
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=45", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "phlo-pgweb"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "pgweb service plugin for Phlo"
|
|
9
|
+
readme = {text = "pgweb service plugin for Phlo.", content-type = "text/plain"}
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
authors = [
|
|
12
|
+
{name = "Phlo Team", email = "team@phlo.dev"},
|
|
13
|
+
]
|
|
14
|
+
license = {text = "MIT"}
|
|
15
|
+
dependencies = [
|
|
16
|
+
"phlo>=0.1.0",
|
|
17
|
+
"pyyaml>=6.0.1",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[project.optional-dependencies]
|
|
21
|
+
dev = [
|
|
22
|
+
"pytest>=7.0",
|
|
23
|
+
"ruff>=0.1.0",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
[project.entry-points."phlo.plugins.services"]
|
|
27
|
+
pgweb = "phlo_pgweb.plugin:PgwebServicePlugin"
|
|
28
|
+
|
|
29
|
+
[tool.setuptools]
|
|
30
|
+
package-dir = {"" = "src"}
|
|
31
|
+
include-package-data = true
|
|
32
|
+
|
|
33
|
+
[tool.setuptools.packages.find]
|
|
34
|
+
where = ["src"]
|
|
35
|
+
|
|
36
|
+
[tool.setuptools.package-data]
|
|
37
|
+
phlo_pgweb = ['service.yaml']
|
|
38
|
+
|
|
39
|
+
[tool.ruff]
|
|
40
|
+
line-length = 100
|
|
41
|
+
target-version = "py311"
|
|
File without changes
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Pgweb service plugin."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from importlib import resources
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
import yaml
|
|
9
|
+
|
|
10
|
+
from phlo.plugins import PluginMetadata, ServicePlugin
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class PgwebServicePlugin(ServicePlugin):
|
|
14
|
+
"""Service plugin for pgweb."""
|
|
15
|
+
|
|
16
|
+
@property
|
|
17
|
+
def metadata(self) -> PluginMetadata:
|
|
18
|
+
return PluginMetadata(
|
|
19
|
+
name="pgweb",
|
|
20
|
+
version="0.1.0",
|
|
21
|
+
description="Web-based PostgreSQL database browser",
|
|
22
|
+
author="Phlo Team",
|
|
23
|
+
tags=["admin", "postgres", "ui"],
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
@property
|
|
27
|
+
def service_definition(self) -> dict[str, Any]:
|
|
28
|
+
service_path = resources.files("phlo_pgweb").joinpath("service.yaml")
|
|
29
|
+
return yaml.safe_load(service_path.read_text(encoding="utf-8"))
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: pgweb
|
|
2
|
+
description: Web-based PostgreSQL database browser
|
|
3
|
+
category: admin
|
|
4
|
+
default: true
|
|
5
|
+
|
|
6
|
+
image: sosedoff/pgweb
|
|
7
|
+
|
|
8
|
+
depends_on:
|
|
9
|
+
- postgres
|
|
10
|
+
|
|
11
|
+
compose:
|
|
12
|
+
restart: unless-stopped
|
|
13
|
+
labels:
|
|
14
|
+
phlo.metrics.enabled: "false"
|
|
15
|
+
environment:
|
|
16
|
+
DATABASE_URL: postgresql://${POSTGRES_USER:-phlo}:${POSTGRES_PASSWORD:-phlo}@postgres:5432/${POSTGRES_DB:-phlo}?sslmode=disable
|
|
17
|
+
ports:
|
|
18
|
+
- "${PGWEB_PORT:-8081}:8081"
|
|
19
|
+
|
|
20
|
+
env_vars:
|
|
21
|
+
PGWEB_PORT:
|
|
22
|
+
default: 8081
|
|
23
|
+
description: pgweb UI port
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: phlo-pgweb
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: pgweb service plugin for Phlo
|
|
5
|
+
Author-email: Phlo Team <team@phlo.dev>
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/plain
|
|
9
|
+
Requires-Dist: phlo>=0.1.0
|
|
10
|
+
Requires-Dist: pyyaml>=6.0.1
|
|
11
|
+
Provides-Extra: dev
|
|
12
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
13
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
14
|
+
|
|
15
|
+
pgweb service plugin for Phlo.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
src/phlo_pgweb/__init__.py
|
|
4
|
+
src/phlo_pgweb/plugin.py
|
|
5
|
+
src/phlo_pgweb/service.yaml
|
|
6
|
+
src/phlo_pgweb.egg-info/PKG-INFO
|
|
7
|
+
src/phlo_pgweb.egg-info/SOURCES.txt
|
|
8
|
+
src/phlo_pgweb.egg-info/dependency_links.txt
|
|
9
|
+
src/phlo_pgweb.egg-info/entry_points.txt
|
|
10
|
+
src/phlo_pgweb.egg-info/requires.txt
|
|
11
|
+
src/phlo_pgweb.egg-info/top_level.txt
|
|
12
|
+
tests/test_integration_pgweb.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
phlo_pgweb
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""Integration tests for phlo-pgweb."""
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
pytestmark = pytest.mark.integration
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def test_pgweb_plugin_initializes():
|
|
9
|
+
"""Test that PgWeb plugin can be instantiated."""
|
|
10
|
+
from phlo_pgweb.plugin import PgwebServicePlugin
|
|
11
|
+
|
|
12
|
+
plugin = PgwebServicePlugin()
|
|
13
|
+
assert plugin is not None
|
|
14
|
+
assert plugin.metadata.name == "pgweb"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def test_pgweb_service_definition():
|
|
18
|
+
"""Test that service definition can be loaded."""
|
|
19
|
+
from phlo_pgweb.plugin import PgwebServicePlugin
|
|
20
|
+
|
|
21
|
+
plugin = PgwebServicePlugin()
|
|
22
|
+
service_def = plugin.service_definition
|
|
23
|
+
|
|
24
|
+
assert isinstance(service_def, dict)
|