Skip to content

Commit 202784f

Browse files
authored
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`
1 parent 70173c5 commit 202784f

File tree

148 files changed

+614
-565
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+614
-565
lines changed

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[run]
22
branch = True
3-
source = struct_module
3+
source = structkit
44

55
[report]
66
omit =

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "Struct devcontainer",
2+
"name": "StructKit devcontainer",
33
"image": "mcr.microsoft.com/devcontainers/python:3",
44
"features": {
55
// "ghcr.io/devcontainers/features/python:1": {},

.github/instructions/struct.instructions.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
applyTo: '**'
33
---
44

5-
# Struct Assistant
5+
# StructKit Assistant
66

77
## Role
88

9-
You are an expert assistant that generates valid `.struct.yaml` files for the [STRUCT tool](https://github.com/httpdss/struct), which automates project structure generation from YAML configuration.
9+
You are an expert assistant that generates valid `.struct.yaml` files for the [StructKit tool](https://github.com/httpdss/struct), which automates project structure generation from YAML configuration.
1010

1111
## Defining the `.struct.yaml` file
1212

@@ -29,10 +29,10 @@ files:
2929
3030
### Defining folders
3131
32-
The `folders` key is used to define folders that are created. Each folder path should include a `struct` key with a list of struct files to call. Optionally, you can define the value of a variable using the `with:` key.
33-
The list of struct files available can be taken from all the files defined inside `struct_module/contribs/`.
34-
Remember the name of the struct file is the path to the file without the `.yaml` extension.
35-
Read from the struct file to kown the variables that can be used.
32+
The `folders` key is used to define folders that are created. Each folder path should include a `struct` key with a list of structkit files to call. Optionally, you can define the value of a variable using the `with:` key.
33+
The list of structkit files available can be taken from all the files defined inside `structkit/contribs/`.
34+
Remember the name of the structkit file is the path to the file without the `.yaml` extension.
35+
Read from the structkit file to kown the variables that can be used.
3636

3737
```yaml
3838
folders:
@@ -48,7 +48,7 @@ folders:
4848

4949
### Defining variables
5050

51-
The `variables` key is used to define variables that can be used in the struct files. Each variable should have a description, type, and optional default value.
51+
The `variables` key is used to define variables that can be used in the structkit files. Each variable should have a description, type, and optional default value.
5252

5353
```yaml
5454
variables:
@@ -63,15 +63,15 @@ variables:
6363
- Follow the JSON Schema definition provided in the references.
6464
- Use valid keys: `files`, `folders`, and `variables`.
6565
- if you want to define files, use the `files:` key, and a list of file paths that are created. each file path should have a content key.
66-
- if you want to define folders, use the `folders:` key, and a list of folder paths that are created. each folder path should have a list of folder paths and each folder path needs to have a list of struct keys. also if you want to define the value of a variable then you should use the `with:` key.
67-
- Follow the conventions from the STRUCT README provided in the references.
66+
- if you want to define folders, use the `folders:` key, and a list of folder paths that are created. each folder path should have a list of folder paths and each folder path needs to have a list of structkit keys. also if you want to define the value of a variable then you should use the `with:` key.
67+
- Follow the conventions from the StructKit README provided in the references.
6868
- Include content blocks under `content:` using pipe notation (`|`) when needed.
6969
- Use `permissions`, `skip`, or `skip_if_exists` if specified. This is used only for the `files` key.
7070
- Use `file:` to reference the content of a file or `content:` to define the content of the file.
71-
- Use `struct:` to define the list of struct files to call for a folder.
72-
- When defining the list of struct files you want to use, make sure to query the `structure name` to know what to use. this will be at ../../docs/structures.md.
71+
- Use `struct:` to define the list of structkit files to call for a folder.
72+
- When defining the list of structkit files you want to use, make sure to query the `structure name` to know what to use. this will be at ../../docs/structures.md.
7373
- Optionally, use Jinja2 custom filters such as `| latest_release`, `| default_branch`, or `| slugify`.
74-
- before creating a file from scratch, check that there is no struct contrib available that can be used to create the file.
74+
- before creating a file from scratch, check that there is no structkit contrib available that can be used to create the file.
7575

7676
## Output
7777

@@ -89,6 +89,6 @@ Always return YAML that is syntactically correct and validated against the provi
8989

9090
## References
9191

92-
- [STRUCT json schema](../../struct-schema.json)
93-
- [STRUCT README](../../README.md)
92+
- [StructKit json schema](../../struct-schema.json)
93+
- [StructKit README](../../README.md)
9494
- [Structures available in contribs](../../doc/structures.md)

.github/prompts/struct.prompt.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Role
44

5-
You are an expert assistant that generates valid `.struct.yaml` files for the [STRUCT tool](https://github.com/httpdss/struct), which automates project structure generation from YAML configuration.
5+
You are an expert assistant that generates valid `.struct.yaml` files for the [StructKit tool](https://github.com/httpdss/struct), which automates project structure generation from YAML configuration.
66

77
## Defining the `.struct.yaml` file
88

@@ -25,10 +25,10 @@ structures:
2525
2626
### Defining folders
2727
28-
The `folders` key is used to define folders that are created. Each folder path should include a `struct` key with a list of struct files to call. Optionally, you can define the value of a variable using the `with:` key.
29-
The list of struct files available can be taken from all the files defined inside `struct_module/contribs/`.
30-
Remember the name of the struct file is the path to the file without the `.yaml` extension.
31-
Read from the struct file to kown the variables that can be used.
28+
The `folders` key is used to define folders that are created. Each folder path should include a `struct` key with a list of structkit files to call. Optionally, you can define the value of a variable using the `with:` key.
29+
The list of structkit files available can be taken from all the files defined inside `structkit/contribs/`.
30+
Remember the name of the structkit file is the path to the file without the `.yaml` extension.
31+
Read from the structkit file to kown the variables that can be used.
3232

3333
```yaml
3434
folders:
@@ -44,7 +44,7 @@ folders:
4444

