Skip to content
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

Add delete_branch_on_merge arg to Repository.edit type stub #1639

Merged
merged 1 commit into from Aug 5, 2020
Merged

Add delete_branch_on_merge arg to Repository.edit type stub #1639

merged 1 commit into from Aug 5, 2020

Conversation

ethanroy
Copy link
Contributor

@ethanroy ethanroy commented Aug 4, 2020

example

from github import Github

Github().get_repo("").edit(
    has_issues=False,
    has_projects=False,
    has_wiki=False,
    default_branch="master",
    allow_squash_merge=False,
    allow_merge_commit=True,
    allow_rebase_merge=False,
    delete_branch_on_merge=False,
)

before changes

% mypy example.py
example.py:3: error: Unexpected keyword argument "delete_branch_on_merge" for "edit" of "Repository"
github/Repository.pyi:219: note: "edit" of "Repository" defined here
Found 1 error in 1 file (checked 1 source file)

after changes

% mypy example.py
Success: no issues found in 1 source file

#### example
```python3
from github import Github

Github().get_repo("").edit(
    has_issues=False,
    has_projects=False,
    has_wiki=False,
    default_branch="master",
    allow_squash_merge=False,
    allow_merge_commit=True,
    allow_rebase_merge=False,
    delete_branch_on_merge=False,
)
```

#### before changes
```console
% mypy example.py
example.py:3: error: Unexpected keyword argument 
"delete_branch_on_merge" for "edit" of "Repository"
github/Repository.pyi:219: note: "edit" of "Repository" defined here
Found 1 error in 1 file (checked 1 source file)
```

#### after changes
```console
% mypy example.py
Success: no issues found in 1 source file
```
@codecov-commenter
Copy link

Codecov Report

Merging #1639 into master will increase coverage by 0.14%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1639      +/-   ##
==========================================
+ Coverage   98.52%   98.66%   +0.14%     
==========================================
  Files          48       48              
  Lines        2304     2555     +251     
==========================================
+ Hits         2270     2521     +251     
  Misses         34       34              
Impacted Files Coverage Δ
github/Path.py 100.00% <0.00%> (ø)
github/Plan.py 100.00% <0.00%> (ø)
github/Rate.py 100.00% <0.00%> (ø)
github/View.py 100.00% <0.00%> (ø)
github/Clones.py 100.00% <0.00%> (ø)
github/GistFile.py 100.00% <0.00%> (ø)
github/Referrer.py 100.00% <0.00%> (ø)
github/GitAuthor.py 100.00% <0.00%> (ø)
github/GitObject.py 100.00% <0.00%> (ø)
github/RateLimit.py 100.00% <0.00%> (ø)
... and 36 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5ad091d...2970abe. Read the comment docs.

@s-t-e-v-e-n-k s-t-e-v-e-n-k merged commit 15b5ae0 into PyGithub:master Aug 5, 2020
@dato
Copy link

dato commented Oct 2, 2020

I think this is needed in Organization.create_repo too?

https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#create-an-organization-repository

dato added a commit to dato/algo2_sistema_entregas that referenced this pull request Oct 2, 2020
Also:

  - actualizar PyGithub de 1.51 a 1.53 para los typing hints de
    delete_branch_on_merge (PyGithub/PyGithub#1639, incompleta)

  - eliminar ramas de except KeyError/ValueError que ya no aplican
    tras el último refactor a alu_repos.py
dato added a commit to algoritmos-rw/algo2_sistema_entregas that referenced this pull request Oct 2, 2020
)

Also:

  - actualizar PyGithub de 1.51 a 1.53 para los typing hints de
    delete_branch_on_merge (PyGithub/PyGithub#1639, incompleta)

  - eliminar ramas de except KeyError/ValueError que ya no aplican
    tras el último refactor a alu_repos.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants