diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 145db80..aebce43 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -1,4 +1,4 @@ -name: Lint +name: pre-commit on: pull_request: branches: @@ -7,15 +7,11 @@ on: branches: - main jobs: - lint: - runs-on: ubuntu-latest - steps: - - - name: Set up Git repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - - - name: Pre-Commit Checks - uses: pre-commit/action@v3.0.1 + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.2 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5c28967..0a92b58 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ repos: rev: 22.3.0 hooks: - id: black - language_version: python3.9 + language_version: python3.10 - repo: https://github.com/pycqa/flake8 rev: 6.1.0 diff --git a/liah/pyproject.toml b/liah/pyproject.toml new file mode 100644 index 0000000..5e29d38 --- /dev/null +++ b/liah/pyproject.toml @@ -0,0 +1,101 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "liah" +dynamic = ["version"] +description = "needle in a haystack" +readme = "README.md" +requires-python = ">=3.10" +license = "MIT" +authors = [ + {name = "James Melvin Priyarajan", email = "melvinebenezer@gmail.com"}, +] +classifiers = [ + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Topic :: Software Development :: Libraries :: Python Modules", +] +dependencies = [ + "xsdata==24.1", + "typing_extensions>=4.6.3,<5.0", +] + +[project.urls] +Documentation = "https://github.com/melvinebenezer/Liah-Lie_in_a_haystack/#README.md" +Issues = "https://github.com/melvinebenezer/Liah-Lie_in_a_haystack/issues" +Source = "https://github.com/melvinebenezer/Liah-Lie_in_a_haystack" + +[project.optional-dependencies] +dev = [ + "black==24.1.1", + "mypy==1.8.0", + "ruff==0.1.14", + "pre-commit==3.6.0", +] + +[tool.hatch.version] +path = "src/aiovantage/__about__.py" + +[[tool.hatch.envs.all.matrix]] +python = ["3.10", "3.11", "3.12"] + +[tool.hatch.envs.dev] +features = ["dev"] + +[tool.hatch.envs.lint] +features = ["dev"] + +[tool.hatch.envs.lint.scripts] +style = [ + "ruff {args:.}", + "black --check --diff {args:.}", +] +fmt = [ + "black {args:.}", + "ruff --fix {args:.}", +] +typing = "mypy {args:.}" + +[tool.mypy] +strict = true + +[tool.black] +target-version = ["py310"] +skip-string-normalization = true + +[tool.ruff] +target-version = "py310" +select = [ + "F", # pyflakes + "E", # pycodestyle errors + "W", # pycodestyle warnings + "I", # isort + "N", # pep8-naming + "UP", # pyupgrade + "D", # pydocstyle + "C", # flake8-comprehensions + "B", # flake8-bugbear + "Q", # flake8-quotes + "C90", # mccabe +] +ignore = [ + "E501", # line too long, handled by black +] + +[tool.ruff.per-file-ignores] +"src/liah/config_client/models/**/*.py" = [ + "D106" # Missing docstring in public nested class +] + +[tool.ruff.isort] +known-first-party = ["liah"] + +[tool.ruff.mccabe] +max-complexity = 15 + +[tool.ruff.pydocstyle] +convention = "google" diff --git a/liah/utils.py b/liah/utils.py index 64e65c6..bbdc98a 100644 --- a/liah/utils.py +++ b/liah/utils.py @@ -34,4 +34,6 @@ retrieve_prompt = lie_needles[0]["question"] if __name__ == "__main__": + print(eval_prompt) print(expert_prompt) + print(system_prompt)