diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..5c9c3b8 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,47 @@ +name: Publish to PyPI + +on: + release: + types: [published] + +permissions: + id-token: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install build tools + run: pip install build + + - name: Build package + run: python -m build + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: dist + path: dist/ + + publish: + needs: build + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + steps: + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: dist + path: dist/ + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..3dc8f1f --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,31 @@ +name: Tests + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + python-version: ["3.9", "3.12"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + pip install -r requirements.txt + pip install pytest + + - name: Run tests + run: python -m pytest tests/ -v diff --git a/pyproject.toml b/pyproject.toml index d07c282..426bee7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = ["setuptools>=68.0", "wheel"] -build-backend = "setuptools.backends._legacy:_Backend" +build-backend = "setuptools.build_meta" [project] name = "virusxcheck" @@ -17,7 +17,6 @@ classifiers = [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Information Technology", - "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", @@ -33,6 +32,8 @@ dependencies = [ "colorama~=0.4.6", "plotly~=5.18", "tqdm~=4.66", + "ratelimit~=2.2", + "tabulate~=0.9", ] [project.optional-dependencies] @@ -48,3 +49,6 @@ virusxcheck = "virusxcheck:main" [tool.pytest.ini_options] testpaths = ["tests"] + +[tool.setuptools] +py-modules = ["virusxcheck", "html_reporter"] diff --git a/requirements.txt b/requirements.txt index 9791bd9..1c57dd1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,6 @@ requests~=2.31 python-dotenv~=1.0 colorama~=0.4.6 plotly~=5.18 -tqdm~=4.66 \ No newline at end of file +tqdm~=4.66 +ratelimit~=2.2 +tabulate~=0.9 \ No newline at end of file