build-cub 0.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. build_cub-0.0.2/.claude/settings.local.json +9 -0
  2. build_cub-0.0.2/.copier-answers.yml +24 -0
  3. build_cub-0.0.2/.github/workflows/build-wheels.yml +111 -0
  4. build_cub-0.0.2/.github/workflows/ci.yml +45 -0
  5. build_cub-0.0.2/.github/workflows/claude-code-review.yml +34 -0
  6. build_cub-0.0.2/.github/workflows/claude.yml +50 -0
  7. build_cub-0.0.2/.github/workflows/release.yml +46 -0
  8. build_cub-0.0.2/.gitignore +217 -0
  9. build_cub-0.0.2/CHANGELOG.md +8 -0
  10. build_cub-0.0.2/CLAUDE.md +223 -0
  11. build_cub-0.0.2/PKG-INFO +232 -0
  12. build_cub-0.0.2/README.md +217 -0
  13. build_cub-0.0.2/TODO.md +89 -0
  14. build_cub-0.0.2/config/bear_build.toml +161 -0
  15. build_cub-0.0.2/config/build_cub/test.toml +4 -0
  16. build_cub-0.0.2/config/coverage.ini +25 -0
  17. build_cub-0.0.2/config/git-changelog.toml +9 -0
  18. build_cub-0.0.2/config/pytest.ini +25 -0
  19. build_cub-0.0.2/config/ruff.toml +142 -0
  20. build_cub-0.0.2/examples/bear_build.toml +153 -0
  21. build_cub-0.0.2/examples/hatch_build.py +45 -0
  22. build_cub-0.0.2/hatch_build.py +154 -0
  23. build_cub-0.0.2/maskfile.md +132 -0
  24. build_cub-0.0.2/noxfile.py +66 -0
  25. build_cub-0.0.2/pyproject.toml +88 -0
  26. build_cub-0.0.2/src/build_cub/README.md +156 -0
  27. build_cub-0.0.2/src/build_cub/__init__.py +11 -0
  28. build_cub-0.0.2/src/build_cub/__main__.py +14 -0
  29. build_cub-0.0.2/src/build_cub/_helpers.py +141 -0
  30. build_cub-0.0.2/src/build_cub/_internal/__init__.py +0 -0
  31. build_cub-0.0.2/src/build_cub/_internal/_cmds.py +80 -0
  32. build_cub-0.0.2/src/build_cub/_internal/_version.pyi +4 -0
  33. build_cub-0.0.2/src/build_cub/_internal/cli.py +49 -0
  34. build_cub-0.0.2/src/build_cub/_internal/debug.py +176 -0
  35. build_cub-0.0.2/src/build_cub/_internal/info.py +228 -0
  36. build_cub-0.0.2/src/build_cub/_printer.py +56 -0
  37. build_cub-0.0.2/src/build_cub/backends/__init__.py +63 -0
  38. build_cub-0.0.2/src/build_cub/backends/_base.py +318 -0
  39. build_cub-0.0.2/src/build_cub/backends/_cpp_base.py +74 -0
  40. build_cub-0.0.2/src/build_cub/backends/cython.py +99 -0
  41. build_cub-0.0.2/src/build_cub/backends/gperf.py +119 -0
  42. build_cub-0.0.2/src/build_cub/backends/pybind11.py +39 -0
  43. build_cub-0.0.2/src/build_cub/backends/raw_cpp.py +28 -0
  44. build_cub-0.0.2/src/build_cub/build_tools.py +23 -0
  45. build_cub-0.0.2/src/build_cub/models/__init__.py +1 -0
  46. build_cub-0.0.2/src/build_cub/models/_backends.py +77 -0
  47. build_cub-0.0.2/src/build_cub/models/_base.py +59 -0
  48. build_cub-0.0.2/src/build_cub/models/_build_data.py +141 -0
  49. build_cub-0.0.2/src/build_cub/models/_defaults.py +68 -0
  50. build_cub-0.0.2/src/build_cub/models/_templates.py +84 -0
  51. build_cub-0.0.2/src/build_cub/models/_version.py +74 -0
  52. build_cub-0.0.2/src/build_cub/py.typed +0 -0
  53. build_cub-0.0.2/tests/__init__.py +7 -0
  54. build_cub-0.0.2/tests/conftest.py +67 -0
  55. build_cub-0.0.2/tests/fixtures/test_bear_build.toml +82 -0
  56. build_cub-0.0.2/tests/test_backends.py +89 -0
  57. build_cub-0.0.2/tests/test_cli.py +56 -0
  58. build_cub-0.0.2/tests/test_config.py +16 -0
  59. build_cub-0.0.2/tests/test_config_loading.py +72 -0
  60. build_cub-0.0.2/tests/test_helpers.py +141 -0
  61. build_cub-0.0.2/tests/test_settings_inheritance.py +65 -0
  62. build_cub-0.0.2/tests/test_settings_merge.py +114 -0
  63. build_cub-0.0.2/tests/test_templates.py +137 -0
