diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..917713e --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,41 @@ +name: continous_integration + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - name: checkout repository + uses: actions/checkout@v3 + + - name: formatting + uses: psf/black@stable + + - name: ruff + uses: chartboost/ruff-action@v1 + + + # - name: install python packages + # run: | + # python -m pip install --upgrade pip + # pip install -r requirements.txt + + # - name: execute py script # run main.py + # env: + # SOME_SECRET: ${{ secrets.SOME_SECRET }} + # run: python main.py + + # - name: commit files + # run: | + # git config --local user.email "action@github.com" + # git config --local user.name "GitHub Action" + # git add -A + # git diff-index --quiet HEAD || (git commit -a -m "updated logs" --allow-empty) + + # - name: push changes + # uses: ad-m/github-push-action@v0.6.0 + # with: + # github_token: ${{ secrets.GITHUB_TOKEN }} + # branch: main diff --git a/pyproject.toml b/pyproject.toml index b8b95d6..dc1e9f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,19 @@ +[tool.black] +line-length = 88 +target-version = ['py37', 'py38'] +include = '\.pyi?$' +extend-exclude = ''' +/( + # The following are specific to Black, you probably don't want those. + tests/data + | profiling +)/ +''' +# We use preview style for formatting Black itself. If you +# want stable formatting across releases, you should keep +# this off. +preview = true + [tool.poetry] name = "llm-pdf-qa-sample-app" version = "0.1.0" @@ -19,6 +35,53 @@ chromadb = "^0.4.9" ruff = "^0.0.287" black = "^23.7.0" +[tool.ruff] +# Enable the pycodestyle (`E`) and Pyflakes (`F`) rules by default. +# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or +# McCabe complexity (`C901`) by default. +select = ["E", "F"] +ignore = [] + +# Allow autofix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] + +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".mypy_cache", + ".nox", + ".pants.d", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "venv", +] +per-file-ignores = {} + +# Same as Black. +line-length = 88 + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" +target-version = "py310" + +[tool.ruff.isort] +case-sensitive = true + [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api"