Skip to content

Commit efded60

Browse files
authored
Prepare for release (#1)
1 parent 5351943 commit efded60

29 files changed

+346
-269
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: "Build"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v5
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v6
18+
- name: Install Python 3.13
19+
run: uv python install 3.13
20+
- name: Build package
21+
run: uv build

.github/workflows/publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Publish"
2+
3+
on:
4+
release:
5+
types:
6+
- released
7+
8+
jobs:
9+
run:
10+
runs-on: ubuntu-latest
11+
environment:
12+
name: pypi
13+
permissions:
14+
id-token: write
15+
contents: read
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v5
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v6
21+
- name: Install Python 3.13
22+
run: uv python install 3.13
23+
- name: Build
24+
run: uv build
25+
- name: Publish
26+
run: uv publish

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
recursive-include src/crowdsec_local_mcp/prompts *.txt
2+
recursive-include src/crowdsec_local_mcp/compose *
3+
recursive-include src/crowdsec_local_mcp/yaml-schemas *.yaml

pyproject.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,19 @@ dependencies = [
1010
"pyyaml>=6.0.3",
1111
"requests>=2.32.5",
1212
]
13+
14+
[project.scripts]
15+
crowdsec-mcp = "crowdsec_local_mcp.__main__:run"
16+
17+
[build-system]
18+
requires = ["setuptools>=69", "wheel"]
19+
build-backend = "setuptools.build_meta"
20+
21+
[tool.setuptools]
22+
include-package-data = true
23+
24+
[tool.setuptools.package-dir]
25+
"" = "src"
26+
27+
[tool.setuptools.packages.find]
28+
where = ["src"]

src/crowdsec_local_mcp/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""CrowdSec MCP package."""
2+
3+
from .mcp_core import main
4+
5+
__all__ = ["main"]

mcp-stdio.py renamed to src/crowdsec_local_mcp/__main__.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,21 @@
22

33
import asyncio
44

5-
from mcp_core import LOGGER, main
5+
from .mcp_core import LOGGER, main
66

77
# Import modules for their registration side effects.
8-
import mcp_waf # noqa: F401
8+
from . import mcp_waf # noqa: F401
99

1010
try:
11-
import mcp_scenarios # noqa: F401
11+
from . import mcp_scenarios # noqa: F401
1212
except ModuleNotFoundError:
1313
LOGGER.warning("Scenario module not available; scenario tools disabled")
1414

1515

16-
if __name__ == "__main__":
16+
def run() -> None:
17+
"""Entry-point used by console scripts."""
1718
asyncio.run(main())
19+
20+
21+
if __name__ == "__main__":
22+
run()

compose/waf-test/.gitignore renamed to src/crowdsec_local_mcp/compose/waf-test/.gitignore

File renamed without changes.

compose/waf-test/crowdsec/acquis.d/appsec.yaml renamed to src/crowdsec_local_mcp/compose/waf-test/crowdsec/acquis.d/appsec.yaml

File renamed without changes.

compose/waf-test/crowdsec/appsec-configs/mcp-appsec.yaml.template renamed to src/crowdsec_local_mcp/compose/waf-test/crowdsec/appsec-configs/mcp-appsec.yaml.template

File renamed without changes.

compose/waf-test/crowdsec/init-bouncer.sh renamed to src/crowdsec_local_mcp/compose/waf-test/crowdsec/init-bouncer.sh

File renamed without changes.

0 commit comments

Comments
 (0)