forked from Pycord-Development/pycord
-
Notifications
You must be signed in to change notification settings - Fork 1
chore: Start migration to uv & ruff & hatch #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2a48b94
Start migration to uv
Paillat-dev c99b3d9
Setup ruff and hatch
Paillat-dev 73cc121
Change pre-commit to use ruff
Paillat-dev 130140a
Format with ruff
Paillat-dev c8f7934
Fix mistake
Paillat-dev 15ab8d6
Add dev deps
Paillat-dev a2e36b4
Change workflows to use uv and ruff
Paillat-dev 9d38186
:heavy_plus_sign: Add colorlog and remove requirements folder and fix…
Paillat-dev 901fb98
:green_heart: Fix sphinx build ?
Paillat-dev 625b4ed
:bug: Add __version.py for version management and update import in __…
Paillat-dev 7999861
:pencil2: Update lib-checks.yml to run ruff on ubuntu-latest
Paillat-dev ce8602b
:bug: Update lib-checks.yml to run mypy with uv
Paillat-dev 0658d79
:fire: Delete MANIFEST.in
Paillat-dev c2ec96e
:sparkles: Enhance lib-checks.yml to include ruff formatter check
Paillat-dev 321c307
:recycle: Refactor pyproject.toml and uv.lock to use optional-depende…
Paillat-dev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
|
@@ -37,18 +37,17 @@ jobs: | |
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.13" | ||
cache: "pip" | ||
cache-dependency-path: "requirements/dev.txt" | ||
- name: "Install dependencies" | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements/dev.txt | ||
- name: "Install uv" | ||
uses: astral-sh/setup-uv@v6 | ||
with: | ||
enable-cache: true | ||
- name: Sync dependencies | ||
run: uv sync --no-python-downloads --group dev | ||
- name: "Run codespell" | ||
run: | ||
codespell --ignore-words-list="groupt,nd,ot,ro,falsy,BU" \ | ||
uv run codespell --ignore-words-list="groupt,nd,ot,ro,falsy,BU" \ | ||
--exclude-file=".github/workflows/codespell.yml" | ||
bandit: | ||
if: ${{ github.event_name != 'schedule' }} | ||
ruff: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout Repository" | ||
|
@@ -57,38 +56,16 @@ jobs: | |
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.13" | ||
cache: "pip" | ||
cache-dependency-path: "requirements/dev.txt" | ||
- name: "Install dependencies" | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements/dev.txt | ||
- name: "Run bandit" | ||
run: bandit --recursive --skip B101,B104,B105,B110,B307,B311,B404,B603,B607 . | ||
pylint: | ||
if: ${{ github.event_name != 'schedule' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout Repository" | ||
uses: actions/checkout@v4 | ||
- name: "Setup Python" | ||
uses: actions/setup-python@v5 | ||
- name: "Install uv" | ||
uses: astral-sh/setup-uv@v6 | ||
with: | ||
python-version: "3.13" | ||
cache: "pip" | ||
cache-dependency-path: "requirements/dev.txt" | ||
- name: "Install dependencies" | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements/dev.txt | ||
- name: "Setup cache" | ||
id: cache-pylint | ||
uses: actions/cache@v4 | ||
with: | ||
path: .pylint.d | ||
key: pylint | ||
- name: "Run pylint" | ||
run: pylint discord/ --exit-zero | ||
enable-cache: true | ||
- name: Sync dependencies | ||
run: uv sync --no-python-downloads --group dev | ||
- name: "Run ruff linter check" | ||
run: uv run ruff check discord/ | ||
- name: "Run ruff formatter check" | ||
run: uv run ruff format --check discord/ | ||
mypy: | ||
if: ${{ github.event_name != 'schedule' }} | ||
runs-on: ubuntu-latest | ||
|
@@ -99,12 +76,12 @@ jobs: | |
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.13" | ||
cache: "pip" | ||
cache-dependency-path: "requirements/dev.txt" | ||
- name: "Install dependencies" | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements/dev.txt | ||
- name: "Install uv" | ||
uses: astral-sh/setup-uv@v6 | ||
with: | ||
enable-cache: true | ||
- name: Sync dependencies | ||
run: uv sync --no-python-downloads --group dev | ||
- name: "Setup cache" | ||
id: cache-mypy | ||
uses: actions/cache@v4 | ||
|
@@ -115,44 +92,4 @@ jobs: | |
id: cache-dir-mypy | ||
run: mkdir -p -v .mypy_cache | ||
- name: "Run mypy" | ||
run: mypy --non-interactive discord/ | ||
pytest: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: despite being called pytest this didn't run any tests but rather just ran the linting checks which is now done by ruff |
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | ||
exclude: | ||
- { python-version: "3.9", os: "macos-latest" } | ||
include: | ||
- { python-version: "3.9", os: "macos-13" } | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
OS: ${{ matrix.os }} | ||
PYTHON: ${{ matrix.python-version }} | ||
steps: | ||
- name: "Checkout Repository" | ||
uses: actions/checkout@v4 | ||
- name: "Setup Python" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: "pip" | ||
cache-dependency-path: "requirements/dev.txt" | ||
check-latest: true | ||
- name: "Install dependencies" | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 | ||
pip install -r requirements/dev.txt | ||
- name: "Setup cache" | ||
id: cache-pytest | ||
uses: actions/cache@v4 | ||
with: | ||
path: .pytest_cache | ||
key: ${{ matrix.os }}-${{ matrix.python-version }}-pytest | ||
- name: "Lint with flake8" | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics | ||
run: uv run mypy --non-interactive discord/ |
This file contains hidden or 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
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: removed because included in the ruff linter