Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f3243bf
chore: add warning to readme
plun1331 May 9, 2025
de83d48
refactor!: properly type MISSING (#2)
VincentRPS May 10, 2025
b6512d2
Merge branch 'Pycord-Development:master' into master
VincentRPS May 13, 2025
32d932d
refactor: port over v3 rate limit code (#1)
VincentRPS May 13, 2025
61ba43a
Merge branch 'Pycord-Development:master' into master
Paillat-dev May 18, 2025
c1e22f3
feat: add banners (#9)
VincentRPS May 19, 2025
32ef1c8
Merge branch 'Pycord-Development:master' into master
Paillat-dev May 21, 2025
2a48b94
Start migration to uv
Paillat-dev May 13, 2025
c99b3d9
Setup ruff and hatch
Paillat-dev May 13, 2025
73cc121
Change pre-commit to use ruff
Paillat-dev May 13, 2025
130140a
Format with ruff
Paillat-dev May 13, 2025
c8f7934
Fix mistake
Paillat-dev May 13, 2025
15ab8d6
Add dev deps
Paillat-dev May 13, 2025
a2e36b4
Change workflows to use uv and ruff
Paillat-dev May 13, 2025
9d38186
:heavy_plus_sign: Add colorlog and remove requirements folder and fix…
Paillat-dev May 26, 2025
901fb98
:green_heart: Fix sphinx build ?
Paillat-dev May 26, 2025
625b4ed
:bug: Add __version.py for version management and update import in __…
Paillat-dev May 26, 2025
7999861
:pencil2: Update lib-checks.yml to run ruff on ubuntu-latest
Paillat-dev May 26, 2025
ce8602b
:bug: Update lib-checks.yml to run mypy with uv
Paillat-dev May 26, 2025
0658d79
:fire: Delete MANIFEST.in
Paillat-dev May 26, 2025
c2ec96e
:sparkles: Enhance lib-checks.yml to include ruff formatter check
Paillat-dev May 26, 2025
321c307
:recycle: Refactor pyproject.toml and uv.lock to use optional-depende…
Paillat-dev May 26, 2025
a34c962
Move utils.py to utils/
Paillat-dev May 29, 2025
fdbe8b0
:fire: Remove `filter_params`
Paillat-dev May 29, 2025
96b0a47
:recycle: Merge and , move to WIP
Paillat-dev May 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/docs-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,22 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: "requirements/docs.txt"
check-latest: true
- name: Install dependencies
run: |
python -m pip install -U pip
pip install ".[docs]"
- name: "Install uv"
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Sync dependencies
run: uv sync --no-python-downloads --group dev --group docs
- name: "Check Links"
env:
SPHINXBUILD: ${{ github.workspace }}/.venv/bin/sphinx-build
if: ${{ github.event_name == 'schedule' || inputs.with_linkcheck }}
run: |
cd docs
make linkcheck
- name: "Compile to html"
env:
SPHINXBUILD: ${{ github.workspace }}/.venv/bin/sphinx-build
run: |
cd docs
make -e SPHINXOPTS="-D language='en'" html
111 changes: 24 additions & 87 deletions .github/workflows/lib-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand All @@ -115,44 +92,4 @@ jobs:
id: cache-dir-mypy
run: mkdir -p -v .mypy_cache
- name: "Run mypy"
run: mypy --non-interactive discord/
pytest:
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/
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ docs/_build
__pycache__
.vs/*
.vscode/*
test.py
node_modules/*

# changelog is autogenerated from CHANGELOG.md
Expand All @@ -192,3 +191,5 @@ docs/build/linkcheck
!docs/locales/*
/build/
/vscode/

/discord/_version.py
75 changes: 5 additions & 70 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,65 +10,12 @@ repos:
exclude: \.(po|pot|yml|yaml)$
- id: end-of-file-fixer
exclude: \.(po|pot|yml|yaml)$
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.9
hooks:
- id: autoflake
# args:
# - --in-place
# - --remove-all-unused-imports
# - --expand-star-imports
# - --remove-duplicate-keys
# - --remove-unused-variables
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade
exclude: \.(po|pot|yml|yaml)$
- repo: https://github.com/PyCQA/isort
rev: 6.0.1
hooks:
- id: isort
exclude: \.(po|pot|yml|yaml)$
- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black
args: [--safe, --quiet]
exclude: \.(po|pot|yml|yaml)$
- repo: https://github.com/Pierre-Sassoulas/black-disable-checker
rev: v1.1.3
hooks:
- id: black-disable-checker
# - repo: https://github.com/PyCQA/flake8
# rev: 4.0.1
# hooks:
# - id: flake8
# additional_dependencies: [flake8-typing-imports==1.12.0]
# - repo: local
# hooks:
# - id: pylint
# name: pylint
# entry: pylint
# language: system
# types: [python]
# args: ["-rn", "-sn", "--rcfile=.pylintrc", "--fail-on=I"]
# # We define an additional manual step to allow running pylint with a spelling
# # checker in CI.
# - id: pylint
# alias: pylint-with-spelling
# name: pylint
# entry: pylint
# language: system
# types: [python]
# args: ["-rn", "-sn", "--rcfile=.pylintrc", "--fail-on=I", "--spelling-dict=en"]
# stages: [manual]
# - id: mypy
# name: mypy
# entry: mypy
# language: system
# types: [python]
# args: ["--non-interactive"]
- id: ruff
args: [ --fix ]
- id: ruff-format
# - repo: https://github.com/myint/rstcheck
# rev: "v5.0.0"
# hooks:
Expand All @@ -86,15 +33,3 @@ repos:
- id: prettier
args: [--prose-wrap=always, --print-width=88]
exclude: \.(po|pot|yml|yaml)$
- repo: https://github.com/DanielNoord/pydocstringformatter
rev: v0.7.3
hooks:
- id: pydocstringformatter
exclude: \.(po|pot|yml|yaml)$
args:
[
--style=numpydoc,
--no-numpydoc-name-type-spacing,
--no-final-period,
--no-capitalize-first-letter,
]
2 changes: 2 additions & 0 deletions CHANGELOG-V3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Removed
- `utils.filter_params`
19 changes: 0 additions & 19 deletions MANIFEST.in

This file was deleted.

4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
⚠️ This is a testing repository, and should not be used in production.

Please use the main repository: https://github.com/Pycord-Development/pycord

.. image:: https://raw.githubusercontent.com/Pycord-Development/pycord/master/pycord.png
:alt: Pycord v3

Expand Down
2 changes: 1 addition & 1 deletion discord/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

# We need __version__ to be imported first
# isort: off
from ._version import *
from .__version import *

# isort: on

Expand Down
34 changes: 8 additions & 26 deletions discord/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,10 @@


def show_version() -> None:
entries = [
"- Python v{0.major}.{0.minor}.{0.micro}-{0.releaselevel}".format(
sys.version_info
)
]
entries = ["- Python v{0.major}.{0.minor}.{0.micro}-{0.releaselevel}".format(sys.version_info)]

version_info = discord.version_info
entries.append(
"- py-cord v{0.major}.{0.minor}.{0.micro}-{0.releaselevel}".format(version_info)
)
entries.append("- py-cord v{0.major}.{0.minor}.{0.micro}-{0.releaselevel}".format(version_info))
if version_info.releaselevel != "final":
version = importlib.metadata.version("py-cord")
if version:
Expand Down Expand Up @@ -299,9 +293,7 @@ def newcog(parser, args) -> None:


def add_newbot_args(subparser: argparse._SubParsersAction) -> None:
parser = subparser.add_parser(
"newbot", help="creates a command bot project quickly"
)
parser = subparser.add_parser("newbot", help="creates a command bot project quickly")
parser.set_defaults(func=newbot)

parser.add_argument("name", help="the bot project name")
Expand All @@ -311,12 +303,8 @@ def add_newbot_args(subparser: argparse._SubParsersAction) -> None:
nargs="?",
default=Path.cwd(),
)
parser.add_argument(
"--prefix", help="the bot prefix (default: $)", default="$", metavar="<prefix>"
)
parser.add_argument(
"--sharded", help="whether to use AutoShardedBot", action="store_true"
)
parser.add_argument("--prefix", help="the bot prefix (default: $)", default="$", metavar="<prefix>")
parser.add_argument("--sharded", help="whether to use AutoShardedBot", action="store_true")
parser.add_argument(
"--no-git",
help="do not create a .gitignore file",
Expand Down Expand Up @@ -347,18 +335,12 @@ def add_newcog_args(subparser: argparse._SubParsersAction) -> None:
help="whether to hide all commands in the cog",
action="store_true",
)
parser.add_argument(
"--full", help="add all special methods as well", action="store_true"
)
parser.add_argument("--full", help="add all special methods as well", action="store_true")


def parse_args() -> Tuple[argparse.ArgumentParser, argparse.Namespace]:
parser = argparse.ArgumentParser(
prog="discord", description="Tools for helping with Pycord"
)
parser.add_argument(
"-v", "--version", action="store_true", help="shows the library version"
)
parser = argparse.ArgumentParser(prog="discord", description="Tools for helping with Pycord")
parser.add_argument("-v", "--version", action="store_true", help="shows the library version")
parser.set_defaults(func=core)

subparser = parser.add_subparsers(dest="subcommand", title="subcommands")
Expand Down
Loading
Loading