Skip to content

Commit a0f672a

Browse files
committed
fix: Fix CI/CD and implement dynamic versioning
- Switch to dynamic versioning from git tags using hatch-vcs - Remove static version file (version.py) - Fix Python version requirements in CI (3.12+ only) - Add Python 3.13 to test matrix - Fix pre-commit mypy configuration - Remove test files from repository - Add fetch-depth to checkout for proper git versioning - Fix linting errors in search.py - Default version is now 0.0.0-dev when no tags present
1 parent 34aaa1e commit a0f672a

22 files changed

Lines changed: 104 additions & 405 deletions

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ YOUTRACK_API_TOKEN=perm:your-api-token
1717
# YOUTRACK_VERIFY_SSL=true
1818

1919
# Optional: Enable debug logging (default: false)
20-
# MCP_DEBUG=false
20+
# MCP_DEBUG=false

.github/workflows/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,4 @@ Using Trusted Publisher provides:
103103
python -m pip install build twine
104104
python -m build
105105
twine upload dist/* # Will need API token
106-
```
106+
```

.github/workflows/ci.yml

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,26 @@ jobs:
1111
lint:
1212
name: Lint and type check
1313
runs-on: ubuntu-latest
14-
14+
1515
steps:
1616
- uses: actions/checkout@v4
17-
17+
with:
18+
fetch-depth: 0 # Fetch all history for proper versioning
19+
1820
- name: Set up Python
1921
uses: actions/setup-python@v5
2022
with:
2123
python-version: '3.12'
22-
24+
2325
- name: Install uv
2426
uses: astral-sh/setup-uv@v3
25-
27+
2628
- name: Install dependencies
2729
run: uv sync
28-
30+
2931
- name: Run Ruff
3032
run: uv run ruff check src/
31-
33+
3234
- name: Run MyPy
3335
run: uv run mypy src/youtrack_rocket_mcp --ignore-missing-imports
3436

@@ -37,22 +39,24 @@ jobs:
3739
runs-on: ubuntu-latest
3840
strategy:
3941
matrix:
40-
python-version: ['3.9', '3.10', '3.11', '3.12']
41-
42+
python-version: ['3.12', '3.13']
43+
4244
steps:
4345
- uses: actions/checkout@v4
44-
46+
with:
47+
fetch-depth: 0 # Fetch all history for proper versioning
48+
4549
- name: Set up Python ${{ matrix.python-version }}
4650
uses: actions/setup-python@v5
4751
with:
4852
python-version: ${{ matrix.python-version }}
49-
53+
5054
- name: Install uv
5155
uses: astral-sh/setup-uv@v3
52-
56+
5357
- name: Install dependencies
5458
run: uv sync
55-
59+
5660
- name: Run tests
5761
run: |
5862
uv run pytest tests/ -v --cov=youtrack_rocket_mcp --cov-report=term-missing
@@ -61,30 +65,32 @@ jobs:
6165
build:
6266
name: Build distribution
6367
runs-on: ubuntu-latest
64-
68+
6569
steps:
6670
- uses: actions/checkout@v4
67-
71+
with:
72+
fetch-depth: 0 # Fetch all history for proper versioning
73+
6874
- name: Set up Python
6975
uses: actions/setup-python@v5
7076
with:
7177
python-version: '3.12'
72-
78+
7379
- name: Install uv
7480
uses: astral-sh/setup-uv@v3
75-
81+
7682
- name: Build package
7783
run: uv build
78-
84+
7985
- name: Check distribution
8086
run: |
8187
uv pip install --system twine
8288
twine check dist/*
8389
ls -lah dist/
84-
90+
8591
- name: Upload artifacts
8692
uses: actions/upload-artifact@v4
8793
with:
8894
name: dist-${{ github.sha }}
8995
path: dist/
90-
retention-days: 7
96+
retention-days: 7

.github/workflows/release.yml

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,25 @@ jobs:
1313
environment: pypi
1414
permissions:
1515
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
16-
16+
1717
steps:
1818
- uses: actions/checkout@v4
19-
19+
2020
- name: Set up Python
2121
uses: actions/setup-python@v5
2222
with:
2323
python-version: '3.12'
24-
24+
2525
- name: Install build tools
2626
run: |
2727
python -m pip install --upgrade pip
2828
python -m pip install build
29-
29+
# Ensure git tags are available for versioning
30+
git fetch --prune --unshallow --tags || true
31+
3032
- name: Build package
3133
run: python -m build
32-
34+
3335
- name: Publish to PyPI
3436
uses: pypa/gh-action-pypi-publish@release/v1
3537
# Uses OIDC Trusted Publisher, no password needed!
@@ -41,7 +43,7 @@ jobs:
4143
permissions:
4244
contents: read
4345
packages: write
44-
46+
4547
steps:
4648
- name: Checkout repository
4749
uses: actions/checkout@v4
@@ -94,29 +96,31 @@ jobs:
9496
build-packages:
9597
name: Build Release Packages
9698
runs-on: ubuntu-latest
97-
99+
98100
steps:
99101
- uses: actions/checkout@v4
100-
102+
101103
- name: Set up Python
102104
uses: actions/setup-python@v5
103105
with:
104106
python-version: '3.12'
105-
107+
106108
- name: Install build tools
107109
run: |
108110
python -m pip install --upgrade pip
109111
python -m pip install build
110-
112+
# Ensure git tags are available for versioning
113+
git fetch --prune --unshallow --tags || true
114+
111115
- name: Build packages
112116
run: python -m build
113-
117+
114118
- name: Upload wheel
115119
uses: actions/upload-artifact@v4
116120
with:
117121
name: wheel
118122
path: dist/*.whl
119-
123+
120124
- name: Upload sdist
121125
uses: actions/upload-artifact@v4
122126
with:
@@ -130,26 +134,26 @@ jobs:
130134
runs-on: ubuntu-latest
131135
permissions:
132136
contents: write
133-
137+
134138
steps:
135139
- uses: actions/checkout@v4
136-
140+
137141
- name: Download wheel artifact
138142
uses: actions/download-artifact@v4
139143
with:
140144
name: wheel
141145
path: dist/
142-
146+
143147
- name: Download sdist artifact
144148
uses: actions/download-artifact@v4
145149
with:
146150
name: sdist
147151
path: dist/
148-
152+
149153
- name: Extract version from tag
150154
id: version
151155
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
152-
156+
153157
- name: Create Release
154158
uses: softprops/action-gh-release@v1
155159
with:
@@ -162,35 +166,35 @@ jobs:
162166
dist/*.tar.gz
163167
body: |
164168
## 🚀 Release v${{ steps.version.outputs.VERSION }}
165-
169+
166170
### Installation Options:
167-
171+
168172
#### Direct Download
169173
Download the packages attached to this release.
170-
174+
171175
#### PyPI
172176
```bash
173177
# Using uvx (no installation required)
174178
uvx youtrack-rocket-mcp
175-
179+
176180
# Or install with uv tool
177181
uv tool install youtrack-rocket-mcp
178-
182+
179183
# Or with pip
180184
pip install youtrack-rocket-mcp
181185
```
182-
186+
183187
#### Docker Hub
184188
```bash
185189
docker pull ivolnistov/youtrack-rocket-mcp:${{ steps.version.outputs.VERSION }}
186190
docker pull ivolnistov/youtrack-rocket-mcp:latest
187191
```
188-
192+
189193
#### GitHub Container Registry
190194
```bash
191195
docker pull ghcr.io/i-volnistov/youtrack-rocket-mcp:${{ steps.version.outputs.VERSION }}
192196
docker pull ghcr.io/i-volnistov/youtrack-rocket-mcp:latest
193197
```
194-
198+
195199
### What's Changed
196-
See the full changelog below.
200+
See the full changelog below.

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ __pycache__/
1313
*.so
1414
.Python
1515

16+
# Auto-generated version file
17+
src/youtrack_rocket_mcp/_version.py
18+
1619
# UV
1720
uv.lock
1821
env/
@@ -65,4 +68,4 @@ integration_tests/
6568
.python-version
6669
CLAUDE.md
6770
.claude/
68-
.qoder/
71+
.qoder/

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ repos:
1212
types: [python]
1313
args: [--fix]
1414
require_serial: true
15-
15+
1616
- id: ruff-format
1717
name: ruff (format)
1818
entry: uv run ruff format
@@ -27,7 +27,7 @@ repos:
2727
language: system
2828
types: [python]
2929
pass_filenames: false
30-
args: [youtrack_mcp]
30+
args: [src/youtrack_rocket_mcp, --ignore-missing-imports]
3131
require_serial: true
3232

3333
# General hooks
@@ -74,4 +74,4 @@ exclude: '^(\.git|\.venv|venv|build|dist|\.egg|\.pytest_cache|__pycache__|htmlco
7474
fail_fast: false
7575

7676
# Default stages
77-
default_stages: [pre-commit]
77+
default_stages: [pre-commit]

CHANGES.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
- Fixed: `lead` field replaced with `leader` in Project model and API requests
4646
- File: `src/youtrack_rocket_mcp/api/resources/projects.py`
4747

48-
2. **Custom fields in projects**
48+
2. **Custom fields in projects**
4949
- Custom fields now loaded only when requesting single project (optimization)
5050
- Custom fields not loaded when requesting project list
5151
- File: `src/youtrack_rocket_mcp/api/resources/projects.py`
@@ -62,7 +62,7 @@
6262
5. **Custom fields as dictionary**
6363
- Added `format_custom_fields()` function to convert custom fields to {name: value} dictionary
6464
- Updated queries to get full field values
65-
- Files:
65+
- Files:
6666
- `src/youtrack_rocket_mcp/api/resources/search.py`
6767
- `src/youtrack_rocket_mcp/tools/search.py`
6868
- `src/youtrack_rocket_mcp/tools/issues.py`
@@ -78,4 +78,4 @@
7878
- Custom fields returned as dictionary with readable values
7979

8080
### Note:
81-
To apply changes in MCP client, restart the MCP server.
81+
To apply changes in MCP client, restart the MCP server.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ ENV YOUTRACK_VERIFY_SSL="true"
2222
ENV YOUTRACK_CLOUD="false"
2323

2424
# Run the MCP server in stdio mode for Claude integration by default
25-
ENTRYPOINT ["python", "-m", "youtrack_rocket_mcp.server"]
25+
ENTRYPOINT ["python", "-m", "youtrack_rocket_mcp.server"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ youtrack-rocket-mcp # Run after installation
126126
3. Run the server:
127127
```bash
128128
uv run python -m youtrack_rocket_mcp.server
129-
129+
130130
# Or with activated virtual environment
131131
python -m youtrack_rocket_mcp.server
132132
```

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ services:
1212
- MCP_DEBUG=${MCP_DEBUG:-false}
1313
stdin_open: true
1414
tty: true
15-
command: ["--transport", "stdio"]
15+
command: ["--transport", "stdio"]

0 commit comments

Comments
 (0)