classifyawsetsjsonbyregion 0.1.0__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. {classifyawsetsjsonbyregion-0.1.0/classifyawsetsjsonbyregion.egg-info → classifyawsetsjsonbyregion-0.2.0}/PKG-INFO +15 -6
  2. {classifyawsetsjsonbyregion-0.1.0 → classifyawsetsjsonbyregion-0.2.0}/README.md +4 -3
  3. classifyawsetsjsonbyregion-0.2.0/classifyawsetsjsonbyregion/__init__.py +3 -0
  4. {classifyawsetsjsonbyregion-0.1.0 → classifyawsetsjsonbyregion-0.2.0}/classifyawsetsjsonbyregion/analyzer.py +5 -1
  5. {classifyawsetsjsonbyregion-0.1.0 → classifyawsetsjsonbyregion-0.2.0}/classifyawsetsjsonbyregion/awsets.py +3 -0
  6. classifyawsetsjsonbyregion-0.2.0/classifyawsetsjsonbyregion/awsregion/__init__.py +3 -0
  7. {classifyawsetsjsonbyregion-0.1.0 → classifyawsetsjsonbyregion-0.2.0}/classifyawsetsjsonbyregion/awsregion/classifier.py +3 -0
  8. {classifyawsetsjsonbyregion-0.1.0 → classifyawsetsjsonbyregion-0.2.0}/classifyawsetsjsonbyregion/cli.py +3 -0
  9. classifyawsetsjsonbyregion-0.2.0/classifyawsetsjsonbyregion/config.py +24 -0
  10. {classifyawsetsjsonbyregion-0.1.0 → classifyawsetsjsonbyregion-0.2.0}/classifyawsetsjsonbyregion/csv.py +13 -5
  11. {classifyawsetsjsonbyregion-0.1.0 → classifyawsetsjsonbyregion-0.2.0}/classifyawsetsjsonbyregion/filepath.py +3 -0
  12. {classifyawsetsjsonbyregion-0.1.0 → classifyawsetsjsonbyregion-0.2.0/classifyawsetsjsonbyregion.egg-info}/PKG-INFO +15 -6
  13. {classifyawsetsjsonbyregion-0.1.0 → classifyawsetsjsonbyregion-0.2.0}/classifyawsetsjsonbyregion.egg-info/SOURCES.txt +0 -2
  14. {classifyawsetsjsonbyregion-0.1.0 → classifyawsetsjsonbyregion-0.2.0}/docs/CONTRIBUTING.md +15 -10
  15. classifyawsetsjsonbyregion-0.2.0/pyproject.toml +249 -0
  16. classifyawsetsjsonbyregion-0.2.0/setup.cfg +4 -0
  17. {classifyawsetsjsonbyregion-0.1.0 → classifyawsetsjsonbyregion-0.2.0}/tests/test_cli.py +5 -5
  18. classifyawsetsjsonbyregion-0.1.0/classifyawsetsjsonbyregion/__init__.py +0 -5
  19. classifyawsetsjsonbyregion-0.1.0/classifyawsetsjsonbyregion/awsregion/__init__.py +0 -1
  20. classifyawsetsjsonbyregion-0.1.0/classifyawsetsjsonbyregion/config.py +0 -11
  21. classifyawsetsjsonbyregion-0.1.0/pyproject.toml +0 -221
  22. classifyawsetsjsonbyregion-0.1.0/setup.cfg +0 -21
  23. classifyawsetsjsonbyregion-0.1.0/setup.py +0 -5
  24. {classifyawsetsjsonbyregion-0.1.0 → classifyawsetsjsonbyregion-0.2.0}/LICENSE +0 -0
  25. {classifyawsetsjsonbyregion-0.1.0 → classifyawsetsjsonbyregion-0.2.0}/MANIFEST.in +0 -0
  26. {classifyawsetsjsonbyregion-0.1.0 → classifyawsetsjsonbyregion-0.2.0}/classifyawsetsjsonbyregion/py.typed +0 -0
  27. {classifyawsetsjsonbyregion-0.1.0 → classifyawsetsjsonbyregion-0.2.0}/classifyawsetsjsonbyregion.egg-info/dependency_links.txt +0 -0
  28. {classifyawsetsjsonbyregion-0.1.0 → classifyawsetsjsonbyregion-0.2.0}/classifyawsetsjsonbyregion.egg-info/entry_points.txt +0 -0
  29. {classifyawsetsjsonbyregion-0.1.0 → classifyawsetsjsonbyregion-0.2.0}/classifyawsetsjsonbyregion.egg-info/not-zip-safe +0 -0
  30. {classifyawsetsjsonbyregion-0.1.0 → classifyawsetsjsonbyregion-0.2.0}/classifyawsetsjsonbyregion.egg-info/requires.txt +0 -0
  31. {classifyawsetsjsonbyregion-0.1.0 → classifyawsetsjsonbyregion-0.2.0}/classifyawsetsjsonbyregion.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: classifyawsetsjsonbyregion
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: Classifies AWSets JSON by region.
5
5
  Author-email: Yukihiko Shinoda <yuk.hik.future@gmail.com>
6
6
  Maintainer-email: Yukihiko Shinoda <yuk.hik.future@gmail.com>
@@ -42,6 +42,10 @@ Classifier: Programming Language :: Python :: 3.8
42
42
  Classifier: Programming Language :: Python :: 3.9
43
43
  Classifier: Programming Language :: Python :: 3.10
44
44
  Classifier: Programming Language :: Python :: 3.11
45
+ Classifier: Programming Language :: Python :: 3.12
46
+ Classifier: Programming Language :: Python :: 3.13
47
+ Classifier: Programming Language :: Python :: 3.14
48
+ Classifier: Programming Language :: Python :: 3.15
45
49
  Classifier: Topic :: Scientific/Engineering
46
50
  Classifier: Topic :: Scientific/Engineering :: Information Analysis
