Skip to content

Commit d92cfba

Browse files
authored
CI: update precommit & apply (#2600)
1 parent 6739749 commit d92cfba

File tree

723 files changed

+79
-843
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

723 files changed

+79
-843
lines changed

.pre-commit-config.yaml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,44 @@
1+
default_language_version:
2+
python: python3
3+
14
repos:
25
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
6+
rev: v4.5.0
47
hooks:
8+
- id: end-of-file-fixer
9+
- id: trailing-whitespace
510
- id: check-symlinks
611
- id: destroyed-symlinks
712
- id: mixed-line-ending
8-
args: [ --fix=lf ]
13+
args:
14+
- "--fix=lf"
915

1016
- repo: https://github.com/asottile/pyupgrade
11-
rev: v3.1.0
17+
rev: v3.15.0
1218
hooks:
1319
- id: pyupgrade
1420
args:
15-
- --py37-plus
21+
- "--py37-plus"
1622

1723
- repo: https://github.com/astral-sh/ruff-pre-commit
18-
rev: 'v0.0.278'
24+
rev: v0.1.5
1925
hooks:
2026
- id: ruff
21-
args: [ "--fix", "--fixable=ALL", "--exit-non-zero-on-fix" ]
27+
args:
28+
- "--fix"
29+
- "--fixable=ALL"
30+
- "--exit-non-zero-on-fix"
2231

2332
- repo: https://github.com/codespell-project/codespell
24-
rev: v2.2.1
33+
rev: v2.2.6
2534
hooks:
2635
- id: codespell
2736
exclude: tests/
2837
args:
29-
- --ignore-words-list="bloaded,nto,pullrequest,pullrequests,thi,tim,wan,Wan,chang,Chang"
30-
- --quiet-level=2
38+
- "--ignore-words-list='bloaded,nto,pullrequest,pullrequests,thi,tim,wan,Wan,chang,Chang'"
39+
- "--quiet-level=2"
3140

3241
- repo: https://github.com/psf/black
33-
rev: 23.3.0
42+
rev: 23.11.0
3443
hooks:
3544
- id: black

DEPLOY.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Github workflow (`.github/workflows/python-publish.yml`) will push tagged commits to PyPI. Here are the steps:
44

5-
1. Run `manage.py`
5+
1. Run `manage.py`
66

77
```bash
88
./manage.sh publish
@@ -12,8 +12,7 @@ Next version number? (previous: 'XXX')
1212
2. Give the new version number based on previous version (Use semantic versioning)
1313

1414
3. Create a new Github [release](https://github.com/PyGithub/PyGithub/releases) from the tag that has just been committed, with the same release note from `doc/changes.rst`. This step is the hook that will trigger the workflow. (also needed for some web spiders for changelog parsing)
15-
16-
4. Now the push will be on hold until you press Enter. Manually inspect the changelog (`doc/changes.rst`) to make changes if necessary. Once you are sure, go back and press Enter.
1715

18-
5. Once the `python-publish` workflow completes, a new version will appear on [PyPI](https://pypi.org/project/PyGithub/#history) shortly.
16+
4. Now the push will be on hold until you press Enter. Manually inspect the changelog (`doc/changes.rst`) to make changes if necessary. Once you are sure, go back and press Enter.
1917

18+
5. Once the `python-publish` workflow completes, a new version will appear on [PyPI](https://pypi.org/project/PyGithub/#history) shortly.

doc/changes.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ Bug Fixes & Improvements
730730
Deprecation
731731
^^^^^^^^^^^
732732

733-
* Repository.get_file_contents() no longer works use Repository.get_contents() instead
733+
* Repository.get_file_contents() no longer works use Repository.get_contents() instead
734734

735735
Version 1.43.7 (April 16, 2019)
736736
-----------------------------------
@@ -1087,7 +1087,7 @@ Version 1.29 (October 10, 2016)
10871087
-----------------------------------
10881088

10891089
* add issue assignee param (3a8edc7)
1090-
* Fix diffrerent case (fcf6cfb)
1090+
* Fix different case (fcf6cfb)
10911091
* DOC: remove easy_install suggestion; update links (45e76d9)
10921092
* Add permission param documentation (9347345)
10931093
* Add ability to set permission for team repo (5dddea7)
@@ -1477,7 +1477,7 @@ Pre-release versions
14771477
* POST `/repos/:owner/:repo/git/trees?base_tree-`
14781478

14791479
* Gists
1480-
* Autorizations
1480+
* Authorizations
14811481
* Keys
14821482
* Hooks
14831483
* Events

doc/examples/Commit.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ Get commit date
2525
>>> print(commit.commit.author.date)
2626
2018-10-11 03:04:52
2727
>>> print(commit.commit.committer.date)
28-
2018-10-11 03:04:52
28+
2018-10-11 03:04:52

doc/examples/Issue.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Get issue
99
>>> repo = g.get_repo("PyGithub/PyGithub")
1010
>>> repo.get_issue(number=874)
1111
Issue(title="PyGithub example usage", number=874)
12-
12+
1313
Create comment on issue
1414
-----------------------
1515

doc/examples/Milestone.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ Get Milestone list
1010
>>> open_milestones = repo.get_milestones(state='open')
1111
>>> for milestone in open_milestones:
1212
... print(milestone)
13-
...
14-
Milestone(number=1)
15-
Milestone(number=2)
13+
...
14+
Milestone(number=1)
15+
Milestone(number=2)
1616
1717
Get Milestone
1818
-------------
@@ -21,7 +21,7 @@ Get Milestone
2121
2222
>>> repo = g.get_repo('PyGithub/PyGithub')
2323
>>> repo.get_milestone(number=1)
24-
Milestone(number=1)
24+
Milestone(number=1)
2525
2626
Create Milestone
2727
----------------
@@ -30,7 +30,7 @@ Create Milestone
3030
3131
>>> repo = g.get_repo('PyGithub/PyGithub')
3232
>>> repo.create_milestone(title='New Milestone')
33-
Milestone(number=1)
33+
Milestone(number=1)
3434
3535
Create Milestone with State and Description
3636
-------------------------------------------
@@ -39,4 +39,4 @@ Create Milestone with State and Description
3939
4040
>>> repo = g.get_repo('PyGithub/PyGithub')
4141
>>> repo.create_milestone(title='New Milestone', state='open', description='Milestone description')
42-
Milestone(number=1)
42+
Milestone(number=1)

doc/examples/PullRequest.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ Get Pull Requests by Query
3535
.. code-block:: python
3636
3737
>>> repo = g.get_repo("PyGithub/PyGithub")
38-
>>> pulls = repo.get_pulls(state='open', sort='created', base='master')
38+
>>> pulls = repo.get_pulls(state='open', sort='created', base='master')
3939
>>> for pr in pulls:
4040
... print(pr.number)
41-
...
41+
...
4242
400
4343
861
4444
875
4545
876
46-
46+
4747
Add and modify Pull Request comment
4848
-----------------------------------
4949

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ PyGithub
77
introduction
88
examples
99
reference
10-
changes
10+
changes

doc/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Projects using PyGithub
8383
* https://github.com/plus3it/satsuki - Automate GitHub releases and uploading binary release assets
8484
* `check-in <https://github.com/webknjaz/check-in>`_ — Python CLI distribution that allows user to use GitHub Checks API as a bot.
8585
* https://github.com/hasii2011/gittodoistclone - Convert GitHub issues to Todoist tasks
86-
86+
8787
They talk about PyGithub
8888
------------------------
8989

github/PublicKey.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def _useAttributes(self, attributes: dict[str, Any]) -> None:
7575
if "key" in attributes: # pragma no branch
7676
self._key = self._makeStringAttribute(attributes["key"])
7777
if "key_id" in attributes: # pragma no branch
78-
if type(attributes["key_id"]) == str:
78+
if isinstance(attributes["key_id"], str):
7979
self._key_id = self._makeStringAttribute(attributes["key_id"])
8080
else:
8181
self._key_id = self._makeIntAttribute(attributes["key_id"])

0 commit comments

Comments
 (0)