Skip to content

Commit

Permalink
refactor GHA workflows to install deps from setup.py, not requirement…
Browse files Browse the repository at this point in the history
…s(-ci).txt
  • Loading branch information
janosh committed Nov 6, 2023
1 parent c113acd commit cae50f1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 44 deletions.
48 changes: 18 additions & 30 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,23 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.8]
python-version: [3.9]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-ci.txt --quiet
- name: mypy
run: |
mypy --namespace-packages --explicit-package-bases pymatgen
- name: black
run: |
black --version
black --check --diff --color pymatgen
- name: flake8
run: |
flake8 --count --show-source --statistics pymatgen
# exit-zero treats all errors as warnings.
flake8 --count --exit-zero --max-complexity=20 --statistics pymatgen
- name: pydocstyle
run: |
pydocstyle --count pymatgen
- name: pylint
run: |
pylint pymatgen
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install mypy ruff
- name: mypy
run: |
mypy --namespace-packages --explicit-package-bases pymatgen
- name: black
run: |
ruff .
ruff format .
26 changes: 12 additions & 14 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on: [push, pull_request]

jobs:
build:

strategy:
max-parallel: 20
matrix:
Expand All @@ -18,16 +17,15 @@ jobs:
MPLBACKEND: "Agg"

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --quiet -r requirements.txt -r requirements-ci.txt
pip install -e .
- name: pytest
run: |
pytest --cov=pymatgen.analysis.diffusion --durations=30 pymatgen
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e '.[dev]'
- name: pytest
run: |
pytest --cov=pymatgen.analysis.diffusion --durations=30 pymatgen

0 comments on commit cae50f1

Please sign in to comment.