Skip to content

Commit

Permalink
Rename to pipelinechain
Browse files Browse the repository at this point in the history
  • Loading branch information
borkweb committed Apr 27, 2024
1 parent 1562794 commit 795796b
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
pull_request:
paths:
- 'tests/**.py'
- 'borkpipeline/**.py'
- 'pipelinechain/**.py'
push:
paths:
- 'tests/**.py'
- 'borkpipeline/**.py'
- 'pipelinechain/**.py'

jobs:
build:
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BorkPipeline
# PipelineChain

[![Tests](https://github.com/borkweb/borkpipeline/workflows/Tests/badge.svg)](https://github.com/borkweb/borkpipeline/actions?query=branch%3Amain)
[![Tests](https://github.com/borkweb/pipelinechain/workflows/Tests/badge.svg)](https://github.com/borkweb/pipelinechain/actions?query=branch%3Amain)

A Pipeline / [Chain of Responsibility](https://refactoring.guru/design-patterns/chain-of-responsibility) design pattern implementation based on [Laravel's Pipeline implementation](https://github.com/illuminate/pipeline/blob/master/Pipeline.python).

Expand Down Expand Up @@ -58,7 +58,7 @@ flowchart LR
Install PyPipeline via pip:

```bash
pip install borkpipeline
pip install pipelinechain
```

## Getting started
Expand Down Expand Up @@ -90,7 +90,7 @@ flowchart LR
```

```python
from borkpipeline.pipeline import Pipeline
from pipelinechain import Pipeline

# Create a new pipeline instance.
pipeline = Pipeline()
Expand Down Expand Up @@ -126,7 +126,7 @@ flowchart LR
```

```python
from borkpipeline.pipeline import Pipeline
from pipelinechain import Pipeline

# Create a new pipeline instance.
pipeline = Pipeline()
Expand Down Expand Up @@ -169,7 +169,7 @@ flowchart LR
```

```python
from borkpipeline.pipeline import Pipeline
from pipelinechain import Pipeline

pipeline = Pipeline()

Expand Down Expand Up @@ -226,7 +226,7 @@ flowchart LR
```

```python
from borkpipeline.pipeline import Pipeline
from pipelinechain import Pipeline

pipeline = Pipeline().through([TitlePipe(), StripPipe()])
result = pipeline.send(' hello world ').then_return()
Expand Down Expand Up @@ -272,7 +272,7 @@ flowchart LR
```

```python
from borkpipeline.pipeline import Pipeline
from pipelinechain import Pipeline

pipeline = Pipeline().via('execute').through([StripPipe(), ReversePipe()])
result = pipeline.send(' hello ').then_return()
Expand All @@ -288,7 +288,7 @@ can do this with a `return` statement!
#### Example pipeline

```python
from borkpipeline.pipeline import Pipeline
from pipelinechain import Pipeline

def check_content(passable, next_pipe):
if 'stop' in passable:
Expand Down Expand Up @@ -326,7 +326,7 @@ flowchart LR
```

```python
from borkpipeline.pipeline import Pipeline
from pipelinechain import Pipeline

pipeline = Pipeline().through([str.strip, str.upper])
result = pipeline.send(' hello world ').then(lambda x: len(x))
Expand Down
Empty file removed borkpipeline/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions borkpipeline/pipeline.py → pipelinechain/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from typing import Any, Callable, List, Optional, Union
from dataclasses import dataclass
from functools import reduce
from inspect import signature

@dataclass
class Pipeline:
"""
A Chain of Responsibility implementation adapted from https://github.com/stellarwp/pipeline
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ requires = ["setuptools>=61.0.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "borkpipeline"
name = "pipelinechain"
version = "1.0.0"
description = "A library that implements the Chain of Responsibility pattern."
readme = "README.md"
Expand All @@ -20,4 +20,4 @@ keywords = ["pipeline", "library"]
requires-python = ">=3.8"

[project.urls]
Homepage = "https://github.com/borkweb/borkpipeline"
Homepage = "https://github.com/borkweb/pipelinechain"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import find_packages, setup

setup(
name='borkpipeline',
name='pipelinechain',
packages=find_packages(),
version='1.0.0',
description='A library that implements the Chain of Responsibility pattern.',
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from borkpipeline.pipeline import Pipeline
from pipelinechain import Pipeline
import unittest

class TestPipeline(unittest.TestCase):
Expand Down

0 comments on commit 795796b

Please sign in to comment.