Skip to content

Commit

Permalink
ci: moved more things to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
pauliacomi committed Feb 2, 2022
1 parent 0b1e43e commit 7637949
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 109 deletions.
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ celerybeat-schedule
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
.env*
.venv*
env/*
venv/*
ENV/*

# Spyder project settings
.spyderproject
Expand Down
12 changes: 7 additions & 5 deletions ci/templates/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ deps =
cover: pytest-cov
commands =
cover: python setup.py clean --all build_ext --force --inplace
nocov: {posargs:pytest --ignore=src -vv}
nocov: {posargs:pytest -vv}
cover: {posargs:pytest --cov --cov-report=term-missing -vv}

[testenv:bootstrap]
Expand All @@ -54,17 +54,19 @@ passenv =
[testenv:check]
deps =
docutils
flake8
readme-renderer
pygments
isort
setuptools-scm
flake8
pylint
darglint
skip_install = true
usedevelop = false
commands =
python setup.py check --strict --metadata --restructuredtext
flake8 src tests setup.py
isort --verbose --check-only --diff src tests setup.py
flake8 src tests setup.py
; pylint src tests setup.py
; darglint src tests setup.py

[testenv:docs]
usedevelop = true
Expand Down
90 changes: 90 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,93 @@ requires = [
write_to = "src/pygaps/_version.py"
local_scheme = 'dirty-tag'
fallback_version = '3.1.0'

# linting: pydocstyle
[tool.pydocstyle]
convention = "numpy"
match-dir = "src\\/.*"

# formatting: isort
[tool.yapf]
based_on_style = "pep8"
dedent_closing_brackets = true
coalesce_brackets = true
split_complex_comprehension = true
split_before_dot = true

# formatting: isort
[tool.isort]
force_single_line = true
line_length = 120
known_first_party = "pygaps"
default_section = "THIRDPARTY"
forced_separate = "test_pygaps"
skip = [".tox",".eggs","ci/templates","build","dist"]

# testing: pytest.py
[tool.pytest.ini_options]
testpaths = [
"tests",
]
norecursedirs = [
".git",
".tox",
".env",
"dist",
"build",
"migrations",
]
python_files = [
"test_*.py",
"*_test.py",
"tests.py",
]
addopts = [
"-ra",
"--cov",
"--cov-report=xml",
"--doctest-glob=\\*.rst",
"--tb=short",
]
markers = [
"core: core pygaps python functionality.",
"utilities: python and scientific tools/utilities.",
"characterisation: characterisation tests on isotherms.",
"modelling: model generation from isotherms.",
"graphing: plotting functionality testing.",
"parsing: parsing functionality testing.",
"okay: custom emtpy marker.",
]
filterwarnings = [
"ignore::UserWarning",
]

# testing: coverage.py
[tool.coverage.run]
branch = false
source = [
"src",
]
omit = [
"*/tests/*",
]
parallel = true
[tool.coverage.paths]
source = [
"src",
"*/site-packages",
]
[tool.coverage.report]
ignore_errors = true
show_missing = true
precision = 1
omit = [
"*migrations*",
]
exclude_lines = [
"pragma: no cover",
"if self.debug",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.",
]
95 changes: 1 addition & 94 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ commit = True
tag = False
message = '{current_version} → {new_version}'

[aliases]
test = pytest

[check-manifest]
ignore =
.travis.yml
.github
.github/*

[bumpversion:file:setup.py]
search = 'fallback_version': '{current_version}'
replace = 'fallback_version': '{new_version}'
Expand All @@ -33,76 +24,11 @@ replace = __version__ = '{new_version}'
search = version = release = '{current_version}'
replace = version = release = '{new_version}'

[tool:pytest]
testpaths =
tests
norecursedirs =
.git
.tox
.env
dist
build
migrations
python_files =
test_*.py
*_test.py
tests.py
addopts =
-ra
--ignore=docs/conf.py
--ignore=setup.py
--ignore=ci
--ignore=examples
--ignore=.eggs
--doctest-modules
--doctest-glob=\*.rst
--tb=short
markers =
core: core pygaps python functionality.
characterisation: characterisation tests on isotherms.
modelling: model generation from isotherms.
graphing: plotting functionality testing.
parsing: parsing functionality testing.
okay: custom emtpy marker.
filterwarnings =
ignore::UserWarning

[coverage]
show_missing = true
precision = 2
omit = *migrations*

[coverage:paths]
source =
src
*/site-packages

[coverage:run]
branch = False
source =
src
omit =
*/tests/*
parallel = true

[coverage:report]
exclude_lines =
pragma: no cover

def __repr__
if self\.debug

raise AssertionError
raise NotImplementedError

if 0:
if __name__ == .__main__.:

[pylint]
extension-pkg-whitelist = numpy, pandas, matplotlib

[flake8]
ignore =
ignore =
E402,
W503,
W504,
Expand All @@ -111,24 +37,5 @@ max-line-length = 140
exclude = .tox,.eggs,ci/templates,build,dist
docstring_style = numpy

[pydocstyle]
convention = numpy
match-dir = 'src\/.*'

[darglint]
docstring_style = numpy

[yapf]
based_on_style = pep8
dedent_closing_brackets = true
coalesce_brackets = true
split_complex_comprehension = true
split_before_dot = true

[tool:isort]
force_single_line = True
line_length = 120
known_first_party = pygaps
default_section = THIRDPARTY
forced_separate = test_pygaps
skip = .tox,.eggs,ci/templates,build,dist
12 changes: 7 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ deps =
cover: pytest-cov
commands =
cover: python setup.py clean --all build_ext --force --inplace
nocov: {posargs:pytest --ignore=src -vv}
nocov: {posargs:pytest -vv}
cover: {posargs:pytest --cov --cov-report=term-missing -vv}

[testenv:bootstrap]
Expand All @@ -58,17 +58,19 @@ passenv =
[testenv:check]
deps =
docutils
flake8
readme-renderer
pygments
isort
setuptools-scm
flake8
pylint
darglint
skip_install = true
usedevelop = false
commands =
python setup.py check --strict --metadata --restructuredtext
flake8 src tests setup.py
isort --verbose --check-only --diff src tests setup.py
flake8 src tests setup.py
; pylint src tests setup.py
; darglint src tests setup.py

[testenv:docs]
usedevelop = true
Expand Down

0 comments on commit 7637949

Please sign in to comment.