Skip to content

Commit

Permalink
Create optional dependency groups for build and cli
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaundry committed Oct 5, 2024
1 parent 1ef3057 commit 1e45fa5
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 57 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 .
Expand All @@ -61,3 +60,5 @@ jobs:
hatch build
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/source/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ source /opt/parsedmarc/venv/bin/activate
To install or upgrade `parsedmarc` inside the virtualenv, run:

```bash
sudo -u parsedmarc /opt/parsedmarc/venv/bin/pip install -U parsedmarc
sudo -u parsedmarc /opt/parsedmarc/venv/bin/pip install -U parsedmarc[cli]
```

## Optional dependencies
Expand Down
27 changes: 21 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@ classifiers = [
]
dependencies = [
"azure-identity>=1.8.0",
"azure-monitor-ingestion>=1.0.0",
"boto3>=1.16.63",
"dateparser>=1.1.1",
"dnspython>=2.0.0",
"elasticsearch-dsl==7.4.0",
"elasticsearch<7.14.0",
"expiringdict>=1.1.4",
"geoip2>=3.0.0",
"google-api-core>=2.4.0",
Expand All @@ -44,16 +40,35 @@ dependencies = [
"google-auth-oauthlib>=0.4.6",
"google-auth>=2.3.3",
"imapclient>=2.1.0",
"kafka-python-ng>=2.2.2",
"lxml>=4.4.0",
"mailsuite>=1.9.17",
"msgraph-core==0.2.2",
"opensearch-py>=2.4.2,<=3.0.0",
"publicsuffixlist>=0.10.0",
"requests>=2.22.0",
"tqdm>=4.31.1",
"urllib3>=1.25.7",
"xmltodict>=0.12.0",
]

[project.optional-dependencies]
build = [
"hatch",
"myst-parser[linkify]",
"nose",
"pytest",
"pytest-cov",
"ruff",
"sphinx",
"sphinx_rtd_theme",
]
cli = [
"azure-identity>=1.8.0",
"azure-monitor-ingestion>=1.0.0",
"boto3>=1.16.63",
"elasticsearch-dsl==7.4.0",
"elasticsearch<7.14.0",
"kafka-python-ng>=2.2.2",
"opensearch-py>=2.4.2,<=3.0.0",
"pygelf>=0.4.2",
]

Expand Down
46 changes: 0 additions & 46 deletions requirements.txt

This file was deleted.

0 comments on commit 1e45fa5

Please sign in to comment.