Skip to content

Commit b1bae8d

Browse files
MinuraPunchihewaankatiyar
andauthoredOct 22, 2024··
feat: Separated the Lint Dependencies for the Plugins (#901)
* separated the lint requirements for kedro-datasets Signed-off-by: Minura Punchihewa <minurapunchihewa17@gmail.com> * added the lint requirements to all Signed-off-by: Minura Punchihewa <minurapunchihewa17@gmail.com> * added the make cmd for installing lint dependencies Signed-off-by: Minura Punchihewa <minurapunchihewa17@gmail.com> * separated the lint requirements for the other plugins Signed-off-by: Minura Punchihewa <minurapunchihewa17@gmail.com> * updated the lint workflow template to install correct dependencies Signed-off-by: Minura Punchihewa <minurapunchihewa17@gmail.com> * Trying to fix lint Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com> --------- Signed-off-by: Minura Punchihewa <minurapunchihewa17@gmail.com> Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com> Co-authored-by: Ankita Katiyar <110245118+ankatiyar@users.noreply.github.com> Co-authored-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>
1 parent 92952cf commit b1bae8d

File tree

7 files changed

+50
-32
lines changed

7 files changed

+50
-32
lines changed
 

‎.github/workflows/lint.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ jobs:
3434
python -m pip install "uv==0.2.21"
3535
- name: Install dependencies
3636
run: |
37-
cd ${{ inputs.plugin }}
38-
uv pip install --system "kedro @ git+https://github.com/kedro-org/kedro@main"
39-
uv pip install --system "${{inputs.plugin}}[test] @ ."
40-
uv pip freeze --system
37+
cd ${{ inputs.plugin }}
38+
uv pip install --system "kedro @ git+https://github.com/kedro-org/kedro@main"
39+
uv pip install --system "${{inputs.plugin}}[lint] @ ."
40+
uv pip freeze --system
4141
- name: Install pre-commit hooks
4242
run: |
43-
pre-commit install --install-hooks
44-
pre-commit install --hook-type pre-push
43+
pre-commit install --install-hooks
44+
pre-commit install --hook-type pre-push
4545
- name: Run linter
4646
run: make plugin=${{ inputs.plugin }} lint
4747
- name: Run mypy

‎Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ secret-scan:
2727
install-test-requirements:
2828
cd $(plugin) && uv pip install ".[test]"
2929

30+
install-lint-requirements:
31+
cd $(plugin) && uv pip install ".[lint]"
32+
3033
install-pre-commit:
3134
pre-commit install --install-hooks
3235

‎kedro-airflow/pyproject.toml

+8-5
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,23 @@ Tracker = "https://github.com/kedro-org/kedro-plugins/issues"
2525
[project.optional-dependencies]
2626
test = [
2727
"apache-airflow<3.0",
28-
"bandit",
2928
"behave",
30-
"black~=22.0",
3129
"coverage>=7.2.0",
3230
"kedro-datasets",
33-
"mypy~=1.0",
34-
"pre-commit>=2.9.2",
3531
"pytest",
3632
"pytest-cov",
3733
"pytest-mock",
3834
"pytest-xdist",
35+
"wheel",
36+
]
37+
38+
lint = [
39+
"bandit",
40+
"black~=22.0",
41+
"mypy~=1.0",
42+
"pre-commit>=2.9.2",
3943
"trufflehog>=2.1.0, <3.0",
4044
"ruff~=0.0.290",
41-
"wheel",
4245
# mypy requirements
4346
"types-PyYAML",
4447
"types-cachetools",

‎kedro-datasets/kedro_datasets/polars/lazy_polars_dataset.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
logger = logging.getLogger(__name__)
2828

2929

30-
class LazyPolarsDataset(AbstractVersionedDataset[pl.LazyFrame, PolarsFrame]):
30+
class LazyPolarsDataset(
31+
AbstractVersionedDataset[pl.LazyFrame, pl.LazyFrame | pl.DataFrame]
32+
):
3133
"""``LazyPolarsDataset`` loads/saves data from/to a data file using an
3234
underlying filesystem (e.g.: local, S3, GCS). It uses Polars to handle
3335
the type of read/write target. It uses lazy loading with Polars Lazy API, but it can

‎kedro-datasets/pyproject.toml

+13-9
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,8 @@ docs = [
203203
test = [
204204
"accelerate<0.32", # Temporary pin
205205
"adlfs~=2023.1",
206-
"bandit>=1.6.2, <2.0",
207206
"behave==1.2.6",
208207
"biopython~=1.73",
209-
"blacken-docs==1.9.2",
210-
"black~=22.0",
211208
"cloudpickle<=2.0.0",
212209
"compress-pickle[lz4]~=2.1.0",
213210
"coverage>=7.2.0",
@@ -222,7 +219,6 @@ test = [
222219
"hdfs>=2.5.8, <3.0",
223220
"holoviews>=1.13.0",
224221
"ibis-framework[duckdb,examples]",
225-
"import-linter[toml]==1.2.6",
226222
"ipython>=7.31.1, <8.0",
227223
"Jinja2<3.2.0",
228224
"joblib>=0.14",
@@ -232,7 +228,6 @@ test = [
232228
"matplotlib>=3.5, <3.6",
233229
"memory_profiler>=0.50.0, <1.0",
234230
"moto==5.0.0",
235-
"mypy~=1.0",
236231
"networkx~=2.4",
237232
"opencv-python~=4.5.5.64",
238233
"openpyxl>=3.0.3, <4.0",
@@ -241,7 +236,6 @@ test = [
241236
"Pillow~=10.0",
242237
"plotly>=4.8.0, <6.0",
243238
"polars[xlsx2csv, deltalake]~=0.18.0",
244-
"pre-commit>=2.9.2",
245239
"pyarrow>=1.0; python_version < '3.11'",
246240
"pyarrow>=7.0; python_version >= '3.11'", # Adding to avoid numpy build errors
247241
"pyodbc~=5.0",
@@ -254,7 +248,6 @@ test = [
254248
"redis~=4.1",
255249
"requests-mock~=1.6",
256250
"requests~=2.20",
257-
"ruff~=0.0.290",
258251
"s3fs>=2021.04",
259252
"snowflake-snowpark-python~=1.0; python_version < '3.11'",
260253
"scikit-learn>=1.0.2,<2",
@@ -265,13 +258,24 @@ test = [
265258
"tensorflow-macos~=2.0; platform_system == 'Darwin' and platform_machine == 'arm64'",
266259
"tensorflow~=2.0; platform_system != 'Darwin' or platform_machine != 'arm64'",
267260
"triad>=0.6.7, <1.0",
268-
"trufflehog~=2.1",
269261
"xarray>=2023.1.0",
270262
"xlsxwriter~=1.0",
271263
# huggingface
272264
"datasets",
273265
"huggingface_hub",
274266
"transformers[torch]",
267+
]
268+
269+
# Lint requirements
270+
lint = [
271+
"bandit>=1.6.2, <2.0",
272+
"blacken-docs==1.9.2",
273+
"black~=22.0",
274+
"import-linter[toml]==1.2.6",
275+
"mypy~=1.0",
276+
"pre-commit>=2.9.2",
277+
"ruff~=0.0.290",
278+
"trufflehog~=2.1",
275279
# mypy related dependencies
276280
"types-cachetools",
277281
"types-PyYAML",
@@ -297,7 +301,7 @@ experimental = [
297301
]
298302

299303
# All requirements
300-
all = ["kedro-datasets[test,docs]"]
304+
all = ["kedro-datasets[test,docs,lint]"]
301305

302306
[project.urls]
303307
Source = "https://github.com/kedro-org/kedro-plugins/tree/main/kedro-datasets"

‎kedro-docker/pyproject.toml

+9-6
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,25 @@ Tracker = "https://github.com/kedro-org/kedro-plugins/issues"
2424

2525
[project.optional-dependencies]
2626
test = [
27-
"bandit",
2827
"behave",
29-
"black~=22.0",
3028
"coverage>=7.2.0",
3129
"docker",
32-
"mypy~=1.0",
33-
"pre-commit>=2.9.2",
3430
"psutil",
3531
"pytest",
3632
"pytest-cov",
3733
"pytest-mock",
3834
"pytest-xdist[psutil]~=2.2.1",
3935
"PyYAML>=5.1, <7.0",
40-
"trufflehog>=2.0.99, <3.0",
36+
"wheel==0.32.2",
37+
]
38+
39+
lint = [
40+
"bandit",
41+
"black~=22.0",
42+
"mypy~=1.0",
43+
"pre-commit>=2.9.2",
44+
"trufflehog>=2.1.0, <3.0",
4145
"ruff~=0.0.290",
42-
"wheel==0.32.2"
4346
]
4447

4548
[project.entry-points."kedro.project_commands"]

‎kedro-telemetry/pyproject.toml

+8-5
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,21 @@ Tracker = "https://github.com/kedro-org/kedro-plugins/issues"
2424

2525
[project.optional-dependencies]
2626
test = [
27-
"bandit>=1.6.2, <2.0",
28-
"black~=22.0",
29-
"mypy~=1.0",
30-
"pre-commit>=2.9.2",
3127
"pytest",
3228
"pytest-cov",
3329
"pytest-mock",
3430
"pytest-xdist[psutil]~=2.2.1",
3531
"PyYAML==5.3.1", # Temporary fix, to be removed
32+
"wheel",
33+
]
34+
35+
lint = [
36+
"bandit>=1.6.2, <2.0",
37+
"black~=22.0",
38+
"mypy~=1.0",
39+
"pre-commit>=2.9.2",
3640
"trufflehog>=2.1.0, <3.0",
3741
"ruff~=0.0.290",
38-
"wheel",
3942
# mypy requirements
4043
"types-requests",
4144
"types-PyYAML",

0 commit comments

Comments
 (0)
Please sign in to comment.