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

enforce more checks #108

Merged
merged 22 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 40 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
version: 2.1


shared: &shared
analysis: &analysis
steps:
- checkout
- run:
name: Install chemcoord
command: pip3 install --editable .
command: pip3 install .
- run:
name: Install infrastructure
command: pip3 install pytest pytest-cov mypy ruff
command: pip3 install -r tests/static_analysis_requirements.txt
- run:
name: Check trailing whitespace
command: git diff-tree --check $(git hash-object -t tree /dev/null) HEAD -- '(exclude)docs/make.bat'
Expand All @@ -18,7 +18,21 @@ shared: &shared
command: ruff format --diff
- run:
name: Ruff check
command: ruff check . || true
command: ruff check
- run:
name: Type checking
command: mypy src/ tests/


run_tests: &run_tests
steps:
- checkout
- run:
name: Install chemcoord
command: pip3 install .
- run:
name: Install infrastructure
command: pip3 install pytest pytest-cov
- run:
name: Running tests
command: python3 -m pytest -Werror --cov=./src/chemcoord tests/
Expand All @@ -32,26 +46,44 @@ workflows:
jobs:
- py39
- py310
- py310_analysis
- py311
- py311_analysis
- py312
- py313

jobs:
py39:
<<: *shared
<<: *run_tests
docker:
- image: cimg/python:3.9

py310:
<<: *shared
<<: *run_tests
docker:
- image: cimg/python:3.10

py310_analysis:
<<: *analysis
docker:
- image: cimg/python:3.10

py311:
<<: *shared
<<: *run_tests
docker:
- image: cimg/python:3.11

py311_analysis:
<<: *analysis
docker:
- image: cimg/python:3.11

py312:
<<: *shared
<<: *run_tests
docker:
- image: cimg/python:3.12

py313:
<<: *run_tests
docker:
- image: cimg/python:3.12
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Features
Installation guide
------------------

A working python 3 installation is required (3.9 <= version <= 3.12 are tested).
A working python 3 installation is required (3.9 <= version <= 3.13 are tested).

It is highly recommended to use this module in combination with
`Ipython <http://ipython.org/>`__ and `jupyter <http://jupyter.org/>`__.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/installation.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Installation guide
==================
A working python 3 installation is required (3.9 <= version <= 3.12 are tested).
A working python 3 installation is required (3.9 <= version <= 3.13 are tested).

It is highly recommended to use this module in combination with
`Ipython <http://ipython.org/>`_ and `jupyter <http://jupyter.org/>`_.
Expand Down
10 changes: 10 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
disallow_untyped_defs = False
check_untyped_defs = False

[mypy-setup]
disallow_untyped_defs = False
check_untyped_defs = False

[mypy-tests.*]
disallow_untyped_defs = False
check_untyped_defs = False
Expand All @@ -20,6 +24,9 @@
[mypy-numba.*]
ignore_missing_imports = True

[mypy-ConfigParser.*]
ignore_missing_imports = True

[mypy-setuptools.*]
ignore_missing_imports = True

Expand All @@ -33,4 +40,7 @@
ignore_missing_imports = True

[mypy-chemcoord.*]
ignore_missing_imports = True

[mypy-ruamel.*]
ignore_missing_imports = True
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def setup_package():
packages=find_packages("src"),
package_dir={"": "src"},
install_requires=INSTALL_REQUIRES,
python_requires=">=3.9,<3.13",
python_requires=">=3.8,<3.14",
)


Expand Down
6 changes: 1 addition & 5 deletions src/chemcoord/configuration.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# -*- coding: utf-8 -*-
try:
import configparser
except ImportError:
# Due to PY27 compatibility
import ConfigParser as configparser
import configparser

Check warning on line 2 in src/chemcoord/configuration.py

View check run for this annotation

Codecov / codecov/patch

src/chemcoord/configuration.py#L2

Added line #L2 was not covered by tests
import os
from warnings import warn

Expand Down
10 changes: 10 additions & 0 deletions tests/static_analysis_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# the additional (!) requirements for performing tests and static analysis of the code
# the dependencies of `chemcoord` itself are given in the setup.py
ruff
pylint
mypy
pytest
pytest-cov
types-simplejson
pandas-stubs
ase-stubs