Skip to content

Commit a32c346

Browse files
Tidying up around the project meta files (#337)
* Clean up project meta file Specifically around the `pyproject.toml` file, and `ruff` rules. * Fix single issue of `SIM910` rule removal * update github actions versions * add dependabot * add cooldown to dependabot * Fix line-too-long issues
1 parent 4151ba0 commit a32c346

10 files changed

Lines changed: 933 additions & 87 deletions

File tree

.github/dependabot.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
cooldown:
8+
default-days: 12
9+
10+
# - package-ecosystem: "pip"
11+
# directory: "/"
12+
# schedule:
13+
# interval: "weekly"

.github/workflows/build_and_publish.yml

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,31 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v4
14-
- name: Set up Python
15-
uses: actions/setup-python@v4
16-
with:
17-
python-version: "3.x"
18-
- name: Install pypa/build
19-
run: >-
20-
python3 -m
21-
pip install
22-
build
23-
--user
24-
- name: Build source and wheels
25-
run: python3 -m build
26-
- name: Store the distribution packages
27-
uses: actions/upload-artifact@v7
28-
with:
29-
name: python-package-distributions
30-
path: dist/
13+
- uses: actions/checkout@v6
14+
- name: Set up Python
15+
uses: actions/setup-python@v6
16+
with:
17+
python-version: "3.x"
18+
- name: Install pypa/build
19+
run: >-
20+
python3 -m
21+
pip install
22+
build
23+
--user
24+
25+
- name: Build source and wheels
26+
run: python3 -m build
27+
28+
- name: Store the distribution packages
29+
uses: actions/upload-artifact@v7
30+
with:
31+
name: python-package-distributions
32+
path: dist/
3133

3234
publish-to-pypi:
3335
name: Upload to PyPi
3436
needs:
35-
- build
37+
- build
3638
runs-on: ubuntu-latest
3739
environment:
3840
name: pypi
@@ -41,10 +43,11 @@ jobs:
4143
id-token: write
4244

4345
steps:
44-
- name: Download all the dists
45-
uses: actions/download-artifact@v4.1.7
46-
with:
47-
name: python-package-distributions
48-
path: dist/
49-
- name: Publish distribution to PyPi
50-
uses: pypa/gh-action-pypi-publish@release/v1
46+
- name: Download all the dists
47+
uses: actions/download-artifact@v5
48+
with:
49+
name: python-package-distributions
50+
path: dist/
51+
52+
- name: Publish distribution to PyPi
53+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/coverage_and_lint.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ jobs:
2020
name: "Type Coverage and Linting @ ${{ matrix.python-version }}"
2121
steps:
2222
- name: "Checkout Repository"
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v6
2424
with:
2525
fetch-depth: 0
2626

2727
- name: "Setup Python @ ${{ matrix.python-version }}"
2828
id: setup-python
29-
uses: actions/setup-python@v4
29+
uses: actions/setup-python@v6
3030
with:
3131
python-version: "${{ matrix.python-version }}"
3232
cache: "pip"
@@ -35,13 +35,19 @@ jobs:
3535
id: install-deps
3636
run: |
3737
pip install -Ur requirements.txt
38+
3839
- name: "Run Pyright @ ${{ matrix.python-version }}"
39-
uses: jakebailey/pyright-action@v1
40+
uses: jakebailey/pyright-action@v3
4041
with:
41-
no-comments: ${{ matrix.python-version != '3.x' }}
42+
annotate: ${{ matrix.python-version != '3.x' }}
4243
warnings: false
4344

44-
- name: Lint with Ruff
45-
if: ${{ always() && steps.install-deps.outcome == 'success' }}
46-
uses: chartboost/ruff-action@v1
47-
45+
- name: Setup Ruff
46+
if: ${{ steps.install-deps.outcome == 'success' }}
47+
uses: astral-sh/ruff-action@v3
48+
- name: Ruff check
49+
if: ${{ steps.install-deps.outcome == 'success' }}
50+
run: "ruff check ."
51+
- name: Ruff format check
52+
if: ${{ steps.install-deps.outcome == 'success' }}
53+
run: "ruff format --check ."

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,4 @@ cython_debug/
162162
.vscode/
163163

164164
# Test
165-
test.py
165+
test.py

pyproject.toml

Lines changed: 26 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,23 @@ build-backend = "setuptools.build_meta"
66
name = "wavelink"
77
version = "3.5.1"
88

9-
authors = [
10-
{ name="PythonistaGuild, EvieePy", email="evieepy@gmail.com" },
11-
]
9+
authors = [{ name = "PythonistaGuild, EvieePy", email = "evieepy@gmail.com" }]
1210
dynamic = ["dependencies"]
1311
description = "A robust and powerful, fully asynchronous Lavalink wrapper built for discord.py in Python."
1412
readme = "README.md"
1513
requires-python = ">=3.10"
1614
classifiers = [
17-
"License :: OSI Approved :: MIT License",
18-
"Intended Audience :: Developers",
19-
"Natural Language :: English",
20-
"Operating System :: OS Independent",
21-
"Programming Language :: Python :: 3.10",
22-
"Programming Language :: Python :: 3.11",
23-
"Programming Language :: Python :: 3.12",
24-
"Topic :: Internet",
25-
"Topic :: Software Development :: Libraries",
26-
"Topic :: Software Development :: Libraries :: Python Modules",
27-
"Topic :: Utilities",
15+
"License :: OSI Approved :: MIT License",
16+
"Intended Audience :: Developers",
17+
"Natural Language :: English",
18+
"Operating System :: OS Independent",
19+
"Programming Language :: Python :: 3.10",
20+
"Programming Language :: Python :: 3.11",
21+
"Programming Language :: Python :: 3.12",
22+
"Topic :: Internet",
23+
"Topic :: Software Development :: Libraries",
24+
"Topic :: Software Development :: Libraries :: Python Modules",
25+
"Topic :: Utilities",
2826
]
2927

3028
[project.urls]
@@ -34,51 +32,43 @@ classifiers = [
3432
packages = ["wavelink", "wavelink.types"]
3533

3634
[tool.setuptools.dynamic]
37-
dependencies = {file = ["requirements.txt"]}
35+
dependencies = { file = ["requirements.txt"] }
3836

3937
[tool.setuptools.package-data]
4038
wavelink = ["py.typed"]
4139

40+
[dependency-groups]
41+
dev = ["ruff>=0.15.10"]
42+
4243
[tool.ruff]
4344
line-length = 120
4445
indent-width = 4
4546
exclude = ["venv", "docs/"]
4647

4748
[tool.ruff.lint]
4849
select = [
50+
"ANN",
4951
"C4",
5052
"E",
5153
"F",
5254
"G",
5355
"I",
56+
"PERF",
5457
"PTH",
5558
"RUF",
5659
"SIM",
57-
"TCH",
60+
"TC",
5861
"UP",
5962
"W",
60-
"PERF",
61-
"ANN",
6263
]
6364
ignore = [
64-
"F402",
65-
"F403",
66-
"F405",
67-
"PERF203",
68-
"RUF001",
69-
"RUF009",
70-
"SIM105",
71-
"UP034",
72-
"UP038",
73-
"ANN101",
74-
"ANN102",
75-
"ANN401",
76-
"UP031",
77-
"PTH123",
78-
"E203",
79-
"E501",
80-
"RUF006",
81-
"SIM910",
65+
"ANN401", # we allow `Any` type
66+
"E203", # we allow whitespace separation after commas, etc
67+
"F403", # allowing manual dict comprehension
68+
"F405", # star imports are used commonly here
69+
"PERF203", # allowing try-except blocks in loops is allowed here, performance hit is negligible
70+
"RUF006", # due to the nature of the library we allow dangling tasks to be cleaned up eagerly
71+
"SIM105", # contextlib.suppress is a performance hit and try-except is preferred.
8272
]
8373

8474
[tool.ruff.lint.isort]
@@ -106,4 +96,3 @@ typeCheckingMode = "strict"
10696
reportImportCycles = false
10797
reportPrivateUsage = false
10898
pythonVersion = "3.10"
109-

0 commit comments

Comments
 (0)