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

[pre-commit.ci] pre-commit autoupdate #183

Merged
merged 2 commits into from
Jul 25, 2023
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
17 changes: 6 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ repos:
- id: text-unicode-replacement-char

- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.2.5
hooks:
- id: codespell
args: ["--write-changes"]
additional_dependencies:
- tomli

- repo: https://github.com/ikamensh/flynt/
rev: '0.78'
rev: '1.0.0'
hooks:
- id: flynt

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.269"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.280"
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -56,20 +56,15 @@ repos:
- id: isort

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.7.0
hooks:
- id: black

- repo: https://github.com/asottile/blacken-docs
rev: 1.13.0
rev: 1.15.0
hooks:
- id: blacken-docs

- repo: https://github.com/tox-dev/pyproject-fmt
rev: "0.11.2"
hooks:
- id: pyproject-fmt

- repo: https://github.com/abravalheri/validate-pyproject
rev: "v0.13"
hooks:
Expand Down
50 changes: 0 additions & 50 deletions asdf_astropy/conftest.py
Original file line number Diff line number Diff line change
@@ -1,50 +0,0 @@
# This file is used to configure the behavior of pytest when using the Astropy
# test infrastructure. It needs to live inside the package in order for it to
# get picked up when running the tests inside an interpreter using
# packagename.test

from pathlib import Path

import asdf
import pytest
from astropy.version import version as astropy_version

# For Astropy 3.0 and later, we can use the standalone pytest plugin
if astropy_version < "3.0":
from astropy.tests.pytest_plugins import * # noqa: F403

del pytest_report_header
ASTROPY_HEADER = True
else:
try:
from pytest_astropy_header.display import PYTEST_HEADER_MODULES, TESTED_VERSIONS

ASTROPY_HEADER = True
except ImportError:
ASTROPY_HEADER = False


def pytest_configure(config):
if ASTROPY_HEADER:
config.option.astropy_header = True

# Customize the following lines to add/remove entries from the list of
# packages for which version numbers are displayed when running the tests.
PYTEST_HEADER_MODULES.pop("Pandas", None)
PYTEST_HEADER_MODULES["scikit-image"] = "skimage"

from . import __version__

packagename = Path(__file__).parent.name
TESTED_VERSIONS[packagename] = __version__


@pytest.fixture(autouse=True)
def _remove_astropy_extensions():
"""
Disable the old astropy extension so that it doesn't
confuse our test results.
"""
with asdf.config_context() as config:
config.remove_extension(package="astropy")
yield
12 changes: 3 additions & 9 deletions asdf_astropy/converters/time/tests/test_time_delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,9 @@


def create_time_deltas():
result = [
TimeDelta([1, 2] * u.day),
]

for format_ in TimeDelta.FORMATS:
result.append(TimeDelta(Time.now() - Time.now(), format=format_))

for scale in [*list(TimeDelta.SCALES), None]:
result.append(TimeDelta(0.125 * u.day, scale=scale))
result = [TimeDelta([1, 2] * u.day)]
result += [TimeDelta(Time.now() - Time.now(), format=format_) for format_ in TimeDelta.FORMATS]
result += [TimeDelta(0.125 * u.day, scale=scale) for scale in [*list(TimeDelta.SCALES), None]]

return result

Expand Down
47 changes: 24 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ classifiers = [
"Programming Language :: Python :: 3 :: Only",
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
"Programming Language :: Python :: 3.11",
]
dynamic = [
'version',
Expand Down Expand Up @@ -79,6 +79,29 @@ force-exclude = '''
)
'''

[tool.ruff]
target-version = "py38"
line-length = 120
select = ["ALL"]
extend-ignore = [
# Ignore check groups
"C90", # mccabe
"D", # pydocstyle
"ANN", # flake8-annotations
"ARG", # flake8-unused-arguments
"DTZ", # flake8-datetimez
"TD", # flake8-todos
"FIX", # flake8-fixme
# Individually ignored checks
"SLF001", # private-member-access
]
extend-exclude = ["docs/*"]

[tool.ruff.per-file-ignores]
"test_*.py" = ["S101"]
"asdf_astropy/testing/helpers.py" = ["S101"]
"scripts/generate_manifest.py" = ["S101", "SLOT000"]

[tool.isort]
profile = "black"
filter_files = true
Expand Down Expand Up @@ -132,27 +155,5 @@ exclude_lines = [
'def _ipython_key_completions_',
]

[tool.ruff]
target-version = "py38"
line-length = 120
select = ["ALL"]
extend-ignore = [
# Ignore check groups
"C90", # mccabe
"D", # pydocstyle
"ANN", # flake8-annotations
"ARG", # flake8-unused-arguments
"DTZ", # flake8-datetimez
"TD", # flake8-todos
# Individually ignored checks
"SLF001", # private-member-access
]
extend-exclude = ["docs/*"]

[tool.ruff.per-file-ignores]
"test_*.py" = ["S101"]
"asdf_astropy/testing/helpers.py" = ["S101"]
"scripts/generate_manifest.py" = ["S101"]

[tool.codespell]
skip="*.pdf,*.fits,*.asdf,*.egg-info,.tox,build,./tags,.git,./docs/_build"
Loading