-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature/issue-33-add-pre-commit (#34)
* feature/issue-33-add-pre-commit * added CONTRIBUTING.md * py3.8 types * remove dev dependencies that are used in pre-commit
- Loading branch information
Showing
10 changed files
with
160 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,17 +38,15 @@ jobs: | |
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: pre-commit/[email protected] | ||
with: | ||
config: '.pre-commit-config.yaml' | ||
verbose: true | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pylint poetry | ||
poetry install --with dev | ||
- name: Lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: integration tests | ||
run: poetry run pytest tests | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.11.1 | ||
hooks: | ||
- id: mypy | ||
args: [--strict, --ignore-missing-imports] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 24.8.0 | ||
hooks: | ||
- id: black | ||
name: black | ||
description: "Black: The uncompromising Python code formatter" | ||
entry: black | ||
language: python | ||
minimum_pre_commit_version: 2.9.2 | ||
require_serial: true | ||
types_or: [python, pyi] | ||
|
||
- repo: https://github.com/pycqa/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
name: isort (python) | ||
|
||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 7.1.0 | ||
hooks: | ||
- id: flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## Contribute | ||
All contributions are welcome: | ||
|
||
- Read the [issues](https://github.com/IamTugy/pyminio/issues), Fork the [project](https://github.com/IamTugy/pyminio) and create a new Pull Request. | ||
- Request a new feature creating a `New issue` with the `enhancement` tag. | ||
- Find any kind of errors in the code and create a `New issue` with the details, or fork the project and do a Pull Request. | ||
- Suggest a better or more pythonic way for existing examples. | ||
|
||
### Work environment | ||
|
||
After forking the project, make sure you have poetry installed, | ||
than install the dependencies using | ||
```bash | ||
poetry install | ||
``` | ||
|
||
Also install pre-commit and activate it: | ||
```bash | ||
pip install pre-commit | ||
pre-commit install | ||
``` | ||
|
||
download the [minio docker](https://hub.docker.com/r/minio/minio/) and start an instance in your computer for development and testing. | ||
|
||
Export The same environment variables you've used to set up your local minio: | ||
```bash | ||
export MINIO_TEST_CONNECTION="<your API host>" # example: 127.0.0.1:9000 | ||
export MINIO_TEST_ACCESS_KEY="<your user>" # example: ROOTNAME | ||
export MINIO_TEST_SECRET_KEY="<your password>" # example: CHANGEME123 | ||
``` | ||
|
||
to run the tests run: | ||
```bash | ||
poetry run pytest tests | ||
``` | ||
#### Don't forget to write tests, and to run all the tests before making a pull request. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.