Skip to content

Commit ae76f1d

Browse files
feat: Major v0.2.0 release - Complete modernization (#12)
1 parent d5e7ece commit ae76f1d

34 files changed

+1461
-406
lines changed

.dockerignore

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
*.egg-info/
20+
.installed.cfg
21+
*.egg
22+
MANIFEST
23+
24+
# Virtual environments
25+
venv/
26+
ENV/
27+
env/
28+
29+
# IDE
30+
.vscode/
31+
.idea/
32+
*.swp
33+
*.swo
34+
*~
35+
36+
# Git
37+
.git/
38+
.gitignore
39+
40+
# CI/CD
41+
.github/
42+
43+
# Documentation
44+
*.md
45+
!README.md
46+
47+
# Test
48+
.pytest_cache/
49+
.coverage
50+
htmlcov/
51+
.tox/
52+
53+
# Generated files
54+
app.py
55+
endpoints_data.json
56+
openapi.json

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, macos-latest, windows-latest]
15+
python-version: ['3.10', '3.11', '3.12']
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -e ".[dev]"
29+
30+
- name: Lint with ruff
31+
run: |
32+
ruff check src/ tests/
33+
34+
- name: Format check with ruff
35+
run: |
36+
ruff format --check src/ tests/
37+
38+
- name: Type check with mypy
39+
run: |
40+
mypy src/
41+
42+
- name: Test with pytest
43+
run: |
44+
pytest
45+
46+
- name: Upload coverage reports to Codecov
47+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
48+
uses: codecov/codecov-action@v4
49+
with:
50+
file: ./coverage.xml
51+
fail_ci_if_error: false

.gitignore

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,26 @@ ENV/
103103
# venv
104104
venv/
105105

106-
# files generated / used by app
107-
src/app.py
108-
src/proposed_endpoints.md
109-
src/endpoints_data.json
106+
# Generated files from API stub generator
107+
app.py
108+
endpoints_data.json
109+
openapi.json
110+
proposed_endpoints.md
111+
112+
# Configuration (keep example)
113+
.stubrc.yml
114+
.stubrc.yaml
115+
stub.yml
116+
stub.yaml
117+
118+
# IDE
119+
.vscode/
120+
.idea/
121+
*.swp
122+
*.swo
110123

111124
# tests cache
112125
.pytest_cache/
126+
127+
# Ruff cache
128+
.ruff_cache/

.stubrc.example.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# API Stub Generator Configuration File
2+
# Copy this file to .stubrc.yml and customize as needed
3+
4+
# Input markdown file with proposed endpoints
5+
input_file: proposed_endpoints.md
6+
7+
# Output JSON file for parsed endpoints
8+
output_file: endpoints_data.json
9+
10+
# Generated application file
11+
app_file: app.py
12+
13+
# Framework to use: flask or fastapi
14+
framework: flask
15+
16+
# Enable CORS for all routes
17+
enable_cors: true
18+
19+
# Enable debug/development mode with auto-reload
20+
debug_mode: true
21+
22+
# Server configuration
23+
port: 5000
24+
host: localhost

.travis.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,45 @@
11
Changelog
22
=========
33

4-
Features & Improvements
5-
-----------------------
4+
## [0.2.0] - 2025-01-09
65

7-
#### 2019-1-29
6+
### 🎉 Major Release - Complete Rewrite
7+
8+
#### Added
9+
- **CLI Interface**: New `api-stub-gen` command with subcommands (`generate`, `watch`, `serve`)
10+
- **FastAPI Support**: Generate FastAPI applications with async support and auto-docs
11+
- **Watch Mode**: Auto-regenerate stubs when markdown files change
12+
- **Configuration Files**: YAML config file support (`.stubrc.yml`)
13+
- **OpenAPI Generation**: Auto-generate OpenAPI 3.0 specifications
14+
- **CORS Support**: Built-in CORS for Flask and FastAPI apps
15+
- **Hot Reload**: Debug mode with auto-reload enabled by default
16+
- **Template System**: Jinja2-based code generation (replaces string concatenation)
17+
- **Validation**: Comprehensive endpoint validation with helpful error messages
18+
- **Docker Support**: Dockerfile and docker-compose.yml for containerization
19+
- **Type Hints**: Full type annotations throughout the codebase
20+
- **Test Coverage**: Comprehensive test suite for all new features
21+
- **Health Endpoint**: Built-in `/health` endpoint for monitoring
22+
23+
#### Changed
24+
- **Python Version**: Minimum Python 3.10 (was 3.7)
25+
- **Dependencies**: Updated to latest versions (Flask 3.0+, pytest 7.4+)
26+
- **CI/CD**: Migrated from Travis CI to GitHub Actions
27+
- **Linting**: Replaced flake8 with Ruff for faster linting and formatting
28+
- **Project Structure**: Added `pyproject.toml` following PEP 621 standards
29+
- **Documentation**: Complete README rewrite with examples and comparisons
30+
31+
#### Deprecated
32+
- Direct usage of `serialize_data.py` and `create_mock_endpoints.py` (use CLI instead)
33+
- Pipenv as primary dependency manager (pip recommended)
34+
35+
#### Fixed
36+
- Better error handling for malformed markdown
37+
- Proper validation of HTTP methods and endpoint formats
38+
- Unicode handling in endpoint descriptions
39+
40+
## [0.1.0] - 2019-01-29
41+
42+
### Features & Improvements
843

944
- Allow `serialize_data.py` accept path for proposed endpoints docs as command line argument. ([@mansiag])
1045

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM python:3.12-slim
2+
3+
WORKDIR /app
4+
5+
# Install dependencies
6+
COPY requirements.txt .
7+
RUN pip install --no-cache-dir -r requirements.txt
8+
9+
# Copy application
10+
COPY . .
11+
12+
# Install the package
13+
RUN pip install -e .
14+
15+
# Default command
16+
CMD ["api-stub-gen", "generate"]

Pipfile

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)