Skip to content

Commit

Permalink
Merge pull request #168 from ku-nlp/develop
Browse files Browse the repository at this point in the history
v1.6.0
  • Loading branch information
nobu-g authored Nov 8, 2023
2 parents 6c9d749 + 7515e2a commit 0b7499e
Show file tree
Hide file tree
Showing 60 changed files with 1,152 additions and 1,075 deletions.
6 changes: 5 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ updates:
schedule:
interval: "monthly"
timezone: "Asia/Tokyo"
groups:
dependencies:
patterns:
- "*"
target-branch: "develop"
ignore:
- dependency-name: "*"
Expand All @@ -20,6 +24,6 @@ updates:
# default location of `.github/workflows`
directory: "/"
schedule:
interval: "weekly"
interval: "monthly"
timezone: "Asia/Tokyo"
target-branch: "develop"
5 changes: 2 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@ jobs:
name: Build the project
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 18
max-parallel: 15
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true # TODO: Remove this line when Python 3.12 is released
- name: Install Poetry
run: |
pipx install poetry
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.7
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: "3.7"
python-version: "3.8"
- name: Run linters
run: |
pipx install pre-commit
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
release:
types: [published]

permissions:
contents: read

jobs:
build-publish:
runs-on: ubuntu-latest
Expand All @@ -25,5 +28,6 @@ jobs:
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
21 changes: 13 additions & 8 deletions .github/workflows/test-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
jobs:
test-example:
name: Run tests for examples
container: kunlp/jumanpp-knp:ubuntu
runs-on: ubuntu-20.04 # to meet the ubuntu version in the kunlp/jumanpp-knp:ubuntu container
container: kunlp/jumanpp-knp:ubuntu22.04
runs-on: ubuntu-22.04
strategy:
max-parallel: 5
fail-fast: false
Expand All @@ -20,24 +20,29 @@ jobs:
uses: actions/checkout@v4
- name: Install required apt packages
run: |
apt update -y
DEBIAN_FRONTEND=noninteractive apt install -y curl build-essential libsqlite3-dev libffi-dev
export DEBIAN_FRONTEND=noninteractive
apt-get update -yq
apt-get install -yq curl build-essential libsqlite3-dev libffi-dev
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true # TODO: Remove this line when Python 3.12 is released
- name: Install Poetry
run: |
python3 -m pip install --user pipx
python3 -m pipx ensurepath
python3 -m pipx install poetry
- name: Add path for Python packages
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: poetry install --no-interaction --without dev,docs --extras=cli
run: |
poetry install --no-interaction --without dev,docs --extras=cli
- name: Install KWJA
run: pipx install kwja
# KWJA does not support Python 3.12
if: ${{ matrix.python-version != 3.12 }}
run: |
pipx install kwja
- name: Run tests for all files under examples/apply_*.py
shell: bash
run: |
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ on: [push, pull_request, workflow_dispatch]
jobs:
test:
name: Run tests with pytest
container: kunlp/jumanpp-knp:ubuntu
runs-on: ubuntu-20.04 # to meet the ubuntu version in the kunlp/jumanpp-knp:ubuntu container
container: kunlp/jumanpp-knp:ubuntu22.04
runs-on: ubuntu-22.04
strategy:
max-parallel: 6
max-parallel: 5
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install required apt packages
run: |
apt update -y
DEBIAN_FRONTEND=noninteractive apt install -y curl build-essential libsqlite3-dev libffi-dev
export DEBIAN_FRONTEND=noninteractive
apt-get update -yq
apt-get install -yq curl build-essential libsqlite3-dev libffi-dev libssl-dev
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true # TODO: Remove this line when Python 3.12 is released
- name: Install Poetry
run: |
python3 -m pip install --user pipx
Expand All @@ -36,8 +36,8 @@ jobs:
run: |
poetry install --no-interaction --without dev,docs --extras=cli
- name: Install KWJA
# KWJA does not support Python 3.7 or 3.12
if: ${{ matrix.python-version != 3.7 && matrix.python-version != 3.12 }}
# KWJA does not support Python 3.12
if: ${{ matrix.python-version != 3.12 }}
run: |
pipx install kwja
kwja --model-size tiny --text "テスト"
Expand Down
37 changes: 15 additions & 22 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,50 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-docstring-first
- id: check-yaml
- id: check-toml
- id: check-added-large-files
exclude: "assets/logo.*"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.0
rev: 23.11.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies: [Flake8-pyproject]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/MarcoGorelli/absolufy-imports
rev: v0.3.1
hooks:
- id: absolufy-imports
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v1.6.1
hooks:
- id: mypy
additional_dependencies:
- types-PyYAML
- typing-extensions
- typer
- types-PyYAML
- rich
- uvicorn
- fastapi
- markdown-it-py==2.2.0 # markdown-it-py 3.0.0 requires Python 3.8+
- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
hooks:
- id: pyupgrade
args:
- --py37-plus
- jinja2
- pygments
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.2
rev: v3.0.3
hooks:
- id: prettier
- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.32.1
rev: v1.34.0
hooks:
- id: djlint-jinja
- id: djlint-reformat-jinja
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ authors:
given-names: Hirokazu
- family-names: Ueda
given-names: Nobuhiro
version: 1.2.0
version: 1.6.0
repository-code: "https://github.com/ku-nlp/rhoknp"
date-released: 2023-02-07
date-released: 2023-11-08
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ with open("result.jumanpp", "rt") as f:

## Requirements

- Python 3.7+
- Python 3.8+
- (Optional) [Juman++](https://github.com/ku-nlp/jumanpp) v2.0.0-rc3+
- (Optional) [KNP](https://github.com/ku-nlp/knp) 5.0+
- (Optional) [KWJA](https://github.com/ku-nlp/kwja) 1.0.0+
Expand Down
Binary file added assets/logo-original.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo-wide.xcf
Binary file not shown.
Binary file added assets/logo.xcf
Binary file not shown.
11 changes: 11 additions & 0 deletions docs/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ Before using the CLI, you need to install _rhoknp_ with the following command:
pip install rhoknp[cli]
```

## cat

The `cat` command prints KNP files with syntax highlighting.

```{eval-rst}
.. prompt::
:prompts: $
rhoknp cat <PATH-TO-KNP-FILE> [--dark]
```

## serve

The `serve` command starts a web server to provide a playground for the given language analyzer.
Expand Down
2 changes: 1 addition & 1 deletion docs/installation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Requirements

- [Python](https://python.org/)
- Supported versions: 3.7+
- Supported versions: 3.8+
- [Juman++](https://github.com/ku-nlp/jumanpp) (Optional)
- Supported versions: v2.0.0-rc3+
- [KNP](https://github.com/ku-nlp/knp) (Optional)
Expand Down
Loading

0 comments on commit 0b7499e

Please sign in to comment.