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

Update copyright dates, black and isort #9

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 7 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

repos:
- repo: https://github.com/psf/black
rev: 19.10b0
rev: 20.8b0
hooks:
- id: black
files: \.py$
- repo: https://github.com/pycqa/isort
rev: 5.6.4
hooks:
- id: isort
files: \.py$
9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ env:
- SCRIPT="test"
- TEST_ARGS=""
- BRANCH_NAME="${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}"
- PIP_USE_FEATURE="2020-resolver"
- NUMPY="numpy"
- COV_CORE_SOURCE="pytest_allclose"
- COV_CORE_CONFIG=".coveragerc"
Expand Down Expand Up @@ -62,7 +63,7 @@ jobs:
- provider: pypi
server: https://test.pypi.org/legacy/
user: tbekolay
password: $PYPI_TOKEN
password: $PYPI_TEST_TOKEN
distributions: "sdist bdist_wheel "
on:
all_branches: true
Expand Down Expand Up @@ -92,11 +93,7 @@ before_install:
# install/run nengo-bones
- pip install git+https://github.com/nengo/nengo-bones#egg=nengo-bones
- bones-generate --output-dir .ci ci-scripts
- if [[ "$TRAVIS_PYTHON_VERSION" < "3.6" ]]; then
echo "Skipping bones-check because Python $TRAVIS_PYTHON_VERSION < 3.6";
else
bones-check --verbose;
fi
- bones-check --verbose
# display environment info
- pip freeze

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pytest-allclose license

MIT License

Copyright (c) 2019-2020 Applied Brain Research
Copyright (c) 2019-2021 Applied Brain Research

Permission is hereby granted, free of charge,
to any person obtaining a copy of this software
Expand Down
25 changes: 17 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Automatically generated by nengo-bones, do not edit this file directly

import os
import pathlib

import pytest_allclose

Expand All @@ -14,10 +14,11 @@
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx.ext.todo",
"sphinx.ext.viewcode",
"nbsphinx",
"nengo_sphinx_theme",
"nengo_sphinx_theme.ext.backoff",
"nengo_sphinx_theme.ext.sourcelinks",
"notfound.extension",
"numpydoc",
]

Expand All @@ -34,18 +35,26 @@
# -- sphinx.ext.intersphinx
intersphinx_mapping = {
"nengo": ("https://www.nengo.ai/nengo/", None),
"numpy": ("https://docs.scipy.org/doc/numpy", None),
"numpy": ("https://numpy.org/doc/stable", None),
"python": ("https://docs.python.org/3", None),
}

# -- sphinx.ext.todo
todo_include_todos = True

# -- nbsphinx
nbsphinx_timeout = -1

# -- notfound.extension
notfound_template = "404.html"
notfound_urls_prefix = "/pytest-allclose/"

# -- numpydoc config
numpydoc_show_class_members = False

# -- nbsphinx
nbsphinx_timeout = -1
# -- nengo_sphinx_theme.ext.sourcelinks
sourcelinks_module = "pytest_allclose"
sourcelinks_url = "https://github.com/nengo/pytest-allclose"

# -- sphinx
nitpicky = True
Expand All @@ -65,19 +74,19 @@

project = "pytest-allclose"
authors = "Applied Brain Research"
copyright = "2019-2020 Applied Brain Research"
copyright = "2019-2021 Applied Brain Research"
version = ".".join(pytest_allclose.__version__.split(".")[:2]) # Short X.Y version
release = pytest_allclose.__version__ # Full version, with tags

# -- HTML output
templates_path = ["_templates"]
html_static_path = ["_static"]
html_theme = "nengo_sphinx_theme"
html_title = "pytest-allclose {0} docs".format(release)
html_title = f"pytest-allclose {release} docs"
htmlhelp_basename = "pytest-allclose"
html_last_updated_fmt = "" # Default output format (suppressed)
html_show_sphinx = False
html_favicon = os.path.join("_static", "favicon.ico")
html_favicon = str(pathlib.Path("_static", "favicon.ico"))
html_theme_options = {
"nengo_logo": "general-small-light.svg",
"nengo_logo_color": "#a8acaf",
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
requires = ["setuptools", "wheel"]

[tool.black]
target-version = ['py35', 'py36', 'py37']
target-version = ['py36', 'py37', 'py38']

[tool.isort]
profile = "black"
src_paths = ["pytest_allclose"]
5 changes: 2 additions & 3 deletions pytest_allclose/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
Pytest fixture extending Numpy's allclose function.
"""

from .version import version as __version__

from .plugin import report_rmses
from .version import version as __version__

__copyright__ = "2019-2019 pytest_plt contributors"
__copyright__ = "2019-2021 pytest_plt contributors"
__license__ = "MIT license"
3 changes: 1 addition & 2 deletions pytest_allclose/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ def _allclose(
print_fail=5,
record_rmse=True,
):
"""Checks if two arrays are close, mimicking `numpy.allclose`.
"""
"""Checks if two arrays are close, mimicking `numpy.allclose`."""

if len(overrides) > 0:
override_args = overrides[min(call_count[0], len(overrides) - 1)]
Expand Down
1 change: 0 additions & 1 deletion pytest_allclose/tests/test_pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import numpy as np
import pytest


pytest_plugins = ["pytester"] # adds the `testdir` fixture


Expand Down
14 changes: 11 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-dir = docs/_build
all_files = 1

[coverage:run]
source = pytest_allclose
source = ./

[coverage:report]
# Regexes for lines to exclude from consideration
Expand Down Expand Up @@ -64,8 +64,8 @@ allclose_tolerances =
xfail_strict = False

[pylint]
# note: pylint doesn't look in setup.cfg by default, need to call it with
# `pylint ... --rcfile=setup.cfg`

[pylint.messages]
disable =
arguments-differ,
assignment-from-no-return,
Expand Down Expand Up @@ -103,12 +103,20 @@ disable =
unsubscriptable-object,
unsupported-assignment-operation,
unused-argument,

[pylint.imports]
known-third-party =
matplotlib,
nengo,
numpy,
pytest,

[pylint.format]
max-line-length = 88

[pylint.classes]
valid-metaclass-classmethod-first-arg = metacls

[pylint.reports]
reports = no
score = no
12 changes: 8 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Automatically generated by nengo-bones, do not edit this file directly

import io
import os
import pathlib
import runpy

try:
Expand All @@ -26,8 +26,8 @@ def read(*filenames, **kwargs):
return sep.join(buf)


root = os.path.dirname(os.path.realpath(__file__))
version = runpy.run_path(os.path.join(root, "pytest_allclose", "version.py"))["version"]
root = pathlib.Path(__file__).parent
version = runpy.run_path(str(root / "pytest_allclose" / "version.py"))["version"]

install_req = [
"numpy>=1.11",
Expand Down Expand Up @@ -68,7 +68,11 @@ def read(*filenames, **kwargs):
"tests": tests_req,
},
python_requires=">=3.5",
entry_points={"pytest11": ["allclose = pytest_allclose.plugin",],},
entry_points={
"pytest11": [
"allclose = pytest_allclose.plugin",
],
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Framework :: Pytest",
Expand Down