@@ -0,0 +1,9 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(pytest)",
5
+ "Bash(wc:*)"
6
+ ]
7
+ },
8
+ "outputStyle": "Learning"
9
+ }
@@ -0,0 +1,24 @@
1
+ # Changes here will be overwritten by Copier.
2
+ _commit: v0.4.9
3
+ _src_path: gh:sicksubroutine/python-template
4
+ author_email: bright.lid5647@fastmail.com
5
+ author_fullname: chaz
6
+ include_cli: true
7
+ include_config: false
8
+ include_cython: false
9
+ include_database: false
10
+ include_docker: false
11
+ include_docs: false
12
+ include_fastapi: false
13
+ include_lazy_loading: true
14
+ minimum_python_version: '3.12'
15
+ project_description: A dynamic versioning, Cython, PyBind11, and Raw C API building.
16
+ Experimental.
17
+ project_name: Build Cub
18
+ python_package_command_line_name: build-cub
19
+ python_package_distribution_name: build-cub
20
+ python_package_import_name: build_cub
21
+ setup_project: true
22
+ starting_version: 0.0.1
23
+ type_cli: argparse
24
+
@@ -0,0 +1,111 @@
1
+ name: Build and Publish
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+ workflow_dispatch: # allows manual trigger for testing
8
+
9
+ jobs:
10
+ build:
11
+ name: Build distributions
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ with:
16
+ fetch-depth: 0
17
+ fetch-tags: true
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v5
21
+
22
+ - name: Build sdist and wheel
23
+ run: uv build
24
+
25
+ - uses: actions/upload-artifact@v4
26
+ with:
27
+ name: dist
28
+ path: dist/*
29
+
30
+ publish:
31
+ name: Publish to PyPI
32
+ needs: [build]
33
+ runs-on: ubuntu-latest
34
+ if: startsWith(github.ref, 'refs/tags/')
35
+ environment: pypi
36
+ permissions:
37
+ id-token: write
38
+
39
+ steps:
40
+ - uses: actions/download-artifact@v4
41
+ with:
42
+ name: dist
43
+ path: dist
44
+
45
+ - name: List distributions
46
+ run: ls -la dist/
47
+
48
+ - name: Publish to PyPI
49
+ uses: pypa/gh-action-pypi-publish@release/v1
50
+
51
+
52
+ ###############################################################################
53
+ # CIBUILDWHEEL - For when build-cub has native extensions
54
+ # Uncomment this section if/when build-cub itself needs compiled extensions
55
+ # (e.g., if we add Cython/Rust components for performance)
56
+ ###############################################################################
57
+
58
+ # build_wheels:
59
+ # name: Build wheels on ${{ matrix.os }}
60
+ # runs-on: ${{ matrix.os }}
61
+ # strategy:
62
+ # matrix:
63
+ # os: [ubuntu-latest, macos-latest, windows-latest]
64
+ #
65
+ # steps:
66
+ # - uses: actions/checkout@v4
67
+ # with:
68
+ # fetch-depth: 0
69
+ # fetch-tags: true
70
+ #
71
+ # - name: Install uv
72
+ # uses: astral-sh/setup-uv@v5
73
+ #
74
+ # # Unix: bash shell activation
75
+ # - name: Install build dependencies (Unix)
76
+ # if: runner.os != 'Windows'
77
+ # run: uv venv && source .venv/bin/activate && uv pip install cibuildwheel setuptools wheel
78
+ # shell: bash
79
+ #
80
+ # # Windows: cmd shell activation
81
+ # - name: Install build dependencies (Windows)
82
+ # if: runner.os == 'Windows'
83
+ # run: uv venv && .venv\Scripts\activate.bat && uv pip install cibuildwheel setuptools wheel
84
+ # shell: cmd
85
+ #
86
+ # - name: Build wheels (Unix)
87
+ # if: runner.os != 'Windows'
88
+ # run: source .venv/bin/activate && cibuildwheel --output-dir wheelhouse
89
+ # shell: bash
90
+ # env:
91
+ # # Build for Python 3.12, 3.13, 3.14
92
+ # CIBW_BUILD: "cp312-* cp313-* cp314-*"
93
+ # # Skip 32-bit and musllinux builds
94
+ # CIBW_SKIP: "*-win32 *-manylinux_i686 *musllinux*"
95
+ #
96
+ # - name: Build wheels (Windows)
97
+ # if: runner.os == 'Windows'
98
+ # run: .venv\Scripts\activate && cibuildwheel --output-dir wheelhouse
99
+ # shell: cmd
100
+ # env:
101
+ # CIBW_BUILD: "cp312-* cp313-* cp314-*"
102
+ # CIBW_SKIP: "*-win32 *-manylinux_i686 *musllinux*"
103
+ #
104
+ # - uses: actions/upload-artifact@v4
105
+ # with:
106
+ # name: wheels-${{ matrix.os }}
107
+ # path: ./wheelhouse/*.whl
108
+ #
109
+ # NOTE: If using cibuildwheel, update the publish job's "needs" to:
110
+ # needs: [build_wheels, build_sdist]
111
+ # And rename the "build" job above to "build_sdist" (remove wheel building from it)
@@ -0,0 +1,45 @@
1
+ name: ci
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ branches:
7
+ - main
8
+
9
+ defaults:
10
+ run:
11
+ shell: bash
12
+
13
+ env:
14
+ LANG: en_US.utf-8
15
+ LC_ALL: en_US.utf-8
16
+ PYTHONIOENCODING: UTF-8
17
+
18
+ jobs:
19
+ quality:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ - name: Setup UV
24
+ uses: astral-sh/setup-uv@v5
25
+ with:
26
+ enable-cache: true
27
+ cache-dependency-glob: pyproject.toml
28
+ python-version: "3.12"
29
+
30
+ - name: Install Dependencies
31
+ run: |
32
+ uv sync
33
+ source .venv/bin/activate
34
+
35
+ - name: Install Nox
36
+ run: uv tool install nox
37
+
38
+ - name: Check the Code Quality
39
+ run: nox -s ruff_fix
40
+
41
+ - name: Check if the code is correctly typed
42
+ run: nox -s pyright
43
+
44
+ - name: Run Tests
45
+ run: pytest -v
@@ -0,0 +1,34 @@
1
+ name: Claude Code Review
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, synchronize, ready_for_review, reopened]
6
+
7
+ jobs:
8
+ claude-review:
9
+ if: |
10
+ !contains(github.event.pull_request.title, '[skip-review]') &&
11
+ !contains(github.event.pull_request.title, '[WIP]') &&
12
+ !contains(github.event.pull_request.labels.*.name, 'WIP')
13
+
14
+ runs-on: ubuntu-latest
15
+ permissions:
16
+ contents: read
17
+ pull-requests: read
18
+ issues: read
19
+ id-token: write
20
+
21
+ steps:
22
+ - name: Checkout repository
23
+ uses: actions/checkout@v4
24
+ with:
25
+ fetch-depth: 1
26
+
27
+ - name: Run Claude Code Review
28
+ id: claude-review
29
+ uses: anthropics/claude-code-action@v1
30
+ with:
31
+ claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
32
+ plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
33
+ plugins: 'code-review@claude-code-plugins'
34
+ prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
@@ -0,0 +1,50 @@
1
+ name: Claude Code
2
+
3
+ on:
4
+ issue_comment:
5
+ types: [created]
6
+ pull_request_review_comment:
7
+ types: [created]
8
+ issues:
9
+ types: [opened, assigned]
10
+ pull_request_review:
11
+ types: [submitted]
12
+
13
+ jobs:
14
+ claude:
15
+ if: |
16
+ (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17
+ (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18
+ (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19
+ (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20
+ runs-on: ubuntu-latest
21
+ permissions:
22
+ contents: read
23
+ pull-requests: read
24
+ issues: read
25
+ id-token: write
26
+ actions: read # Required for Claude to read CI results on PRs
27
+ steps:
28
+ - name: Checkout repository
29
+ uses: actions/checkout@v4
30
+ with:
31
+ fetch-depth: 1
32
+
33
+ - name: Run Claude Code
34
+ id: claude
35
+ uses: anthropics/claude-code-action@v1
36
+ with:
37
+ claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38
+
39
+ # This is an optional setting that allows Claude to read CI results on PRs
40
+ additional_permissions: |
41
+ actions: read
42
+
43
+ # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
44
+ # prompt: 'Update the pull request description to include a summary of changes.'
45
+
46
+ # Optional: Add claude_args to customize behavior and configuration
47
+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
48
+ # or https://code.claude.com/docs/en/cli-reference for available options
49
+ # claude_args: '--allowed-tools Bash(gh pr:*)'
50
+
@@ -0,0 +1,46 @@
1
+ name: release
2
+
3
+ on: push
4
+ permissions:
5
+ contents: write
6
+
7
+ jobs:
8
+ release:
9
+ runs-on: ubuntu-latest
10
+ if: startsWith(github.ref, 'refs/tags/')
11
+ steps:
12
+ - name: Checkout
13
+ uses: actions/checkout@v4
14
+ with:
15
+ fetch-depth: 0
16
+ fetch-tags: true
17
+ #
18
+ token: ${{ secrets.GITHUB_TOKEN }}
19
+ #
20
+ name: Setup Python
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: "3.13"
24
+ - name: Setup uv
25
+ uses: astral-sh/setup-uv@v5
26
+ - name: Update changelog
27
+ run: uv tool run git-changelog --config-file config/git-changelog.toml
28
+ - name: Commit updated changelog
29
+ run: |
30
+ git config --local user.email "action@github.com"
31
+ git config --local user.name "GitHub Action"
32
+ git add CHANGELOG.md
33
+ if git diff --staged --quiet; then
34
+ echo "No changelog changes to commit"
35
+ else
36
+ git commit -m "chore: update changelog for $(git describe --tags --abbrev=0)"
37
+ #
38
+ git push origin HEAD:${{ github.event.repository.default_branch }} || echo "Failed to push changelog update, but continuing with release"
39
+ #
40
+ fi
41
+ - name: Prepare release notes
42
+ run: uv tool run git-changelog --release-notes > release-notes.md
43
+ - name: Create release
44
+ uses: softprops/action-gh-release@v2
45
+ with:
46
+ body_path: release-notes.md
@@ -0,0 +1,217 @@
1
+ # Created by https://www.toptal.com/developers/gitignore/api/python,macos,shell
2
+ # Edit at https://www.toptal.com/developers/gitignore?templates=python,macos,shell
3
+
4
+ ### macOS ###
5
+ # General
6
+ .DS_Store
7
+ .AppleDouble
8
+ .LSOverride
9
+
10
+ # Icon must end with two \r
11
+ Icon
12
+
13
+
14
+ # Thumbnails
15
+ ._*
16
+
17
+ # Files that might appear in the root of a volume
18
+ .DocumentRevisions-V100
19
+ .fseventsd
20
+ .Spotlight-V100
21
+ .TemporaryItems
22
+ .Trashes
23
+ .VolumeIcon.icns
24
+ .com.apple.timemachine.donotpresent
25
+
26
+ # Directories potentially created on remote AFP share
27
+ .AppleDB
28
+ .AppleDesktop
29
+ Network Trash Folder
30
+ Temporary Items
31
+ .apdisk
32
+
33
+ ### macOS Patch ###
34
+ # iCloud generated files
35
+ *.icloud
36
+
37
+ ### Python ###
38
+ # Byte-compiled / optimized / DLL files
39
+ __pycache__/
40
+ *.py[cod]
41
+ *$py.class
42
+
43
+ # C extensions
44
+ *.so
45
+
46
+ # Distribution / packaging
47
+ .Python
48
+ build/
49
+ develop-eggs/
50
+ dist/
51
+ downloads/
52
+ eggs/
53
+ .eggs/
54
+ lib/
55
+ lib64/
56
+ parts/
57
+ sdist/
58
+ var/
59
+ wheels/
60
+ share/python-wheels/
61
+ *.egg-info/
62
+ .installed.cfg
63
+ *.egg
64
+ MANIFEST
65
+
66
+ # PyInstaller
67
+ # Usually these files are written by a python script from a template
68
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
69
+ *.manifest
70
+ *.spec
71
+
72
+ # Installer logs
73
+ pip-log.txt
74
+ pip-delete-this-directory.txt
75
+
76
+ # Unit test / coverage reports
77
+ htmlcov/
78
+ .tox/
79
+ .nox/
80
+ .coverage
81
+ .coverage.*
82
+ .cache
83
+ nosetests.xml
84
+ coverage.xml
85
+ *.cover
86
+ *.py,cover
87
+ .hypothesis/
88
+ .pytest_cache/
89
+ cover/
90
+
91
+ # Translations
92
+ *.mo
93
+ *.pot
94
+
95
+ # Django stuff:
96
+ *.log
97
+ local_settings.py
98
+ db.sqlite3
99
+ db.sqlite3-journal
100
+
101
+ # Flask stuff:
102
+ instance/
103
+ .webassets-cache
104
+
105
+ # Scrapy stuff:
106
+ .scrapy
107
+
108
+ # Sphinx documentation
109
+ docs/_build/
110
+
111
+ # PyBuilder
112
+ .pybuilder/
113
+ target/
114
+
115
+ # Jupyter Notebook
116
+ .ipynb_checkpoints
117
+
118
+ # IPython
119
+ profile_default/
120
+ ipython_config.py
121
+
122
+ # pyenv
123
+ # For a library or package, you might want to ignore these files since the code is
124
+ # intended to run in multiple environments; otherwise, check them in:
125
+ .python-version
126
+
127
+ # pipenv
128
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
129
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
130
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
131
+ # install all needed dependencies.
132
+ #Pipfile.lock
133
+
134
+ # poetry
135
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
136
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
137
+ # commonly ignored for libraries.
138
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
139
+ #poetry.lock
140
+
141
+ # pdm
142
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
143
+ #pdm.lock
144
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
145
+ # in version control.
146
+ # https://pdm.fming.dev/#use-with-ide
147
+ .pdm.toml
148
+
149
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
150
+ __pypackages__/
151
+
152
+ # Celery stuff
153
+ celerybeat-schedule
154
+ celerybeat.pid
155
+
156
+ # SageMath parsed files
157
+ *.sage.py
158
+
159
+ # Environments
160
+ .env
161
+ .venv
162
+ env/
163
+ venv/
164
+ ENV/
165
+ env.bak/
166
+ venv.bak/
167
+
168
+ # Spyder project settings
169
+ .spyderproject
170
+ .spyproject
171
+
172
+ # Rope project settings
173
+ .ropeproject
174
+
175
+ # mkdocs documentation
176
+ /site
177
+
178
+ # mypy
179
+ .mypy_cache/
180
+ .dmypy.json
181
+ dmypy.json
182
+ ``
183
+ # Pyre type checker
184
+ .pyre/
185
+
186
+ # pytype static type analyzer
187
+ .pytype/
188
+
189
+ # Cython debug symbols
190
+ cython_debug/
191
+
192
+ # PyCharm
193
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
194
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
195
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
196
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
197
+ .idea/
198
+
199
+ ### Python Patch ###
200
+ # Poetry local configuration file `
201
+
202
+ # ruff
203
+ .ruff_cache/
204
+
205
+ # LSP config files
206
+ pyrightconfig.json
207
+
208
+ .vscode/
209
+
210
+ *.db
211
+ *.log
212
+ **/_internal/_version.py
213
+ uv.lock
214
+
215
+ !/project/.vscode
216
+
217
+ **/prod.toml
@@ -0,0 +1,8 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
+
8
+ <!-- insertion marker -->