diff --git a/.github/labels.yml b/.github/labels.yml
index b09419e..5c86376 100644
--- a/.github/labels.yml
+++ b/.github/labels.yml
@@ -49,11 +49,8 @@
name: "changelog: skip"
# Other labels
-- color: 28a745
- description: "To automatically merge PRs that are ready"
- name: automerge
- color: 0366d6
- description: "For dependencies and dependabot"
+ description: "For dependencies"
name: dependencies
- color: f4660e
description: ""
@@ -61,6 +58,9 @@
- color: f4660e
description: "To credit accepted Hacktoberfest PRs"
name: hacktoberfest-accepted
+- color: d65e88
+ description: "Deploy and release"
+ name: release
- color: fbca04
description: "Unit tests, linting, CI, etc."
name: testing
diff --git a/.github/workflows/require-pr-label.yml b/.github/workflows/require-pr-label.yml
new file mode 100644
index 0000000..1079f3f
--- /dev/null
+++ b/.github/workflows/require-pr-label.yml
@@ -0,0 +1,18 @@
+name: Require PR label
+
+on:
+ pull_request:
+ types: [opened, reopened, labeled, unlabeled, synchronize]
+
+jobs:
+ label:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: mheap/github-action-required-labels@v2
+ with:
+ mode: minimum
+ count: 1
+ labels:
+ "changelog: Added, changelog: Changed, changelog: Deprecated, changelog:
+ Fixed, changelog: Removed, changelog: Security, changelog: skip"
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 6f429a9..e25cb8f 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- python-version: ["3.11-dev", "pypy-3.7", "3.7", "3.8", "3.9", "3.10"]
+ python-version: ["3.11-dev", "pypy-3.8", "3.7", "3.8", "3.9", "3.10"]
os: [windows-latest, macos-latest, ubuntu-latest]
steps:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 763014e..daff5ea 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -15,6 +15,7 @@ repos:
rev: 5.10.1
hooks:
- id: isort
+ args: [--add-import=from __future__ import annotations]
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
@@ -30,6 +31,7 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
+ - id: check-json
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
diff --git a/LICENSE.txt b/LICENSE.txt
index 5beab5f..5a834ed 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2018-2021 Hugo van Kemenade
+Copyright (c) 2018-2022 Hugo van Kemenade
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index f469526..9a92f85 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
[](https://pypistats.org/packages/norwegianblue)
[](https://github.com/hugovk/norwegianblue/actions)
[](https://codecov.io/gh/hugovk/norwegianblue)
-[](LICENSE.txt)
+[](LICENSE.txt)
[](https://github.com/psf/black)

diff --git a/RELEASING.md b/RELEASING.md
index 6022659..f2bb14a 100644
--- a/RELEASING.md
+++ b/RELEASING.md
@@ -19,5 +19,5 @@
- [ ] Check installation:
```bash
-pip3 uninstall -y norwegianblue && pip3 install -U norwegianblue
+pip3 uninstall -y norwegianblue && pip3 install -U norwegianblue && norwegianblue --version
```
diff --git a/pyproject.toml b/pyproject.toml
index 2617c9c..0db2d19 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -7,7 +7,7 @@ requires = [
[project]
name = "norwegianblue"
-description = "CLI to show end-of-life dates for a number of products."
+description = "CLI to show end-of-life dates for a number of products"
readme = "README.md"
keywords = [
"end-of-life",
@@ -43,6 +43,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
+ "Programming Language :: Python :: Implementation :: PyPy",
]
[project.optional-dependencies]
tests = [
diff --git a/scripts/run_command.py b/scripts/run_command.py
index 94d7d00..bc8fa06 100644
--- a/scripts/run_command.py
+++ b/scripts/run_command.py
@@ -1,3 +1,5 @@
+from __future__ import annotations
+
import subprocess
diff --git a/src/norwegianblue/__init__.py b/src/norwegianblue/__init__.py
index 23e314a..3664afd 100644
--- a/src/norwegianblue/__init__.py
+++ b/src/norwegianblue/__init__.py
@@ -19,7 +19,7 @@
# Python 3.8+
import importlib.metadata as importlib_metadata
except ImportError:
- # Python 3.7 and lower
+ # Python 3.7
import importlib_metadata # type: ignore
__version__ = importlib_metadata.version(__name__)
diff --git a/src/norwegianblue/__main__.py b/src/norwegianblue/__main__.py
index b147ca7..621c515 100644
--- a/src/norwegianblue/__main__.py
+++ b/src/norwegianblue/__main__.py
@@ -1,3 +1,5 @@
+from __future__ import annotations
+
from norwegianblue import cli
if __name__ == "__main__":
diff --git a/src/norwegianblue/_data.py b/src/norwegianblue/_data.py
index c6da517..74a017d 100644
--- a/src/norwegianblue/_data.py
+++ b/src/norwegianblue/_data.py
@@ -1,3 +1,5 @@
+from __future__ import annotations
+
import random
d = {}
diff --git a/src/norwegianblue/cli.py b/src/norwegianblue/cli.py
index 7ea8a5b..cd856ab 100644
--- a/src/norwegianblue/cli.py
+++ b/src/norwegianblue/cli.py
@@ -11,6 +11,8 @@
Something missing? Please contribute! https://endoflife.date/contribute
"""
+from __future__ import annotations
+
import argparse
import atexit
import logging
@@ -50,7 +52,7 @@ def main() -> None:
"--color",
default="auto",
choices=("yes", "no", "auto"),
- help="color terminal output",
+ help="Color the terminal output",
)
parser.add_argument(
"--clear-cache", action="store_true", help="Clear cache before running"
diff --git a/tests/data/expected_output.py b/tests/data/expected_output.py
index f5e30ef..5b0423b 100644
--- a/tests/data/expected_output.py
+++ b/tests/data/expected_output.py
@@ -1,3 +1,5 @@
+from __future__ import annotations
+
EXPECTED_HTML = """
diff --git a/tests/data/sample_response.py b/tests/data/sample_response.py
index 40e39b7..a6e36c0 100644
--- a/tests/data/sample_response.py
+++ b/tests/data/sample_response.py
@@ -1,3 +1,5 @@
+from __future__ import annotations
+
SAMPLE_RESPONSE_ALL_JSON = """
[
"alpine",
diff --git a/tests/test_cache.py b/tests/test_cache.py
index 4ccdc46..03e5013 100644
--- a/tests/test_cache.py
+++ b/tests/test_cache.py
@@ -1,6 +1,8 @@
"""
Unit tests for norwegianblue cache
"""
+from __future__ import annotations
+
import tempfile
from pathlib import Path
diff --git a/tests/test_norwegianblue.py b/tests/test_norwegianblue.py
index ca6b650..6387124 100644
--- a/tests/test_norwegianblue.py
+++ b/tests/test_norwegianblue.py
@@ -1,6 +1,8 @@
"""
Unit tests for norwegianblue
"""
+from __future__ import annotations
+
import json
import os
from pathlib import Path
diff --git a/tox.ini b/tox.ini
index c643600..42e802f 100644
--- a/tox.ini
+++ b/tox.ini
@@ -3,7 +3,7 @@ envlist =
cog
lint
pins
- py{311, 310, 39, 38, 37}
+ py{py3, 311, 310, 39, 38, 37}
isolated_build = true
[testenv]
@@ -30,7 +30,7 @@ skip_install = true
deps =
pre-commit
commands =
- pre-commit run --all-files
+ pre-commit run --all-files --show-diff-on-failure
[testenv:pins]
extras =