Skip to content

Commit

Permalink
MAINT: Migrate from setup.cfg to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
BvB93 committed May 17, 2023
1 parent 7e466b5 commit 10bce90
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 37 deletions.
5 changes: 3 additions & 2 deletions linting_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
pydocstyle
flake8
pydocstyle[toml]>=6.1
flake8>=5
Flake8-pyproject>=1.0.1

# Mypy-related stuff
mypy
Expand Down
25 changes: 25 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,31 @@ module = [
]
ignore_missing_imports = true

[tool.pydocstyle]
add_ignore = ["D401"]

[tool.coverage.run]
branch = true
source = ["nanoqm"]

[tool.pytest.ini_options]
testpaths = "test"
addopts = "--tb=short --cov --cov-report xml --cov-report term --cov-report html --cache-clear --pdbcls=IPython.terminal.debugger:TerminalPdb --durations=6"
markers = [
"slow: A marker for slow tests requiring external quantum-chemical packages."
]
filterwarnings = [
"error::qmflows.warnings_qmflows.QMFlows_Warning",
"ignore:Generic keyword '_pytestfixturefunction' not implemented for package \\w+:qmflows.warnings_qmflows.Key_Warning",
]

[tool.flake8]
max-line-length = 100
per-file-ignores = [
"nanoqm/workflows/input_validation.py: E704,E501",
"nanoqm/analysis/tools.py: F821",
]

[tool.cibuildwheel]
build = [
"cp38-manylinux_x86_64",
Expand Down
1 change: 0 additions & 1 deletion scripts/prepare_test_dir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
set -euo pipefail

mkdir /tmp/nanoqm
cp setup.cfg /tmp/nanoqm/
cp conftest.py /tmp/nanoqm/
cp -r test /tmp/nanoqm/
cp CITATION.cff /tmp/nanoqm/
Expand Down
27 changes: 0 additions & 27 deletions setup.cfg

This file was deleted.

17 changes: 10 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
from setuptools.command.build_ext import build_ext
from wheel.bdist_wheel import bdist_wheel

here = os.path.abspath(os.path.dirname(__file__))

version: "dict[str, str]" = {}
with open(os.path.join(here, 'nanoqm', '_version.py'), 'r', encoding='utf8') as f:
exec(f.read(), version)
def get_version() -> str:
"""Load the version."""
here = os.path.abspath(os.path.dirname(__file__))
version: "dict[str, str]" = {}
with open(os.path.join(here, 'nanoqm', '_version.py'), 'r', encoding='utf8') as f:
exec(f.read(), version)
return version["__version__"]


def readme() -> str:
def get_readme() -> str:
"""Load readme."""
with open('README.rst', 'r', encoding='utf8') as f:
return f.read()
Expand Down Expand Up @@ -152,15 +155,15 @@ def get_paths() -> "tuple[list[str], list[str]]":

setup(
name='nano-qmflows',
version=version['__version__'],
version=get_version(),
description='Derivative coupling calculation',
license='Apache-2.0',
license_files=["LICENSE*.txt"],
url='https://github.com/SCM-NV/nano-qmflows',
author='Felipe Zapata & Ivan Infante',
author_email='[email protected]',
keywords='chemistry Photochemistry Simulation',
long_description=readme() + '\n\n',
long_description=get_readme() + '\n\n',
long_description_content_type='text/x-rst',
packages=find_packages(exclude=["test"]),
classifiers=[
Expand Down

0 comments on commit 10bce90

Please sign in to comment.