Commit Graph
16 Commits
Author SHA1 Message Date
Steve Kowalik e113e37de1 Add pyupgrade to pre-commit configuration (#1783)
To help us switch to f-strings and other 3.6+ changes, add pyupgrade to
our pre-commit configuration to keep the codebase clean.
2020-12-15 14:07:33 +11:00
Florent Clarret ee4c7a7e9e feat(pullrequest): add the rebaseable attribute (#1690) 2020-10-26 16:44:31 +11:00
Steve Kowalik 07e29fe014 Format with new black (#1679)
Black is very opinionated, but sometimes those opinions change. Run the
new black version across the codebase, and lock down the version used by
pre-commit so we don't get surprised like this again.
2020-09-02 14:59:09 +10:00
Steve Kowalik 291c46303d Drastically increase coverage by checking repr() (#1521)
A lot of our missing coverage is caused by not checking repr(), which is
trivial enough to test against -- do so, and also clean up existing repr
tests to look the same by calling repr(). Where it was trivial, add a
few assertions about missing attributes.
2020-05-19 11:54:07 +10:00
Florent Clarret e0997b438e Add and handle the maintainer_can_modify attribute in PullRequest (#1465) 2020-04-26 10:04:12 +08:00
Steve Kowalik b1c35499f4 Don't transform completely in PullRequest.*assignees (#1428)
The two methods PullRequest.add_to_assignees() and
PullRequest.remove_from_assignees() are special, in that they call
POST/DELETE on the issue_url of the pull request, and then transform all
their attributes based on what was returned. This has a number of
effects, none of them any good for calling new methods on the same pull
request object. Instead, only pull out the changed attribute and use
that. Also change the returned URL for the POST call in the replay data
to match what GitHub returns.

Fixes #1406
2020-03-10 12:39:23 +11:00
MarcoFalke bd28524853 Add draft attribute, update test 2020-03-09 12:20:12 +05:30
Steve Kowalik 806130e93d PullRequest.update_branch(): allow expected_head_sha to be empty (#1412)
* PullRequest.update_branch(): allow expected_head_sha to be empty

* PullRequest.testUpdateBranch(): test also with empty expected_head_sha

* Updated replay data for PullRequest.testUpdateBranch

* tox formatted changes
2020-03-06 11:00:40 +11:00
Steve Kowalik 37122cf2bb Switch to no argument super() (#1361)
Now that Python 2 support is gone, we can switch to no argument super()
rather than calling our superclass by name.
2020-01-21 21:15:22 +11:00
Steve Kowalik b7894ea00c Drop Python 2 support (#1329)
With the Python 2 deadline gone, it's time to move with the times and
switch to Python 3 only.
2020-01-06 18:01:38 +11:00
Tim Gates baddb7193f Add support for update branch (#1317)
* Add Support for PullRequest update-branch

* Add test case

* Fix test case

* Add test data record

* Update PullRequest.py

* Update PullRequest.py

* Support py2.7

* Assert response status is 202

* black + isort
2019-12-12 20:50:25 +08:00
Wan Liuyang 6ceb9e9a15 Apply black to whole codebase (#1303) 2019-12-10 17:14:33 +08:00
Pavan Kunisetty a163ba1562 Add assignee removal/addition support to PRs (#1241)
Add assignee removal/addition support to PRs
Fixes #1109

Add test for new PR assignee functionality

Add record file

Addressed comments on #1016
2019-10-22 21:34:55 +11:00
Steve Kowalik dc2f2ad8cb Switch to using six (#1189)
With the Python 2.7 deadline fast approaching, modernize the codebase
making use of the modernize module to switch to using six, as well as
other upcoming features, such as absolute imports . Stop using 2to3
for Travis, yay!
2019-08-05 14:06:19 +10:00
Mark Browning acd515aaec Adds get_issue_events to PullRequest object (#1154)
* Adds `get_issue_events` to `PullRequest` object

* Add unit test for

* Fix PullRequest.get_issue_events unit test

Use actual event ids...

* Fix missing import on PullRequest.

I wish the unit tests would run in Python3...

* Add PulReqeust.testGetIssueEvents ReplayData

* Updating replay data to use developer's personal credentials.
2019-07-03 08:52:11 +08:00
TechnicalPirate 78d283b9b5 Updated setup.py to exclude tests (#1031)
# Problem #
The `.whl` available on PyPi for this repository contains its entire `tests` submodule. 

The total size of the `pygithub` module is less than `1mb` without tests and `>23mb` with. 

Previous discussions on this topic indicated the removal of tests would be accepted if someone created a pull request to do so: https://github.com/PyGithub/PyGithub/issues/672 

This is that pull request! 😄

# Solution/Implementation # 

- Moved "tests" to root of the repository ( outside the package ) 
    - Added `tests.` module path to the imports in `AllTests.py`
- Updated `setup.py`
    - Removed `package_data` from product
    - Removed "tests" from packages definition
    - Repointed `test_suite` to new location
- Updated `travis.yml`
    - Added conditional ( if not `py2.7` ) conversion of code to `py3`

_... apologies for all the failed build spam below - new to working with Travis CI / had some gotcha moments!_
2019-04-16 11:45:02 +08:00