Skip to content

Commit 811368e

Browse files
authored
Merge pull request #188 from onuralpszr/pre-commit
feat: ✨ bring pre-commit and tests from supervision
2 parents d419158 + 022ba67 commit 811368e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+6790
-236
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ jobs:
1212
python-version: [3.8]
1313
steps:
1414
- name: 🛎️ Checkout
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1616
with:
1717
ref: ${{ github.head_ref }}
1818
- name: 🐍 Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v5
2020
with:
2121
python-version: ${{ matrix.python-version }}
2222
- name: 🦾 Install dependencies
2323
run: |
2424
python -m pip install --upgrade pip
2525
pip install ".[dev]"
2626
- name: 🚀 Publish to PyPi
27-
env:
27+
env:
2828
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
2929
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
3030
PYPI_TEST_PASSWORD: ${{ secrets.PYPI_TEST_PASSWORD }}
3131
run: |
32-
make publish -e PYPI_USERNAME=$PYPI_USERNAME -e PYPI_PASSWORD=$PYPI_PASSWORD -e PYPI_TEST_PASSWORD=$PYPI_TEST_PASSWORD
32+
make publish -e PYPI_USERNAME=$PYPI_USERNAME -e PYPI_PASSWORD=$PYPI_PASSWORD -e PYPI_TEST_PASSWORD=$PYPI_TEST_PASSWORD

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: [3.8, 3.9]
14+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1515

1616
steps:
1717
- name: 🛎️ Checkout
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919
with:
2020
ref: ${{ github.event.pull_request.head.ref }}
2121
repository: ${{ github.event.pull_request.head.repo.full_name }}
2222
- name: 🐍 Set up Python ${{ matrix.python-version }}
23-
uses: actions/setup-python@v2
23+
uses: actions/setup-python@v5
2424
with:
2525
python-version: ${{ matrix.python-version }}
2626
- name: 🦾 Install dependencies
@@ -31,8 +31,8 @@ jobs:
3131
run: |
3232
make check_code_quality
3333
- name: 🧪 Test
34-
env:
34+
env:
3535
ROBOFLOW_API_KEY: ${{ secrets.ROBOFLOW_API_KEY }}
3636
PROJECT_NAME: ${{ secrets.PROJECT_NAME }}
3737
PROJECT_VERSION: ${{ secrets.PROJECT_VERSION }}
38-
run: "python -m unittest"
38+
run: "python -m unittest"

.pre-commit-config.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
ci:
2+
autofix_prs: true
3+
autoupdate_schedule: weekly
4+
autofix_commit_msg: "fix(pre_commit): 🎨 auto format pre-commit hooks"
5+
autoupdate_commit_msg: "chore(pre_commit): ⬆ pre_commit autoupdate"
6+
7+
repos:
8+
- repo: https://github.com/pre-commit/pre-commit-hooks
9+
rev: v4.4.0
10+
hooks:
11+
- id: end-of-file-fixer
12+
- id: trailing-whitespace
13+
- id: check-yaml
14+
- id: check-docstring-first
15+
- id: check-executables-have-shebangs
16+
- id: check-toml
17+
- id: check-case-conflict
18+
- id: check-added-large-files
19+
- id: detect-private-key
20+
- id: forbid-new-submodules
21+
- id: pretty-format-json
22+
args: ['--autofix', '--no-sort-keys', '--indent=4']
23+
- id: end-of-file-fixer
24+
- id: mixed-line-ending
25+
26+
27+
- repo: https://github.com/PyCQA/isort
28+
rev: 5.12.0
29+
hooks:
30+
- id: isort
31+
name: Sort imports
32+
33+
- repo: https://github.com/PyCQA/flake8
34+
rev: 6.1.0
35+
hooks:
36+
- id: flake8
37+
name: Flake8 Checks
38+
entry: flake8
39+
additional_dependencies: [Flake8-pyproject]
40+
41+
42+
- repo: https://github.com/PyCQA/bandit
43+
rev: '1.7.5'
44+
hooks:
45+
- id: bandit
46+
args: ["-c", "pyproject.toml"]
47+
additional_dependencies: ["bandit[toml]"]
48+
49+
- repo: https://github.com/astral-sh/ruff-pre-commit
50+
rev: v0.0.288
51+
hooks:
52+
- id: ruff
53+
args: [--fix, --exit-non-zero-on-fix]

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
"python.formatting.provider": "none",
1818
"python.testing.pytestEnabled": false,
1919
"editor.inlineSuggest.showToolbar": "onHover"
20-
}
20+
}

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ All notable changes to this project will be documented in this file.
44

55
## 1.1.5
66

7-
[stub]
7+
[stub]

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ abstract: >-
1717
keywords:
1818
- computer vision
1919
- image processing
20-
license: MIT
20+
license: MIT

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ check_code_quality:
1212
isort --check-only --profile black $(check_dirs)
1313
# stop the build if there are Python syntax errors or undefined names
1414
flake8 $(check_dirs) --count --select=E9,F63,F7,F82 --show-source --statistics
15-
# exit-zero treats all errors as warnings. E203 for black, E501 for docstring, W503 for line breaks before logical operators
15+
# exit-zero treats all errors as warnings. E203 for black, E501 for docstring, W503 for line breaks before logical operators
1616
flake8 $(check_dirs) --count --max-line-length=88 --exit-zero --ignore=D --extend-ignore=E203,E501,W503 --statistics
17-
17+
1818
publish:
1919
python setup.py sdist bdist_wheel
2020
twine check dist/*
21-
twine upload dist/* -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD} --verbose
21+
twine upload dist/* -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD} --verbose

docs/core/dataset.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
:::roboflow.core.dataset
1+
:::roboflow.core.dataset

docs/core/model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
:::roboflow.core.model
1+
:::roboflow.core.model

docs/core/project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
:::roboflow.core.project
1+
:::roboflow.core.project

0 commit comments

Comments
 (0)