Commit Graph
93 Commits
Author SHA1 Message Date
Trim21 294c0cc9c5 Enable mypy disallow_untyped_defs (#2609) 2023-07-14 21:47:24 +02:00
Jirka Borovec 13e178a3ab Set line length to 120 characters (#2599) 2023-07-13 17:37:20 +02:00
Mauricio Alejandro Martínez PachecoandEnrico Minack 91b3f40f79 Add support for repo and org level actions variables (#2580)
Co-authored-by: Enrico Minack <github@enrico.minack.dev>
2023-07-07 15:29:30 +02:00
Enrico MinackandJohn T. Wodder II 0177f7c513 Make datetime objects timezone-aware (#2565)
Comparing timestamps returned by the API with naive datetime objects (without timezone information) will raise an error. Add `tzinfo=datetime.timezone.utc` to your datetime instance.

Co-authored-by: John T. Wodder II <git@varonathe.org>
2023-06-28 21:47:48 +02:00
Jonathan GregandEnrico Minack 517ad33654 Add Webhook Deliveries (#2508)
Co-authored-by: Enrico Minack <github@enrico.minack.dev>
2023-06-20 08:49:02 +02:00
Jonathan Leitschuh b94a83cbf3 Add new create_fork arguments (#2493)
Adds support for new `create_fork` arguments:
 - `name` - To set the name of the fork on creation
 - `default_branch_only` - To only include the default branch

Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
2023-05-23 17:40:02 +02:00
Felipe Peter bab4180fd5 Add allow_update_branch option to Organization (#2465) 2023-05-08 20:16:36 +02:00
b50283a7cf Create repo from template (#2090)
Co-authored-by: bagashvilit <bagashvilit@allegheny.edu>
Co-authored-by: WonjoonC <chos@allegheny.edu>
Co-authored-by: Isac Souza <isouza@daitangroup.com>
Co-authored-by: Isac Souza <isouza@daitan.com>
Co-authored-by: Liuyang Wan <tsfdye@gmail.com>
2022-10-13 09:13:31 +08:00
Tanner 8d1397af2f Add support for 'visibility' attribute preview for Repositories (#1872)
Expose the new 'visibility' attribute for repository objects.

Fixes #1446
2021-11-01 21:02:16 +11:00
James Simpson 53fb49882f Implement organization.cancel_invitation() (#2072)
Implement a new function cancel_invitation for github.Organization objects, allowing for
cancellation of organization invitations.
2021-10-13 16:22:54 +11:00
Marina Peresypkina bc5e5950aa Add github actions secrets to org (#2006)
Add functionality to create and delete Secrets for Organizations.
2021-10-13 15:33:18 +11:00
Mark Walker ab36b89aa5 Fixed links to github docs. [#2009] 2021-07-31 02:34:34 +01:00
Steve Kowalik babcbcd04f Update most URLs to docs.github.com (#1896)
Now that GitHub have moved their documentation from
developer.github.com, we should update our links. I have also tried to
update the call strings to their new format, but since it was done via
regex, some of them may not match exactly.
2021-03-26 20:43:48 +11:00
Steve Kowalik 290b62726f Switch all string addition to using f-strings (#1774)
Now that we no longer support Python 3.5, stop using string addition
everywhere it makes sense, and move to the best feature 3.6+ gives us,
f-strings!
2021-03-03 14:50:57 +11:00
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
latacora-daniel b42fb244f2 Added get_installations() to Organizations (#1695)
* Added get_installations() to Organizations

Fixes #1694
2020-10-28 14:00:47 +11:00
ton-katsu 3ab97d6145 Add some attributes. (#1468)
* Add some attributes to Repository and Organization

* Format.

* small fix

* Add some test.
2020-04-21 11:49:32 +10:00
Anuj Bansal 801ea38551 Add create project method and tests 2020-03-15 22:12:44 +05:30
Glenn McDonald 9564cd4de7 Add repo edit support for delete_branch_on_merge (#1381)
* Add repo edit support for delete_branch_on_merge

* Assert delete_branch_on_merge
2020-02-11 12:24:33 +11:00
Steve Kowalik fc4eff3185 Fix all but one sphinx warnings (#1346)
To hopefully correct our doc build, tidy up some of the warnings that
sphinx complains about. The one remaining one is legitimate.
2020-01-11 10:15:34 +10: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
Wan Liuyang 540a085001 Fix isort - add known first and third party 2019-12-11 00:54:59 +08:00
Wan Liuyang 6ceb9e9a15 Apply black to whole codebase (#1303) 2019-12-10 17:14:33 +08:00
Steve Kowalik f93207b4ca Run flake8 in Travis (#1163)
Clean up a few errors I missed, ignore another, and configure flake8 using
a config file to ignore certain errors. The next step would be to remove
the F* ignores.
2019-08-05 15:03:10 +10: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
ebrown a0731685f5 Add two factor attributes on organizations (#1132)
* Add 2fa attribute on organizations

* Fix property name and test value
2019-07-03 14:51:28 +08:00
Steve Kowalik 828b53b756 Silence more flake8 errors (#1160)
Make more whitespace changes to silence flake8 errors under the github
directory only.
2019-07-02 17:55:04 +08:00
Steve Kowalik b8dad9817e Clean up a lot of pyflakes warnings (#1153)
Clean up unused imports or unused variables to mostly silence pyflakes.
We aren't quite yet in a place where we can run it via Travis, but baby
steps.
2019-07-02 18:06:09 +10:00
Shibasis PatelandWan Liuyang edab176b5d Adding support for pending team invitations (#993)
* fixes issue#823

* Update GithubObject.py

* Added tests for Pending team invitations(Issue#823)


Co-authored-by: Wan Liuyang <tsfdye@gmail.com>
2019-06-28 11:35:58 +08:00
Pascal Bach 03939fe55c Fix assertion in add_to_members (#1146)
The role parameter is set to NotSet by default
but the assertion only allowed str and unicode.
So it would always fail. Add NotSet to the assertion
to allow calling the function without a role.

Signed-off-by: Pascal Bach <pascal.bach@nextrem.ch>
2019-06-21 10:01:15 +08:00
Geoffroy Jabouley ef6f009dc3 Add sorting capability to Organization.get_repos() (#1139) 2019-06-20 15:51:55 +08:00
Steve Kowalik 4349bca136 Add new Organization.get_team_by_slug method (#1144)
Add a new API call to Organization that allows fetching teams by
slug.

Closes #1116
2019-06-20 15:40:20 +08:00
Brian Choy 4a37860bc4 Add description field when creating a new team (#1125) 2019-05-23 08:07:53 +08:00
Raihaan 480f91cf1d Fix Organization.add_to_members() role passing (#1039)
* Fix role passing

* Fix typo

* Fix another typo

* Move parameter to JSON payload

* Move parameter to JSON payload

* Add content type

* Add content type

* Double Quotes

* Double quotes
2019-02-12 14:39:44 +08:00
Shubham Singh b4d895eddd Adding migration api wrapper (#899)
Closes #818
2018-12-21 12:01:01 +08:00
Yossarian King faca4ce1c0 Add support for projects (#854)
Initial solution for [PyGithub support for projects](https://github.com/PyGithub/PyGithub/issues/606) (#606). Adds comprehensive project querying API.

Currently does not support for modifying projects, columns or cards. (I only need this interface for reporting purposes. Of course once I'm done others are more than welcome to add additional features!)

API that was integrated:
https://developer.github.com/v3/projects
https://developer.github.com/v3/projects/columns
https://developer.github.com/v3/projects/cards

Note that the Github project API is in preview mode - it requires a special header in order for requests to be processed, and the API is subject to change without notice.

## Summary
- new classes: Project, ProjectColumn, ProjectCard
- add Organization.get_projects method
- add Repository.get_projects method
- add MainClass.get_project method
- add test cases to exercise all new classes and methods and verify attributes are as expected; replay data is included, recorded (mostly) from my fork of PyGithub
- updated add_attribute script to:
  - use makeXXXAttribute API
  - be able to add to the end of the current set of properties
  - handle both Completable and NonCompletable class types correctly

## Checklist
Not to be merged until these are done:

- [x] remaining Project properties
- [x] remaining ProjectColumn properties
- [x] remaining ProjectCard properties
- [x] support for archived_state parameter when getting cards: all,archived, or not_archived
- [x] get issue from card, not just pull request ("get_content" method?)
- [x] centralize header management for "preview" access to projects API
- [x] add test for retrieving organization projects
- [x] add test for getting issue / pull request content from card
2018-09-11 13:05:16 +08:00
Steve Kowalik eb80564b01 Implement Organization.invite_user (#880)
Utilize the API preview for the organization invite system to allow
organization owners to invite outside colloborators either via passing
in the user directly, or their email address.
    
Fixes #851
2018-08-28 14:29:23 +08:00
Wan Liuyang 7c73d8de4e Fix Organization display name 2018-08-21 15:25:56 +08:00
Wan Liuyang 3f0caa4057 Sync copyright header 2018-08-19 10:47:41 +08:00
Jacopo Notarstefano 1d91880967 Add description to Organizations (#838)
As mentioned in https://developer.github.com/v3/orgs/, an organization also has a description. This PR adds this attribute to the `Organization` class, as well as modifies its `edit` method so that it's possible to update it.

I noticed too late the [`add_attribute.py` script](https://github.com/PyGithub/PyGithub/blob/8ae2bcb1e6f96beeec99fbbcf00f4af46bb38cde/scripts/add_attribute.py), so I did my modifications by hand, but I noticed that the output of the script and the style used for all the other attributes are different. I preferred the style that is prevalent in the file, rather than the output of the script.
2018-07-10 15:04:29 +08:00
Jasper van Wanrooy c44469965e API outside collaborators (#533)
* API outside collaborators

* Include remaining to organization api calls.
2018-04-19 10:00:15 +08:00
Tim Boring 4da483d1c0 Add add_to_members() and remove_from_membership() (#741)
* Add methods add_to_members(), has_in_pending_members(), and remove_from_membership() methods to Organization class.

* Add scrubbed replay files used for testing

* More massaging of test data

* Fix URL to remove organization membership

* Remove `has_in_pending_members()` method
2018-04-09 22:44:22 +08:00
Raihaan 5cb5ab71b3 Add team privacy parameter to create team (#702)
* Add team privacy and add additional parameter to test. Still requires replaydata

* Reorder parameters to not break existing code

* Update tests for #702
2018-04-06 17:08:34 +08:00
sfdye 365a0a24d3 Apply fix_headers script to update copyright info 2018-03-17 20:06:16 +08:00
sfdye 58e1ef9ccb Fix copyright formatting 2018-03-13 22:30:47 +08:00
sfdye 020c136a40 Update doc link in copyright text 2018-03-13 22:07:38 +08:00
Anton Nguyen c7f6563c34 Add hook support for organizations (#729)
* Add hook support for organizations
Specifically, the create_hook, get_hook, and get_hooks calls

* Added support for the edit and delete hook functions
2018-03-12 23:02:52 +08:00
Balázs Rostás 5c41120a8a Added missing parameters for repo creation (#623)
* Added missing parameters to organisation repo creation

* team_id should already be an id not a team object

* Name arguments in the test

* Fixed assertion check

* Added missing parameters to user repo creation

* Fixed comments
2017-11-27 14:25:00 -08:00
Matthew Neal 0154c6b0d5 Support HTTP 302 redirect in Organization.has_in_members 2017-01-18 22:13:14 -06:00
Michael Pereira f119147399 Add details of repo type for get_repos documentation
Taken from https://developer.github.com/v3/repos/#list-organization-repositories
2017-01-17 12:56:17 -06:00