From 1a78256488b71f8b91b7019d3c7fd3dd92edcdd5 Mon Sep 17 00:00:00 2001 From: Dhrumil Mistry <56185972+dmdhrumilmistry@users.noreply.github.com> Date: Mon, 20 Nov 2023 23:14:33 +0530 Subject: [PATCH] add pypi-publish workflow file remove unused imports --- .github/workflows/pypi-publish.yml | 41 ++++++++++++++++++++++++++++++ breach_check/breach.py | 2 +- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pypi-publish.yml diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml new file mode 100644 index 0000000..8070699 --- /dev/null +++ b/.github/workflows/pypi-publish.yml @@ -0,0 +1,41 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Python Package to PyPi + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: "3.x" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: | + cd src + python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@v1.8.10 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + packages_dir: src/dist diff --git a/breach_check/breach.py b/breach_check/breach.py index c41ef7b..7d3db9d 100644 --- a/breach_check/breach.py +++ b/breach_check/breach.py @@ -1,5 +1,5 @@ from aiohttp.client_exceptions import ClientProxyConnectionError -from asyncio import run, ensure_future, gather +from asyncio import ensure_future, gather from breach_check.http import AsyncRequests from breach_check.logger import logger, console from json import loads as json_loads