Skip to content

Commit a6c2c34

Browse files
authored
Update ci (#1513)
* Updated Github CI * Fix * Cleanup
1 parent 96868a4 commit a6c2c34

File tree

5 files changed

+29
-49
lines changed

5 files changed

+29
-49
lines changed

.deepsource.toml

-17
This file was deleted.

.github/workflows/ci.yml

+3-22
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ jobs:
2121
uses: actions/setup-python@v5
2222
with:
2323
python-version: ${{ matrix.python-version }}
24-
- name: Show OS and Python version
25-
run: |
26-
echo "OS: ${{ matrix.operating-system }}"
27-
echo "Python: ${{ matrix.python-version }}"
2824
- name: Update pip
2925
run: python -m pip install --upgrade pip
3026
- name: Install wheel
@@ -64,24 +60,9 @@ jobs:
6460
- name: Update pip
6561
run: python -m pip install --upgrade pip
6662
- name: Install linters
67-
run: >
68-
pip install
69-
flake8==5.0.3
70-
flake8-docstrings==1.6.0
71-
isort==5.11.5
72-
mypy==0.991
73-
types-PyYAML
74-
types-setuptools
75-
types-pkg-resources
76-
black==22.6.0
77-
- name: Run Black
78-
run: black --config=black.toml --check .
79-
- name: Run Flake8
80-
run: flake8
81-
- name: Run mypy
82-
run: mypy .
83-
- name: Run isort
84-
run: isort --profile black albumentations
63+
run: pip install -r requirements-dev.txt
64+
- name: Run checks
65+
run: pre-commit run --files $(find albumentations -type f)
8566

8667
check_transforms_docs:
8768
name: Check that transforms docs are not outdated

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.3.0
3+
rev: v4.5.0
44
hooks:
55
- id: trailing-whitespace
66
- id: end-of-file-fixer

CONTRIBUTING.md

+16-9
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,20 @@ python3 -m venv env
2424
source env/bin/activate
2525
```
2626

27-
#### Install development dependencies:
27+
#### Install development dependencies
2828

29-
Install the project's development dependencies, which include testing and documentation tools:
29+
Install the project's dependencies by running:
3030

3131
```bash
3232
pip install -e .[develop]
3333
```
3434

35+
Additionally, to ensure you have all the necessary tools for code formatting, linting, and additional development utilities, install the requirements from `requirements-dev.txt`:
36+
37+
```bash
38+
pip install -r requirements-dev.txt
39+
```
40+
3541
## Navigating the Project
3642

3743
* The main source code is located in the `albumentations/` directory.
@@ -66,7 +72,7 @@ pip install -e .[develop]
6672

6773
### Using Pre-commit Hooks
6874

69-
To maintain code quality and consistency, we use pre-commit hooks. These hooks run checks on your commits before they are submitted, helping catch common issues early. To set up pre-commit hooks in your local repository, follow these steps:
75+
To maintain code quality and consistency, we use pre-commit hooks. Follow these steps to set up pre-commit hooks in your local repository:
7076

7177
1. **Install pre-commit:** If you haven't already, you need to install pre-commit on your machine. You can do this using pip:
7278

@@ -84,9 +90,9 @@ pre-commit install
8490

8591
This command sets up the pre-commit hooks based on the configurations found in `.pre-commit-config.yaml` at the root of the repository.
8692

87-
3. **Run pre-commit hooks:**
93+
3. **Running pre-commit hooks:**
8894

89-
Pre-commit will now automatically run on each commit. However, you can manually run the checks on all files in the repository with:
95+
Pre-commit will automatically run the configured hooks on each commit. You can also manually run the hooks on all files in the repository with:
9096

9197
```bash
9298
pre-commit run --all-files
@@ -110,19 +116,20 @@ Run the tests:
110116

111117
With `pytest` installed, you can run all tests using the following command from the root of the repository:
112118

113-
bash
114-
Copy code
119+
```bash
115120
pytest
121+
```
122+
116123
This will execute all the tests and display the results, indicating whether each test passed or failed.
117124

118-
**Tip**: If you've made changes to a specific area of the library, you can run a subset of the tests related to your changes. This can save time and make it easier to debug issues. Use the pytest documentation to learn more about running specific tests.
125+
**Tip**: If you've made changes to a specific area of the library, you can run a subset of the tests related to your changes. This can save time and make it easier to debug issues. Use the `pytest` documentation to learn more about running specific tests.
119126

120127
### Ensuring Your Contribution is Ready
121128

122129
* After setting up pre-commit hooks and ensuring all tests pass, your contribution is nearly ready for submission.
123130
* Review your changes one last time, ensuring they meet the project's coding guidelines and documentation standards.
124131
* If your changes affect how users interact with Albumentations, update the documentation accordingly.
125-
*
132+
126133
By following these guidelines, you help ensure that Albumentations remains a high-quality, reliable library. We appreciate your contributions and look forward to your pull request!
127134

128135
## Additional Resources

requirements-dev.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
flake8==5.0.3
2+
flake8-docstrings==1.6.0
3+
isort==5.11.5
4+
mypy==0.991
5+
types-PyYAML
6+
types-setuptools
7+
types-pkg-resources
8+
black==22.6.0
9+
pre_commit>=3.5.0

0 commit comments

Comments
 (0)