4545
### Defining variables
4646

47-
The `variables` key is used to define variables that can be used in the struct files. Each variable should have a description, type, and optional default value.
47+
The `variables` key is used to define variables that can be used in the structkit files. Each variable should have a description, type, and optional default value.
4848

4949
```yaml
5050
variables:
@@ -59,12 +59,12 @@ variables:
5959
- Follow the JSON Schema definition provided in the references.
6060
- Use valid keys: `structures`, `folders`, and `variables`.
6161
- if you want to define files, use the `structures:` key, and a list of file paths that are created. each file path should have a content key.
62-
- if you want to define folders, use the `folders:` key, and a list of folder paths that are created. each folder path should have a list of folder paths and each folder path needs to have a list of struct keys. also if you want to define the value of a variable then you should use the `with:` key.
63-
- Follow the conventions from the STRUCT README provided in the references.
62+
- if you want to define folders, use the `folders:` key, and a list of folder paths that are created. each folder path should have a list of folder paths and each folder path needs to have a list of structkit keys. also if you want to define the value of a variable then you should use the `with:` key.
63+
- Follow the conventions from the StructKit README provided in the references.
6464
- Include content blocks under `content:` using pipe notation (`|`) when needed.
6565
- Use `permissions`, `skip`, or `skip_if_exists` if specified. This is used only for the `structures` key.
6666
- Use `file:` to reference the content of a file or `content:` to define the content of the file.
67-
- Use `struct:` to define the list of struct files to call for a folder.
67+
- Use `struct:` to define the list of structkit files to call for a folder.
6868
- Optionally, use Jinja2 custom filters such as `| latest_release`, `| default_branch`, or `| slugify`.
6969

7070
## Output
@@ -83,5 +83,5 @@ Always return YAML that is syntactically correct and validated against the provi
8383

8484
## References
8585

86-
- [STRUCT json schema](https://raw.githubusercontent.com/httpdss/struct/refs/heads/main/struct-schema.json)
87-
- [STRUCT README](https://raw.githubusercontent.com/httpdss/struct/refs/heads/main/README.md)
86+
- [StructKit json schema](https://raw.githubusercontent.com/httpdss/struct/refs/heads/main/struct-schema.json)
87+
- [StructKit README](https://raw.githubusercontent.com/httpdss/struct/refs/heads/main/README.md)

.github/workflows/publish-pypi.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,8 @@ jobs:
6262
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
6363
run: twine upload dist/* --skip-existing
6464

65-
- name: Create release note
66-
if: github.event_name == 'release'
65+
- name: Put pypi url on job summary
6766
run: |
68-
echo "Package published to PyPI successfully!"
69-
echo "Version: ${{ github.event.release.tag_name }}"
70-
echo "PyPI URL: https://pypi.org/project/struct/"
67+
echo "## PyPI Package Published" >> $GITHUB_STEP_SUMMARY
68+
echo "" >> $GITHUB_STEP_SUMMARY
69+
echo "The package has been published to [PyPI](https://pypi.org/project/structkit/)." >> $GITHUB_STEP_SUMMARY

.github/workflows/struct-generate.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_call:
55
inputs:
66
struct_file:
7-
description: 'Path to the STRUCT file'
7+
description: 'Path to the StructKit file'
88
type: string
99
required: false
1010
default: '.struct.yaml'
@@ -14,20 +14,20 @@ on:
1414
required: false
1515
default: '.'
1616
args:
17-
description: 'Additional arguments to pass to STRUCT'
17+
description: 'Additional arguments to pass to StructKit'
1818
type: string
1919
required: false
2020
default: ''
2121
pr_title:
2222
description: 'Title of the PR'
2323
type: string
2424
required: false
25-
default: 'Run STRUCT generate on repository'
25+
default: 'Run StructKit generate on repository'
2626
pr_body:
2727
description: 'Body of the PR'
2828
type: string
2929
required: false
30-
default: 'This PR was automatically generated by the STRUCT action.'
30+
default: 'This PR was automatically generated by the StructKit action.'
3131
pr_assignees:
3232
description: 'Assignees of the PR'
3333
type: string
@@ -70,10 +70,10 @@ jobs:
7070
with:
7171
python-version: '3.x'
7272

73-
- name: Install STRUCT
73+
- name: Install StructKit
7474
run: |
7575
pip install git+https://github.com/httpdss/struct.git
76-
struct -h
76+
structkit -h
7777
7878
- name: Install custom structures
7979
if: ${{ inputs.custom_structure_repository != '' }}
@@ -84,25 +84,25 @@ jobs:
8484
path: ./custom-structures
8585
fetch-depth: 1
8686

87-
- name: Run STRUCT
87+
- name: Run StructKit
8888
env:
8989
GITHUB_TOKEN: ${{ secrets.token }}
9090
run: |
9191
if [ -d ./custom-structures ]; then
9292
93-
struct list \
93+
structkit list \
9494
-s ./custom-structures/${{ inputs.custom_structure_path }}
9595
96-
struct generate \
96+
structkit generate \
9797
--non-interactive \
9898
-s ./custom-structures/${{ inputs.custom_structure_path }} \
9999
${{ inputs.args }} \
100100
${{ inputs.struct_file }} \
101101
${{ inputs.output_dir }}
102102
else
103-
struct list
103+
structkit list
104104
105-
struct generate \
105+
structkit generate \
106106
--non-interactive \
107107
${{ inputs.args }} \
108108
${{ inputs.struct_file }} \

.github/workflows/struct-on-gha.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@ jobs:
1515
with:
1616
python-version: '3.x'
1717

18-
- name: Install STRUCT
18+
- name: Install StructKit
1919
run: |
2020
pip install git+https://github.com/httpdss/struct.git
21-
struct -h
21+
structkit -h
2222
23-
- name: Run STRUCT
23+
- name: Run StructKit
2424
run: |
25-
# struct generate ...
26-
struct list
25+
# structkit generate ...
26+
structkit list
2727
2828
- name: Generate PR with changes
2929
if: github.event_name == 'workflow_dispatch'
3030
uses: peter-evans/create-pull-request@v7
3131
with:
3232
token: ${{ secrets.GITHUB_TOKEN }}
33-
commit-message: "Run STRUCT generate on repository"
34-
title: "Run STRUCT generate on repository"
33+
commit-message: "Run StructKit generate on repository"
34+
title: "Run StructKit generate on repository"
3535
body: |
36-
This PR was automatically generated by the STRUCT action.
36+
This PR was automatically generated by the StructKit action.
3737
base: "main"
3838
assignees: "httpdss"
3939
branch: repository-dispatch/update-${{ github.run_id }}

.github/workflows/test-script.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
shell: bash
4343
run: |
4444
echo "REPORT_FILE=${REPORT_OUTPUT}" >> "$GITHUB_ENV"
45-
pytest --cov=struct_module --cov-branch --cov-report=xml -v --md-report --md-report-flavor gfm --md-report-exclude-outcomes passed skipped xpassed --md-report-output "$REPORT_OUTPUT" --pyargs tests
45+
pytest --cov=structkit --cov-branch --cov-report=xml -v --md-report --md-report-flavor gfm --md-report-exclude-outcomes passed skipped xpassed --md-report-output "$REPORT_OUTPUT" --pyargs tests
4646
4747
- name: Upload coverage reports to Codecov
4848
uses: codecov/codecov-action@v5

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"yaml.schemas": {
3+
"file:///home/kenny/.vscode-server/extensions/atlassian.atlascode-4.0.6/resources/schemas/pipelines-schema.json": "bitbucket-pipelines.yml",
4+
"file:///home/kenny/.vscode-server/extensions/httpdss.vscode-struct-0.1.0/schemas/struct-schema.json": [
5+
"*.struct.yaml"
6+
]
7+
}
8+
}

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN pip install argcomplete
1818
COPY . .
1919

2020
# Register the script for auto-completion
21-
RUN echo 'eval "$(register-python-argcomplete struct)"' >> /etc/bash.bashrc
21+
RUN echo 'eval "$(register-python-argcomplete structkit)"' >> /etc/bash.bashrc
2222

2323
# Run your script when the container launches
24-
ENTRYPOINT ["python", "struct_module/main.py"]
24+
ENTRYPOINT ["python", "structkit/main.py"]

0 commit comments

Comments
 (0)