diff --git a/.github/workflows/poetry-publish.yml b/.github/workflows/poetry-publish.yml new file mode 100644 index 00000000..e691f777 --- /dev/null +++ b/.github/workflows/poetry-publish.yml @@ -0,0 +1,14 @@ +name: Python package +on: + push: + tags: + - "v*.*.*" +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build and publish to pypi + uses: JRubics/poetry-publish@v1.17 + with: + pypi_token: ${{ secrets.PYPI_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..4bfbe2f5 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,12 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace +- repo: https://github.com/psf/black + rev: 22.10.0 + hooks: + - id: black + args: ['--line-length', '140'] diff --git a/README.md b/README.md index e7a1a41b..eed32351 100644 --- a/README.md +++ b/README.md @@ -358,6 +358,12 @@ git clone git@github.com:cpacker/MemGPT.git poetry shell poetry install ``` +We recommend installing pre-commit to ensure proper formatting during development: +``` +pip install pre-commit +pre-commit install +pre-commit run --all-files +``` ### Contributing We welcome pull requests! Please run the formatter before submitting a pull request: