Skip to content

configure pre-commit for project #346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [Ubuntu, MacOS, Windows]
python-version: ['3.6.7', '3.7', '3.8', '3.9', '3.10']
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
exclude:
- os: Windows
python-version: 3.6
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:

- name: Install dependencies
shell: bash
run: poetry install
run: poetry install -E compiler

- name: Generate code from proto files
shell: bash
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run Black
uses: lgeiger/black-action@master
with:
args: --check src/ tests/ benchmarks/

- name: Install rST dependcies
run: python -m pip install doc8
- name: Lint documentation for errors
run: python -m doc8 docs --max-line-length 88 --ignore-path-errors "docs/migrating.rst;D001"
# it has a table which is longer than 88 characters long
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.3
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ci:
autofix_prs: false

repos:
- repo: https://github.com/psf/black
rev: 22.1.0
hooks:
- id: black

- repo: https://github.com/PyCQA/doc8
rev: 0.10.1
hooks:
- id: doc8
additional_dependencies:
- toml
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,7 @@ datetime.datetime(2019, 1, 1, 11, 59, 58, 800000, tzinfo=datetime.timezone.utc)

```sh
# Get set up with the virtual env & dependencies
poetry run pip install --upgrade pip
poetry install
poetry install -E compiler

# Activate the poetry environment
poetry shell
Expand Down
Loading