Skip to content

Commit

Permalink
chore: Init repository
Browse files Browse the repository at this point in the history
  • Loading branch information
neet committed Mar 19, 2024
1 parent 4799587 commit c9e2eef
Show file tree
Hide file tree
Showing 15 changed files with 433 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs

# Top-most EditorConfig file
root = true

# Python files
[*.py]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{yaml,json}]
indent_style = space
indent_size = 2
5 changes: 5 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use flake
dotenv

# https://python-poetry.org/docs/basic-usage/#activating-the-virtual-environment
source $(poetry env info --path)/bin/activate
50 changes: 50 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: "CI"

on:
push:
branches:
- main
pull_request:
branches:
- "*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

# https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#caching-packages
- name: Install poetry
run: pipx install poetry
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: poetry

- name: Install dependencies
run: poetry install

# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#using-ruff-to-lint-code
- name: Ruff
run: poetry run ruff --output-format=github .
continue-on-error: true

- name: Mypy
run: poetry run mypy .

# https://github.com/codecov/example-python
- name: Pytest
run: poetry run pytest --cov=src --cov-report=xml

# - name: Compile Vertex Pipeline
# run: python -m src.dazai_bert_pipeline.compile

- name: Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"files.exclude": {
".venv": true,
".mypy_cache": true,
".ruff_cache": true,
".pytest_cache": true,
"**/*.egg-info": true,
"**/__pycache__": true
},
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": {
"source.fixAll": "always"
}
}
}
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# ainu-llm
# ainu-nlp

[![CI](https://github.com/aynumosir/ainu-nlp/actions/workflows/ci.yaml/badge.svg)](https://github.com/aynumosir/ainu-nlp/actions/workflows/ci.yaml)
[![codecov](https://codecov.io/gh/aynumosir/ainu-nlp/graph/badge.svg?token=K8CFQ0UBPN)](https://codecov.io/gh/aynumosir/ainu-nlp)
27 changes: 27 additions & 0 deletions flake.lock

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

20 changes: 20 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
description = "A very basic flake";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};

outputs = { self, nixpkgs }: let
pkgs = nixpkgs.legacyPackages.aarch64-darwin;
in
{
devShell.aarch64-darwin = pkgs.mkShell {
buildInputs = with pkgs; [
python311
poetry
# google-cloud-sdk
];
};
};
}
250 changes: 250 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[tool.poetry]
name = "ainu-nlp"
version = "0.1.0"
description = ""
authors = ["Ryo Igarashi <[email protected]>"]
license = "MIT"
readme = "README.md"
package-mode = false

[tool.poetry.dependencies]
python = "^3.11"


[tool.poetry.group.dev.dependencies]
pytest = "^8.1.1"
pytest-cov = "^4.1.0"
ruff = "^0.3.3"
mypy = "^1.9.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.mypy]
ignore_missing_imports = true
exclude = ["dazai_bert_pipeline"]

[tool.ruff.lint]
select = ["E4", "E7", "E9", "F", "I", "ANN"]
ignore = ["ANN101", "ANN102"]
Empty file.
2 changes: 2 additions & 0 deletions src/ainu_nlp_pipeline/add.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def add(x: int, y: int) -> int:
return x + y
5 changes: 5 additions & 0 deletions src/ainu_nlp_pipeline/add_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .add import add


def test_add() -> None:
assert add(1, 2) == 3
Empty file.
2 changes: 2 additions & 0 deletions src/ainu_nlp_trainer/add.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def add(x: int, y: int) -> int:
return x + y
5 changes: 5 additions & 0 deletions src/ainu_nlp_trainer/add_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .add import add


def test_add() -> None:
assert add(1, 2) == 3

0 comments on commit c9e2eef

Please sign in to comment.