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

py(deps): ruff 0.2.2 -> 0.3.0, et al. #368

Merged
merged 4 commits into from
Mar 2, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
python -V
poetry run python -V

- name: Lint with ruff
run: poetry run ruff .
- name: Lint with ruff check
run: poetry run ruff check .

- name: Format with ruff
- name: Format with ruff format
run: poetry run ruff format . --check

- name: Lint with mypy
Expand Down
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@

### Development

- ruff 0.2.2 -> 0.3.0 (#368)

Related formattings. Update CI to use `ruff check .` instead of `ruff .`.

See also: https://github.com/astral-sh/ruff/blob/v0.3.0/CHANGELOG.md
- Strengthen linting (#367)

- Add flake8-commas (COM)
Expand Down
1 change: 1 addition & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
See "pytest_plugins in non-top-level conftest files" in
https://docs.pytest.org/en/stable/deprecations.html
"""

import getpass
import pathlib
import typing as t
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sphinx configuration for cihai."""

# flake8: NOQA: E501
import inspect
import pathlib
Expand Down
1 change: 1 addition & 0 deletions examples/basic_usage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
"""Demonstrate basic case of Cihai's python API with UNIHAN."""

import typing as t

from cihai.core import Cihai
Expand Down
1 change: 1 addition & 0 deletions examples/basic_usage_manual.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
"""Demonstrate what basic_usage's unihan=True (default Cihai) does under the hood."""

import typing as t

from cihai.core import Cihai
Expand Down
1 change: 1 addition & 0 deletions examples/dataset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
"""Example of a custom dataset for cihai."""

import typing as t

from cihai.core import Cihai
Expand Down
1 change: 1 addition & 0 deletions examples/variant_ts_difficulties.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
"""Cihai example for difficult cases of traditional and simplified CJK variants."""

import typing as t

from cihai.core import Cihai
Expand Down
1 change: 1 addition & 0 deletions examples/variants.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
"""CJK Variant lookup example for Cihai."""

import typing as t

from cihai.core import Cihai
Expand Down
48 changes: 24 additions & 24 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/cihai/__about__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Cihai Metadata package."""

__title__ = "cihai"
__package_name__ = "cihai"
__version__ = "0.31.0"
Expand Down
1 change: 1 addition & 0 deletions src/cihai/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""Cihai package."""

from .__about__ import __version__ as __version__
1 change: 1 addition & 0 deletions src/cihai/_internal/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

.. _typeshed's: https://github.com/python/typeshed/blob/5df8de7/stdlib/_typeshed/__init__.pyi#L115-L118
"""

import typing as t
from os import PathLike

Expand Down
1 change: 1 addition & 0 deletions src/cihai/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Configuration options for Cihai app."""

import os
import pathlib
import typing as t
Expand Down
1 change: 1 addition & 0 deletions src/cihai/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Constants for cihai."""

import pathlib
import typing as t

Expand Down
10 changes: 4 additions & 6 deletions src/cihai/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
.. _MIT: https://bitbucket.org/lost_theory/ltchinese/src/9227813/LICENSE.txt
.. _conversion.py @9227813: https://bitbucket.org/lost_theory/ltchinese/raw/9227813/ltchinese/conversion.py
"""

import logging
import re
import typing as t
Expand Down Expand Up @@ -223,18 +224,15 @@ def euc_to_unicode(hexstr: bytes) -> str:


@t.overload
def python_to_ucn(uni_char: str, as_bytes: t.Literal[True]) -> bytes:
...
def python_to_ucn(uni_char: str, as_bytes: t.Literal[True]) -> bytes: ...


@t.overload
def python_to_ucn(uni_char: str, as_bytes: t.Literal[False]) -> str:
...
def python_to_ucn(uni_char: str, as_bytes: t.Literal[False]) -> str: ...


@t.overload
def python_to_ucn(uni_char: str, as_bytes: t.Literal[False] = False) -> str:
...
def python_to_ucn(uni_char: str, as_bytes: t.Literal[False] = False) -> str: ...


def python_to_ucn(uni_char: str, as_bytes: bool = False) -> t.Union[bytes, str]:
Expand Down
1 change: 1 addition & 0 deletions src/cihai/core.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Cihai core functionality."""

import inspect
import logging
import pathlib
Expand Down
1 change: 1 addition & 0 deletions src/cihai/data/decomp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
Last edited Dec 6, 2013 at 8:09 PM by gavingrover, version 3

"""

import logging

__copyright__ = "Copyright 2013-2018 Tony Narlock."
Expand Down
1 change: 1 addition & 0 deletions src/cihai/data/unihan/bootstrap.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Fetch + extract + transform + load UNIHAN dataset to Cihai."""

import dataclasses
import typing as t

Expand Down
1 change: 1 addition & 0 deletions src/cihai/data/unihan/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Constants for UNIHAN cihai dataset."""

import typing as t

#: Mapping of files from unihan-etl (UNIHAN database)
Expand Down
1 change: 1 addition & 0 deletions src/cihai/data/unihan/dataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module for UNIHAN Dataset for cihai."""

import typing as t

from sqlalchemy import or_
Expand Down
1 change: 1 addition & 0 deletions src/cihai/db.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Cihai core functionality."""

import typing as t

from sqlalchemy import MetaData, create_engine
Expand Down
1 change: 1 addition & 0 deletions src/cihai/exc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Exceptions raised from the Cihai library."""

import typing as t


Expand Down
1 change: 1 addition & 0 deletions src/cihai/extend.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
You can also create plugins which extend another. So if Unihan doesn't have a lookup
for variant glyphs, this can be added.
"""

import typing as t

from . import utils
Expand Down
1 change: 1 addition & 0 deletions src/cihai/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
~~~~~~~~~

"""

import logging
import time
import typing as t
Expand Down
1 change: 1 addition & 0 deletions src/cihai/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
>>> def my_fn(dir_config: "DirsConfigDict") -> None:
... pass
"""

import pathlib
import typing as t

Expand Down
1 change: 1 addition & 0 deletions src/cihai/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utility and helper methods for cihai."""

import sys
import typing as t

Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Pytest configuration for cihai tests."""

import pathlib
import typing as t
import zipfile
Expand Down
1 change: 1 addition & 0 deletions tests/data/unihan/test_bootstrap.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test bootstrapping of database."""

import pathlib
import typing as t

Expand Down
1 change: 1 addition & 0 deletions tests/test_cihai.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Test :class:`Cihai` object. Other tests will use an instance of ``Cihai``
using the ``test_config.yml``.
"""

import typing as t

import sqlalchemy
Expand Down
1 change: 1 addition & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test configuration for cihai."""

import os
import pathlib
import typing as t
Expand Down
1 change: 1 addition & 0 deletions tests/test_conversion.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test character conversion utilities."""

from cihai import conversion


Expand Down
1 change: 1 addition & 0 deletions tests/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
settings found in ``test_config.yml``.

"""

import random
import typing as t

Expand Down
1 change: 1 addition & 0 deletions tests/test_examples.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test examples/ found in cihai source directory."""

import importlib
import importlib.util
import pathlib
Expand Down
1 change: 1 addition & 0 deletions tests/test_exc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Exception tests for cihai."""

import pytest

from cihai import exc
Expand Down
1 change: 1 addition & 0 deletions tests/test_extend.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Extension tests for cihai."""

import typing as t

from cihai import extend
Expand Down
1 change: 1 addition & 0 deletions tests/test_middleware/simple/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Simple demonstration dataset for Cihai."""

import typing as t

if t.TYPE_CHECKING:
Expand Down
1 change: 1 addition & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test utilities for cihai."""

import typing as t

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Typings for cihai test module."""

import pathlib
import typing as t

Expand Down