From efd6e558a14cc487a6e4cae1236dd690951218ab Mon Sep 17 00:00:00 2001 From: MaxMLang Date: Sun, 7 Apr 2024 04:10:37 +0100 Subject: [PATCH] Testing fixes --- .github/workflows/workflow.yml | 45 +++++++++++++++++----------------- README.md | 6 +++++ setup.py | 2 +- 3 files changed, 29 insertions(+), 24 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 4d55a5d..02c2ecd 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,4 +1,4 @@ -name: Upload Python Package +name: Publish Python Package on: push: @@ -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 }} diff --git a/README.md b/README.md index d15be1e..b353c12 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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. diff --git a/setup.py b/setup.py index b4eeacc..55b3f35 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='pytector', - version='0.0.5', + version='0.0.6', author='Max Melchior Lang', author_email='langmaxmelchior@gmail.com', description='A package for detecting prompt injections in text using Open-Source LLMs.',