-
Notifications
You must be signed in to change notification settings - Fork 1
Setup uv and ci (lint, publish) #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
aspeddro
wants to merge
4
commits into
basedosdados:main
Choose a base branch
from
aspeddro:setup-uv-ci
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| ci: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v9 | ||
|
|
||
| - name: Install dependencies | ||
| run: uv sync --frozen --all-groups | ||
|
|
||
| - name: Ruff lint | ||
| run: uv run ruff check --output-format=github server.py | ||
|
|
||
| - name: Pyrefly type check | ||
| run: uv run pyrefly check | ||
|
|
||
| - name: Build package | ||
| run: uv build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| name: Publish | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "v*" | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| environment: pypi | ||
| permissions: | ||
| id-token: write # required for PyPI trusted publishing (OIDC) | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v9 | ||
|
|
||
| - name: Build package | ||
| run: uv build | ||
|
|
||
| - name: Publish to PyPI | ||
| run: uv publish --trusted-publishing always |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.11 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| [project] | ||
| name = "databasis-mcp" | ||
| version = "0.1.0" | ||
| description = "MCP server exposing the Base dos Dados (basedosdados.org) API — metadata search, BigQuery queries, and metadata registration — as tools for AI agents." | ||
| readme = "README.md" | ||
| requires-python = ">=3.11" | ||
| license = { text = "MIT" } | ||
| authors = [{ name = "Ricardo Dahis", email = "rdahis@basedosdados.org" }] | ||
| keywords = ["mcp", "basedosdados", "bigquery", "llm", "data"] | ||
| classifiers = [ | ||
| "Programming Language :: Python :: 3", | ||
| "License :: OSI Approved :: MIT License", | ||
| "Operating System :: OS Independent", | ||
| ] | ||
| dependencies = [ | ||
| "fastmcp>=3.4,<4", | ||
| "requests>=2.31", | ||
| "google-cloud-bigquery>=3.0", | ||
| "types-requests>=2.33.0.20260712", | ||
| ] | ||
|
|
||
| [project.urls] | ||
| Homepage = "https://basedosdados.org" | ||
| Repository = "https://github.com/basedosdados/mcp" | ||
|
|
||
| [project.scripts] | ||
| databasis-mcp = "server:main" | ||
|
|
||
| [build-system] | ||
| requires = ["hatchling"] | ||
| build-backend = "hatchling.build" | ||
|
|
||
| [tool.hatch.build.targets.wheel] | ||
| only-include = ["server.py"] | ||
|
|
||
| [dependency-groups] | ||
| dev = [ | ||
| "pyrefly>=1.1.1", | ||
| "ruff>=0.16.0", | ||
| ] | ||
|
|
||
| [tool.ruff] | ||
| target-version = "py311" | ||
| line-length = 80 | ||
|
|
||
| [tool.ruff.lint] | ||
| select = [ | ||
| "E", # pycodestyle errors | ||
| "F", # pyflakes | ||
| "I", # isort | ||
| "UP", # pyupgrade | ||
| "B", # flake8-bugbear | ||
| "SIM", # flake8-simplify | ||
| ] | ||
|
|
||
| ignore = [ | ||
| # line-to-long | ||
| "E501" | ||
| ] | ||
|
|
||
| [tool.pyrefly] | ||
| project-includes = ["server.py"] | ||
| python-version = "3.11" |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| { | ||
| "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json", | ||
| "name": "io.github.basedosdados/mcp", | ||
| "description": "Exposes the Base dos Dados (basedosdados.org) API as tools for AI agents: metadata search, BigQuery queries, and metadata registration.", | ||
| "repository": { | ||
| "url": "https://github.com/basedosdados/mcp", | ||
| "source": "github" | ||
| }, | ||
| "version": "0.1.0", | ||
| "packages": [ | ||
| { | ||
| "registryType": "pypi", | ||
| "identifier": "databasis-mcp", | ||
| "version": "0.1.0", | ||
| "runtimeHint": "uvx", | ||
| "transport": { | ||
| "type": "stdio" | ||
| }, | ||
| "environmentVariables": [ | ||
| { | ||
| "description": "Target backend environment: local, dev, staging, or prod. Defaults to dev.", | ||
| "isRequired": false, | ||
| "format": "string", | ||
| "name": "ENV" | ||
| }, | ||
| { | ||
| "description": "GCP project charged for BigQuery queries. Falls back to ~/.basedosdados/credentials.json (gcp_project).", | ||
| "isRequired": false, | ||
| "format": "string", | ||
| "name": "GCP_PROJECT_ID" | ||
| }, | ||
| { | ||
| "description": "Base dos Dados backend token (bdtoken_...). Required only for write tools; falls back to ~/.basedosdados/credentials.json.", | ||
| "isRequired": false, | ||
| "format": "string", | ||
| "isSecret": true, | ||
| "name": "BACKEND_TOKEN" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://docs.pypi.org/trusted-publishers/
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rdahis esse PR tem alguns ajustes no mcp, principalmente para publicar no pypi. Tem interesse em publicar o mcp?
Se sim você pode configurar o pypi para fazer o lançamento usando github actions automaticamente? https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/