Skip to content

Tags: httpdss/structkit

Tags

v3.2.0

Toggle v3.2.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Bump pyproject version to 3.2.0 (#180)

Release Drafter resolved the next release as `3.2.0`.

This PR updates `pyproject.toml` before the draft release is published
so the PyPI publish workflow can build a package whose version matches
the release tag.

Co-authored-by: httpdss <39445+httpdss@users.noreply.github.com>

v3

Toggle v3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Bump pyproject version to 3.2.0 (#180)

Release Drafter resolved the next release as `3.2.0`.

This PR updates `pyproject.toml` before the draft release is published
so the PyPI publish workflow can build a package whose version matches
the release tag.

Co-authored-by: httpdss <39445+httpdss@users.noreply.github.com>

v3.1.0

Toggle v3.1.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
[#167] Normalize template variable validation errors beyond enum chec…

…ks (#172)

## Summary

Fixes #167.

Regex, min, and max validation failures in
`TemplateRenderer._coerce_and_validate` were raising plain `ValueError`.
Since `GenerateCommand.execute()` catches `TemplateVariableError` but
not every `ValueError`, these user-caused schema violations could
surface as raw Python tracebacks.

## Changes

### `structkit/template_renderer.py`
- Regex pattern mismatch (`pattern`/`regex` key) now raises
`TemplateVariableError` with the variable name, pattern, and received
value.
- Min constraint violation now raises `TemplateVariableError` with the
variable name, bound, and received value.
- Max constraint violation now raises `TemplateVariableError` with the
variable name, bound, and received value.

### `tests/test_template_renderer.py`
- Added `test_regex_violation_raises_template_variable_error`
- Added `test_min_violation_raises_template_variable_error`
- Added `test_max_violation_raises_template_variable_error`

### `tests/test_commands_more.py`
- Added parametrized `test_generate_validation_error_exits_cleanly`
covering regex, min, and max violations through the full CLI path (exit
1, clean message, no `Traceback`).

## Acceptance criteria

- [x] Invalid regex-pattern value exits 1 with no `Traceback`.
- [x] Below-min numeric value exits 1 with no `Traceback`.
- [x] Above-max numeric value exits 1 with no `Traceback`.
- [x] Error messages include variable name, expected constraint, and
received value.
- [x] Tests cover regex, min, and max through both `TemplateRenderer`
unit tests and `structkit generate` integration tests.

v3.0.0

Toggle v3.0.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Rename project from 'struct' to 'structkit' (#121)

## Overview
Rename the project from `struct` to `structkit` to avoid conflicts with
the Python Standard Library `struct` module.

## Changes
- Updated package name in `pyproject.toml` to `structkit`
- Changed CLI entry point from `struct` to `structkit`
- Updated repository URLs to reflect new project name
- Renamed MCP server to `structkit-mcp-server`
- Updated Docker Compose service names
- Updated all string references throughout the project

## Why
The current package name `struct` conflicts with Python's built-in
`struct` module, causing PyPI upload failures.

## Testing
Please verify:
- [ ] Package installs correctly: `pip install structkit`
- [ ] CLI works: `structkit --help`
- [ ] MCP server runs: `structkit mcp`

v2.8.1

Toggle v2.8.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Bump version to 2.8.1 (#120)

This pull request updates the versioning approach for the `struct`
Python package and refines the GitHub Actions workflow for publishing to
PyPI. The most important changes are the adoption of dynamic version
retrieval, a version bump, and workflow simplification.

**Versioning Improvements**

* Updated the `struct_module/__init__.py` to dynamically retrieve the
package version using `importlib.metadata`, falling back to `"unknown"`
if the package is not installed. This replaces the previous hardcoded
version string.
* Changed the MCP server initialization in `struct_module/mcp_server.py`
to use the dynamically retrieved `__version__` instead of a hardcoded
value.

**Release Workflow Simplification**

* Removed the `update-version` job from
`.github/workflows/publish-pypi.yml`, which previously updated the
version in `pyproject.toml` on release events. The workflow now relies
solely on manual dispatch and no longer automatically bumps the version
on release.
[[1]](diffhunk://#diff-d4585bdbbb00b46a400628c271f195eb312333d18474299152a0b75fb1a7ec4bL4-L5)
[[2]](diffhunk://#diff-d4585bdbbb00b46a400628c271f195eb312333d18474299152a0b75fb1a7ec4bL14-L45)

**Version Bump**

* Updated the package version in `pyproject.toml` from `1.0.0` to
`2.8.1` to reflect the new release.

v2.8.0

Toggle v2.8.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
feat: implement optional dependencies and modernize packaging (issue #96

) (#119)

## Description
Implements optional dependencies and modernizes packaging for the
project.

Closes #96

## Changes
- Implement optional dependencies
- Modernize packaging configuration

## Type of change
- [x] New feature
- [x] Enhancement

v2

Toggle v2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Bump version to 2.8.1 (#120)

This pull request updates the versioning approach for the `struct`
Python package and refines the GitHub Actions workflow for publishing to
PyPI. The most important changes are the adoption of dynamic version
retrieval, a version bump, and workflow simplification.

**Versioning Improvements**

* Updated the `struct_module/__init__.py` to dynamically retrieve the
package version using `importlib.metadata`, falling back to `"unknown"`
if the package is not installed. This replaces the previous hardcoded
version string.
* Changed the MCP server initialization in `struct_module/mcp_server.py`
to use the dynamically retrieved `__version__` instead of a hardcoded
value.

**Release Workflow Simplification**

* Removed the `update-version` job from
`.github/workflows/publish-pypi.yml`, which previously updated the
version in `pyproject.toml` on release events. The workflow now relies
solely on manual dispatch and no longer automatically bumps the version
on release.
[[1]](diffhunk://#diff-d4585bdbbb00b46a400628c271f195eb312333d18474299152a0b75fb1a7ec4bL4-L5)
[[2]](diffhunk://#diff-d4585bdbbb00b46a400628c271f195eb312333d18474299152a0b75fb1a7ec4bL14-L45)

**Version Bump**

* Updated the package version in `pyproject.toml` from `1.0.0` to
`2.8.1` to reflect the new release.

v2.7.0

Toggle v2.7.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
feat: switch to shtab-generated shell completions and add --print-com…

…pletion (#110)

Summary
- Replace custom completion wiring with shtab-generated static
completions.
- Add --print-completion to emit completion scripts for bash/zsh/tcsh.
- Add completion subcommand with install, generated by shtab.
- Keep existing CLI flags intact; no breaking changes.

Why
- shtab centralizes completion generation based on argparse definitions,
reducing drift between help text and completions.
- Faster iteration: changes to options/choices immediately reflect in
completions after regeneration.

Key changes
- completions: switch to shtab static completions
  - expose argparse parser for shtab
  - add --print-completion and completion install
- generate: improve template variable parsing/merging logic

Installation and usage
- Zsh:
  struct completion install zsh
  # or:
struct --print-completion zsh > ~/.zfunc/_struct && autoload -Uz
compinit && compinit
- Bash:
  struct completion install bash
  # or:
struct --print-completion bash | sudo tee /etc/bash_completion.d/struct
>/dev/null
- tcsh:
  struct --print-completion tcsh

Notes
- Completions now come from shtab output; re-run the generator when CLI
options change.
- Dynamic suggestions for struct generate can be layered later if
desired.

Testing
- Verified on zsh 5.9 and bash 5.x; unit tests pass; docs updated.

Checklist
- [x] Feature works locally
- [x] Unit tests pass
- [x] Docs updated
- [x] No breaking changes

v2.6.0

Toggle v2.6.0's commit message
Add MCP integration documentation reference to docs index

- Add MCP Integration link to Advanced Features section in docs/index.md
- Ensures the new MCP documentation is discoverable from the main docs index

v2.5.0

Toggle v2.5.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Add generate-schema command for JSON schema generation (#63)

## Description

This PR adds a new `generate-schema` command that generates JSON schema
definitions for available structure templates.

## Features

- **New Command**: `struct generate-schema` command
- **Flexible Input**: Supports scanning built-in contribs directory and
custom structures path
- **Output Options**: Can output to stdout or save to a specified file
- **JSON Schema Generation**: Creates a properly formatted JSON schema
with PluginList enum

## Usage

```bash
# Generate schema to stdout
struct generate-schema

# Generate schema with custom structures path
struct generate-schema -s /path/to/structures

# Save schema to file
struct generate-schema -o schema.json

# Combine custom path and output file
struct generate-schema -s /path/to/structures -o schema.json
```

## Implementation Details

- Scans YAML files in the contribs directory and optional custom
structures path
- Removes file extensions and creates relative paths for structure names
- Generates JSON schema with sorted enum values for consistency
- Includes proper error handling and logging
- Creates output directories if they don't exist

## Files Changed

- `struct_module/commands/generate_schema.py` - New command
implementation
- `struct_module/main.py` - Updated to register the new command
- `docs/generate-schema.md` - Added documentation for the new command

This enhancement makes it easier for users and tools to discover
available structure templates programmatically.