Skip to content

Commit

Permalink
Change pylint to ruff and black (#1565)
Browse files Browse the repository at this point in the history
Signed-off-by: yangxuan <[email protected]>
  • Loading branch information
XuanYang-cn authored Jul 3, 2023
1 parent 2d9884e commit 551da96
Show file tree
Hide file tree
Showing 49 changed files with 4,004 additions and 3,514 deletions.
9 changes: 6 additions & 3 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ pull_request_rules:
- or:
- base=master
- base~=2\.\d
- "status-success=Run Python Tests (3.8)"
- "status-success=Run Check Proto (3.8)"
- "status-success=Code lint check (3.8)"
- "status-success=Run Python Tests (3.7)"
- "status-success=Run Check Proto (3.7)"
- "status-success=Code lint check (3.7)"
- "status-success=Run Python Tests (3.11)"
- "status-success=Run Check Proto (3.11)"
- "status-success=Code lint check (3.11)"
actions:
label:
add:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_milvus_proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
python-version: [3.7, 3.11]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.11]
python-version: [3.7, 3.11]
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6]
python-version: [3.7]
env:
IMAGE_REPO: "milvusdb"
TAG_PREFIX: "master-"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.11]
python-version: [3.7, 3.11]

steps:
- name: Checkout code
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ unittest:
PYTHONPATH=`pwd` python3 -m pytest tests --cov=pymilvus -v

lint:
PYTHONPATH=`pwd` pylint --rcfile=pylint.conf pymilvus
PYTHONPATH=`pwd` black pymilvus --check
PYTHONPATH=`pwd` ruff check pymilvus

format:
PYTHONPATH=`pwd` black pymilvus
PYTHONPATH=`pwd` ruff check pymilvus --fix

codecov:
PYTHONPATH=`pwd` pytest --cov=pymilvus --cov-report=xml tests -x -v -rxXs
Expand All @@ -24,7 +29,7 @@ gen_proto:

check_proto_product: gen_proto
./check_proto_product.sh

version:
python -m setuptools_scm

Expand Down
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ The following collection shows Milvus versions and recommended PyMilvus versions
| 1.1.\* | 1.1.2 |
| 2.0.\* | 2.0.2 |
| 2.1.\* | 2.1.3 |
| 2.2.\* | 2.2.0 |
| 2.2.\* | 2.2.13 |


## Installation

You can install PyMilvus via `pip` or `pip3` for Python 3.6+:
You can install PyMilvus via `pip` or `pip3` for Python 3.7+:

```shell
$ pip3 install pymilvus
Expand All @@ -35,7 +35,7 @@ $ pip3 install pymilvus
You can install a specific version of PyMilvus by:

```shell
$ pip3 install pymilvus==2.2.0
$ pip3 install pymilvus==2.2.13
```

You can upgrade PyMilvus to the latest version by:
Expand Down Expand Up @@ -66,7 +66,21 @@ Q3. How to use the local PyMilvus repository for Milvus server?

A3.
```shell
$ python setup.py install
$ make install
```

Q4. How to check coding styles?

A4.
```shell
make lint
```

Q5. How to fix the coding styles?

Q5
```shell
make format
```


Expand Down
Loading

0 comments on commit 551da96

Please sign in to comment.