47
51
  Classifier: Topic :: Security
@@ -50,15 +54,20 @@ Classifier: Topic :: Text Processing :: Filters
50
54
  Classifier: Typing :: Typed
51
55
  Requires-Python: >=3.7
52
56
  Description-Content-Type: text/markdown
53
- Provides-Extra: test
54
57
  License-File: LICENSE
58
+ Requires-Dist: click>=7.0
59
+ Requires-Dist: typing-extensions; python_version <= "3.7"
60
+ Requires-Dist: yamldataclassconfig
61
+ Provides-Extra: test
62
+ Dynamic: license-file
55
63
 
56
64
  # Classify AWSets JSON by Region
57
65
 
58
66
  [![Test](https://github.com/yukihiko-shinoda/classify-awsets-json-by-region/workflows/Test/badge.svg)](https://github.com/yukihiko-shinoda/classify-awsets-json-by-region/actions?query=workflow%3ATest)
59
- [![Test Coverage](https://api.codeclimate.com/v1/badges/d3006b43fedc1ffd5db7/test_coverage)](https://codeclimate.com/github/yukihiko-shinoda/classify-awsets-json-by-region/test_coverage)
60
- [![Maintainability](https://api.codeclimate.com/v1/badges/d3006b43fedc1ffd5db7/maintainability)](https://codeclimate.com/github/yukihiko-shinoda/classify-awsets-json-by-region/maintainability)
61
- [![Code Climate technical debt](https://img.shields.io/codeclimate/tech-debt/yukihiko-shinoda/classify-awsets-json-by-region)](https://codeclimate.com/github/yukihiko-shinoda/classify-awsets-json-by-region)
67
+ [![CodeQL](https://github.com/yukihiko-shinoda/classify-awsets-json-by-region/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/yukihiko-shinoda/classify-awsets-json-by-region/actions/workflows/github-code-scanning/codeql)
68
+ [![Code Coverage](https://qlty.sh/gh/yukihiko-shinoda/projects/classify-awsets-json-by-region/coverage.svg)](https://qlty.sh/gh/yukihiko-shinoda/projects/classify-awsets-json-by-region)
69
+ [![Maintainability](https://qlty.sh/gh/yukihiko-shinoda/projects/classify-awsets-json-by-region/maintainability.svg)](https://qlty.sh/gh/yukihiko-shinoda/projects/classify-awsets-json-by-region)
70
+ [![Dependabot](https://flat.badgen.net/github/dependabot/yukihiko-shinoda/classify-awsets-json-by-region?icon=dependabot)](https://github.com/yukihiko-shinoda/classify-awsets-json-by-region/security/dependabot)
62
71
  [![Python versions](https://img.shields.io/pypi/pyversions/classifyawsetsjsonbyregion.svg)](https://pypi.org/project/classifyawsetsjsonbyregion)
63
72
  [![Twitter URL](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Fyukihiko-shinoda%2Fclassify-awsets-json-by-region)](http://twitter.com/share?text=Classify%20AWSets%20JSON%20by%20Region&url=https://pypi.org/project/classifyawsetsjsonbyregion/&hashtags=python)
64
73
 
@@ -1,9 +1,10 @@
1
1
  # Classify AWSets JSON by Region
2
2
 
3
3
  [![Test](https://github.com/yukihiko-shinoda/classify-awsets-json-by-region/workflows/Test/badge.svg)](https://github.com/yukihiko-shinoda/classify-awsets-json-by-region/actions?query=workflow%3ATest)
4
- [![Test Coverage](https://api.codeclimate.com/v1/badges/d3006b43fedc1ffd5db7/test_coverage)](https://codeclimate.com/github/yukihiko-shinoda/classify-awsets-json-by-region/test_coverage)
5
- [![Maintainability](https://api.codeclimate.com/v1/badges/d3006b43fedc1ffd5db7/maintainability)](https://codeclimate.com/github/yukihiko-shinoda/classify-awsets-json-by-region/maintainability)
6
- [![Code Climate technical debt](https://img.shields.io/codeclimate/tech-debt/yukihiko-shinoda/classify-awsets-json-by-region)](https://codeclimate.com/github/yukihiko-shinoda/classify-awsets-json-by-region)
4
+ [![CodeQL](https://github.com/yukihiko-shinoda/classify-awsets-json-by-region/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/yukihiko-shinoda/classify-awsets-json-by-region/actions/workflows/github-code-scanning/codeql)
5
+ [![Code Coverage](https://qlty.sh/gh/yukihiko-shinoda/projects/classify-awsets-json-by-region/coverage.svg)](https://qlty.sh/gh/yukihiko-shinoda/projects/classify-awsets-json-by-region)
6
+ [![Maintainability](https://qlty.sh/gh/yukihiko-shinoda/projects/classify-awsets-json-by-region/maintainability.svg)](https://qlty.sh/gh/yukihiko-shinoda/projects/classify-awsets-json-by-region)
7
+ [![Dependabot](https://flat.badgen.net/github/dependabot/yukihiko-shinoda/classify-awsets-json-by-region?icon=dependabot)](https://github.com/yukihiko-shinoda/classify-awsets-json-by-region/security/dependabot)
7
8
  [![Python versions](https://img.shields.io/pypi/pyversions/classifyawsetsjsonbyregion.svg)](https://pypi.org/project/classifyawsetsjsonbyregion)
8
9
  [![Twitter URL](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Fyukihiko-shinoda%2Fclassify-awsets-json-by-region)](http://twitter.com/share?text=Classify%20AWSets%20JSON%20by%20Region&url=https://pypi.org/project/classifyawsetsjsonbyregion/&hashtags=python)
9
10
 
@@ -0,0 +1,3 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2023 Yukihiko Shinoda
2
+ # SPDX-License-Identifier: MIT
3
+ """Top-level package for Classify AWSets JSON by Region."""
@@ -1,10 +1,14 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2023 Yukihiko Shinoda
2
+ # SPDX-License-Identifier: MIT
1
3
  """Analyze AWSets JSON."""
4
+
2
5
  from __future__ import annotations
3
6
 
4
7
  import json
5
8
  from typing import Any
6
9
 
7
- from classifyawsetsjsonbyregion.awsets import Awset, AwsetFilter
10
+ from classifyawsetsjsonbyregion.awsets import Awset
11
+ from classifyawsetsjsonbyregion.awsets import AwsetFilter
8
12
  from classifyawsetsjsonbyregion.awsregion.classifier import Classifier
9
13
  from classifyawsetsjsonbyregion.config import Config
10
14
  from classifyawsetsjsonbyregion.csv import OutputCsv
@@ -1,4 +1,7 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2023 Yukihiko Shinoda
2
+ # SPDX-License-Identifier: MIT
1
3
  """Model of AWSets."""
4
+
2
5
  from __future__ import annotations
3
6
 
4
7
  import re
@@ -0,0 +1,3 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2023 Yukihiko Shinoda
2
+ # SPDX-License-Identifier: MIT
3
+ """AWS region."""
@@ -1,4 +1,7 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2023 Yukihiko Shinoda
2
+ # SPDX-License-Identifier: MIT
1
3
  """Classifies AWSets into each regions."""
4
+
2
5
  from __future__ import annotations
3
6
 
4
7
  from typing import TYPE_CHECKING
@@ -1,4 +1,7 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2023 Yukihiko Shinoda
2
+ # SPDX-License-Identifier: MIT
1
3
  """Console script for classifyawsetsjsonbyregion."""
4
+
2
5
  import sys
3
6
 
4
7
  import click
@@ -0,0 +1,24 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2023 Yukihiko Shinoda
2
+ # SPDX-License-Identifier: MIT
3
+ """Configurations."""
4
+
5
+ from dataclasses import dataclass
6
+ from typing import Dict
7
+ from typing import List
8
+
9
+ from yamldataclassconfig import YamlDataClassConfig
10
+
11
+
12
+ @dataclass
13
+ class Config(YamlDataClassConfig):
14
+ """Configuration loaded from config.yml."""
15
+
16
+ # Reason: `from __future__ import annotations` turns field.type into a string,
17
+ # and dataclasses_json builds the marshmallow schema from field.type,
18
+ # so these fields fall back to an untyped field ("Unknown type" warning) and lose type validation:
19
+ # - PEP 563 - Postponed Evaluation of Annotations
20
+ # https://peps.python.org/pep-0563/
21
+ # - dataclasses-json/dataclasses_json/mm.py at v0.6.7 · lidatong/dataclasses-json
22
+ # https://github.com/lidatong/dataclasses-json/blob/v0.6.7/dataclasses_json/mm.py#L306
23
+ region_exclude: List[str] = None # type: ignore[assignment] # noqa: FA100
24
+ ignore_pattern: Dict[str, List[str]] = None # type: ignore[assignment] # noqa: FA100
@@ -1,16 +1,24 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2023 Yukihiko Shinoda
2
+ # SPDX-License-Identifier: MIT
1
3
  """Json to CSV."""
2
- from contextlib import contextmanager, suppress
4
+
3
5
  import csv
6
+ from contextlib import contextmanager
7
+ from contextlib import suppress
4
8
  from pathlib import Path
5
9
  from typing import TYPE_CHECKING
6
10
 
7
11
  if TYPE_CHECKING:
12
+ import sys
8
13
  from collections.abc import Generator
9
14
 
10
- import _csv
15
+ # typeshed names the type of csv.writer() objects Writer since Python 3.10, and _writer before that.
16
+ if sys.version_info >= (3, 10):
17
+ from _csv import Writer as StandardCsvWriter
18
+ else:
19
+ from _csv import _writer
11
20
 
12
- # Reason: For type hinting.
13
- standard_csv_writer = _csv._writer # noqa: SLF001 pylint: disable=protected-access,no-member
21
+ StandardCsvWriter = _writer
14
22
 
15
23
 
16
24
  class OutputCsv:
@@ -22,6 +30,6 @@ class OutputCsv:
22
30
  self.path_csv.unlink()
23
31
 
24
32
  @contextmanager
25
- def writer(self) -> "Generator[standard_csv_writer, None, None]":
33
+ def writer(self) -> "Generator[StandardCsvWriter, None, None]":
26
34
  with self.path_csv.open("w", newline="") as csv_file_pointer:
27
35
  yield csv.writer(csv_file_pointer, delimiter=" ", quotechar="|", quoting=csv.QUOTE_MINIMAL)
@@ -1,4 +1,7 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2023 Yukihiko Shinoda
2
+ # SPDX-License-Identifier: MIT
1
3
  """JSON per each regions."""
4
+
2
5
  from pathlib import Path
3
6
 
4
7
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: classifyawsetsjsonbyregion
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: Classifies AWSets JSON by region.
5
5
  Author-email: Yukihiko Shinoda <yuk.hik.future@gmail.com>
6
6
  Maintainer-email: Yukihiko Shinoda <yuk.hik.future@gmail.com>
@@ -42,6 +42,10 @@ Classifier: Programming Language :: Python :: 3.8
42
42
  Classifier: Programming Language :: Python :: 3.9
43
43
  Classifier: Programming Language :: Python :: 3.10
44
44
  Classifier: Programming Language :: Python :: 3.11
45
+ Classifier: Programming Language :: Python :: 3.12
46
+ Classifier: Programming Language :: Python :: 3.13
47
+ Classifier: Programming Language :: Python :: 3.14
48
+ Classifier: Programming Language :: Python :: 3.15
45
49
  Classifier: Topic :: Scientific/Engineering
46
50
  Classifier: Topic :: Scientific/Engineering :: Information Analysis
47
51
  Classifier: Topic :: Security
@@ -50,15 +54,20 @@ Classifier: Topic :: Text Processing :: Filters
50
54
  Classifier: Typing :: Typed
51
55
  Requires-Python: >=3.7
52
56
  Description-Content-Type: text/markdown
53
- Provides-Extra: test
54
57
  License-File: LICENSE
58
+ Requires-Dist: click>=7.0
59
+ Requires-Dist: typing-extensions; python_version <= "3.7"
60
+ Requires-Dist: yamldataclassconfig
61
+ Provides-Extra: test
62
+ Dynamic: license-file
55
63
 
56
64
  # Classify AWSets JSON by Region
57
65
 
58
66
  [![Test](https://github.com/yukihiko-shinoda/classify-awsets-json-by-region/workflows/Test/badge.svg)](https://github.com/yukihiko-shinoda/classify-awsets-json-by-region/actions?query=workflow%3ATest)
59
- [![Test Coverage](https://api.codeclimate.com/v1/badges/d3006b43fedc1ffd5db7/test_coverage)](https://codeclimate.com/github/yukihiko-shinoda/classify-awsets-json-by-region/test_coverage)
60
- [![Maintainability](https://api.codeclimate.com/v1/badges/d3006b43fedc1ffd5db7/maintainability)](https://codeclimate.com/github/yukihiko-shinoda/classify-awsets-json-by-region/maintainability)
61
- [![Code Climate technical debt](https://img.shields.io/codeclimate/tech-debt/yukihiko-shinoda/classify-awsets-json-by-region)](https://codeclimate.com/github/yukihiko-shinoda/classify-awsets-json-by-region)
67
+ [![CodeQL](https://github.com/yukihiko-shinoda/classify-awsets-json-by-region/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/yukihiko-shinoda/classify-awsets-json-by-region/actions/workflows/github-code-scanning/codeql)
68
+ [![Code Coverage](https://qlty.sh/gh/yukihiko-shinoda/projects/classify-awsets-json-by-region/coverage.svg)](https://qlty.sh/gh/yukihiko-shinoda/projects/classify-awsets-json-by-region)
69
+ [![Maintainability](https://qlty.sh/gh/yukihiko-shinoda/projects/classify-awsets-json-by-region/maintainability.svg)](https://qlty.sh/gh/yukihiko-shinoda/projects/classify-awsets-json-by-region)
70
+ [![Dependabot](https://flat.badgen.net/github/dependabot/yukihiko-shinoda/classify-awsets-json-by-region?icon=dependabot)](https://github.com/yukihiko-shinoda/classify-awsets-json-by-region/security/dependabot)
62
71
  [![Python versions](https://img.shields.io/pypi/pyversions/classifyawsetsjsonbyregion.svg)](https://pypi.org/project/classifyawsetsjsonbyregion)
63
72
  [![Twitter URL](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Fyukihiko-shinoda%2Fclassify-awsets-json-by-region)](http://twitter.com/share?text=Classify%20AWSets%20JSON%20by%20Region&url=https://pypi.org/project/classifyawsetsjsonbyregion/&hashtags=python)
64
73
 
@@ -2,8 +2,6 @@ LICENSE
2
2
  MANIFEST.in
3
3
  README.md
4
4
  pyproject.toml
5
- setup.cfg
6
- setup.py
7
5
  classifyawsetsjsonbyregion/__init__.py
8
6
  classifyawsetsjsonbyregion/analyzer.py
9
7
  classifyawsetsjsonbyregion/awsets.py
@@ -57,10 +57,10 @@ Ready to contribute? Here's how to set up `Classify AWSets JSON by Region` for l
57
57
  git clone git@github.com:your_name_here/classify-awsets-json-by-region.git
58
58
  ```
59
59
 
60
- 3. Install your local copy into a virtualenv. Assuming you have Pipenv installed, this is how you set up your fork for local development:
60
+ 3. Install your local copy into a virtualenv. Assuming you have [uv](https://docs.astral.sh/uv/) installed, this is how you set up your fork for local development:
61
61
 
62
62
  ```console
63
- pipenv install --dev
63
+ uv sync
64
64
  ```
65
65
 
66
66
  4. Create a branch for local development:
@@ -72,14 +72,19 @@ Ready to contribute? Here's how to set up `Classify AWSets JSON by Region` for l
72
72
  Now you can make your changes locally.
73
73
 
74
74
  5. When you're done making changes,
75
- check that your changes pass isort, flake8, black,
76
- and the tests, including testing oldest Python version:
75
+ check that your changes pass all of the following checks,
76
+ which [Invoke Lint](https://github.com/yukihiko-shinoda/invoke-lint) runs:
77
+
78
+ - Formatting
79
+ - Linting
80
+ - Tests, including on the oldest supported Python version
77
81
 
78
82
  ```console
79
- pipenv run inv style --check
80
- pipenv run pytest
81
- pipenv install --python 3.7
82
- pipenv run pytest
83
+ uv run inv style --check
84
+ uv run inv lint
85
+ uv run inv lint.deep
86
+ uv run inv test
87
+ uv run --python 3.7 inv test
83
88
  ```
84
89
 
85
90
  6. Commit your changes and push your branch to GitHub:
@@ -106,7 +111,7 @@ Before you submit a pull request, check that it meets these guidelines:
106
111
  To run a subset of tests:
107
112
 
108
113
  ```console
109
- pipenv run pytest tests.test_classifyawsetsjsonbyregion
114
+ uv run pytest tests/test_cli.py
110
115
 
111
116
  ```
112
117
 
@@ -117,7 +122,7 @@ Make sure all your changes are committed.
117
122
  Then run:
118
123
 
119
124
  ```console
120
- bump2version patch # possible: major / minor / patch
125
+ uv run bump-my-version bump patch # possible: major / minor / patch
121
126
  git push
122
127
  git push --tags
123
128
  ```
@@ -0,0 +1,249 @@
1
+ [build-system]
2
+ requires = ["setuptools"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "classifyawsetsjsonbyregion"
7
+ version = "0.2.0"
8
+ description = "Classifies AWSets JSON by region."
9
+ readme = "README.md"
10
+ requires-python = ">=3.7"
11
+ license = {file = "LICENSE"}
12
+ keywords = [
13
+ "classifyawsetsjsonbyregion",
14
+ "classify-awsets-json-by-region",
15
+ "awsets",
16
+ "aws",
17
+ ]
18
+ authors = [
19
+ {name = "Yukihiko Shinoda", email = "yuk.hik.future@gmail.com"},
20
+ ]
21
+ maintainers = [
22
+ {name = "Yukihiko Shinoda", email = "yuk.hik.future@gmail.com"},
23
+ ]
24
+ classifiers = [
25
+ "Development Status :: 4 - Beta",
26
+ "Intended Audience :: Developers",
27
+ "Intended Audience :: Information Technology",
28
+ "License :: OSI Approved :: MIT License",
29
+ "Natural Language :: English",
30
+ "Operating System :: OS Independent",
31
+ "Programming Language :: Python",
32
+ "Programming Language :: Python :: 3",
33
+ "Programming Language :: Python :: 3.7",
34
+ "Programming Language :: Python :: 3.8",
35
+ "Programming Language :: Python :: 3.9",
36
+ "Programming Language :: Python :: 3.10",
37
+ "Programming Language :: Python :: 3.11",
38
+ "Programming Language :: Python :: 3.12",
39
+ "Programming Language :: Python :: 3.13",
40
+ "Programming Language :: Python :: 3.14",
41
+ "Programming Language :: Python :: 3.15",
42
+ "Topic :: Scientific/Engineering",
43
+ "Topic :: Scientific/Engineering :: Information Analysis",
44
+ "Topic :: Security",
45
+ "Topic :: Text Processing",
46
+ "Topic :: Text Processing :: Filters",
47
+ "Typing :: Typed",
48
+ ]
49
+ dependencies = [
50
+ "click>=7.0",
51
+ 'typing-extensions; python_version <= "3.7"',
52
+ "yamldataclassconfig",
53
+ ]
54
+
55
+ [project.optional-dependencies]
56
+ test = []
57
+
58
+ [dependency-groups]
59
+ dev = [
60
+ "bump-my-version",
61
+ "invokelint[basic]>=0.23.0",
62
+ "pytest-resource-path",
63
+ "pyvelocity; python_version >= '3.9'",
64
+ ]
65
+
66
+ [project.urls]
67
+ homepage = "https://github.com/yukihiko-shinoda/classify-awsets-json-by-region"
68
+ # documentation = "https://readthedocs.org"
69
+ repository = "https://github.com/yukihiko-shinoda/classify-awsets-json-by-region"
70
+ # changelog = "https://github.com/me/spam/blob/master/CHANGELOG.md"
71
+
72
+ [project.entry-points.console_scripts]
73
+ classify-awsets-json-by-region = "classifyawsetsjsonbyregion.cli:main"
74
+
75
+ [tool.setuptools]
76
+ zip-safe = false
77
+
78
+ [tool.setuptools.packages.find]
79
+ where = ["."]
80
+ include = ["classifyawsetsjsonbyregion", "classifyawsetsjsonbyregion.*"]
81
+
82
+ [tool.bandit.assert_used]
83
+ skips = ["tests/*"]
84
+
85
+ [tool.bumpversion]
86
+ current_version = "0.2.0"
87
+ commit = true
88
+ tag = true
89
+
90
+ [[tool.bumpversion.files]]
91
+ filename = "pyproject.toml"
92
+ search = 'version = "{current_version}"'
93
+ replace = 'version = "{new_version}"'
94
+
95
+ [tool.coverage.report]
96
+ exclude_also = [
97
+ # Assume `if TYPE_CHECKING: ... else: ...` block is covered · Issue #831 · nedbat/coveragepy
98
+ # https://github.com/nedbat/coveragepy/issues/831#issuecomment-517778185
99
+ "if TYPE_CHECKING:",
100
+ # Pylint will detect instead:
101
+ # - abstract-method / W0223 - Pylint 2.17.0-dev0 documentation
102
+ # https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/abstract-method.html
103
+ "raise NotImplementedError",
104
+ ]
105
+
106
+ [tool.coverage.run]
107
+ source = ["classifyawsetsjsonbyregion"]
108
+
109
+ [tool.docformatter]
110
+ recursive = true
111
+ # For compatibility with Black
112
+ # - How to Configure docformatter — docformatter 1.7.5 documentation
113
+ # https://docformatter.readthedocs.io/en/stable/configuration.html#a-note-on-options-to-control-styles
114
+ black = true
115
+ wrap-descriptions = 119
116
+ wrap-summaries = 119
117
+
118
+ [tool.flake8]
119
+ # flake8-bugbear B950 reports lines exceeding max_line_length by more than 10%.
120
+ # Black recommends 88 without bugbear and 80 with it,
121
+ # so following that ratio, a line length of 119 corresponds to 109:
122
+ # - PyCQA/flake8-bugbear: A plugin for Flake8 finding likely bugs and design problems in your program.
123
+ # https://github.com/PyCQA/flake8-bugbear?tab=readme-ov-file#opinionated-warnings
124
+ # - Using Black with other tools - Black 25.1.0 documentation
125
+ # https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#bugbear
126
+ max_line_length = 109
127
+ # B9 (opinionated) warnings of flake8-bugbear are disabled by default,
128
+ # so they must be enabled explicitly (B950 checks line length instead of E501):
129
+ # - PyCQA/flake8-bugbear: A plugin for Flake8 finding likely bugs and design problems in your program.
130
+ # https://github.com/pycqa/flake8-bugbear#how-to-enable-opinionated-warnings
131
+ extend_select = [
132
+ "B9",
133
+ ]
134
+ # To allow Claude Code to run Flake8 in its sandbox,
135
+ # which denies creating the Unix socket required by multiprocessing for parallel jobs:
136
+ # File ".../multiprocessing/forkserver.py", line 187, in ensure_running
137
+ # with socket.socket(socket.AF_UNIX) as listener:
138
+ # File ".../socket.py", line 237, in __init__
139
+ # _socket.socket.__init__(self, family, type, proto, fileno)
140
+ # PermissionError: [Errno 1] Operation not permitted
141
+ jobs = 1
142
+ extend_ignore = [
143
+ # For compatibility with Black:
144
+ # - Using Black with other tools - Black 25.1.0 documentation
145
+ # https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#bugbear
146
+ "E203",
147
+ "E501",
148
+ "E701",
149
+ # 2025-05-24 Now openstack/hacking wasn't introduced into Ruff and sorting imports is mainly considered with isort.
150
+ "H306",
151
+ # Cohesion may be in experimental.
152
+ "H601",
153
+ ]
154
+ statistics = true
155
+ show_source = true
156
+ exclude = [
157
+ ".venv",
158
+ ]
159
+
160
+ [tool.mypy]
161
+ strict = true
162
+
163
+ [tool.pylint]
164
+ disable = [
165
+ # We check line length by flake8-bugbear B950.
166
+ "line-too-long",
167
+ ]
168
+
169
+ [tool.pylint.basic]
170
+ docstring-min-length = "7"
171
+
172
+ [tool.pylint.format]
173
+ max-line-length = 119
174
+
175
+ [tool.pylint.options]
176
+ # Since this rule against single responsibility principle.
177
+ # - python - Why does Pylint want two public methods per class? - Stack Overflow
178
+ # https://stackoverflow.com/a/40258006/12721873
179
+ min-public-methods = "1"
180
+
181
+ [tool.pytest.ini_options]
182
+ markers = [
183
+ "slow: marks tests as slow (deselect with '-m \"not slow\"')",
184
+ ]
185
+
186
+ [tool.ruff]
187
+ line-length = 119
188
+
189
+ [tool.ruff.lint]
190
+ # Avoiding flagging (and removing) any codes starting with `H` from any
191
+ # `# noqa` directives, despite Ruff's lack of support for `hacking`.
192
+ # - Long import statement violates flake8: H301: one import per line · Issue #1220 · psf/black
193
+ # https://github.com/psf/black/issues/1220#issuecomment-570970250
194
+ # - Bug #2123810 “H301 with long line” : Bugs : hacking
195
+ # https://bugs.launchpad.net/hacking/+bug/2123810
196
+ external = [
197
+ # Flake8-Bugbear rules that are preview-only in Ruff aren't run with Ruff's default settings,
198
+ # so list them to prevent Ruff from judging `# noqa` markers needed for Flake8 as unused.
199
+ "B043", # Do not call `delattr` with a constant attribute value
200
+ "B901", # Using `yield` and `return {value}` in a generator function can lead to confusing behavior
201
+ "B903", # Class could be dataclass or namedtuple
202
+ "B909", # Mutation to loop iterable `{name}` during iteration
203
+ # Not implemented in Ruff; only Flake8-Bugbear detects it.
204
+ "B950", # Line too long
205
+ "DUO", # dlint
206
+ "H", # Openstack/hacking
207
+ ]
208
+ select = [
209
+ "ALL",
210
+ # Compatible with PEP 257 and checkable by Ruff, so there's no need to think about it further:
211
+ # - Python の関数 docstring 1 行目は命令形にするべき? (ruff / pydocstyle D401)
212
+ # https://zenn.dev/y_shinoda/articles/pydocstyle-d401
213
+ "D401", # First line should be in imperative mood
214
+ ]
215
+ ignore = [
216
+ # lint.pydocstyle
217
+ # Reason: Docstring may be missed since docstring-min-length is set.
218
+ "D101", # Missing docstring in public class
219
+ "D102", # Missing docstring in public method
220
+ "D103", # Missing docstring in public function
221
+ "D105", # Missing docstring in magic method
222
+ "D106", # Missing docstring in public nested class
223
+ "D107", # Missing docstring in __init__
224
+ # Reason: First line may ends with function signature for expression.
225
+ "D402", # First line should not be the function’s “signature”
226
+ # Reason: First line may ends with ":" for expression.
227
+ "D415", # First line should end with a period, question mark, or exclamation point
228
+ # Reason: `Line too long` is checked by flake8-bugbear.
229
+ "E501", # Line too long ({width} > {limit})
230
+ ]
231
+ unfixable = [
232
+ # When fix `return a and b != ""` as `return a and b`, mypy will report warning:
233
+ # error: Incompatible return value type (got "Union[Literal[False], str]", expected "bool") [return-value]
234
+ "PLC1901",
235
+ ]
236
+
237
+ [tool.ruff.lint.isort]
238
+ force-single-line = true
239
+
240
+ [tool.ruff.lint.mccabe]
241
+ # The default value: 10 is too loose,
242
+ # 5 is as same as the default value of Radon for A rank that we use without any problems for a decade.
243
+ max-complexity = 5
244
+
245
+ [tool.ruff.lint.per-file-ignores]
246
+ "tests/*" = ["S101"]
247
+
248
+ [tool.ruff.lint.pydocstyle]
249
+ convention = "google"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -1,4 +1,7 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2023 Yukihiko Shinoda
2
+ # SPDX-License-Identifier: MIT
1
3
  """Tests for `classifyawsetsjsonbyregion` package."""
4
+
2
5
  from __future__ import annotations
3
6
 
4
7
  from pathlib import Path
@@ -39,17 +42,14 @@ def test_command_line_interface(configured_cli_runner: CliRunner) -> None:
39
42
  }
40
43
  result = configured_cli_runner.invoke(cli.main)
41
44
  # Reason: Check that output is empty.
42
- assert result.output == "" # noqa: PLC1901
45
+ assert result.output == ""
43
46
  assert result.exit_code == 0
44
47
  list_output_file = list((Path.cwd() / "output").iterdir())
45
48
  assert_output_files(expected, list_output_file)
46
49
 
47
50
 
48
51
  def assert_output_files(expected: dict[str, str], list_output_file: list[Path]) -> None:
49
- assert len(list_output_file) == len(expected)
50
- for output_file, (expected_file_name, expected_json) in zip(sorted(list_output_file), expected.items()):
51
- assert output_file.name == expected_file_name
52
- assert output_file.read_text() == expected_json
52
+ assert {output_file.name: output_file.read_text() for output_file in list_output_file} == expected
53
53
 
54
54
 
55
55
  def test_help() -> None:
@@ -1,5 +0,0 @@
1
- """Top-level package for Classify AWSets JSON by Region."""
2
-
3
- __author__ = """Yukihiko Shinoda"""
4
- __email__ = "yuk.hik.future@gmail.com"
5
- __version__ = "0.1.0"
@@ -1,11 +0,0 @@
1
- """Configurations."""
2
- from dataclasses import dataclass
3
- from typing import Dict, List
4
-
5
- from yamldataclassconfig import YamlDataClassConfig
6
-
7
-
8
- @dataclass
9
- class Config(YamlDataClassConfig):
10
- region_exclude: List[str] = None # type: ignore[assignment]
11
- ignore_pattern: Dict[str, List[str]] = None # type: ignore[assignment]
@@ -1,221 +0,0 @@
1
- [build-system]
2
- requires = ["setuptools"]
3
- build-backend = "setuptools.build_meta"
4
-
5
- [project]
6
- name = "classifyawsetsjsonbyregion"
7
- version = "0.1.0"
8
- description = "Classifies AWSets JSON by region."
9
- readme = "README.md"
10
- requires-python = ">=3.7"
11
- license = {file = "LICENSE"}
12
- keywords = [
13
- "classifyawsetsjsonbyregion",
14
- "classify-awsets-json-by-region",
15
- "awsets",
16
- "aws",
17
- ]
18
- authors = [
19
- {name = "Yukihiko Shinoda", email = "yuk.hik.future@gmail.com"},
20
- ]
21
- maintainers = [
22
- {name = "Yukihiko Shinoda", email = "yuk.hik.future@gmail.com"},
23
- ]
24
- classifiers = [
25
- "Development Status :: 4 - Beta",
26
- "Intended Audience :: Developers",
27
- "Intended Audience :: Information Technology",
28
- "License :: OSI Approved :: MIT License",
29
- "Natural Language :: English",
30
- "Operating System :: OS Independent",
31
- "Programming Language :: Python",
32
- "Programming Language :: Python :: 3",
33
- "Programming Language :: Python :: 3.7",
34
- "Programming Language :: Python :: 3.8",
35
- "Programming Language :: Python :: 3.9",
36
- "Programming Language :: Python :: 3.10",
37
- "Programming Language :: Python :: 3.11",
38
- "Topic :: Scientific/Engineering",
39
- "Topic :: Scientific/Engineering :: Information Analysis",
40
- "Topic :: Security",
41
- "Topic :: Text Processing",
42
- "Topic :: Text Processing :: Filters",
43
- "Typing :: Typed",
44
- ]
45
- dependencies = [
46
- "click>=7.0",
47
- 'typing-extensions; python_version <= "3.7"',
48
- "yamldataclassconfig",
49
- ]
50
-
51
- [project.optional-dependencies]
52
- test = []
53
-
54
- [project.urls]
55
- homepage = "https://github.com/yukihiko-shinoda/classify-awsets-json-by-region"
56
- # documentation = "https://readthedocs.org"
57
- repository = "https://github.com/yukihiko-shinoda/classify-awsets-json-by-region"
58
- # changelog = "https://github.com/me/spam/blob/master/CHANGELOG.md"
59
-
60
- [project.entry-points.console_scripts]
61
- classify-awsets-json-by-region = "classifyawsetsjsonbyregion.cli:main"
62
-
63
- [tool.setuptools]
64
- zip-safe = false
65
-
66
- [tool.setuptools.packages.find]
67
- where = ["."]
68
- include = ["classifyawsetsjsonbyregion", "classifyawsetsjsonbyregion.*"]
69
-
70
- [tool.bandit.assert_used]
71
- skips = [
72
- "*_test.py",
73
- "*/test_*.py",
74
- ]
75
-
76
- # @see https://black.readthedocs.io/en/stable/pyproject_toml.html#configuration-format
77
- [tool.black]
78
- line-length = 119
79
-
80
- [tool.coverage.report]
81
- exclude_lines = [
82
- "pragma: no cover",
83
- # Assume `if TYPE_CHECKING: ... else: ...` block is covered · Issue #831 · nedbat/coveragepy
84
- # https://github.com/nedbat/coveragepy/issues/831#issuecomment-517778185
85
- "if TYPE_CHECKING:",
86
- # Pylint will detect instead:
87
- # - abstract-method / W0223 - Pylint 2.17.0-dev0 documentation
88
- # https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/abstract-method.html
89
- "raise NotImplementedError",
90
- ]
91
-
92
- [tool.docformatter]
93
- recursive = true
94
- wrap-descriptions = 119
95
- wrap-summaries = 119
96
-
97
- [tool.isort]
98
- # see:
99
- # - Using Black with other tools - Black 23.1.0 documentation
100
- # https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#custom-configuration
101
- multi_line_output = 3
102
- include_trailing_comma = true
103
- force_grid_wrap = 0
104
- use_parentheses = true
105
- ensure_newline_before_comments = true
106
- line_length = 119
107
- # For compatibility with PyLint and Hacking, Google also supports,
108
- # Black doesn't have any opinions
109
- # see:
110
- # - https://pycqa.github.io/isort/docs/configuration/profiles.html
111
- # - https://qiita.com/kaityo256/items/5b0b55d105ef2366cb0c
112
- # - https://www.xn--ebkc7kqd.com/entry/hacking-isort
113
- force_sort_within_sections = true
114
- lexicographical = true
115
- # Google supports, Black doesn't have any opinions
116
- # see: https://pycqa.github.io/isort/docs/configuration/profiles.html
117
- order_by_type = false
118
-
119
- [tool.mypy]
120
- strict = true
121
-
122
- [tool.pydocstyle]
123
- # To add Google convention
124
- # see:
125
- # - Error Codes — pydocstyle 6.1.1 documentation
126
- # http://www.pydocstyle.org/en/stable/error_codes.html#default-conventions
127
- add_select = ["D212", "D214", "D410", "D411", "D415", "D416", "D417"]
128
- # D400: First line may ends with ":" for expression.
129
- # D402: First line may ends with function signature for expression.
130
- # D415: First line may ends with ":" for expression.
131
- # D101: Docstring may be missed in public class since docstring-min-length is set.
132
- # D102: Docstring may be missed in public method since docstring-min-length is set.
133
- # D103: Docstring may be missed in public function since docstring-min-length is set.
134
- # D105: Docstring may be missed in magic method since docstring-min-length is set.
135
- # D105: Docstring may be missed in public nested class since docstring-min-length is set.
136
- # D107: Docstring may be missed in __init__ method since docstring-min-length is set.
137
- add_ignore = ["D400", "D401", "D402", "D415", "D101", "D102", "D103", "D105", "D106", "D107"]
138
-
139
- [tool.pylint.basic]
140
- docstring-min-length = "7"
141
-
142
- [tool.pylint.format]
143
- max-line-length = 119
144
-
145
- [tool.pylint.options]
146
- # Since this rule against single responsibility principle.
147
- # @see https://stackoverflow.com/questions/28722314/why-does-pylint-want-2-public-methods-per-class/40258006#40258006
148
- min-public-methods = "1"
149
-
150
- [tool.pytest.ini_options]
151
- markers = [
152
- "slow: marks tests as slow (deselect with '-m \"not slow\"')",
153
- ]
154
-
155
- [tool.ruff]
156
- line-length = 119
157
- select = [
158
- "F", # Pyflakes
159
- "E", # pycodestyle
160
- "W", # pycodestyle
161
- "C90", # mccabe
162
- # "I", # isort
163
- "N", # pep8-naming
164
- # "D", # pydocstyle
165
- "UP", # pyupgrade
166
- "YTT", # flake8-2020
167
- "ANN", # flake8-annotations
168
- "S", # flake8-bandit
169
- "BLE", # flake8-blind-except
170
- "FBT", # flake8-boolean-trap
171
- "B", # flake8-bugbear
172
- "A", # flake8-builtins
173
- "COM", # flake8-commas
174
- "C4", # flake8-comprehensions
175
- "DTZ", # flake8-datetimez
176
- "T10", # flake8-debugger
177
- "DJ", # flake8-django
178
- "EM", # flake8-errmsg
179
- "EXE", # flake8-executable
180
- "ISC", # flake8-implicit-str-concat
181
- "ICN", # flake8-import-conventions
182
- "G", # flake8-logging-format
183
- "INP", # flake8-no-pep420
184
- "PIE", # flake8-pie
185
- "T20", # flake8-print
186
- "PYI", # flake8-pyi
187
- "PT", # flake8-pytest-style
188
- "Q", # flake8-quotes
189
- "RSE", # flake8-raise
190
- "RET", # flake8-return
191
- "SLF", # flake8-self
192
- "SIM", # flake8-simplify
193
- "TID", # flake8-tidy-imports
194
- "TCH", # flake8-type-checking
195
- "ARG", # flake8-unused-arguments
196
- "PTH", # flake8-use-pathlib
197
- "ERA", # eradicate
198
- "PD", # pandas-vet
199
- "PGH", # pygrep-hooks
200
- "PL", # Pylint
201
- "TRY", # tryceratops
202
- "NPY", # NumPy-specific rules
203
- "RUF", # Ruff-specific rules
204
- ]
205
- ignore = [
206
- "UP032", # [*] Use f-string instead of `format` call
207
- "ANN101", # Missing type annotation for `self` in method
208
- "ANN401", # Dynamically typed expressions (typing.Any) are disallowed, These warnings are disabled by default
209
- ]
210
- fixable = [
211
- "COM812", # Trailing comma missing
212
- "PT001", # Use `@pytest.fixture()` over `@pytest.fixture`
213
- "PT006", # Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`
214
- "SIM108", # Use ternary operator `extra_context = {} if extra_context is None else request.param` instead of `if`-`else`-block
215
- "UP015", # Unnecessary open mode parameters
216
- "UP037", # Remove quotes from type annotation
217
- ]
218
- target-version = "py37"
219
-
220
- [tool.ruff.per-file-ignores]
221
- "tests/*" = ["S101"]
@@ -1,21 +0,0 @@
1
- [flake8]
2
- max-line-length = 119
3
- extend-ignore =
4
- E203,
5
- H301,
6
- H601
7
- statistics = True
8
- show_source = True
9
- exclude =
10
- .venv,
11
- docs
12
-
13
- [radon]
14
- cc_min = B
15
- show_complexity = True
16
- show_mi = True
17
-
18
- [egg_info]
19
- tag_build =
20
- tag_date = 0
21
-
@@ -1,5 +0,0 @@
1
- """The setup script."""
2
-
3
- from setuptools import setup # type: ignore[import]
4
-
5
- setup()