Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ jobs:
run: cargo test

- name: Test Python
run: uv run pytest tests/python
run: uv run pytest tests/python
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ stackforge.egg-info/
.idea/

# Tools
.bin/
.bin/
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: \.rs$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt
entry: cargo fmt -- --check
language: system
types: [rust]
49 changes: 49 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
63 changes: 63 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Contributing to Stackforge

Thank you for your interest in contributing! We welcome bug reports, feature requests, and pull requests.

## Prerequisites

* **Rust:** Stable toolchain (install via [rustup](https://rustup.rs/)).
* **Python:** Version 3.13 or higher.
* **uv:** Fast Python package manager (install via [astral.sh/uv](https://docs.astral.sh/uv/)).

## Setting Up the Environment

1. **Clone the repository:**
```bash
git clone https://github.com/LaBackDoor/stackforge.git
cd stackforge
```

2. **Sync dependencies:** This will set up the virtual environment and install dependencies.

```bash
uv sync
```

3. **Build and install in editable mode:** This compiles the Rust extension and installs it into the local environment.

```bash
uv run maturin develop
```

## Running Tests

We use cargo for Rust tests and pytest for Python tests.

```bash
# Run Rust unit tests
cargo test

# Run Python integration tests
uv run pytest tests/python
```

## Linting and Formatting

Please ensure your code is formatted and linted before submitting a PR.

```bash
# Rust
cargo fmt
cargo clippy

# Python
# If you have ruff or black configured:
# uv run ruff check .
```

## Pull Request Process

1. Fork the repo and create your branch from main.
2. If you've added code that should be tested, add tests.
3. Ensure the test suite passes.
4. Make sure your code lints.
5. Issue that pull request!
7 changes: 4 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@ resolver = "2"

[package]
name = "stackforge"
version = "0.1.0"
version = "0.1.1"
edition = "2024"
license = "GPL-3.0-only"
description = "A high-performance, modular networking stack and automata framework."
repository = "https://github.com/LaBackDoor/stackforge"
homepage = "https://github.com/LaBackDoor/stackforge"
keywords = ["networking", "python", "automata", "rust"]
categories = ["network-programming", "science"]
publish = false

[package.metadata.release]
shared-version = true
tag-name = "v{{version}}"

[workspace.package]
version = "0.1.0"
version = "0.1.1"
edition = "2024"
license = "GPL-3.0-only"
repository = "https://github.com/LaBackDoor/stackforge"
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,37 @@
# stackforge
# Stackforge

[![CI](https://github.com/LaBackDoor/stackforge/actions/workflows/test.yml/badge.svg)](https://github.com/LaBackDoor/stackforge/actions/workflows/test.yml)
[![PyPI](https://img.shields.io/pypi/v/stackforge)](https://pypi.org/project/stackforge/)
[![License: GPL-3.0](https://img.shields.io/badge/License-GPL_v3-blue.svg)](LICENSE)

**Stackforge** is a high-performance, modular networking stack and automata framework written in Rust with efficient Python bindings. It combines the speed and safety of Rust with the ease of use of Python.

## Features
* **High Performance:** Core logic implemented in Rust for maximum speed.
* **Modular Design:** Built with composable layers for networking and automata.
* **Pythonic API:** Seamless integration with the Python ecosystem.

## Installation

You can install `stackforge` via uv:

```bash
uv add stackforge
```

## Usage

```python
import stackforge

# Example usage
print("Stackforge is ready!")
```

## Development

See CONTRIBUTING.md to set up your development environment.

## License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
1 change: 1 addition & 0 deletions crates/stackforge-automata/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 1 addition & 1 deletion crates/stackforge-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ repository.workspace = true
license.workspace = true
description = "Core networking logic for Stackforge."

[dependencies]
[dependencies]
1 change: 1 addition & 0 deletions crates/stackforge-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ build-backend = "maturin"

[project]
name = "stackforge"
version = "0.1.0"
dynamic=["version"]
requires-python = ">=3.13"
dependencies = []

[tool.maturin]
features = ["pyo3/extension-module"]
Expand All @@ -14,5 +15,7 @@ module-name = "stackforge.stackforge"

[dependency-groups]
dev = [
"pre-commit>=4.5.1",
"pytest>=9.0.2",
"ruff>=0.14.10",
]
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "stable"
components = ["rustfmt", "clippy"]
components = ["rustfmt", "clippy"]
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ use pyo3::prelude::*;
#[pymodule]
fn stackforge(_py: Python, _m: &Bound<'_, PyModule>) -> PyResult<()> {
Ok(())
}
}
3 changes: 2 additions & 1 deletion tests/python/test_core.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import stackforge


def test_import():
assert stackforge is not None
assert stackforge is not None
Loading