Skip to content

Commit

Permalink
Add pre-commit to the CI (#967)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fokko committed Oct 3, 2022
1 parent 585d6ff commit e9b8ab4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Expand Up @@ -48,11 +48,11 @@ jobs:
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
Expand All @@ -61,7 +61,7 @@ jobs:
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/pre-commit.yml
@@ -0,0 +1,13 @@
name: "Pre-commit"

jobs:
pre-commit:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Install
run: pip3 install pre-commit
- name: Run
run: pre-commit run --all-files
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Expand Up @@ -6,20 +6,20 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: 'https://github.com/asottile/pyupgrade'
rev: v2.34.0
rev: v2.37.3
hooks:
- id: pyupgrade
args:
- '--py37-plus'
- repo: 'https://github.com/psf/black'
rev: 22.6.0
rev: 22.8.0
hooks:
- id: black
- repo: 'https://github.com/PyCQA/isort'
rev: 5.10.1
hooks:
- id: isort
- repo: 'https://github.com/pycqa/flake8'
rev: 4.0.1
rev: 5.0.4
hooks:
- id: flake8
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Expand Up @@ -66,7 +66,7 @@ botocore calls eventually called.

The best way I've seen to upgrade botocore support is by performing the following:

1. Download sources of the release of botocore you're trying to upgrade to, and the version of botocore that aiobotocore is currently locked to (see setup.py) and do a folder based file comparison of the botocore folders (tools like DiffMerge are nice).
1. Download sources of the release of botocore you're trying to upgrade to, and the version of botocore that aiobotocore is currently locked to (see setup.py) and do a folder based file comparison of the botocore folders (tools like DiffMerge are nice).
2. Manually apply the relevant changes to their aiobotocore equivalent(s). Note that sometimes new functions are added which will need to be overridden (like `__enter__` -> `__aenter__`)
3. Update the "extras" in setup.py to the versions which match the botocore version you are targeting.
4. Now do a directory diff between aiobotocore and your target version botocore directory to ensure the changes were propagated.
Expand Down

0 comments on commit e9b8ab4

Please sign in to comment.