Skip to content

Commit b05cbaa

Browse files
authored
Refactor to make library installable as module (#42)
1 parent 388dd9a commit b05cbaa

36 files changed

+575
-380
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
pull_request
5+
6+
jobs:
7+
pre-commit:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Set up Python
13+
uses: actions/setup-python@v4
14+
with:
15+
python-version: '3.12'
16+
17+
- name: Install pre-commit
18+
run: pip install pre-commit
19+
20+
- name: Run pre-commit
21+
run: pre-commit run --all-files
22+
23+
tests:
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v5
31+
with:
32+
enable-cache: true
33+
34+
- name: Set up Python
35+
uses: actions/setup-python@v4
36+
with:
37+
python-version: '3.12'
38+
39+
- name: Install dependencies
40+
run: |
41+
uv sync --all-extras
42+
43+
- name: Run tests
44+
run: make test-firecrawl

.github/workflows/release.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
env:
9+
PYTHONVERSION: "3.12"
10+
11+
jobs:
12+
release:
13+
runs-on: macos-latest
14+
15+
steps:
16+
- name: Check out the repo
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Python and Install dependencies
22+
if: env.SKIP_RELEASE != 'true'
23+
run: |
24+
uv python install ${{ env.PYTHONVERSION }}
25+
uv venv
26+
uv pip install .
27+
uv pip install twine build toml
28+
29+
- name: Get version from main
30+
id: get-main-version
31+
run: |
32+
git switch main
33+
MAIN_VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
34+
echo "MAIN_VERSION=$MAIN_VERSION" >> $GITHUB_ENV
35+
git switch -
36+
37+
- name: Compare versions
38+
id: compare-versions
39+
run: |
40+
CUR_VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
41+
42+
echo "Current version in pyproject.toml: $CUR_VERSION"
43+
echo "Version on main branch: $MAIN_VERSION"
44+
45+
if [ "$CUR_VERSION" == "$MAIN_VERSION" ]; then
46+
echo "The version hasn't changed. Skipping release."
47+
echo "SKIP_RELEASE=true" >> $GITHUB_ENV
48+
else
49+
echo "Versions differ. Proceed with the release."
50+
echo "SKIP_RELEASE=false" >> $GITHUB_ENV
51+
52+
- name: Release to PyPI
53+
if: env.SKIP_RELEASE != 'true'
54+
env:
55+
TWINE_USERNAME: "__token__"
56+
TWINE_PASSWORD: ${{ secrets.PRIVATE_PYPI_PUBLISHER_TOKEN }}
57+
run: |
58+
uv run python -m build --sdist
59+
uv run twine upload -r pypi dist/*

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
*.ipynb_checkpoints*
66
build
77
.idea
8+
dist

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
## 0.1.2-dev
1+
## 0.1.2
22

33
### Enhancements
44

5-
- Ability to run the minimal client and server separately (relies on the HTTP SSE interaface)
5+
- Ability to run the minimal client and server separately (relies on the HTTP SSE interface)
6+
67
- Neo4j Username is now ENV variable instead of being tool argument
8+
79
- Added notebook with example workflow having Azure source and Neo4j destination
810

911
- **Destination connector adding**: MongoDB, Databricks Volumes, Databricks Volumes Delta Table, Pinecone
@@ -16,6 +18,8 @@
1618

1719
- Adds terminal access to the minimal client using DesktopCommanderMCP
1820

21+
- UNS-MCP server can be installed as standalone package, thus the usage of it is simplified for non-dev users
22+
1923
### Fixes
2024

2125
- avoid client startup error if env not defined

MANIFEST.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
graft uns_mcp
2+
prune notebooks
3+
prune minimal_client
4+
prune tests
5+
global-exclude *.py[cod] __pycache__/* *.egg-info/*

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sse-client:
88

99

1010
.PHONY: sse-client-terminal
11-
sse-client:
11+
sse-client-terminal:
1212
uv run python minimal_client/client.py "http://127.0.0.1:8080/sse" "@wonderwhy-er/desktop-commander"
1313

1414
.PHONY: sse-server

0 commit comments

Comments
 (0)