diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b5668c4..a4e90aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,10 +18,10 @@ jobs: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v2.2.0 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: "3.x" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ff8df16..ce71c34 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,11 +17,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: '3.10' - - uses: actions/checkout@v2.2.0 + - uses: actions/checkout@v4 - name: Install deps run: python -mpip install -r requirements-dev.txt @@ -33,11 +33,11 @@ jobs: strategy: matrix: python-version: - - '3.8' - '3.9' - '3.10' - '3.11' - - '3.12.0-alpha.0 - 3.12' + - '3.12' + - '3.13.0-alpha.0 - 3.13' - 'pypy-3.9' os-version: - 'ubuntu-latest' @@ -55,7 +55,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -73,5 +73,4 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - - uses: pre-commit/action@v3.0.0 + - uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c4770f8..131217d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,18 +6,8 @@ default_language_version: python: python3 repos: -- repo: https://github.com/psf/black - rev: 23.7.0 - hooks: - - id: black -- repo: https://github.com/pycqa/isort - rev: 5.12.0 - hooks: - - id: isort - name: isort (python) - args: ['--profile', 'black'] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.6.0 hooks: - id: check-yaml - id: end-of-file-fixer @@ -25,10 +15,15 @@ repos: - id: trailing-whitespace exclude: tests - repo: https://github.com/fsfe/reuse-tool - rev: v2.1.0 + rev: v3.0.2 hooks: - id: reuse -- repo: https://github.com/pycqa/pylint - rev: v2.17.1 +- repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.4.3 hooks: - - id: pylint + # Run the linter. + - id: ruff + args: [ --fix ] + # Run the formatter. + - id: ruff-format diff --git a/leapseconddata/__init__.py b/leapseconddata/__init__.py index e438e24..9379422 100755 --- a/leapseconddata/__init__.py +++ b/leapseconddata/__init__.py @@ -84,7 +84,7 @@ class LeapSecondData: def _check_validity(self, when: Optional[datetime.datetime]) -> Optional[str]: if when is None: - when = datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc) + when = datetime.datetime.now(datetime.timezone.utc) if not self.valid_until: return "Data validity unknown" if when > self.valid_until: diff --git a/setup.cfg b/setup.cfg index 5e1d9c0..044748e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -12,7 +12,6 @@ long_description_content_type = text/markdown url = https://github.com/jepler/leapseconddata classifiers = Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 @@ -25,7 +24,7 @@ classifiers = [options] package_dir = =. -python_requires = >=3.8 +python_requires = >=3.9 packages = leapseconddata [options.package_data] diff --git a/testleapseconddata.py b/testleapseconddata.py index 431dafa..885b9d8 100644 --- a/testleapseconddata.py +++ b/testleapseconddata.py @@ -5,6 +5,7 @@ # SPDX-License-Identifier: GPL-3.0-only """Test most leapseconddata functionality""" + # pylint: disable=missing-class-docstring,missing-function-docstring import datetime import unittest