pyrustygraph 0.4.1__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.
- pyrustygraph-0.4.1/.fleet/settings.json +3 -0
- pyrustygraph-0.4.1/.github/workflows/README.md +215 -0
- pyrustygraph-0.4.1/.github/workflows/bump_version.py +111 -0
- pyrustygraph-0.4.1/.github/workflows/publish-python-on-tag.yml +136 -0
- pyrustygraph-0.4.1/.github/workflows/publish-python.yml +133 -0
- pyrustygraph-0.4.1/.github/workflows/rust.yml +22 -0
- pyrustygraph-0.4.1/.github/workflows/setup-pypi.sh +119 -0
- pyrustygraph-0.4.1/.gitignore +35 -0
- pyrustygraph-0.4.1/.idea/.gitignore +8 -0
- pyrustygraph-0.4.1/.idea/copilot.data.migration.agent.xml +6 -0
- pyrustygraph-0.4.1/.idea/copilot.data.migration.ask.xml +6 -0
- pyrustygraph-0.4.1/.idea/copilot.data.migration.edit.xml +6 -0
- pyrustygraph-0.4.1/.idea/modules.xml +8 -0
- pyrustygraph-0.4.1/.idea/rustygraph.iml +20 -0
- pyrustygraph-0.4.1/.idea/vcs.xml +6 -0
- pyrustygraph-0.4.1/CHANGELOG.md +185 -0
- pyrustygraph-0.4.1/Cargo.lock +4328 -0
- pyrustygraph-0.4.1/Cargo.toml +105 -0
- pyrustygraph-0.4.1/MANIFEST.in +8 -0
- pyrustygraph-0.4.1/PKG-INFO +747 -0
- pyrustygraph-0.4.1/PUBLISHING_CHECKLIST.md +172 -0
- pyrustygraph-0.4.1/README.md +712 -0
- pyrustygraph-0.4.1/VISUAL_GUIDE.md +539 -0
- pyrustygraph-0.4.1/benches/comprehensive_benchmarks.rs +215 -0
- pyrustygraph-0.4.1/benches/parallel_comparison.rs +56 -0
- pyrustygraph-0.4.1/benches/simd_comparison.rs +44 -0
- pyrustygraph-0.4.1/benches/visibility_benchmarks.rs +223 -0
- pyrustygraph-0.4.1/examples/advanced_analytics.rs +149 -0
- pyrustygraph-0.4.1/examples/advanced_features.rs +132 -0
- pyrustygraph-0.4.1/examples/advanced_optimization.rs +204 -0
- pyrustygraph-0.4.1/examples/advanced_statistics.rs +196 -0
- pyrustygraph-0.4.1/examples/basic_usage.rs +64 -0
- pyrustygraph-0.4.1/examples/benchmarks/benchmarking_validation.rs +174 -0
- pyrustygraph-0.4.1/examples/benchmarks/performance_io.rs +171 -0
- pyrustygraph-0.4.1/examples/benchmarks/performance_showcase.rs +179 -0
- pyrustygraph-0.4.1/examples/benchmarks/rust_benchmark.rs +84 -0
- pyrustygraph-0.4.1/examples/benchmarks/validate_claims.rs +179 -0
- pyrustygraph-0.4.1/examples/community_detection.rs +142 -0
- pyrustygraph-0.4.1/examples/export_formats.rs +237 -0
- pyrustygraph-0.4.1/examples/gpu/gpu_benchmark.rs +226 -0
- pyrustygraph-0.4.1/examples/gpu/gpu_large_graph_benchmark.rs +150 -0
- pyrustygraph-0.4.1/examples/gpu/gpu_optimized_benchmark.rs +244 -0
- pyrustygraph-0.4.1/examples/gpu/gpu_precision_comparison.rs +259 -0
- pyrustygraph-0.4.1/examples/gpu/gpu_realistic_benchmark.rs +120 -0
- pyrustygraph-0.4.1/examples/gpu/gpu_showcase.rs +184 -0
- pyrustygraph-0.4.1/examples/gpu/metal_debug.rs +89 -0
- pyrustygraph-0.4.1/examples/integrations.rs +112 -0
- pyrustygraph-0.4.1/examples/ml_dataloader.rs +133 -0
- pyrustygraph-0.4.1/examples/polars_integration.rs +173 -0
- pyrustygraph-0.4.1/examples/simd_and_motifs.rs +200 -0
- pyrustygraph-0.4.1/examples/testing/check_simd.rs +29 -0
- pyrustygraph-0.4.1/examples/testing/correctness_test.rs +103 -0
- pyrustygraph-0.4.1/examples/testing/debug_edge_bug.rs +40 -0
- pyrustygraph-0.4.1/examples/testing/direct_comparison.rs +62 -0
- pyrustygraph-0.4.1/examples/testing/edge_diff.rs +61 -0
- pyrustygraph-0.4.1/examples/testing/ground_truth.rs +105 -0
- pyrustygraph-0.4.1/examples/testing/manual_verify.rs +67 -0
- pyrustygraph-0.4.1/examples/testing/test_edge_consistency.rs +36 -0
- pyrustygraph-0.4.1/examples/testing/test_parallel_on.rs +44 -0
- pyrustygraph-0.4.1/examples/testing/test_parallel_simd.rs +48 -0
- pyrustygraph-0.4.1/examples/testing/verify_edges.rs +67 -0
- pyrustygraph-0.4.1/examples/testing/verify_false_positive.rs +45 -0
- pyrustygraph-0.4.1/examples/weighted_graphs.rs +69 -0
- pyrustygraph-0.4.1/examples/with_features.rs +97 -0
- pyrustygraph-0.4.1/pyproject.toml +62 -0
- pyrustygraph-0.4.1/python/examples/comprehensive_example.py +299 -0
- pyrustygraph-0.4.1/python/rustygraph/__init__.py +41 -0
- pyrustygraph-0.4.1/python/rustygraph/__init__.pyi +467 -0
- pyrustygraph-0.4.1/python/tests/test_enhanced_bindings.py +385 -0
- pyrustygraph-0.4.1/scripts/benchmark_rust_vs_python.py +266 -0
- pyrustygraph-0.4.1/scripts/compare_edge_counts.sh +57 -0
- pyrustygraph-0.4.1/scripts/compare_rust_sequential_vs_optimized.sh +64 -0
- pyrustygraph-0.4.1/scripts/test_python_bindings.py +193 -0
- pyrustygraph-0.4.1/scripts/test_python_features.py +214 -0
- pyrustygraph-0.4.1/src/advanced/frequency.rs +415 -0
- pyrustygraph-0.4.1/src/advanced/mod.rs +11 -0
- pyrustygraph-0.4.1/src/analysis/community.rs +321 -0
- pyrustygraph-0.4.1/src/analysis/metrics.rs +504 -0
- pyrustygraph-0.4.1/src/analysis/mod.rs +13 -0
- pyrustygraph-0.4.1/src/analysis/motifs.rs +324 -0
- pyrustygraph-0.4.1/src/analysis/statistics.rs +561 -0
- pyrustygraph-0.4.1/src/core/algorithms/edges.rs +444 -0
- pyrustygraph-0.4.1/src/core/algorithms/mod.rs +106 -0
- pyrustygraph-0.4.1/src/core/data_split.rs +273 -0
- pyrustygraph-0.4.1/src/core/features/builtin.rs +413 -0
- pyrustygraph-0.4.1/src/core/features/missing_data.rs +432 -0
- pyrustygraph-0.4.1/src/core/features/mod.rs +78 -0
- pyrustygraph-0.4.1/src/core/mod.rs +15 -0
- pyrustygraph-0.4.1/src/core/time_series.rs +440 -0
- pyrustygraph-0.4.1/src/core/visibility_graph.rs +646 -0
- pyrustygraph-0.4.1/src/integrations/burn.rs +209 -0
- pyrustygraph-0.4.1/src/integrations/mod.rs +21 -0
- pyrustygraph-0.4.1/src/integrations/ndarray.rs +268 -0
- pyrustygraph-0.4.1/src/integrations/petgraph.rs +212 -0
- pyrustygraph-0.4.1/src/integrations/polars.rs +532 -0
- pyrustygraph-0.4.1/src/integrations/python.rs +868 -0
- pyrustygraph-0.4.1/src/io/export.rs +544 -0
- pyrustygraph-0.4.1/src/io/export_advanced.rs +347 -0
- pyrustygraph-0.4.1/src/io/import.rs +243 -0
- pyrustygraph-0.4.1/src/io/mod.rs +15 -0
- pyrustygraph-0.4.1/src/lib.rs +143 -0
- pyrustygraph-0.4.1/src/performance/batch.rs +261 -0
- pyrustygraph-0.4.1/src/performance/gpu.rs +789 -0
- pyrustygraph-0.4.1/src/performance/lazy.rs +150 -0
- pyrustygraph-0.4.1/src/performance/metal.rs +390 -0
- pyrustygraph-0.4.1/src/performance/mod.rs +21 -0
- pyrustygraph-0.4.1/src/performance/parallel.rs +96 -0
- pyrustygraph-0.4.1/src/performance/shaders/visibility.metal +162 -0
- pyrustygraph-0.4.1/src/performance/simd.rs +511 -0
- pyrustygraph-0.4.1/src/performance/tuning.rs +242 -0
- pyrustygraph-0.4.1/src/utils/datasets.rs +248 -0
- pyrustygraph-0.4.1/src/utils/mod.rs +6 -0
- pyrustygraph-0.4.1/tests/horizontal_visibility_tests.rs +110 -0
- pyrustygraph-0.4.1/tests/integration_tests.rs +95 -0
- pyrustygraph-0.4.1/tests/natural_visibility_tests.rs +96 -0
- pyrustygraph-0.4.1/tests/property_tests.proptest-regressions +7 -0
- pyrustygraph-0.4.1/tests/property_tests.rs +216 -0
- pyrustygraph-0.4.1/tests/time_series_tests.rs +83 -0
- pyrustygraph-0.4.1/tests/visibility_graph_tests.rs +29 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# Python Package Publishing Workflows
|
|
2
|
+
|
|
3
|
+
This directory contains GitHub Actions workflows for automatically building and publishing the `rustygraph` Python package to PyPI.
|
|
4
|
+
|
|
5
|
+
## Workflows
|
|
6
|
+
|
|
7
|
+
### 1. `publish-python.yml` - Publish on Main Branch Commits
|
|
8
|
+
This workflow automatically publishes the package to PyPI when changes are pushed to the `main` branch.
|
|
9
|
+
|
|
10
|
+
**Triggers:**
|
|
11
|
+
- Push to `main` branch with changes in: `src/`, `python/`, `pyproject.toml`, `Cargo.toml`, or `Cargo.lock`
|
|
12
|
+
- Manual workflow dispatch
|
|
13
|
+
|
|
14
|
+
**What it does:**
|
|
15
|
+
- Builds wheels for Linux (x86_64, aarch64)
|
|
16
|
+
- Builds wheels for macOS (x86_64, aarch64/Apple Silicon)
|
|
17
|
+
- Builds wheels for Windows (x64)
|
|
18
|
+
- Builds source distribution (sdist)
|
|
19
|
+
- Publishes all artifacts to PyPI
|
|
20
|
+
|
|
21
|
+
### 2. `publish-python-on-tag.yml` - Publish on Version Tags (RECOMMENDED)
|
|
22
|
+
This workflow publishes the package when you create and push a version tag.
|
|
23
|
+
|
|
24
|
+
**Triggers:**
|
|
25
|
+
- Push of tags matching `v*` pattern (e.g., `v0.4.0`, `v1.0.0`)
|
|
26
|
+
- Manual workflow dispatch
|
|
27
|
+
|
|
28
|
+
**What it does:**
|
|
29
|
+
- Builds wheels for Linux (x86_64, aarch64)
|
|
30
|
+
- Builds wheels for macOS (x86_64, aarch64/Apple Silicon)
|
|
31
|
+
- Builds wheels for Windows (x64)
|
|
32
|
+
- Builds source distribution (sdist)
|
|
33
|
+
- Publishes all artifacts to PyPI
|
|
34
|
+
- Creates a GitHub Release with the built wheels attached
|
|
35
|
+
|
|
36
|
+
## Setup Instructions
|
|
37
|
+
|
|
38
|
+
### 1. Set up PyPI API Token
|
|
39
|
+
|
|
40
|
+
You need to configure a PyPI API token as a GitHub secret:
|
|
41
|
+
|
|
42
|
+
1. Go to [PyPI Account Settings](https://pypi.org/manage/account/)
|
|
43
|
+
2. Scroll to "API tokens" section
|
|
44
|
+
3. Click "Add API token"
|
|
45
|
+
4. Give it a name (e.g., "rustygraph-github-actions")
|
|
46
|
+
5. Set scope to "Entire account" or specific to "rustygraph" project
|
|
47
|
+
6. Copy the token (starts with `pypi-`)
|
|
48
|
+
7. Go to your GitHub repository → Settings → Secrets and variables → Actions
|
|
49
|
+
8. Click "New repository secret"
|
|
50
|
+
9. Name: `PYPI_API_TOKEN`
|
|
51
|
+
10. Value: paste your PyPI token
|
|
52
|
+
11. Click "Add secret"
|
|
53
|
+
|
|
54
|
+
### 2. Alternative: Use Trusted Publishing (Recommended)
|
|
55
|
+
|
|
56
|
+
PyPI supports "trusted publishing" which doesn't require managing tokens:
|
|
57
|
+
|
|
58
|
+
1. Go to [PyPI project management](https://pypi.org/manage/project/rustygraph/settings/)
|
|
59
|
+
2. Scroll to "Publishing" section
|
|
60
|
+
3. Add a new publisher:
|
|
61
|
+
- PyPI Project Name: `rustygraph`
|
|
62
|
+
- Owner: `paulmagos` (your GitHub username/org)
|
|
63
|
+
- Repository name: `rustygraph`
|
|
64
|
+
- Workflow name: `publish-python-on-tag.yml`
|
|
65
|
+
- Environment name: (leave empty)
|
|
66
|
+
|
|
67
|
+
If using trusted publishing, you can remove the `MATURIN_PYPI_TOKEN` line from the workflow.
|
|
68
|
+
|
|
69
|
+
## Usage
|
|
70
|
+
|
|
71
|
+
### Option 1: Publish on Every Commit to Main
|
|
72
|
+
|
|
73
|
+
The `publish-python.yml` workflow will automatically run when you push to main:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
git add .
|
|
77
|
+
git commit -m "Update feature"
|
|
78
|
+
git push origin main
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Note:** This publishes immediately! Make sure your code is ready for release.
|
|
82
|
+
|
|
83
|
+
### Option 2: Publish on Tagged Releases (RECOMMENDED)
|
|
84
|
+
|
|
85
|
+
The `publish-python-on-tag.yml` workflow runs when you create a version tag:
|
|
86
|
+
|
|
87
|
+
1. Update version in `pyproject.toml`:
|
|
88
|
+
```toml
|
|
89
|
+
[project]
|
|
90
|
+
version = "0.5.0"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
2. Update version in `Cargo.toml`:
|
|
94
|
+
```toml
|
|
95
|
+
[package]
|
|
96
|
+
version = "0.5.0"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
3. Commit the changes:
|
|
100
|
+
```bash
|
|
101
|
+
git add pyproject.toml Cargo.toml
|
|
102
|
+
git commit -m "Bump version to 0.5.0"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
4. Create and push a tag:
|
|
106
|
+
```bash
|
|
107
|
+
git tag v0.5.0
|
|
108
|
+
git push origin v0.5.0
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
5. The workflow will automatically:
|
|
112
|
+
- Build wheels for all platforms
|
|
113
|
+
- Publish to PyPI
|
|
114
|
+
- Create a GitHub Release
|
|
115
|
+
|
|
116
|
+
### Manual Trigger
|
|
117
|
+
|
|
118
|
+
Both workflows can be manually triggered:
|
|
119
|
+
|
|
120
|
+
1. Go to GitHub → Actions
|
|
121
|
+
2. Select the workflow
|
|
122
|
+
3. Click "Run workflow"
|
|
123
|
+
4. Choose the branch
|
|
124
|
+
5. Click "Run workflow"
|
|
125
|
+
|
|
126
|
+
## Monitoring
|
|
127
|
+
|
|
128
|
+
### Check Workflow Status
|
|
129
|
+
|
|
130
|
+
1. Go to GitHub repository → Actions tab
|
|
131
|
+
2. Click on the workflow run
|
|
132
|
+
3. View logs for each job (linux, macos, windows, sdist, release)
|
|
133
|
+
|
|
134
|
+
### Verify Publication
|
|
135
|
+
|
|
136
|
+
After successful run:
|
|
137
|
+
|
|
138
|
+
1. Check PyPI: https://pypi.org/project/rustygraph/
|
|
139
|
+
2. Install and test:
|
|
140
|
+
```bash
|
|
141
|
+
pip install --upgrade rustygraph
|
|
142
|
+
python -c "import rustygraph; print(rustygraph.__version__)"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Troubleshooting
|
|
146
|
+
|
|
147
|
+
### Build Failures
|
|
148
|
+
|
|
149
|
+
**Error: "Rust compiler not found"**
|
|
150
|
+
- The workflow uses maturin-action which includes Rust toolchain
|
|
151
|
+
- Check if `Cargo.toml` is valid
|
|
152
|
+
|
|
153
|
+
**Error: "Python version not supported"**
|
|
154
|
+
- Ensure `pyproject.toml` has correct Python version requirements
|
|
155
|
+
- The workflow uses Python 3.11 for building
|
|
156
|
+
|
|
157
|
+
### Publication Failures
|
|
158
|
+
|
|
159
|
+
**Error: "Invalid API token"**
|
|
160
|
+
- Verify `PYPI_API_TOKEN` secret is set correctly
|
|
161
|
+
- Make sure token hasn't expired
|
|
162
|
+
|
|
163
|
+
**Error: "File already exists"**
|
|
164
|
+
- The version already exists on PyPI
|
|
165
|
+
- Bump the version in `pyproject.toml` and `Cargo.toml`
|
|
166
|
+
- The workflow uses `--skip-existing` to avoid this error
|
|
167
|
+
|
|
168
|
+
**Error: "Package name already taken"**
|
|
169
|
+
- If first time publishing, you need to register the package name
|
|
170
|
+
- Publish manually first: `maturin publish`
|
|
171
|
+
|
|
172
|
+
## Best Practices
|
|
173
|
+
|
|
174
|
+
1. **Use tagged releases** (Option 2) rather than publishing on every commit
|
|
175
|
+
2. **Test locally** before pushing:
|
|
176
|
+
```bash
|
|
177
|
+
maturin build --release
|
|
178
|
+
maturin develop
|
|
179
|
+
pytest python/tests/
|
|
180
|
+
```
|
|
181
|
+
3. **Version management**:
|
|
182
|
+
- Use semantic versioning (MAJOR.MINOR.PATCH)
|
|
183
|
+
- Keep `pyproject.toml` and `Cargo.toml` versions in sync
|
|
184
|
+
4. **Update CHANGELOG.md** before releasing
|
|
185
|
+
5. **Test the package** after publishing:
|
|
186
|
+
```bash
|
|
187
|
+
pip install --upgrade rustygraph
|
|
188
|
+
python python/examples/comprehensive_example.py
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Platform Support
|
|
192
|
+
|
|
193
|
+
The workflows build for:
|
|
194
|
+
|
|
195
|
+
- **Linux**: x86_64 (Intel/AMD), aarch64 (ARM)
|
|
196
|
+
- **macOS**: x86_64 (Intel), aarch64 (Apple Silicon M1/M2/M3)
|
|
197
|
+
- **Windows**: x64
|
|
198
|
+
|
|
199
|
+
Users on these platforms can install pre-built wheels. Others will compile from source.
|
|
200
|
+
|
|
201
|
+
## Disabling Auto-Publish
|
|
202
|
+
|
|
203
|
+
If you want to disable automatic publishing on commits:
|
|
204
|
+
|
|
205
|
+
1. Rename or delete `publish-python.yml`
|
|
206
|
+
2. Keep only `publish-python-on-tag.yml`
|
|
207
|
+
3. Publish only when you explicitly create tags
|
|
208
|
+
|
|
209
|
+
## Related Files
|
|
210
|
+
|
|
211
|
+
- `pyproject.toml` - Python package metadata and build configuration
|
|
212
|
+
- `Cargo.toml` - Rust crate configuration
|
|
213
|
+
- `src/integrations/python.rs` - Python bindings implementation
|
|
214
|
+
- `python/rustygraph/__init__.py` - Python package entry point
|
|
215
|
+
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Version bumper for rustygraph
|
|
4
|
+
Keeps version numbers in sync across pyproject.toml and Cargo.toml
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import re
|
|
8
|
+
import sys
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def update_version_in_file(file_path: Path, new_version: str) -> bool:
|
|
13
|
+
"""Update version in a TOML file."""
|
|
14
|
+
content = file_path.read_text()
|
|
15
|
+
|
|
16
|
+
# Pattern for version = "X.Y.Z"
|
|
17
|
+
pattern = r'(version\s*=\s*")[^"]+(")'
|
|
18
|
+
replacement = rf'\g<1>{new_version}\g<2>'
|
|
19
|
+
|
|
20
|
+
new_content = re.sub(pattern, replacement, content, count=1)
|
|
21
|
+
|
|
22
|
+
if content == new_content:
|
|
23
|
+
return False
|
|
24
|
+
|
|
25
|
+
file_path.write_text(new_content)
|
|
26
|
+
return True
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def get_current_version(file_path: Path) -> str | None:
|
|
30
|
+
"""Extract current version from a TOML file."""
|
|
31
|
+
content = file_path.read_text()
|
|
32
|
+
match = re.search(r'version\s*=\s*"([^"]+)"', content)
|
|
33
|
+
return match.group(1) if match else None
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def validate_version(version: str) -> bool:
|
|
37
|
+
"""Check if version follows semantic versioning."""
|
|
38
|
+
pattern = r'^\d+\.\d+\.\d+(-[a-zA-Z0-9.]+)?$'
|
|
39
|
+
return bool(re.match(pattern, version))
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def main():
|
|
43
|
+
if len(sys.argv) != 2:
|
|
44
|
+
print("Usage: bump_version.py VERSION")
|
|
45
|
+
print("Example: bump_version.py 0.5.0")
|
|
46
|
+
sys.exit(1)
|
|
47
|
+
|
|
48
|
+
new_version = sys.argv[1]
|
|
49
|
+
|
|
50
|
+
# Validate version format
|
|
51
|
+
if not validate_version(new_version):
|
|
52
|
+
print(f"❌ Invalid version format: {new_version}")
|
|
53
|
+
print(" Must follow semantic versioning: MAJOR.MINOR.PATCH")
|
|
54
|
+
print(" Examples: 0.5.0, 1.0.0, 1.2.3-beta")
|
|
55
|
+
sys.exit(1)
|
|
56
|
+
|
|
57
|
+
# Paths
|
|
58
|
+
project_root = Path(__file__).parent.parent.parent
|
|
59
|
+
pyproject_path = project_root / "pyproject.toml"
|
|
60
|
+
cargo_path = project_root / "Cargo.toml"
|
|
61
|
+
|
|
62
|
+
# Check files exist
|
|
63
|
+
if not pyproject_path.exists():
|
|
64
|
+
print(f"❌ Not found: {pyproject_path}")
|
|
65
|
+
sys.exit(1)
|
|
66
|
+
if not cargo_path.exists():
|
|
67
|
+
print(f"❌ Not found: {cargo_path}")
|
|
68
|
+
sys.exit(1)
|
|
69
|
+
|
|
70
|
+
# Get current versions
|
|
71
|
+
pyproject_version = get_current_version(pyproject_path)
|
|
72
|
+
cargo_version = get_current_version(cargo_path)
|
|
73
|
+
|
|
74
|
+
print("📦 RustyGraph Version Bumper")
|
|
75
|
+
print("=" * 40)
|
|
76
|
+
print(f"Current versions:")
|
|
77
|
+
print(f" pyproject.toml: {pyproject_version}")
|
|
78
|
+
print(f" Cargo.toml: {cargo_version}")
|
|
79
|
+
print(f"\nNew version: {new_version}")
|
|
80
|
+
print()
|
|
81
|
+
|
|
82
|
+
# Confirm
|
|
83
|
+
response = input("Proceed? [y/N] ").strip().lower()
|
|
84
|
+
if response not in ('y', 'yes'):
|
|
85
|
+
print("Aborted.")
|
|
86
|
+
sys.exit(0)
|
|
87
|
+
|
|
88
|
+
# Update files
|
|
89
|
+
print("\nUpdating files...")
|
|
90
|
+
|
|
91
|
+
if update_version_in_file(pyproject_path, new_version):
|
|
92
|
+
print(f"✅ Updated {pyproject_path.name}")
|
|
93
|
+
else:
|
|
94
|
+
print(f"⚠️ No changes in {pyproject_path.name}")
|
|
95
|
+
|
|
96
|
+
if update_version_in_file(cargo_path, new_version):
|
|
97
|
+
print(f"✅ Updated {cargo_path.name}")
|
|
98
|
+
else:
|
|
99
|
+
print(f"⚠️ No changes in {cargo_path.name}")
|
|
100
|
+
|
|
101
|
+
print("\n📋 Next steps:")
|
|
102
|
+
print(f" 1. Review changes: git diff")
|
|
103
|
+
print(f" 2. Commit: git commit -am 'Bump version to {new_version}'")
|
|
104
|
+
print(f" 3. Tag: git tag v{new_version}")
|
|
105
|
+
print(f" 4. Push: git push origin main && git push origin v{new_version}")
|
|
106
|
+
print(f"\nThe GitHub Action will automatically publish to PyPI.")
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
if __name__ == "__main__":
|
|
110
|
+
main()
|
|
111
|
+
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
name: Publish Python Package on Tag
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*' # Trigger on version tags like v0.4.0, v1.0.0, etc.
|
|
7
|
+
workflow_dispatch: # Allow manual triggering
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
# Build wheels for Linux
|
|
11
|
+
linux:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
target: [x86_64, aarch64]
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- uses: actions/setup-python@v5
|
|
20
|
+
with:
|
|
21
|
+
python-version: '3.11'
|
|
22
|
+
|
|
23
|
+
- name: Build wheels
|
|
24
|
+
uses: PyO3/maturin-action@v1
|
|
25
|
+
with:
|
|
26
|
+
target: ${{ matrix.target }}
|
|
27
|
+
args: --release --out dist --find-interpreter
|
|
28
|
+
sccache: 'true'
|
|
29
|
+
manylinux: auto
|
|
30
|
+
|
|
31
|
+
- name: Upload wheels
|
|
32
|
+
uses: actions/upload-artifact@v4
|
|
33
|
+
with:
|
|
34
|
+
name: wheels-linux-${{ matrix.target }}
|
|
35
|
+
path: dist
|
|
36
|
+
|
|
37
|
+
# Build wheels for macOS
|
|
38
|
+
macos:
|
|
39
|
+
runs-on: macos-latest
|
|
40
|
+
strategy:
|
|
41
|
+
matrix:
|
|
42
|
+
target: [aarch64]
|
|
43
|
+
steps:
|
|
44
|
+
- uses: actions/checkout@v4
|
|
45
|
+
|
|
46
|
+
- uses: actions/setup-python@v5
|
|
47
|
+
with:
|
|
48
|
+
python-version: '3.11'
|
|
49
|
+
|
|
50
|
+
- name: Build wheels
|
|
51
|
+
uses: PyO3/maturin-action@v1
|
|
52
|
+
with:
|
|
53
|
+
target: ${{ matrix.target }}
|
|
54
|
+
args: --release --out dist --find-interpreter
|
|
55
|
+
sccache: 'true'
|
|
56
|
+
|
|
57
|
+
- name: Upload wheels
|
|
58
|
+
uses: actions/upload-artifact@v4
|
|
59
|
+
with:
|
|
60
|
+
name: wheels-macos-${{ matrix.target }}
|
|
61
|
+
path: dist
|
|
62
|
+
|
|
63
|
+
# Build wheels for Windows
|
|
64
|
+
windows:
|
|
65
|
+
runs-on: windows-latest
|
|
66
|
+
strategy:
|
|
67
|
+
matrix:
|
|
68
|
+
target: [x64]
|
|
69
|
+
steps:
|
|
70
|
+
- uses: actions/checkout@v4
|
|
71
|
+
|
|
72
|
+
- uses: actions/setup-python@v5
|
|
73
|
+
with:
|
|
74
|
+
python-version: '3.11'
|
|
75
|
+
|
|
76
|
+
- name: Build wheels
|
|
77
|
+
uses: PyO3/maturin-action@v1
|
|
78
|
+
with:
|
|
79
|
+
target: ${{ matrix.target }}
|
|
80
|
+
args: --release --out dist --find-interpreter
|
|
81
|
+
sccache: 'true'
|
|
82
|
+
|
|
83
|
+
- name: Upload wheels
|
|
84
|
+
uses: actions/upload-artifact@v4
|
|
85
|
+
with:
|
|
86
|
+
name: wheels-windows-${{ matrix.target }}
|
|
87
|
+
path: dist
|
|
88
|
+
|
|
89
|
+
# Build source distribution
|
|
90
|
+
sdist:
|
|
91
|
+
runs-on: ubuntu-latest
|
|
92
|
+
steps:
|
|
93
|
+
- uses: actions/checkout@v4
|
|
94
|
+
|
|
95
|
+
- name: Build sdist
|
|
96
|
+
uses: PyO3/maturin-action@v1
|
|
97
|
+
with:
|
|
98
|
+
command: sdist
|
|
99
|
+
args: --out dist
|
|
100
|
+
|
|
101
|
+
- name: Upload sdist
|
|
102
|
+
uses: actions/upload-artifact@v4
|
|
103
|
+
with:
|
|
104
|
+
name: wheels-sdist
|
|
105
|
+
path: dist
|
|
106
|
+
|
|
107
|
+
# Publish to PyPI
|
|
108
|
+
release:
|
|
109
|
+
name: Release to PyPI
|
|
110
|
+
runs-on: ubuntu-latest
|
|
111
|
+
needs: [linux, macos, windows, sdist]
|
|
112
|
+
permissions:
|
|
113
|
+
id-token: write # Required for trusted publishing
|
|
114
|
+
steps:
|
|
115
|
+
- uses: actions/download-artifact@v4
|
|
116
|
+
with:
|
|
117
|
+
pattern: wheels-*
|
|
118
|
+
merge-multiple: true
|
|
119
|
+
path: dist
|
|
120
|
+
|
|
121
|
+
- name: Publish to PyPI
|
|
122
|
+
uses: PyO3/maturin-action@v1
|
|
123
|
+
with:
|
|
124
|
+
command: upload
|
|
125
|
+
args: --non-interactive --skip-existing dist/*
|
|
126
|
+
env:
|
|
127
|
+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
|
128
|
+
|
|
129
|
+
- name: Create GitHub Release
|
|
130
|
+
uses: softprops/action-gh-release@v1
|
|
131
|
+
with:
|
|
132
|
+
files: dist/*
|
|
133
|
+
generate_release_notes: true
|
|
134
|
+
env:
|
|
135
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
136
|
+
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
name: Publish Python Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ "main" ]
|
|
6
|
+
paths:
|
|
7
|
+
- 'src/**'
|
|
8
|
+
- 'python/**'
|
|
9
|
+
- 'pyproject.toml'
|
|
10
|
+
- 'Cargo.toml'
|
|
11
|
+
- 'Cargo.lock'
|
|
12
|
+
workflow_dispatch: # Allow manual triggering
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
# Build wheels for Linux
|
|
16
|
+
linux:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
strategy:
|
|
19
|
+
matrix:
|
|
20
|
+
target: [x86_64, aarch64]
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: '3.11'
|
|
27
|
+
|
|
28
|
+
- name: Build wheels
|
|
29
|
+
uses: PyO3/maturin-action@v1
|
|
30
|
+
with:
|
|
31
|
+
target: ${{ matrix.target }}
|
|
32
|
+
args: --release --out dist --find-interpreter
|
|
33
|
+
sccache: 'true'
|
|
34
|
+
manylinux: auto
|
|
35
|
+
|
|
36
|
+
- name: Upload wheels
|
|
37
|
+
uses: actions/upload-artifact@v4
|
|
38
|
+
with:
|
|
39
|
+
name: wheels-linux-${{ matrix.target }}
|
|
40
|
+
path: dist
|
|
41
|
+
|
|
42
|
+
# Build wheels for macOS
|
|
43
|
+
macos:
|
|
44
|
+
runs-on: macos-latest
|
|
45
|
+
strategy:
|
|
46
|
+
matrix:
|
|
47
|
+
target: [aarch64]
|
|
48
|
+
steps:
|
|
49
|
+
- uses: actions/checkout@v4
|
|
50
|
+
|
|
51
|
+
- uses: actions/setup-python@v5
|
|
52
|
+
with:
|
|
53
|
+
python-version: '3.11'
|
|
54
|
+
|
|
55
|
+
- name: Build wheels
|
|
56
|
+
uses: PyO3/maturin-action@v1
|
|
57
|
+
with:
|
|
58
|
+
target: ${{ matrix.target }}
|
|
59
|
+
args: --release --out dist --find-interpreter
|
|
60
|
+
sccache: 'true'
|
|
61
|
+
|
|
62
|
+
- name: Upload wheels
|
|
63
|
+
uses: actions/upload-artifact@v4
|
|
64
|
+
with:
|
|
65
|
+
name: wheels-macos-${{ matrix.target }}
|
|
66
|
+
path: dist
|
|
67
|
+
|
|
68
|
+
# Build wheels for Windows
|
|
69
|
+
windows:
|
|
70
|
+
runs-on: windows-latest
|
|
71
|
+
strategy:
|
|
72
|
+
matrix:
|
|
73
|
+
target: [x64]
|
|
74
|
+
steps:
|
|
75
|
+
- uses: actions/checkout@v4
|
|
76
|
+
|
|
77
|
+
- uses: actions/setup-python@v5
|
|
78
|
+
with:
|
|
79
|
+
python-version: '3.11'
|
|
80
|
+
|
|
81
|
+
- name: Build wheels
|
|
82
|
+
uses: PyO3/maturin-action@v1
|
|
83
|
+
with:
|
|
84
|
+
target: ${{ matrix.target }}
|
|
85
|
+
args: --release --out dist --find-interpreter
|
|
86
|
+
sccache: 'true'
|
|
87
|
+
|
|
88
|
+
- name: Upload wheels
|
|
89
|
+
uses: actions/upload-artifact@v4
|
|
90
|
+
with:
|
|
91
|
+
name: wheels-windows-${{ matrix.target }}
|
|
92
|
+
path: dist
|
|
93
|
+
|
|
94
|
+
# Build source distribution
|
|
95
|
+
sdist:
|
|
96
|
+
runs-on: ubuntu-latest
|
|
97
|
+
steps:
|
|
98
|
+
- uses: actions/checkout@v4
|
|
99
|
+
|
|
100
|
+
- name: Build sdist
|
|
101
|
+
uses: PyO3/maturin-action@v1
|
|
102
|
+
with:
|
|
103
|
+
command: sdist
|
|
104
|
+
args: --out dist
|
|
105
|
+
|
|
106
|
+
- name: Upload sdist
|
|
107
|
+
uses: actions/upload-artifact@v4
|
|
108
|
+
with:
|
|
109
|
+
name: wheels-sdist
|
|
110
|
+
path: dist
|
|
111
|
+
|
|
112
|
+
# Publish to PyPI
|
|
113
|
+
release:
|
|
114
|
+
name: Release to PyPI
|
|
115
|
+
runs-on: ubuntu-latest
|
|
116
|
+
needs: [linux, macos, windows, sdist]
|
|
117
|
+
permissions:
|
|
118
|
+
id-token: write # Required for trusted publishing
|
|
119
|
+
steps:
|
|
120
|
+
- uses: actions/download-artifact@v4
|
|
121
|
+
with:
|
|
122
|
+
pattern: wheels-*
|
|
123
|
+
merge-multiple: true
|
|
124
|
+
path: dist
|
|
125
|
+
|
|
126
|
+
- name: Publish to PyPI
|
|
127
|
+
uses: PyO3/maturin-action@v1
|
|
128
|
+
with:
|
|
129
|
+
command: upload
|
|
130
|
+
args: --non-interactive --skip-existing dist/*
|
|
131
|
+
env:
|
|
132
|
+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
|
133
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: Rust
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ "main" ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ "main" ]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- name: Build
|
|
20
|
+
run: cargo build --verbose
|
|
21
|
+
- name: Run tests
|
|
22
|
+
run: cargo test --verbose
|