diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index d5946904..1fbd2164 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -39,7 +39,7 @@ jobs: - name: Install Python dependencies run: | python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install .[build] - name: Test building documentation run: | cd docs @@ -49,8 +49,7 @@ jobs: ruff check . - name: Run unit tests run: | - coverage run tests.py - coverage json + pytest --cov --cov-report=xml tests.py - name: Test sample DMARC reports run: | pip install -e . @@ -61,3 +60,5 @@ jobs: hatch build - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/build.sh b/build.sh index ce37510d..34e9d84c 100755 --- a/build.sh +++ b/build.sh @@ -7,7 +7,7 @@ if [ ! -d "venv" ]; then fi . venv/bin/activate -pip install -U -r requirements.txt +pip install .[build] ruff format . cd docs make clean diff --git a/pyproject.toml b/pyproject.toml index d6d1d719..7ffc954b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,11 +50,23 @@ dependencies = [ "msgraph-core==0.2.2", "opensearch-py>=2.4.2,<=3.0.0", "publicsuffixlist>=0.10.0", + "pygelf>=0.4.2", "requests>=2.22.0", "tqdm>=4.31.1", "urllib3>=1.25.7", "xmltodict>=0.12.0", - "pygelf>=0.4.2", +] + +[project.optional-dependencies] +build = [ + "hatch", + "myst-parser[linkify]", + "nose", + "pytest", + "pytest-cov", + "ruff", + "sphinx", + "sphinx_rtd_theme", ] [project.scripts] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index ba292bb6..00000000 --- a/requirements.txt +++ /dev/null @@ -1,46 +0,0 @@ -tqdm>=4.31.1 -pygments>=2.11.1 -dnspython>=2.0.0 -expiringdict>=1.1.4 -urllib3>=1.25.7 -requests>=2.22.0 -publicsuffixlist>=0.10.0 -xmltodict>=0.12.0 -geoip2>=3.0.0 -imapclient>=2.1.0 -dateparser>=1.1.1 -elasticsearch<7.14.0 -elasticsearch-dsl>=7.4.0 -opensearch-py>=2.4.2,<=3.0.0 -kafka-python-ng>=2.2.2 -mailsuite>=1.9.17 -pygelf -nose>=1.3.7 -wheel>=0.37.0 -ruff -jinja2>=2.10.1 -packaging>=19.1 -imagesize>=1.1.0 -alabaster>=0.7.12 -Babel>=2.7.0 -docutils<0.18,>=0.14 -sphinx>=1.0.5 -sphinx_rtd_theme>=0.4.3 -codecov>=2.0.15 -lxml>=4.4.0 -boto3>=1.16.63 -msgraph-core==0.2.2 -azure-identity>=1.8.0 -azure-monitor-ingestion>=1.0.0 -google-api-core>=2.4.0 -google-api-python-client>=2.35.0 -google-auth>=2.3.3 -google-auth-httplib2>=0.1.0 -google-auth-oauthlib>=0.4.6 -hatch>=1.5.0 -myst-parser>=0.18.0 -myst-parser[linkify] -requests -bs4 -pytest -