Skip to content

Commit

Permalink
Testing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxMLang committed Apr 7, 2024
1 parent ad0b8f9 commit efd6e55
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 24 deletions.
45 changes: 22 additions & 23 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Upload Python Package
name: Publish Python Package

on:
push:
Expand All @@ -8,27 +8,26 @@ on:
- 'v*'

jobs:
deploy:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Install the package
run: pip install .
- name: Run tests
run: |
python -m unittest discover -s tests
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Run tests
run: |
# Run your project's tests here
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Publish package
if: startsWith(github.ref, 'refs/tags/v')
run: twine upload dist/*
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Pytector is still a prototype and cannot provide 100% protection against prompt
- Easy-to-use interface with customizable threshold settings.

## Installation
Via PIP
```bash
pip install pytector
```

Install Pytector directly from the source code:

Expand All @@ -23,6 +27,8 @@ cd pytector
pip install .
```



## Usage

To use Pytector, you can import the `PromptInjectionDetector` class and create an instance with a pre-defined model or a custom model URL.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='pytector',
version='0.0.5',
version='0.0.6',
author='Max Melchior Lang',
author_email='[email protected]',
description='A package for detecting prompt injections in text using Open-Source LLMs.',
Expand Down

0 comments on commit efd6e55

Please sign in to comment.