Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize the repo #13

Merged
merged 13 commits into from
Nov 6, 2023
Merged
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
42 changes: 8 additions & 34 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,22 @@
exclude: ^(docs|.*test_files|cmd_line|dev_scripts)

default_language_version:
python: python3.8

ci:
autoupdate_schedule: monthly
skip: [flake8, autoflake, mypy]
autoupdate_schedule: quarterly

repos:
- repo: https://github.com/psf/black
rev: 23.7.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
hooks:
- id: black
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8

- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
hooks:
- id: pyupgrade
args: [--py38-plus]

- repo: https://github.com/PyCQA/autoflake
rev: v2.2.1
hooks:
- id: autoflake
args:
- --in-place
- --remove-unused-variables
- --remove-all-unused-imports
- --expand-star-imports
- --ignore-init-module-imports

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v1.6.1
hooks:
- id: mypy
5 changes: 0 additions & 5 deletions MANIFEST.in

This file was deleted.

Loading
Loading