Skip to content

Commit 3305b9e

Browse files
committed
prepare for v0.1.0 release
1 parent 4f0c0c9 commit 3305b9e

5 files changed

Lines changed: 156 additions & 37 deletions

File tree

.github/workflows/release.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
pull_request:
7+
paths-ignore:
8+
- "docs/**"
9+
- "**.md"
10+
workflow_dispatch:
11+
12+
jobs:
13+
build_wheels:
14+
name: Wheel (${{ matrix.os }})
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-22.04, macos-13]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
# Build wheels using cibuildwheel
25+
# ENV variables control the build (architectures, python versions)
26+
- name: Build wheels
27+
uses: pypa/cibuildwheel@v2.21.3
28+
env:
29+
# Build for Python 3.9+
30+
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*"
31+
# Skip PyPy and musllinux for now (unless desired)
32+
CIBW_SKIP: "pp* *-musllinux_*"
33+
34+
# macOS: Build Universal2 wheels on Intel runner (macos-13)
35+
CIBW_ARCHS_MACOS: "universal2"
36+
CIBW_TEST_COMMAND: "python -c \"import netgraph_core; print(netgraph_core.__version__)\""
37+
38+
- uses: actions/upload-artifact@v4
39+
with:
40+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
41+
path: ./wheelhouse/*.whl
42+
43+
build_sdist:
44+
name: Build SDist
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Build SDist
50+
run: pipx run build --sdist
51+
52+
- uses: actions/upload-artifact@v4
53+
with:
54+
name: cibw-sdist
55+
path: dist/*.tar.gz
56+
57+
publish_pypi:
58+
name: Publish to PyPI
59+
needs: [build_wheels, build_sdist]
60+
runs-on: ubuntu-latest
61+
environment: pypi
62+
permissions:
63+
id-token: write # Required for Trusted Publishing (OIDC)
64+
65+
# Only publish on tag pushes
66+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
67+
68+
steps:
69+
- uses: actions/download-artifact@v4
70+
with:
71+
pattern: cibw-*
72+
path: dist
73+
merge-multiple: true
74+
75+
- name: Publish to PyPI
76+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/tests.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches: [ main, master ]
66
pull_request:
7+
workflow_dispatch:
78

89
jobs:
910
test:
@@ -13,7 +14,7 @@ jobs:
1314
fail-fast: false
1415
matrix:
1516
os: [ubuntu-22.04, macos-13]
16-
python-version: ["3.10", "3.11", "3.12", "3.13"]
17+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1718
steps:
1819
- uses: actions/checkout@v4
1920
- uses: actions/setup-python@v5
@@ -48,11 +49,3 @@ jobs:
4849
build/coverage/coverage-python.xml
4950
build/coverage/coverage-cpp.xml
5051
build/coverage/coverage-combined.html
51-
# - name: Upload to Codecov
52-
# uses: codecov/codecov-action@v4
53-
# with:
54-
# files: |
55-
# coverage-python.xml
56-
# coverage-cpp.xml
57-
# token: ${{ secrets.CODECOV_TOKEN }}
58-
# fail_ci_if_error: false

.github/workflows/wheels.yml

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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ coverage.xml
4949
*.py.cover
5050
.hypothesis/
5151
.pytest_cache/
52+
.benchmarks/
5253
cover/
5354

5455
# Consolidated coverage artifacts

CONTRIBUTING.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Contributing to NetGraph-Core
2+
3+
This document provides guidelines for setting up your development environment and submitting contributions.
4+
5+
## Development Setup
6+
7+
NetGraph-Core is a hybrid C++/Python project. You will need:
8+
9+
- Python 3.9+
10+
- C++20 compatible compiler (GCC 10+, Clang 12+, MSVC 2019+)
11+
- CMake 3.23+
12+
- Ninja (recommended)
13+
14+
### 1. Clone the repository
15+
16+
```bash
17+
git clone https://github.com/networmix/NetGraph-Core.git
18+
cd NetGraph-Core
19+
```
20+
21+
### 2. Create a virtual environment and install dependencies
22+
23+
We use a `Makefile` to simplify development tasks.
24+
25+
```bash
26+
make dev
27+
source venv/bin/activate
28+
```
29+
30+
This will:
31+
32+
- Create a virtual environment in `./venv`
33+
- Install all development dependencies
34+
- Install pre-commit hooks
35+
36+
## Workflow
37+
38+
### Running Tests
39+
40+
Run all checks (linting + C++ tests + Python tests):
41+
42+
```bash
43+
make check
44+
```
45+
46+
Run specific test suites:
47+
48+
```bash
49+
make cpp-test # C++ tests (GoogleTest)
50+
make py-test # Python tests (pytest)
51+
```
52+
53+
### Code Style
54+
55+
- **Python**: We use `ruff` for linting and formatting, and `pyright` for static type checking.
56+
- **C++**: We follow standard C++20 practices.
57+
58+
Auto-fix Python formatting:
59+
60+
```bash
61+
make format
62+
```
63+
64+
## Release Process
65+
66+
Releases are automated via GitHub Actions when a new tag is pushed.
67+
68+
1. Bump version in `pyproject.toml` and `python/netgraph_core/_version.py`.
69+
2. Commit and push.
70+
3. Create and push a tag:
71+
72+
```bash
73+
git tag v0.1.0
74+
git push origin v0.1.0
75+
```
76+
77+
4. The CI pipeline will build wheels, sdist, and publish to PyPI.

0 commit comments

Comments
 (0)