From 24e88589bd82c52c2fc867093b7a462d1aeb521b Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Fri, 27 Sep 2024 11:37:36 +0200 Subject: [PATCH 1/5] Loosen numpy and pandas deps --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9c5f71e..217f281 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,11 +23,11 @@ dependencies = [ "optimade[server,ase]~=1.1", "pyyaml~=6.0", "pymatgen>=2023.9", - "pandas~=2.1", + "pandas >= 1.5, < 3", "pybtex~=0.24", "tqdm~=4.65", "requests~=2.31", - "numpy~=1.26", + "numpy >= 1.26, < 3", "click~=8.1" ] From 7b43b0eed07c6eb0f1d352a3876698260671fcaa Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Fri, 27 Sep 2024 11:41:55 +0200 Subject: [PATCH 2/5] Even looser numpy --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 217f281..06dace0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ dependencies = [ "pybtex~=0.24", "tqdm~=4.65", "requests~=2.31", - "numpy >= 1.26, < 3", + "numpy >= 1.22, < 3", "click~=8.1" ] From 7fc51d9e6ee90854359ceb7aa672a9c95e6270ca Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Fri, 27 Sep 2024 11:50:52 +0200 Subject: [PATCH 3/5] Fix out-of-date linting config wrt. pydantic and typeshed --- .pre-commit-config.yaml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3d1a267..e972313 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,4 +36,4 @@ repos: hooks: - id: mypy name: "MyPy" - additional_dependencies: ["types-all", "pydantic~=1.10"] + additional_dependencies: ["pydantic~=2.2"] diff --git a/pyproject.toml b/pyproject.toml index 06dace0..b373df0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ dependencies = [ [project.optional-dependencies] tests = ["pytest~=7.4", "pytest-cov~=4.0"] -dev = ["black", "ruff", "pre-commit", "mypy", "isort", "types-all"] +dev = ["black", "ruff", "pre-commit", "mypy", "isort"] [tool.ruff] select = ["E", "F", "I", "W", "Q"] From d3383bf7eeda660d97f8f395d87ada3c81018669 Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Wed, 30 Oct 2024 10:42:24 +0000 Subject: [PATCH 4/5] Add missing typeshed stubs to pre-commit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e972313..5a05ac9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,4 +36,4 @@ repos: hooks: - id: mypy name: "MyPy" - additional_dependencies: ["pydantic~=2.2"] + additional_dependencies: ["pydantic~=2.2", "types-PyYAML", "types-requests"] From 666e5a52fda07f420c91edc6cc2901c86ea79014 Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Wed, 30 Oct 2024 10:46:45 +0000 Subject: [PATCH 5/5] pre-commit autoupdate, and associated linting changes --- .pre-commit-config.yaml | 8 ++++---- pyproject.toml | 4 +++- src/optimade_maker/archive/utils.py | 1 + src/optimade_maker/config.py | 3 +-- tests/test_convert.py | 1 + tests/test_yaml.py | 1 + 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5a05ac9..0b27d25 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,13 +5,13 @@ exclude: "scripts|src/optimade_launch" repos: - repo: https://github.com/ambv/black - rev: 23.3.0 + rev: 24.10.0 hooks: - id: black name: Blacken - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v5.0.0 hooks: - id: check-symlinks - id: check-yaml @@ -26,13 +26,13 @@ repos: args: [--markdown-linebreak-ext=md] - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: 'v0.0.270' + rev: 'v0.7.1' hooks: - id: ruff args: [--fix] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.3.0 + rev: v1.13.0 hooks: - id: mypy name: "MyPy" diff --git a/pyproject.toml b/pyproject.toml index b373df0..fb7383a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,11 +36,13 @@ tests = ["pytest~=7.4", "pytest-cov~=4.0"] dev = ["black", "ruff", "pre-commit", "mypy", "isort"] [tool.ruff] +target-version = "py311" + +[tool.ruff.lint] select = ["E", "F", "I", "W", "Q"] ignore = ["E501", "E402"] fixable = ["A", "B", "C", "D", "E", "F", "I"] unfixable = [] -target-version = "py311" per-file-ignores = {} # Allow unused variables when underscore-prefixed. dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" diff --git a/src/optimade_maker/archive/utils.py b/src/optimade_maker/archive/utils.py index 31d1c32..4e52543 100644 --- a/src/optimade_maker/archive/utils.py +++ b/src/optimade_maker/archive/utils.py @@ -1,4 +1,5 @@ """Get file URLs from Materials Cloud records""" + from __future__ import print_function import json diff --git a/src/optimade_maker/config.py b/src/optimade_maker/config.py index f6ca2fd..6902fc0 100644 --- a/src/optimade_maker/config.py +++ b/src/optimade_maker/config.py @@ -14,8 +14,7 @@ from pydantic import BaseModel, Field -class UnsupportedConfigVersion(RuntimeError): - ... +class UnsupportedConfigVersion(RuntimeError): ... class PropertyDefinition(BaseModel): diff --git a/tests/test_convert.py b/tests/test_convert.py index c4ce8ff..2cfcafa 100644 --- a/tests/test_convert.py +++ b/tests/test_convert.py @@ -5,6 +5,7 @@ import numpy as np import pytest from optimade.models import EntryInfoResource + from optimade_maker.convert import convert_archive EXAMPLE_ARCHIVES = (Path(__file__).parent.parent / "examples").glob("*") diff --git a/tests/test_yaml.py b/tests/test_yaml.py index 65a7e9f..9c4fd77 100644 --- a/tests/test_yaml.py +++ b/tests/test_yaml.py @@ -1,6 +1,7 @@ from pathlib import Path import pytest + from optimade_maker.config import Config EXAMPLE_YAMLS = (Path(__file__).parent.parent / "examples").glob("*/optimade.yaml")