Conversation
-Improved reliability: Updated action versions (checkout@v5 → @v4, setup-uv@v6 → @V3) and pinned Python to "3.11" for consistent builds across environments -Enhanced caching strategy: Extended dependency caching to include both uv.lock and pyproject.toml files, reducing CI run times for the team Added code quality gates: -Integrated ruff linting to maintain code standards -Added pytest execution to catch regressions early -Implemented automatic package building for release readiness -Better developer experience: Added descriptive step names and structured workflow for easier debugging and maintenance -Streamlined configuration: Removed unnecessary allow-prereleases flag to prevent potential instability issues
.github/workflows/build.yml
Outdated
| run: uv run ruff check , --output-format=github | ||
|
|
||
|
|
||
| run: uv run ruff check , --output-format=github |
There was a problem hiding this comment.
What does the comma (,) do on this line?
There was a problem hiding this comment.
Is the . useful? If not, let's remove it.
|
Why does pre-commit fail? |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - name: Checkout Repository |
There was a problem hiding this comment.
This step only has a name but no run or uses so this GHA is invalid https://github.com/TheAlgorithms/Python/actions/runs/17159313101
There was a problem hiding this comment.
The pre-commit fails due to some wrong indentation and some mismatched indents, let me see that. |
| schedule: | ||
| - cron: "0 0 * * *" # Run everyday | ||
| push: | ||
| branches: [main, develop] |
There was a problem hiding this comment.
This repo has no main or develop branch, so this change disables all push testing.
.github/workflows/build.yml
Outdated
| - "*.md" | ||
| - "docs/**" |
There was a problem hiding this comment.
Why ignore these? docs contains Python code.
| - "docs/**" | ||
|
|
||
| pull_request: | ||
| branches: [main] |
There was a problem hiding this comment.
This repo has no main branch, so this change disables all pull request testing.
|
|
||
| pull_request: | ||
| branches: [main] | ||
| types: [opened, synchronize, reopened] |
| types: [opened, synchronize, reopened] | ||
| paths-ignore: | ||
| - "*.md" | ||
| - "docs/**" |
There was a problem hiding this comment.
Why ignore these? docs contains Python code.
| **/uv.lock | ||
| **/pyproject.toml | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 |
There was a problem hiding this comment.
The hyphen on line 37 makes this entire file invalid.
actions/setup-python@v5 tells the reader more than Set up Python.
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: 3.x | ||
| python-version: "3.11" |
There was a problem hiding this comment.
CONTRIBUTING.md says we always use the latest production version of CPython, so why slow down and invalidate our testing by using an old version of Python?
| python-version: "3.11" | ||
| allow-prereleases: true | ||
| - run: uv sync --group=test | ||
| - name: Install dependencies |
There was a problem hiding this comment.
uv sync --group=test tells the reader more than Install dependencies.
| uv sync --all-extras | ||
| uv pip list |
There was a problem hiding this comment.
Not helpful. This has the potential to slow down the build and generate longer logs, which will go unread.
| - if: ${{ success() }} | ||
| run: scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md |
There was a problem hiding this comment.
The if and run commands need to be placed in the same job step, not in two separate job steps.
| uv sync --all-extras | ||
| uv pip list | ||
| - name: Lint code | ||
| run: uv run ruff check . --output-format=github |
There was a problem hiding this comment.
Why run ruff again? It is already run in the pre-commit and dedicated ruff jobs.
-Improved reliability:
Updated action versions (checkout@v5 → @v4, setup-uv@v6 → @V3) and pinned Python to "3.11" for consistent builds across environments -Enhanced caching strategy:
Extended dependency caching to include both uv.lock and pyproject.toml files, reducing CI run times for the team Added code quality gates:
-Integrated ruff linting to maintain code standards -Added pytest execution to catch regressions early -Implemented automatic package building for release readiness
-Better developer experience: Added descriptive step names and structured workflow for easier debugging and maintenance
-Streamlined configuration: Removed unnecessary allow-prereleases flag to prevent potential instability issues
Describe your change:
Checklist: