Skip to content

Commit fede4c7

Browse files
committed
update poe tasks -- slightly
1 parent 5211973 commit fede4c7

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

pyproject.toml

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -124,63 +124,57 @@ dev = ["pytest"]
124124
airbyte-cdk = "airbyte_cdk.cli.airbyte_cdk:cli"
125125
source-declarative-manifest = "airbyte_cdk.cli.source_declarative_manifest:run"
126126

127-
[tool.isort]
128-
skip = ["__init__.py"] # TODO: Remove after this is fixed: https://github.com/airbytehq/airbyte-python-cdk/issues/12
129-
130127
# Ruff configuration moved to ruff.toml
131128

132129
[tool.poe.tasks]
133130
# Installation
134-
install = { shell = "poetry install --all-extras" }
135-
lock = { shell = "poetry lock" }
131+
install = { shell = "poetry install --all-extras", help = "Install all dependencies." }
132+
lock = { shell = "poetry lock", help = "Lock all dependencies." }
136133

137134
# Build tasks
138135
assemble = {cmd = "bin/generate-component-manifest-dagger.sh", help = "Generate component manifest files."}
139136
build-package = {cmd = "poetry build", help = "Build the python package: source and wheels archives."}
140137
build = {sequence = ["assemble", "build-package"], help = "Run all tasks to build the package."}
141138

142139
# Format check tasks
140+
format-check = {sequence = ["_format-check-ruff", "_format-check-prettier"], help = "Check formatting for all file types via Ruff and Prettier.", ignore_fail = "return_non_zero"}
143141
_format-check-ruff = {cmd = "poetry run ruff format --check .", help = "Check formatting with Ruff."}
144142
_format-check-prettier = {cmd = "npx prettier . --check", help = "Check formatting with prettier."}
145-
format-check = {sequence = ["_format-check-ruff", "_format-check-prettier"], help = "Check formatting for all file types.", ignore_fail = "return_non_zero"}
146143

147144
# Format fix tasks
145+
format-fix = {sequence = ["_format-fix-ruff", "_format-fix-prettier"], help = "Format all file types via Ruff and Prettier.", ignore_fail = "return_non_zero"}
148146
_format-fix-ruff = {cmd = "poetry run ruff format .", help = "Format with Ruff."}
149147
_format-fix-prettier = {cmd = "npx prettier . --write", help = "Format with prettier."}
150-
format-fix = {sequence = ["_format-fix-ruff", "_format-fix-prettier"], help = "Format all file types.", ignore_fail = "return_non_zero"}
151148

152149
# Linting/Typing check tasks
153-
_lint-ruff = {cmd = "poetry run ruff check .", help = "Lint with Ruff."}
150+
lint = {cmd = "poetry run ruff check .", help = "Lint with Ruff."}
154151
type-check = {cmd = "poetry run mypy airbyte_cdk", help = "Type check modified files with mypy."}
155-
lint = {sequence = ["_lint-ruff", "type-check"], help = "Lint all code. Includes type checking.", ignore_fail = "return_non_zero"}
156-
157-
# Lockfile check task
158-
check-lockfile = {cmd = "poetry check", help = "Check the poetry lock file."}
159152

160153
# Linting/Typing fix tasks
161-
lint-fix = { cmd = "poetry run ruff check --fix .", help = "Auto-fix any lint issues that Ruff can automatically resolve (excluding 'unsafe' fixes)." }
162-
lint-fix-unsafe = { cmd = "poetry run ruff check --fix --unsafe-fixes .", help = "Lint-fix modified files, including 'unsafe' fixes. It is recommended to first commit any pending changes and then always manually review any unsafe changes applied." }
154+
lint-fix = { cmd = "poetry run ruff check --fix .", help = "Auto-fix any lint issues that Ruff can automatically resolve (excluding 'unsafe' fixes) with Ruff." }
155+
lint-fix-unsafe = { cmd = "poetry run ruff check --fix --unsafe-fixes .", help = "Lint-fix modified files, including 'unsafe' fixes with Ruff. It is recommended to first commit any pending changes and then always manually review any unsafe changes applied." }
163156

164157
# ruff fix everything (ignoring non-Python fixes)
165158
ruff-fix = { sequence = ["lint-fix", "_format-fix-ruff"], help = "Lint-fix and format-fix all code." }
166159

167-
# Combined Check and Fix tasks
160+
# Lockfile check task
161+
_check-lockfile = {cmd = "poetry check", help = "Check the poetry lock file."}
168162

169-
check-all = {sequence = ["lint", "format-check", "type-check", "check-lockfile"], help = "Lint, format, and type-check modified files.", ignore_fail = "return_non_zero"}
163+
# Combined Check and Fix tasks
164+
check-all = {sequence = ["lint", "format-check", "type-check", "_check-lockfile"], help = "Lint, format, and type-check modified files.", ignore_fail = "return_non_zero"}
170165
fix-all = {sequence = ["format-fix", "lint-fix"], help = "Lint-fix and format-fix modified files, ignoring unsafe fixes.", ignore_fail = "return_non_zero"}
171166
fix-and-check = {sequence = ["fix-all", "check-all"], help = "Lint-fix and format-fix, then re-check to see if any issues remain.", ignore_fail = "return_non_zero"}
172167

173168
# PyTest tasks
174-
175169
pytest = {cmd = "poetry run coverage run -m pytest --durations=10", help = "Run all pytest tests."}
176-
pytest-fast = {cmd = "poetry run coverage run -m pytest --durations=5 --exitfirst -m 'not flaky and not slow and not requires_creds'", help = "Run pytest tests, failing fast and excluding slow tests."}
170+
pytest-fast = {cmd = "poetry run coverage run -m pytest --skipslow --durations=5 --exitfirst -m 'not flaky and not slow and not requires_creds'", help = "Run pytest tests, failing fast and excluding slow tests."}
177171
unit-test-with-cov = {cmd = "poetry run pytest -s unit_tests --cov=airbyte_cdk --cov-report=term --cov-config ./pyproject.toml", help = "Run unit tests and create a coverage report."}
178172

179173
# Combined check tasks (other)
180174

181175
# TODO: find a version of the modified mypy check that works both locally and in CI.
182-
check-local = {sequence = ["lint", "type-check", "check-lockfile", "unit-test-with-cov"], help = "Lint all code, type-check modified files, and run unit tests."}
183-
check-ci = {sequence = ["check-lockfile", "build", "lint", "unit-test-with-cov"], help = "Build the package, lint and run unit tests. Does not include type-checking."}
176+
check-local = {sequence = ["lint", "type-check", "_check-lockfile", "unit-test-with-cov"], help = "Lint all code, type-check modified files, and run unit tests."}
177+
check-ci = {sequence = ["_check-lockfile", "build", "lint", "unit-test-with-cov"], help = "Build the package, lint and run unit tests. Does not include type-checking."}
184178

185179
# Build and check
186180
pre-push = {sequence = ["build", "check-local"], help = "Run all build and check tasks."}

0 commit comments

Comments
 (0)