8000 Update Github actions and pre-commit config files (#230) · arangodb/python-arango@4a66501 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4a66501

Browse files
authored
Update Github actions and pre-commit config files (#230)
1 parent 86411ef commit 4a66501

File tree

7 files changed

+77
-51
lines changed

7 files changed

+77
-51
lines changed

.github/workflows/build.yaml

Lines changed: 39 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,72 @@
11
name: Build
22
on:
3-
workflow_dispatch:
43
push:
54
branches: [ main, dev ]
65
pull_request:
76
branches: [ main, dev ]
7+
workflow_dispatch:
8+
inputs:
9+
debug_enabled:
10+
type: boolean
11+
description: Run the build with tmate debugging
12+
required: false
13+
default: false
14+
815
jobs:
916
build:
10-
name: Test
1117
runs-on: ubuntu-latest
18+
1219
strategy:
1320
matrix:
14-
python-version: [ 3.7, 3.8, 3.9 ]
21+
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
22+
1523
steps:
16-
- uses: actions/checkout@v2
24+
- name: Checkout repository
25+
uses: actions/checkout@v3
26+
27+
- name: Fetch complete history for all tags and branches
28+
run: git fetch --prune --unshallow
29+
1730
- name: Create ArangoDB Docker container
1831
run: >
1932
docker create --name arango -p 8529:8529 -e ARANGO_ROOT_PASSWORD=passwd
2033
arangodb/arangodb:3.7.7 --server.jwt-secret-keyfile=/tmp/keyfile
34+
2135
- name: Copy Foxx service zip into ArangoDB Docker container
2236
run: docker cp tests/static/service.zip arango:/tmp/service.zip
37+
2338
- name: Copy keyfile into ArangoDB Docker container
2439
run: docker cp tests/static/keyfile arango:/tmp/keyfile
40+
2541
- name: Start ArangoDB Docker container
2642
run: docker start arango
27-
- name: Fetch complete history for all tags and branches
28-
run: git fetch --prune --unshallow
43+
2944
- name: Set up Python ${{ matrix.python-version }}
30-
uses: actions/setup-python@v2
45+
uses: actions/setup-python@v4
3146
with:
3247
python-version: ${{ matrix.python-version }}
33-
- name: Setup pip
34-
run: python -m pip install --upgrade pip setuptools wheel
35-
- name: Install packages
48+
49+
- name: Start tmate session
50+
uses: mxschmitt/action-tmate@v3
51+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
52+
53+
- name: Run pre-commit checks
54+
uses: pre-commit/action@v3.0.0
55+
56+
- name: Install package
3657
run: pip install .[dev]
37-
- name: Run black
38-
run: black --check .
39-
- name: Run flake8
40-
run: flake8 .
41-
- name: Run isort
42-
run: isort --check --profile=black .
43-
- name: Run mypy
44-
run: mypy arango
45-
- name: Run pytest
58+
59+
- name: Run unit tests
4660
run: py.test --complete --cov=arango --cov-report=xml
61+
4762
- name: Run Sphinx doctest
4863
run: python -m sphinx -b doctest docs docs/_build
49-
- name: Run Sphinx HTML
64+
65+
- name: Generate Sphinx HTML
5066
run: python -m sphinx -b html -W docs docs/_build
51-
- name: Upload coverge to Codecov
52-
uses: codecov/codecov-action@v2
67+
68+
- name: Upload coverage to Codecov
69+
uses: codecov/codecov-action@v3
5370
if: matrix.python-version == '3.8'
5471
with:
5572
fail_ci_if_error: false

.pre-commit-config.yaml

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,41 @@
11
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v3.4.0
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.2.0
4+
# See https://pre-commit.com/hooks.html
45
hooks:
5-
- id: check-case-conflict
6-
- id: check-executables-have-shebangs
7-
- id: check-json
8-
- id: check-merge-conflict
9-
- id: check-symlinks
10-
- id: check-toml
11-
- id: check-yaml
12-
- id: end-of-file-fixer
13-
- id: mixed-line-ending
14-
- repo: https://github.com/psf/black
15-
rev: 22.3.0
6+
- id: check-case-conflict
7+
- id: check-executables-have-shebangs
8+
- id: check-merge-conflict
9+
- id: check-symlinks
10+
- id: check-toml
11+
- id: check-xml
12+
- id: check-yaml
13+
- id: debug-statements
14+
- id: detect-private-key
15+
- id: end-of-file-fixer
16+
- id: mixed-line-ending
17+
- id: pretty-format-json
18+
- id: trailing-whitespace
19+
20+
- repo: https://github.com/psf/black
21+
rev: 22.10.0
1622
hooks:
17-
- id: black
18-
- repo: https://github.com/timothycrosley/isort
23+
- id: black
24+
25+
- repo: https://github.com/PyCQA/isort
1926
rev: 5.10.1
2027
hooks:
21-
- id: isort
28+
- id: isort
2229
args: [ --profile, black ]
23-
- repo: https://github.com/pre-commit/mirrors-mypy
24-
rev: v0.931
30+
31+
- repo: https://github.com/PyCQA/flake8
32+
rev: 5.0.4
2533
hooks:
26-
- id: mypy
27-
files: ^arango/
28-
additional_dependencies: ['types-requests']
29-
- repo: https://gitlab.com/pycqa/flake8
30-
rev: 4.0.1
34+
- id: flake8
35+
36+
- repo: https://github.com/pre-commit/mirrors-mypy
37+
rev: v0.991
3138
hooks:
32-
- id: flake8
39+
- id: mypy
40+
files: ^arango/
41+
additional_dependencies: ['types-requests', "types-setuptools"]

docs/analyzer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ to `ArangoDB manual`_.
3232
# Delete an analyzer.
3333
db.delete_analyzer('test_analyzer', ignore_missing=True)
3434

35-
Refer to :ref:`StandardDatabase` class for API specification.
35+
Refer to :ref:`StandardDatabase` class for API specification.

docs/serializer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ initialization. They must be callables that take a single argument.
1919
deserializer=json.loads
2020
)
2121

22-
See :ref:`ArangoClient` for API specification.
22+
See :ref:`ArangoClient` for API specification.

docs/transaction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,4 @@ Javascript code in a transaction.
121121
assert result is True
122122
assert 'Lucy' in students
123123
assert 'Greg' in students
124-
assert 'Dona' not in students
124+
assert 'Dona' not in students

docs/user.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,4 @@ these operations can only be performed by admin users via ``_system`` database.
9393
collection='students'
9494
)
9595

96-
See :ref:`StandardDatabase` for API specification.
96+
See :ref:`StandardDatabase` for API specification.

tests/static/keyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
secret
1+
secret

0 commit comments

Comments
 (0)
0