-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add mypy.ini * add `numpy.typing.mypy_plugin` to mypy.ini * update type_check.yaml (#358) * Update mypy.ini Co-authored-by: Yoshiaki Bando <[email protected]> * fix type_check.yaml * Improve configs for readability * modify test structures * format .pre-commit-config.yaml * rename test files * Fix workflows * fix workflows * update tests * Update workflows --------- Co-authored-by: Yoshiaki Bando <[email protected]>
- Loading branch information
Showing
13 changed files
with
124 additions
and
203 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: CI | ||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
ci: | ||
name: CI | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: ['ubuntu-22.04'] | ||
python-version: ['3.10'] | ||
test_target: ['apps', 'hpo'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
cache-dependency-path: pyproject.toml | ||
- name: Install dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install .[dev,github-actions] | ||
- name: Run pytest | ||
run: pytest -v --cov=aiaccel --cov-branch --cov-report=term-missing tests/${{ strategy.target }} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Lint | ||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: ['ubuntu-22.04'] | ||
python-version: ['3.10'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
cache-dependency-path: pyproject.toml | ||
- name: Install dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install .[dev,github-actions] | ||
- name: Perform ruff | ||
run: | | ||
ruff check | ||
ruff format --check | ||
- name: Perform mypy | ||
run: | | ||
mypy --config-file mypy.ini . |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,22 @@ | ||
repos: | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.1.9 | ||
hooks: | ||
- id: ruff | ||
args: [ --fix ] | ||
- id: ruff-format | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.1.1 | ||
hooks: | ||
- id: mypy | ||
args: [ | ||
"--install-types", | ||
"--non-interactive", | ||
"--ignore-missing-imports", | ||
"--warn-unused-configs", | ||
"--disallow-any-generics", | ||
"--disallow-untyped-calls", | ||
"--disallow-untyped-defs", | ||
"--disallow-incomplete-defs", | ||
"--check-untyped-defs", | ||
"--disallow-untyped-decorators", | ||
"--warn-redundant-casts", | ||
"--warn-unused-ignores", | ||
"--no-implicit-reexport", | ||
"--strict-equality", | ||
"--strict-concatenate", | ||
] | ||
exclude: ^(?:examples|tests)/.* | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.3.5 | ||
hooks: | ||
- id: ruff | ||
args: [--fix] | ||
- id: ruff-format | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.9.0 | ||
hooks: | ||
- id: mypy | ||
language: system | ||
args: [--config-file, mypy.ini] | ||
- repo: local | ||
hooks: | ||
- id: pytest | ||
name: pytest | ||
entry: pytest -s -v tests/ | ||
stages: [push] | ||
language: system | ||
pass_filenames: false | ||
always_run: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[mypy] | ||
python_version = 3.10 | ||
cache_dir = .mypy_cache | ||
|
||
plugins = numpy.typing.mypy_plugin | ||
|
||
allow_redefinition = True | ||
warn_unused_configs = True | ||
warn_redundant_casts = True | ||
show_error_codes = True | ||
show_column_numbers = True | ||
check_untyped_defs = True | ||
follow_imports = skip | ||
local_partial_types = True | ||
enable_error_code = possibly-undefined | ||
warn_unused_ignores = False | ||
|
||
strict_optional = True | ||
warn_no_return = True | ||
disallow_any_unimported = True | ||
strict = True | ||
implicit_reexport = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ name = "aiaccel" | |
version = "2.0.0" | ||
description = "A library for accelerating research on AI Bridging Cloud Infrastructure (ABCI)." | ||
readme = "README.md" | ||
requires-python = ">=3.8.1,<3.12" | ||
requires-python = ">=3.10" | ||
license = {text = "MIT"} | ||
authors = [ | ||
{name = "AIST", email = "[email protected]"} | ||
|
@@ -27,51 +27,31 @@ documentation = "https://aiaccel.readthedocs.io" | |
repository = "https://github.com/aistairc/aiaccel" | ||
|
||
[project.optional-dependencies] | ||
test = [ | ||
"pytest", | ||
"pytest-cov", | ||
"pytest-subprocess", | ||
"undecorated", | ||
] | ||
github-actions = [ | ||
"pytest-github-actions-annotate-failures", | ||
] | ||
dev = [ | ||
"ruff", | ||
"mypy", | ||
"myst-parser", | ||
"pre-commit", | ||
"pytest", | ||
"pytest-cov", | ||
"pytest-subprocess", | ||
"ruff", | ||
"sphinx", | ||
"sphinxcontrib-jquery", | ||
"sphinx-intl", | ||
"sphinx-fontawesome", | ||
"sphinx-rtd-theme", | ||
"undecorated", | ||
] | ||
github-actions = [ | ||
"pytest-github-actions-annotate-failures", | ||
] | ||
|
||
[tool.ruff] | ||
line-length = 120 | ||
target-version = "py38" | ||
target-version = "py310" | ||
fix = true | ||
|
||
select = ["E", "F", "W", "UP", "B", "SIM", "I", "C"] | ||
|
||
[tool.ruff.per-file-ignores] | ||
"__init__.py" = ["F401"] | ||
|
||
[tool.mypy] | ||
python_version="3.8" | ||
install_types = true | ||
non_interactive = true | ||
ignore_missing_imports = true | ||
warn_unused_configs = true | ||
disallow_any_generics = true | ||
disallow_untyped_calls = true | ||
disallow_untyped_defs = true | ||
disallow_incomplete_defs = true | ||
check_untyped_defs = true | ||
disallow_untyped_decorators = true | ||
warn_redundant_casts = true | ||
warn_unused_ignores = true | ||
no_implicit_reexport = true | ||
strict_equality = true | ||
strict_concatenate = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from unittest import TestCase | ||
|
||
|
||
class TestHpo(TestCase): # TODO: implement your test here | ||
def test_hpo(self) -> None: | ||
assert True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from unittest import TestCase | ||
|
||
|
||
class TestNelderMeadSampler(TestCase): | ||
def test_nelder_mead(self) -> None: | ||
assert True # TODO: implement your test here |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.