Skip to content

Commit

Permalink
Remove python 3 7 support (duartegroup#170)
Browse files Browse the repository at this point in the history
* Remove support for Python v 3.7
  • Loading branch information
t-young31 committed Oct 1, 2022
1 parent 1e5fc3d commit da680d9
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fail-fast: true
matrix:
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.7", "3.8", "3.9"]
python-version: ["3.8", "3.9", "3.10"]

defaults:
run:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pytest_cov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
fail-fast: true
matrix:
os: ["ubuntu-latest"]
python-version: ["3.7", "3.9"]
python-version: ["3.10"]

defaults:
run:
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion autode/calculations/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import autode.exceptions as ex

from typing import Optional, List
from autode.utils import cached_property
from functools import cached_property
from autode.log import logger


Expand Down
3 changes: 2 additions & 1 deletion autode/hessians.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
"""
import numpy as np
import multiprocessing as mp

from functools import cached_property
from typing import List, Tuple, Iterator, Optional, Sequence, Union
from autode.wrappers.keywords import Functional, GradientKeywords
from autode.log import logger
from autode.utils import cached_property
from autode.config import Config
from autode.constants import Constants
from autode.values import ValueArray, Frequency, Coordinates
Expand Down
25 changes: 0 additions & 25 deletions autode/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import sys
import shutil
import warnings
from time import time
Expand All @@ -26,30 +25,6 @@
logger.warning('Multiprocessing context has already been defined')


if sys.version_info.minor > 7: # Python >3.7
from functools import cached_property # lgtm[py/unused-import]
# LGTM alert is suppressed as this is imported in Python >3.7

if sys.version_info.minor <= 7: # Python <3.7
# Define a cached_property equivalent decorator

class cached_property(object):
# Based on https://github.com/pydanny/cached-property/

def __init__(self, func):
self.__doc__ = func.__doc__
self.func = func

def cached_property_wrapper(self, obj, _cls):
if obj is None:
return self

value = obj.__dict__[self.func.__name__] = self.func(obj)
return value

__get__ = cached_property_wrapper


def check_sufficient_memory(func: Callable):
"""Decorator to check that enough memory is available for a calculation"""

Expand Down
1 change: 1 addition & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Usability improvements/Changes
* Returns :code:`None` rather than rasies exceptions when calling the (deprecated) calculation get methods, to be consistent with ...get_energy
* Adds an :code:`autode.wrappers.keywords` package to improve file structure
* Removes any exceptions on calling :code:`.run()` on an optimiser instance where the system has no degrees of freedom
* Removes support for Python < v3.8


Functionality improvements
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

setup(name='autode',
version='1.3.0',
python_requires='>3.7',
packages=['autode',
'autode.conformers',
'autode.calculations',
Expand Down
23 changes: 0 additions & 23 deletions tests/test_cached_property.py

This file was deleted.

0 comments on commit da680d9

Please sign in to comment.