././@PaxHeader 0000000 0000000 0000000 00000000034 00000000000 010212 x ustar 00 28 mtime=1619412318.9267669
PyGithub-1.55/ 0000755 0001751 0000171 00000000000 00000000000 012537 5 ustar 00runner docker ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/COPYING 0000644 0001751 0000171 00000104513 00000000000 013576 0 ustar 00runner docker GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/COPYING.LESSER 0000644 0001751 0000171 00000016743 00000000000 014601 0 ustar 00runner docker GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/MANIFEST.in 0000644 0001751 0000171 00000000043 00000000000 014272 0 ustar 00runner docker include COPYING*
include README.md
././@PaxHeader 0000000 0000000 0000000 00000000034 00000000000 010212 x ustar 00 28 mtime=1619412318.9267669
PyGithub-1.55/PKG-INFO 0000644 0001751 0000171 00000003343 00000000000 013637 0 ustar 00runner docker Metadata-Version: 2.1
Name: PyGithub
Version: 1.55
Summary: Use the full Github API v3
Home-page: https://github.com/pygithub/pygithub
Author: Vincent Jacques
Author-email: vincent@vincent-jacques.net
License: UNKNOWN
Project-URL: Documentation, http://pygithub.readthedocs.io/en/latest/
Project-URL: Source, https://github.com/pygithub/pygithub
Project-URL: Tracker, https://github.com/pygithub/pygithub/issues
Description: (Very short) Tutorial
=====================
First create a Github instance::
from github import Github
# using username and password
g = Github("user", "password")
# or using an access token
g = Github("access_token")
Then play with your Github objects::
for repo in g.get_user().get_repos():
print(repo.name)
repo.edit(has_wiki=False)
Reference documentation
=======================
See http://pygithub.readthedocs.io/en/latest/
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development
Requires-Python: >=3.6
Provides-Extra: integrations
././@PaxHeader 0000000 0000000 0000000 00000000034 00000000000 010212 x ustar 00 28 mtime=1619412318.9027653
PyGithub-1.55/PyGithub.egg-info/ 0000755 0001751 0000171 00000000000 00000000000 015764 5 ustar 00runner docker ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412318.0
PyGithub-1.55/PyGithub.egg-info/PKG-INFO 0000644 0001751 0000171 00000003343 00000000000 017064 0 ustar 00runner docker Metadata-Version: 2.1
Name: PyGithub
Version: 1.55
Summary: Use the full Github API v3
Home-page: https://github.com/pygithub/pygithub
Author: Vincent Jacques
Author-email: vincent@vincent-jacques.net
License: UNKNOWN
Project-URL: Documentation, http://pygithub.readthedocs.io/en/latest/
Project-URL: Source, https://github.com/pygithub/pygithub
Project-URL: Tracker, https://github.com/pygithub/pygithub/issues
Description: (Very short) Tutorial
=====================
First create a Github instance::
from github import Github
# using username and password
g = Github("user", "password")
# or using an access token
g = Github("access_token")
Then play with your Github objects::
for repo in g.get_user().get_repos():
print(repo.name)
repo.edit(has_wiki=False)
Reference documentation
=======================
See http://pygithub.readthedocs.io/en/latest/
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development
Requires-Python: >=3.6
Provides-Extra: integrations
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412318.0
PyGithub-1.55/PyGithub.egg-info/SOURCES.txt 0000644 0001751 0000171 00000012122 00000000000 017646 0 ustar 00runner docker COPYING
COPYING.LESSER
MANIFEST.in
README.md
setup.py
PyGithub.egg-info/PKG-INFO
PyGithub.egg-info/SOURCES.txt
PyGithub.egg-info/dependency_links.txt
PyGithub.egg-info/requires.txt
PyGithub.egg-info/top_level.txt
github/AccessToken.py
github/AccessToken.pyi
github/ApplicationOAuth.py
github/ApplicationOAuth.pyi
github/AuthenticatedUser.py
github/AuthenticatedUser.pyi
github/Authorization.py
github/Authorization.pyi
github/AuthorizationApplication.py
github/AuthorizationApplication.pyi
github/Branch.py
github/Branch.pyi
github/BranchProtection.py
github/BranchProtection.pyi
github/CheckRun.py
github/CheckRun.pyi
github/CheckRunAnnotation.py
github/CheckRunAnnotation.pyi
github/CheckRunOutput.py
github/CheckRunOutput.pyi
github/CheckSuite.py
github/CheckSuite.pyi
github/Clones.py
github/Clones.pyi
github/Commit.py
github/Commit.pyi
github/CommitCombinedStatus.py
github/CommitCombinedStatus.pyi
github/CommitComment.py
github/CommitComment.pyi
github/CommitStats.py
github/CommitStats.pyi
github/CommitStatus.py
github/CommitStatus.pyi
github/Comparison.py
github/Comparison.pyi
github/Consts.py
github/ContentFile.py
github/ContentFile.pyi
github/Deployment.py
github/Deployment.pyi
github/DeploymentStatus.py
github/DeploymentStatus.pyi
github/Download.py
github/Download.pyi
github/Event.py
github/Event.pyi
github/File.py
github/File.pyi
github/Gist.py
github/Gist.pyi
github/GistComment.py
github/GistComment.pyi
github/GistFile.py
github/GistFile.pyi
github/GistHistoryState.py
github/GistHistoryState.pyi
github/GitAuthor.py
github/GitAuthor.pyi
github/GitBlob.py
github/GitBlob.pyi
github/GitCommit.py
github/GitCommit.pyi
github/GitObject.py
github/GitObject.pyi
github/GitRef.py
github/GitRef.pyi
github/GitRelease.py
github/GitRelease.pyi
github/GitReleaseAsset.py
github/GitReleaseAsset.pyi
github/GitTag.py
github/GitTag.pyi
github/GitTree.py
github/GitTree.pyi
github/GitTreeElement.py
github/GitTreeElement.pyi
github/GithubApp.py
github/GithubApp.pyi
github/GithubException.py
github/GithubException.pyi
github/GithubObject.py
github/GithubObject.pyi
github/GitignoreTemplate.py
github/GitignoreTemplate.pyi
github/Hook.py
github/Hook.pyi
github/HookDescription.py
github/HookDescription.pyi
github/HookResponse.py
github/HookResponse.pyi
github/InputFileContent.py
github/InputFileContent.pyi
github/InputGitAuthor.py
github/InputGitAuthor.pyi
github/InputGitTreeElement.py
github/InputGitTreeElement.pyi
github/Installation.py
github/Installation.pyi
github/InstallationAuthorization.py
github/InstallationAuthorization.pyi
github/Invitation.py
github/Invitation.pyi
github/Issue.py
github/Issue.pyi
github/IssueComment.py
github/IssueComment.pyi
github/IssueEvent.py
github/IssueEvent.pyi
github/IssuePullRequest.py
github/IssuePullRequest.pyi
github/Label.py
github/Label.pyi
github/License.py
github/License.pyi
github/MainClass.py
github/MainClass.pyi
github/Membership.py
github/Membership.pyi
github/Migration.py
github/Migration.pyi
github/Milestone.py
github/Milestone.pyi
github/NamedUser.py
github/NamedUser.pyi
github/Notification.py
github/Notification.pyi
github/NotificationSubject.py
github/NotificationSubject.pyi
github/Organization.py
github/Organization.pyi
github/PaginatedList.py
github/PaginatedList.pyi
github/Path.py
github/Path.pyi
github/Permissions.py
github/Permissions.pyi
github/Plan.py
github/Plan.pyi
github/Project.py
github/Project.pyi
github/ProjectCard.py
github/ProjectCard.pyi
github/ProjectColumn.py
github/ProjectColumn.pyi
github/PublicKey.py
github/PublicKey.pyi
github/PullRequest.py
github/PullRequest.pyi
github/PullRequestComment.py
github/PullRequestComment.pyi
github/PullRequestMergeStatus.py
github/PullRequestMergeStatus.pyi
github/PullRequestPart.py
github/PullRequestPart.pyi
github/PullRequestReview.py
github/PullRequestReview.pyi
github/Rate.py
github/Rate.pyi
github/RateLimit.py
github/RateLimit.pyi
github/Reaction.py
github/Reaction.pyi
github/Referrer.py
github/Referrer.pyi
github/Repository.py
github/Repository.pyi
github/RepositoryKey.py
github/RepositoryKey.pyi
github/RepositoryPreferences.py
github/RepositoryPreferences.pyi
github/Requester.py
github/Requester.pyi
github/RequiredPullRequestReviews.py
github/RequiredPullRequestReviews.pyi
github/RequiredStatusChecks.py
github/RequiredStatusChecks.pyi
github/SelfHostedActionsRunner.py
github/SelfHostedActionsRunner.pyi
github/SourceImport.py
github/SourceImport.pyi
github/Stargazer.py
github/Stargazer.pyi
github/StatsCodeFrequency.py
github/StatsCodeFrequency.pyi
github/StatsCommitActivity.py
github/StatsCommitActivity.pyi
github/StatsContributor.py
github/StatsContributor.pyi
github/StatsParticipation.py
github/StatsParticipation.pyi
github/StatsPunchCard.py
github/StatsPunchCard.pyi
github/Tag.py
github/Tag.pyi
github/Team.py
github/Team.pyi
github/TeamDiscussion.py
github/TeamDiscussion.pyi
github/TimelineEvent.py
github/TimelineEvent.pyi
github/TimelineEventSource.py
github/TimelineEventSource.pyi
github/Topic.py
github/Topic.pyi
github/UserKey.py
github/UserKey.pyi
github/View.py
github/View.pyi
github/Workflow.py
github/Workflow.pyi
github/WorkflowRun.py
github/WorkflowRun.pyi
github/__init__.py
github/__init__.pyi
github/py.typed ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412318.0
PyGithub-1.55/PyGithub.egg-info/dependency_links.txt 0000644 0001751 0000171 00000000001 00000000000 022032 0 ustar 00runner docker
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412318.0
PyGithub-1.55/PyGithub.egg-info/requires.txt 0000644 0001751 0000171 00000000122 00000000000 020357 0 ustar 00runner docker deprecated
pyjwt>=2.0
pynacl>=1.4.0
requests>=2.14.0
[integrations]
cryptography
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412318.0
PyGithub-1.55/PyGithub.egg-info/top_level.txt 0000644 0001751 0000171 00000000007 00000000000 020513 0 ustar 00runner docker github
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/README.md 0000644 0001751 0000171 00000004441 00000000000 014021 0 ustar 00runner docker # PyGitHub
[](https://pypi.python.org/pypi/PyGithub)

[](https://pygithub.readthedocs.io/en/latest/?badge=latest)
[](https://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License)
[](https://join.slack.com/t/pygithub-project/shared_invite/zt-duj89xtx-uKFZtgAg209o6Vweqm8xeQ)
[](https://www.codetriage.com/pygithub/pygithub)
[](https://codecov.io/gh/PyGithub/PyGithub)
[](https://github.com/psf/black)
PyGitHub is a Python library to access the [GitHub REST API].
This library enables you to manage [GitHub] resources such as repositories, user profiles, and organizations in your Python applications.
[GitHub REST API]: https://docs.github.com/en/rest
[GitHub]: https://github.com
## Install
```bash
$ pip install PyGithub
```
## Simple Demo
```python
from github import Github
# First create a Github instance:
# using an access token
g = Github("access_token")
# Github Enterprise with custom hostname
g = Github(base_url="https://{hostname}/api/v3", login_or_token="access_token")
# Then play with your Github objects:
for repo in g.get_user().get_repos():
print(repo.name)
```
## Documentation
More information can be found on the [PyGitHub documentation site.](https://pygithub.readthedocs.io/en/latest/introduction.html)
## Development
### Contributing
Long-term discussion and bug reports are maintained via GitHub Issues.
Code review is done via GitHub Pull Requests.
For more information read [CONTRIBUTING.md].
[CONTRIBUTING.md]: /CONTRIBUTING.md
### Maintainership
We're actively seeking maintainers that will triage issues and pull requests and cut releases.
If you work on a project that leverages PyGitHub and have a vested interest in keeping the code alive and well, send an email to someone in the MAINTAINERS file.
././@PaxHeader 0000000 0000000 0000000 00000000034 00000000000 010212 x ustar 00 28 mtime=1619412318.9267669
PyGithub-1.55/github/ 0000755 0001751 0000171 00000000000 00000000000 014021 5 ustar 00runner docker ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/AccessToken.py 0000644 0001751 0000171 00000005750 00000000000 016604 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2019 Rigas Papathanasopoulos #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
import github.GithubObject
class AccessToken(github.GithubObject.NonCompletableGithubObject):
"""
This class represents access tokens.
"""
def __repr__(self):
return self.get__repr__(
{
"token": "{}...".format(self.token[:5]),
"scope": self.scope,
"type": self.type,
}
)
@property
def token(self):
"""
:type: string
"""
return self._token.value
@property
def type(self):
"""
:type: string
"""
return self._type.value
@property
def scope(self):
"""
:type: string
"""
return self._scope.value
def _initAttributes(self):
self._token = github.GithubObject.NotSet
self._type = github.GithubObject.NotSet
self._scope = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "access_token" in attributes: # pragma no branch
self._token = self._makeStringAttribute(attributes["access_token"])
if "token_type" in attributes: # pragma no branch
self._type = self._makeStringAttribute(attributes["token_type"])
if "scope" in attributes: # pragma no branch
self._scope = self._makeStringAttribute(attributes["scope"])
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/AccessToken.pyi 0000644 0001751 0000171 00000000646 00000000000 016754 0 ustar 00runner docker from typing import Any, Dict
from github.GithubObject import NonCompletableGithubObject
class AccessToken(NonCompletableGithubObject):
def __repr__(self) -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
@property
def token(self) -> str: ...
@property
def type(self) -> str: ...
@property
def scope(self) -> str: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/ApplicationOAuth.py 0000644 0001751 0000171 00000011323 00000000000 017577 0 ustar 00runner docker ############################ Copyrights and license ###########################
# #
# Copyright 2019 Rigas Papathanasopoulos #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more#
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
###############################################################################
import urllib
import github.GithubObject
from github.AccessToken import AccessToken
class ApplicationOAuth(github.GithubObject.NonCompletableGithubObject):
"""
This class is used for identifying and authorizing users for Github Apps.
The reference can be found at https://docs.github.com/en/developers/apps/identifying-and-authorizing-users-for-github-apps
"""
def __repr__(self):
return self.get__repr__({"client_id": self._client_id.value})
@property
def client_id(self):
return self._client_id.value
@property
def client_secret(self):
return self._client_secret.value
def _initAttributes(self):
self._client_id = github.GithubObject.NotSet
self._client_secret = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "client_id" in attributes: # pragma no branch
self._client_id = self._makeStringAttribute(attributes["client_id"])
if "client_secret" in attributes: # pragma no branch
self._client_secret = self._makeStringAttribute(attributes["client_secret"])
def get_login_url(self, redirect_uri=None, state=None, login=None):
"""
Return the URL you need to redirect a user to in order to authorize
your App.
:type: string
"""
parameters = {"client_id": self.client_id}
if redirect_uri is not None:
assert isinstance(redirect_uri, str), redirect_uri
parameters["redirect_uri"] = redirect_uri
if state is not None:
assert isinstance(state, str), state
parameters["state"] = state
if login is not None:
assert isinstance(login, str), login
parameters["login"] = login
parameters = urllib.parse.urlencode(parameters)
base_url = "https://github.com/login/oauth/authorize"
return f"{base_url}?{parameters}"
def get_access_token(self, code, state=None):
"""
:calls: `POST /login/oauth/access_token `_
:param code: string
:param state: string
"""
assert isinstance(code, str), code
post_parameters = {
"code": code,
"client_id": self.client_id,
"client_secret": self.client_secret,
}
if state is not None:
post_parameters["state"] = state
self._requester._Requester__authorizationHeader = None
headers, data = self._requester.requestJsonAndCheck(
"POST",
"https://github.com/login/oauth/access_token",
headers={
"Accept": "application/json",
"Content-Type": "application/json",
"User-Agent": "PyGithub/Python",
},
input=post_parameters,
)
return AccessToken(
requester=self._requester,
# not required, this is a NonCompletableGithubObject
headers={},
attributes=data,
completed=False,
)
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/ApplicationOAuth.pyi 0000644 0001751 0000171 00000001310 00000000000 017743 0 ustar 00runner docker from typing import Any, Dict, Optional
from github.AccessToken import AccessToken
from github.GithubObject import NonCompletableGithubObject
class ApplicationOAuth(NonCompletableGithubObject):
def __repr__(self) -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
@property
def client_id(self) -> str: ...
@property
def client_secret(self) -> str: ...
def get_login_url(
self,
redirect_uri: Optional[str],
state: Optional[str],
login: Optional[str]
) -> str: ...
def get_access_token(
self,
code: str,
state: Optional[str]
) -> AccessToken: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/AuthenticatedUser.py 0000644 0001751 0000171 00000163144 00000000000 020025 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2012 Steve English #
# Copyright 2012 Vincent Jacques #
# Copyright 2012 Zearin #
# Copyright 2013 AKFish #
# Copyright 2013 Cameron White #
# Copyright 2013 Vincent Jacques #
# Copyright 2013 poulp #
# Copyright 2014 Tomas Radej #
# Copyright 2014 Vincent Jacques #
# Copyright 2016 E. Dunham #
# Copyright 2016 Jannis Gebauer #
# Copyright 2016 Peter Buckley #
# Copyright 2017 Balázs Rostás #
# Copyright 2017 Jannis Gebauer #
# Copyright 2017 Simon #
# Copyright 2018 Wan Liuyang #
# Copyright 2018 bryanhuntesl <31992054+bryanhuntesl@users.noreply.github.com> #
# Copyright 2018 sfdye #
# Copyright 2018 itsbruce #
# Copyright 2019 Rigas Papathanasopoulos #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
import datetime
from collections import namedtuple
import github.Authorization
import github.Event
import github.Gist
import github.GithubObject
import github.Invitation
import github.Issue
import github.Membership
import github.Migration
import github.NamedUser
import github.Notification
import github.Organization
import github.PaginatedList
import github.Plan
import github.Repository
import github.UserKey
from . import Consts
class AuthenticatedUser(github.GithubObject.CompletableGithubObject):
"""
This class represents AuthenticatedUsers as returned by https://docs.github.com/en/rest/reference/users#get-the-authenticated-user
An AuthenticatedUser object can be created by calling ``get_user()`` on a Github object.
"""
def __repr__(self):
return self.get__repr__({"login": self._login.value})
@property
def avatar_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._avatar_url)
return self._avatar_url.value
@property
def bio(self):
"""
:type: string
"""
self._completeIfNotSet(self._bio)
return self._bio.value
@property
def blog(self):
"""
:type: string
"""
self._completeIfNotSet(self._blog)
return self._blog.value
@property
def collaborators(self):
"""
:type: integer
"""
self._completeIfNotSet(self._collaborators)
return self._collaborators.value
@property
def company(self):
"""
:type: string
"""
self._completeIfNotSet(self._company)
return self._company.value
@property
def created_at(self):
"""
:type: datetime.datetime
"""
self._completeIfNotSet(self._created_at)
return self._created_at.value
@property
def disk_usage(self):
"""
:type: integer
"""
self._completeIfNotSet(self._disk_usage)
return self._disk_usage.value
@property
def email(self):
"""
:type: string
"""
self._completeIfNotSet(self._email)
return self._email.value
@property
def events_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._events_url)
return self._events_url.value
@property
def followers(self):
"""
:type: integer
"""
self._completeIfNotSet(self._followers)
return self._followers.value
@property
def followers_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._followers_url)
return self._followers_url.value
@property
def following(self):
"""
:type: integer
"""
self._completeIfNotSet(self._following)
return self._following.value
@property
def following_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._following_url)
return self._following_url.value
@property
def gists_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._gists_url)
return self._gists_url.value
@property
def gravatar_id(self):
"""
:type: string
"""
self._completeIfNotSet(self._gravatar_id)
return self._gravatar_id.value
@property
def hireable(self):
"""
:type: bool
"""
self._completeIfNotSet(self._hireable)
return self._hireable.value
@property
def html_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._html_url)
return self._html_url.value
@property
def id(self):
"""
:type: integer
"""
self._completeIfNotSet(self._id)
return self._id.value
@property
def location(self):
"""
:type: string
"""
self._completeIfNotSet(self._location)
return self._location.value
@property
def login(self):
"""
:type: string
"""
self._completeIfNotSet(self._login)
return self._login.value
@property
def name(self):
"""
:type: string
"""
self._completeIfNotSet(self._name)
return self._name.value
@property
def node_id(self):
"""
:type: string
"""
self._completeIfNotSet(self._node_id)
return self._node_id.value
@property
def organizations_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._organizations_url)
return self._organizations_url.value
@property
def owned_private_repos(self):
"""
:type: integer
"""
self._completeIfNotSet(self._owned_private_repos)
return self._owned_private_repos.value
@property
def plan(self):
"""
:type: :class:`github.Plan.Plan`
"""
self._completeIfNotSet(self._plan)
return self._plan.value
@property
def private_gists(self):
"""
:type: integer
"""
self._completeIfNotSet(self._private_gists)
return self._private_gists.value
@property
def public_gists(self):
"""
:type: integer
"""
self._completeIfNotSet(self._public_gists)
return self._public_gists.value
@property
def public_repos(self):
"""
:type: integer
"""
self._completeIfNotSet(self._public_repos)
return self._public_repos.value
@property
def received_events_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._received_events_url)
return self._received_events_url.value
@property
def repos_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._repos_url)
return self._repos_url.value
@property
def site_admin(self):
"""
:type: bool
"""
self._completeIfNotSet(self._site_admin)
return self._site_admin.value
@property
def starred_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._starred_url)
return self._starred_url.value
@property
def subscriptions_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._subscriptions_url)
return self._subscriptions_url.value
@property
def total_private_repos(self):
"""
:type: integer
"""
self._completeIfNotSet(self._total_private_repos)
return self._total_private_repos.value
@property
def type(self):
"""
:type: string
"""
self._completeIfNotSet(self._type)
return self._type.value
@property
def updated_at(self):
"""
:type: datetime.datetime
"""
self._completeIfNotSet(self._updated_at)
return self._updated_at.value
@property
def url(self):
"""
:type: string
"""
self._completeIfNotSet(self._url)
return self._url.value
def add_to_emails(self, *emails):
"""
:calls: `POST /user/emails `_
:param email: string
:rtype: None
"""
assert all(isinstance(element, str) for element in emails), emails
post_parameters = {"emails": emails}
headers, data = self._requester.requestJsonAndCheck(
"POST", "/user/emails", input=post_parameters
)
def add_to_following(self, following):
"""
:calls: `PUT /user/following/{user} `_
:param following: :class:`github.NamedUser.NamedUser`
:rtype: None
"""
assert isinstance(following, github.NamedUser.NamedUser), following
headers, data = self._requester.requestJsonAndCheck(
"PUT", f"/user/following/{following._identity}"
)
def add_to_starred(self, starred):
"""
:calls: `PUT /user/starred/{owner}/{repo} `_
:param starred: :class:`github.Repository.Repository`
:rtype: None
"""
assert isinstance(starred, github.Repository.Repository), starred
headers, data = self._requester.requestJsonAndCheck(
"PUT", f"/user/starred/{starred._identity}"
)
def add_to_subscriptions(self, subscription):
"""
:calls: `PUT /user/subscriptions/{owner}/{repo} `_
:param subscription: :class:`github.Repository.Repository`
:rtype: None
"""
assert isinstance(subscription, github.Repository.Repository), subscription
headers, data = self._requester.requestJsonAndCheck(
"PUT", f"/user/subscriptions/{subscription._identity}"
)
def add_to_watched(self, watched):
"""
:calls: `PUT /repos/{owner}/{repo}/subscription `_
:param watched: :class:`github.Repository.Repository`
:rtype: None
"""
assert isinstance(watched, github.Repository.Repository), watched
headers, data = self._requester.requestJsonAndCheck(
"PUT",
f"/repos/{watched._identity}/subscription",
input={"subscribed": True},
)
def create_authorization(
self,
scopes=github.GithubObject.NotSet,
note=github.GithubObject.NotSet,
note_url=github.GithubObject.NotSet,
client_id=github.GithubObject.NotSet,
client_secret=github.GithubObject.NotSet,
onetime_password=None,
):
"""
:calls: `POST /authorizations `_
:param scopes: list of string
:param note: string
:param note_url: string
:param client_id: string
:param client_secret: string
:param onetime_password: string
:rtype: :class:`github.Authorization.Authorization`
"""
assert scopes is github.GithubObject.NotSet or all(
isinstance(element, str) for element in scopes
), scopes
assert note is github.GithubObject.NotSet or isinstance(note, str), note
assert note_url is github.GithubObject.NotSet or isinstance(
note_url, str
), note_url
assert client_id is github.GithubObject.NotSet or isinstance(
client_id, str
), client_id
assert client_secret is github.GithubObject.NotSet or isinstance(
client_secret, str
), client_secret
assert onetime_password is None or isinstance(
onetime_password, str
), onetime_password
post_parameters = dict()
if scopes is not github.GithubObject.NotSet:
post_parameters["scopes"] = scopes
if note is not github.GithubObject.NotSet:
post_parameters["note"] = note
if note_url is not github.GithubObject.NotSet:
post_parameters["note_url"] = note_url
if client_id is not github.GithubObject.NotSet:
post_parameters["client_id"] = client_id
if client_secret is not github.GithubObject.NotSet:
post_parameters["client_secret"] = client_secret
if onetime_password is not None:
request_header = {
Consts.headerOTP: onetime_password
} # pragma no cover (Should be covered)
else:
request_header = None
headers, data = self._requester.requestJsonAndCheck(
"POST",
"/authorizations",
input=post_parameters,
headers=request_header,
)
return github.Authorization.Authorization(
self._requester, headers, data, completed=True
)
def create_fork(self, repo):
"""
:calls: `POST /repos/{owner}/{repo}/forks `_
:param repo: :class:`github.Repository.Repository`
:rtype: :class:`github.Repository.Repository`
"""
assert isinstance(repo, github.Repository.Repository), repo
headers, data = self._requester.requestJsonAndCheck(
"POST", f"/repos/{repo.owner.login}/{repo.name}/forks"
)
return github.Repository.Repository(
self._requester, headers, data, completed=True
)
def create_gist(self, public, files, description=github.GithubObject.NotSet):
"""
:calls: `POST /gists `_
:param public: bool
:param files: dict of string to :class:`github.InputFileContent.InputFileContent`
:param description: string
:rtype: :class:`github.Gist.Gist`
"""
assert isinstance(public, bool), public
assert all(
isinstance(element, github.InputFileContent) for element in files.values()
), files
assert description is github.GithubObject.NotSet or isinstance(
description, str
), description
post_parameters = {
"public": public,
"files": {key: value._identity for key, value in files.items()},
}
if description is not github.GithubObject.NotSet:
post_parameters["description"] = description
headers, data = self._requester.requestJsonAndCheck(
"POST", "/gists", input=post_parameters
)
return github.Gist.Gist(self._requester, headers, data, completed=True)
def create_key(self, title, key):
"""
:calls: `POST /user/keys `_
:param title: string
:param key: string
:rtype: :class:`github.UserKey.UserKey`
"""
assert isinstance(title, str), title
assert isinstance(key, str), key
post_parameters = {
"title": title,
"key": key,
}
headers, data = self._requester.requestJsonAndCheck(
"POST", "/user/keys", input=post_parameters
)
return github.UserKey.UserKey(self._requester, headers, data, completed=True)
def create_project(self, name, body=github.GithubObject.NotSet):
"""
:calls: `POST /user/projects `_
:param name: string
:param body: string
:rtype: :class:`github.Project.Project`
"""
assert isinstance(name, str), name
assert body is github.GithubObject.NotSet or isinstance(body, str), body
post_parameters = {
"name": name,
"body": body,
}
headers, data = self._requester.requestJsonAndCheck(
"POST",
"/user/projects",
input=post_parameters,
headers={"Accept": Consts.mediaTypeProjectsPreview},
)
return github.Project.Project(self._requester, headers, data, completed=True)
def create_repo(
self,
name,
description=github.GithubObject.NotSet,
homepage=github.GithubObject.NotSet,
private=github.GithubObject.NotSet,
has_issues=github.GithubObject.NotSet,
has_wiki=github.GithubObject.NotSet,
has_downloads=github.GithubObject.NotSet,
has_projects=github.GithubObject.NotSet,
auto_init=github.GithubObject.NotSet,
license_template=github.GithubObject.NotSet,
gitignore_template=github.GithubObject.NotSet,
allow_squash_merge=github.GithubObject.NotSet,
allow_merge_commit=github.GithubObject.NotSet,
allow_rebase_merge=github.GithubObject.NotSet,
delete_branch_on_merge=github.GithubObject.NotSet,
):
"""
:calls: `POST /user/repos `_
:param name: string
:param description: string
:param homepage: string
:param private: bool
:param has_issues: bool
:param has_wiki: bool
:param has_downloads: bool
:param has_projects: bool
:param auto_init: bool
:param license_template: string
:param gitignore_template: string
:param allow_squash_merge: bool
:param allow_merge_commit: bool
:param allow_rebase_merge: bool
:param delete_branch_on_merge: bool
:rtype: :class:`github.Repository.Repository`
"""
assert isinstance(name, str), name
assert description is github.GithubObject.NotSet or isinstance(
description, str
), description
assert homepage is github.GithubObject.NotSet or isinstance(
homepage, str
), homepage
assert private is github.GithubObject.NotSet or isinstance(
private, bool
), private
assert has_issues is github.GithubObject.NotSet or isinstance(
has_issues, bool
), has_issues
assert has_wiki is github.GithubObject.NotSet or isinstance(
has_wiki, bool
), has_wiki
assert has_downloads is github.GithubObject.NotSet or isinstance(
has_downloads, bool
), has_downloads
assert has_projects is github.GithubObject.NotSet or isinstance(
has_projects, bool
), has_projects
assert auto_init is github.GithubObject.NotSet or isinstance(
auto_init, bool
), auto_init
assert license_template is github.GithubObject.NotSet or isinstance(
license_template, str
), license_template
assert gitignore_template is github.GithubObject.NotSet or isinstance(
gitignore_template, str
), gitignore_template
assert allow_squash_merge is github.GithubObject.NotSet or isinstance(
allow_squash_merge, bool
), allow_squash_merge
assert allow_merge_commit is github.GithubObject.NotSet or isinstance(
allow_merge_commit, bool
), allow_merge_commit
assert allow_rebase_merge is github.GithubObject.NotSet or isinstance(
allow_rebase_merge, bool
), allow_rebase_merge
assert delete_branch_on_merge is github.GithubObject.NotSet or isinstance(
delete_branch_on_merge, bool
), delete_branch_on_merge
post_parameters = {
"name": name,
}
if description is not github.GithubObject.NotSet:
post_parameters["description"] = description
if homepage is not github.GithubObject.NotSet:
post_parameters["homepage"] = homepage
if private is not github.GithubObject.NotSet:
post_parameters["private"] = private
if has_issues is not github.GithubObject.NotSet:
post_parameters["has_issues"] = has_issues
if has_wiki is not github.GithubObject.NotSet:
post_parameters["has_wiki"] = has_wiki
if has_downloads is not github.GithubObject.NotSet:
post_parameters["has_downloads"] = has_downloads
if has_projects is not github.GithubObject.NotSet:
post_parameters["has_projects"] = has_projects
if auto_init is not github.GithubObject.NotSet:
post_parameters["auto_init"] = auto_init
if license_template is not github.GithubObject.NotSet:
post_parameters["license_template"] = license_template
if gitignore_template is not github.GithubObject.NotSet:
post_parameters["gitignore_template"] = gitignore_template
if allow_squash_merge is not github.GithubObject.NotSet:
post_parameters["allow_squash_merge"] = allow_squash_merge
if allow_merge_commit is not github.GithubObject.NotSet:
post_parameters["allow_merge_commit"] = allow_merge_commit
if allow_rebase_merge is not github.GithubObject.NotSet:
post_parameters["allow_rebase_merge"] = allow_rebase_merge
if delete_branch_on_merge is not github.GithubObject.NotSet:
post_parameters["delete_branch_on_merge"] = delete_branch_on_merge
headers, data = self._requester.requestJsonAndCheck(
"POST", "/user/repos", input=post_parameters
)
return github.Repository.Repository(
self._requester, headers, data, completed=True
)
def edit(
self,
name=github.GithubObject.NotSet,
email=github.GithubObject.NotSet,
blog=github.GithubObject.NotSet,
company=github.GithubObject.NotSet,
location=github.GithubObject.NotSet,
hireable=github.GithubObject.NotSet,
bio=github.GithubObject.NotSet,
):
"""
:calls: `PATCH /user `_
:param name: string
:param email: string
:param blog: string
:param company: string
:param location: string
:param hireable: bool
:param bio: string
:rtype: None
"""
assert name is github.GithubObject.NotSet or isinstance(name, str), name
assert email is github.GithubObject.NotSet or isinstance(email, str), email
assert blog is github.GithubObject.NotSet or isinstance(blog, str), blog
assert company is github.GithubObject.NotSet or isinstance(
company, str
), company
assert location is github.GithubObject.NotSet or isinstance(
location, str
), location
assert hireable is github.GithubObject.NotSet or isinstance(
hireable, bool
), hireable
assert bio is github.GithubObject.NotSet or isinstance(bio, str), bio
post_parameters = dict()
if name is not github.GithubObject.NotSet:
post_parameters["name"] = name
if email is not github.GithubObject.NotSet:
post_parameters["email"] = email
if blog is not github.GithubObject.NotSet:
post_parameters["blog"] = blog
if company is not github.GithubObject.NotSet:
post_parameters["company"] = company
if location is not github.GithubObject.NotSet:
post_parameters["location"] = location
if hireable is not github.GithubObject.NotSet:
post_parameters["hireable"] = hireable
if bio is not github.GithubObject.NotSet:
post_parameters["bio"] = bio
headers, data = self._requester.requestJsonAndCheck(
"PATCH", "/user", input=post_parameters
)
self._useAttributes(data)
def get_authorization(self, id):
"""
:calls: `GET /authorizations/{id} `_
:param id: integer
:rtype: :class:`github.Authorization.Authorization`
"""
assert isinstance(id, int), id
headers, data = self._requester.requestJsonAndCheck(
"GET", f"/authorizations/{id}"
)
return github.Authorization.Authorization(
self._requester, headers, data, completed=True
)
def get_authorizations(self):
"""
:calls: `GET /authorizations `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Authorization.Authorization`
"""
return github.PaginatedList.PaginatedList(
github.Authorization.Authorization, self._requester, "/authorizations", None
)
def get_emails(self):
"""
:calls: `GET /user/emails `_
:rtype: list of namedtuples with members email, primary, verified and visibility
"""
headers, data = self._requester.requestJsonAndCheck("GET", "/user/emails")
itemdata = namedtuple("EmailData", data[0].keys())
return [itemdata._make(item.values()) for item in data]
def get_events(self):
"""
:calls: `GET /events `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Event.Event`
"""
return github.PaginatedList.PaginatedList(
github.Event.Event, self._requester, "/events", None
)
def get_followers(self):
"""
:calls: `GET /user/followers `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
"""
return github.PaginatedList.PaginatedList(
github.NamedUser.NamedUser, self._requester, "/user/followers", None
)
def get_following(self):
"""
:calls: `GET /user/following `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
"""
return github.PaginatedList.PaginatedList(
github.NamedUser.NamedUser, self._requester, "/user/following", None
)
def get_gists(self, since=github.GithubObject.NotSet):
"""
:calls: `GET /gists `_
:param since: datetime.datetime format YYYY-MM-DDTHH:MM:SSZ
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Gist.Gist`
"""
assert since is github.GithubObject.NotSet or isinstance(
since, datetime.datetime
), since
url_parameters = dict()
if since is not github.GithubObject.NotSet:
url_parameters["since"] = since.strftime("%Y-%m-%dT%H:%M:%SZ")
return github.PaginatedList.PaginatedList(
github.Gist.Gist, self._requester, "/gists", url_parameters
)
def get_issues(
self,
filter=github.GithubObject.NotSet,
state=github.GithubObject.NotSet,
labels=github.GithubObject.NotSet,
sort=github.GithubObject.NotSet,
direction=github.GithubObject.NotSet,
since=github.GithubObject.NotSet,
):
"""
:calls: `GET /issues `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Issue.Issue`
:param filter: string
:param state: string
:param labels: list of :class:`github.Label.Label`
:param sort: string
:param direction: string
:param since: datetime.datetime
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Issue.Issue`
"""
assert filter is github.GithubObject.NotSet or isinstance(filter, str), filter
assert state is github.GithubObject.NotSet or isinstance(state, str), state
assert labels is github.GithubObject.NotSet or all(
isinstance(element, github.Label.Label) for element in labels
), labels
assert sort is github.GithubObject.NotSet or isinstance(sort, str), sort
assert direction is github.GithubObject.NotSet or isinstance(
direction, str
), direction
assert since is github.GithubObject.NotSet or isinstance(
since, datetime.datetime
), since
url_parameters = dict()
if filter is not github.GithubObject.NotSet:
url_parameters["filter"] = filter
if state is not github.GithubObject.NotSet:
url_parameters["state"] = state
if labels is not github.GithubObject.NotSet:
url_parameters["labels"] = ",".join(label.name for label in labels)
if sort is not github.GithubObject.NotSet:
url_parameters["sort"] = sort
if direction is not github.GithubObject.NotSet:
url_parameters["direction"] = direction
if since is not github.GithubObject.NotSet:
url_parameters["since"] = since.strftime("%Y-%m-%dT%H:%M:%SZ")
return github.PaginatedList.PaginatedList(
github.Issue.Issue, self._requester, "/issues", url_parameters
)
def get_user_issues(
self,
filter=github.GithubObject.NotSet,
state=github.GithubObject.NotSet,
labels=github.GithubObject.NotSet,
sort=github.GithubObject.NotSet,
direction=github.GithubObject.NotSet,
since=github.GithubObject.NotSet,
):
"""
:calls: `GET /user/issues `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Issue.Issue`
:param filter: string
:param state: string
:param labels: list of :class:`github.Label.Label`
:param sort: string
:param direction: string
:param since: datetime.datetime
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Issue.Issue`
"""
assert filter is github.GithubObject.NotSet or isinstance(filter, str), filter
assert state is github.GithubObject.NotSet or isinstance(state, str), state
assert labels is github.GithubObject.NotSet or all(
isinstance(element, github.Label.Label) for element in labels
), labels
assert sort is github.GithubObject.NotSet or isinstance(sort, str), sort
assert direction is github.GithubObject.NotSet or isinstance(
direction, str
), direction
assert since is github.GithubObject.NotSet or isinstance(
since, datetime.datetime
), since
url_parameters = dict()
if filter is not github.GithubObject.NotSet:
url_parameters["filter"] = filter
if state is not github.GithubObject.NotSet:
url_parameters["state"] = state
if labels is not github.GithubObject.NotSet:
url_parameters["labels"] = ",".join(label.name for label in labels)
if sort is not github.GithubObject.NotSet:
url_parameters["sort"] = sort
if direction is not github.GithubObject.NotSet:
url_parameters["direction"] = direction
if since is not github.GithubObject.NotSet:
url_parameters["since"] = since.strftime("%Y-%m-%dT%H:%M:%SZ")
return github.PaginatedList.PaginatedList(
github.Issue.Issue, self._requester, "/user/issues", url_parameters
)
def get_key(self, id):
"""
:calls: `GET /user/keys/{id} `_
:param id: integer
:rtype: :class:`github.UserKey.UserKey`
"""
assert isinstance(id, int), id
headers, data = self._requester.requestJsonAndCheck("GET", f"/user/keys/{id}")
return github.UserKey.UserKey(self._requester, headers, data, completed=True)
def get_keys(self):
"""
:calls: `GET /user/keys `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.UserKey.UserKey`
"""
return github.PaginatedList.PaginatedList(
github.UserKey.UserKey, self._requester, "/user/keys", None
)
def get_notification(self, id):
"""
:calls: `GET /notifications/threads/{id} `_
:rtype: :class:`github.Notification.Notification`
"""
assert isinstance(id, str), id
headers, data = self._requester.requestJsonAndCheck(
"GET", f"/notifications/threads/{id}"
)
return github.Notification.Notification(
self._requester, headers, data, completed=True
)
def get_notifications(
self,
all=github.GithubObject.NotSet,
participating=github.GithubObject.NotSet,
since=github.GithubObject.NotSet,
before=github.GithubObject.NotSet,
):
"""
:calls: `GET /notifications `_
:param all: bool
:param participating: bool
:param since: datetime.datetime
:param before: datetime.datetime
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Notification.Notification`
"""
assert all is github.GithubObject.NotSet or isinstance(all, bool), all
assert participating is github.GithubObject.NotSet or isinstance(
participating, bool
), participating
assert since is github.GithubObject.NotSet or isinstance(
since, datetime.datetime
), since
assert before is github.GithubObject.NotSet or isinstance(
before, datetime.datetime
), before
params = dict()
if all is not github.GithubObject.NotSet:
params["all"] = all
if participating is not github.GithubObject.NotSet:
params["participating"] = participating
if since is not github.GithubObject.NotSet:
params["since"] = since.strftime("%Y-%m-%dT%H:%M:%SZ")
if before is not github.GithubObject.NotSet:
params["before"] = before.strftime("%Y-%m-%dT%H:%M:%SZ")
return github.PaginatedList.PaginatedList(
github.Notification.Notification, self._requester, "/notifications", params
)
def get_organization_events(self, org):
"""
:calls: `GET /users/{user}/events/orgs/{org} `_
:param org: :class:`github.Organization.Organization`
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Event.Event`
"""
assert isinstance(org, github.Organization.Organization), org
return github.PaginatedList.PaginatedList(
github.Event.Event,
self._requester,
f"/users/{self.login}/events/orgs/{org.login}",
None,
)
def get_orgs(self):
"""
:calls: `GET /user/orgs `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Organization.Organization`
"""
return github.PaginatedList.PaginatedList(
github.Organization.Organization, self._requester, "/user/orgs", None
)
def get_repo(self, name):
"""
:calls: `GET /repos/{owner}/{repo} `_
:param name: string
:rtype: :class:`github.Repository.Repository`
"""
assert isinstance(name, str), name
headers, data = self._requester.requestJsonAndCheck(
"GET", f"/repos/{self.login}/{name}"
)
return github.Repository.Repository(
self._requester, headers, data, completed=True
)
def get_repos(
self,
visibility=github.GithubObject.NotSet,
affiliation=github.GithubObject.NotSet,
type=github.GithubObject.NotSet,
sort=github.GithubObject.NotSet,
direction=github.GithubObject.NotSet,
):
"""
:calls: `GET /user/repos `
:param visibility: string
:param affiliation: string
:param type: string
:param sort: string
:param direction: string
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
"""
assert visibility is github.GithubObject.NotSet or isinstance(
visibility, str
), visibility
assert affiliation is github.GithubObject.NotSet or isinstance(
affiliation, str
), affiliation
assert type is github.GithubObject.NotSet or isinstance(type, str), type
assert sort is github.GithubObject.NotSet or isinstance(sort, str), sort
assert direction is github.GithubObject.NotSet or isinstance(
direction, str
), direction
url_parameters = dict()
if visibility is not github.GithubObject.NotSet:
url_parameters["visibility"] = visibility
if affiliation is not github.GithubObject.NotSet:
url_parameters["affiliation"] = affiliation
if type is not github.GithubObject.NotSet:
url_parameters["type"] = type
if sort is not github.GithubObject.NotSet:
url_parameters["sort"] = sort
if direction is not github.GithubObject.NotSet:
url_parameters["direction"] = direction
return github.PaginatedList.PaginatedList(
github.Repository.Repository, self._requester, "/user/repos", url_parameters
)
def get_starred(self):
"""
:calls: `GET /user/starred `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
"""
return github.PaginatedList.PaginatedList(
github.Repository.Repository, self._requester, "/user/starred", None
)
def get_starred_gists(self):
"""
:calls: `GET /gists/starred `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Gist.Gist`
"""
return github.PaginatedList.PaginatedList(
github.Gist.Gist, self._requester, "/gists/starred", None
)
def get_subscriptions(self):
"""
:calls: `GET /user/subscriptions `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
"""
return github.PaginatedList.PaginatedList(
github.Repository.Repository, self._requester, "/user/subscriptions", None
)
def get_teams(self):
"""
:calls: `GET /user/teams `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Team.Team`
"""
return github.PaginatedList.PaginatedList(
github.Team.Team, self._requester, "/user/teams", None
)
def get_watched(self):
"""
:calls: `GET /user/subscriptions `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
"""
return github.PaginatedList.PaginatedList(
github.Repository.Repository, self._requester, "/user/subscriptions", None
)
def get_installations(self):
"""
:calls: `GET /user/installations `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Installation.Installation`
"""
return github.PaginatedList.PaginatedList(
github.Installation.Installation,
self._requester,
"/user/installations",
None,
headers={"Accept": Consts.mediaTypeIntegrationPreview},
list_item="installations",
)
def has_in_following(self, following):
"""
:calls: `GET /user/following/{user} `_
:param following: :class:`github.NamedUser.NamedUser`
:rtype: bool
"""
assert isinstance(following, github.NamedUser.NamedUser), following
status, headers, data = self._requester.requestJson(
"GET", f"/user/following/{following._identity}"
)
return status == 204
def has_in_starred(self, starred):
"""
:calls: `GET /user/starred/{owner}/{repo} `_
:param starred: :class:`github.Repository.Repository`
:rtype: bool
"""
assert isinstance(starred, github.Repository.Repository), starred
status, headers, data = self._requester.requestJson(
"GET", f"/user/starred/{starred._identity}"
)
return status == 204
def has_in_subscriptions(self, subscription):
"""
:calls: `GET /user/subscriptions/{owner}/{repo} `_
:param subscription: :class:`github.Repository.Repository`
:rtype: bool
"""
assert isinstance(subscription, github.Repository.Repository), subscription
status, headers, data = self._requester.requestJson(
"GET", f"/user/subscriptions/{subscription._identity}"
)
return status == 204
def has_in_watched(self, watched):
"""
:calls: `GET /repos/{owner}/{repo}/subscription `_
:param watched: :class:`github.Repository.Repository`
:rtype: bool
"""
assert isinstance(watched, github.Repository.Repository), watched
status, headers, data = self._requester.requestJson(
"GET", f"/repos/{watched._identity}/subscription"
)
return status == 200
def mark_notifications_as_read(self, last_read_at=datetime.datetime.utcnow()):
"""
:calls: `PUT /notifications `_
:param last_read_at: datetime
"""
assert isinstance(last_read_at, datetime.datetime)
put_parameters = {"last_read_at": last_read_at.strftime("%Y-%m-%dT%H:%M:%SZ")}
headers, data = self._requester.requestJsonAndCheck(
"PUT", "/notifications", input=put_parameters
)
def remove_from_emails(self, *emails):
"""
:calls: `DELETE /user/emails `_
:param email: string
:rtype: None
"""
assert all(isinstance(element, str) for element in emails), emails
post_parameters = {"emails": emails}
headers, data = self._requester.requestJsonAndCheck(
"DELETE", "/user/emails", input=post_parameters
)
def remove_from_following(self, following):
"""
:calls: `DELETE /user/following/{user} `_
:param following: :class:`github.NamedUser.NamedUser`
:rtype: None
"""
assert isinstance(following, github.NamedUser.NamedUser), following
headers, data = self._requester.requestJsonAndCheck(
"DELETE", f"/user/following/{following._identity}"
)
def remove_from_starred(self, starred):
"""
:calls: `DELETE /user/starred/{owner}/{repo} `_
:param starred: :class:`github.Repository.Repository`
:rtype: None
"""
assert isinstance(starred, github.Repository.Repository), starred
headers, data = self._requester.requestJsonAndCheck(
"DELETE", f"/user/starred/{starred._identity}"
)
def remove_from_subscriptions(self, subscription):
"""
:calls: `DELETE /user/subscriptions/{owner}/{repo} `_
:param subscription: :class:`github.Repository.Repository`
:rtype: None
"""
assert isinstance(subscription, github.Repository.Repository), subscription
headers, data = self._requester.requestJsonAndCheck(
"DELETE", f"/user/subscriptions/{subscription._identity}"
)
def remove_from_watched(self, watched):
"""
:calls: `DELETE /repos/{owner}/{repo}/subscription `_
:param watched: :class:`github.Repository.Repository`
:rtype: None
"""
assert isinstance(watched, github.Repository.Repository), watched
headers, data = self._requester.requestJsonAndCheck(
"DELETE", f"/repos/{watched._identity}/subscription"
)
def accept_invitation(self, invitation):
"""
:calls: `PATCH /user/repository_invitations/{invitation_id} `
:param invitation: :class:`github.Invitation.Invitation` or int
:rtype: None
"""
assert isinstance(invitation, github.Invitation.Invitation) or isinstance(
invitation, int
)
if isinstance(invitation, github.Invitation.Invitation):
invitation = invitation.id
headers, data = self._requester.requestJsonAndCheck(
"PATCH", f"/user/repository_invitations/{invitation}", input={}
)
def get_invitations(self):
"""
:calls: `GET /user/repository_invitations `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Invitation.Invitation`
"""
return github.PaginatedList.PaginatedList(
github.Invitation.Invitation,
self._requester,
"/user/repository_invitations",
None,
)
def create_migration(
self,
repos,
lock_repositories=github.GithubObject.NotSet,
exclude_attachments=github.GithubObject.NotSet,
):
"""
:calls: `POST /user/migrations `_
:param repos: list or tuple of str
:param lock_repositories: bool
:param exclude_attachments: bool
:rtype: :class:`github.Migration.Migration`
"""
assert isinstance(repos, (list, tuple)), repos
assert all(isinstance(repo, str) for repo in repos), repos
assert lock_repositories is github.GithubObject.NotSet or isinstance(
lock_repositories, bool
), lock_repositories
assert exclude_attachments is github.GithubObject.NotSet or isinstance(
exclude_attachments, bool
), exclude_attachments
post_parameters = {"repositories": repos}
if lock_repositories is not github.GithubObject.NotSet:
post_parameters["lock_repositories"] = lock_repositories
if exclude_attachments is not github.GithubObject.NotSet:
post_parameters["exclude_attachments"] = exclude_attachments
headers, data = self._requester.requestJsonAndCheck(
"POST",
"/user/migrations",
input=post_parameters,
headers={"Accept": Consts.mediaTypeMigrationPreview},
)
return github.Migration.Migration(
self._requester, headers, data, completed=True
)
def get_migrations(self):
"""
:calls: `GET /user/migrations `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Migration.Migration`
"""
return github.PaginatedList.PaginatedList(
github.Migration.Migration,
self._requester,
"/user/migrations",
None,
headers={"Accept": Consts.mediaTypeMigrationPreview},
)
def get_organization_membership(self, org):
"""
:calls: `GET /user/memberships/orgs/{org} `_
:rtype: :class:`github.Membership.Membership`
"""
assert isinstance(org, str)
headers, data = self._requester.requestJsonAndCheck(
"GET", f"/user/memberships/orgs/{org}"
)
return github.Membership.Membership(
self._requester, headers, data, completed=True
)
def _initAttributes(self):
self._avatar_url = github.GithubObject.NotSet
self._bio = github.GithubObject.NotSet
self._blog = github.GithubObject.NotSet
self._collaborators = github.GithubObject.NotSet
self._company = github.GithubObject.NotSet
self._created_at = github.GithubObject.NotSet
self._disk_usage = github.GithubObject.NotSet
self._email = github.GithubObject.NotSet
self._events_url = github.GithubObject.NotSet
self._followers = github.GithubObject.NotSet
self._followers_url = github.GithubObject.NotSet
self._following = github.GithubObject.NotSet
self._following_url = github.GithubObject.NotSet
self._gists_url = github.GithubObject.NotSet
self._gravatar_id = github.GithubObject.NotSet
self._hireable = github.GithubObject.NotSet
self._html_url = github.GithubObject.NotSet
self._id = github.GithubObject.NotSet
self._location = github.GithubObject.NotSet
self._login = github.GithubObject.NotSet
self._name = github.GithubObject.NotSet
self._node_id = github.GithubObject.NotSet
self._organizations_url = github.GithubObject.NotSet
self._owned_private_repos = github.GithubObject.NotSet
self._plan = github.GithubObject.NotSet
self._private_gists = github.GithubObject.NotSet
self._public_gists = github.GithubObject.NotSet
self._public_repos = github.GithubObject.NotSet
self._received_events_url = github.GithubObject.NotSet
self._repos_url = github.GithubObject.NotSet
self._site_admin = github.GithubObject.NotSet
self._starred_url = github.GithubObject.NotSet
self._subscriptions_url = github.GithubObject.NotSet
self._total_private_repos = github.GithubObject.NotSet
self._type = github.GithubObject.NotSet
self._updated_at = github.GithubObject.NotSet
self._url = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "avatar_url" in attributes: # pragma no branch
self._avatar_url = self._makeStringAttribute(attributes["avatar_url"])
if "bio" in attributes: # pragma no branch
self._bio = self._makeStringAttribute(attributes["bio"])
if "blog" in attributes: # pragma no branch
self._blog = self._makeStringAttribute(attributes["blog"])
if "collaborators" in attributes: # pragma no branch
self._collaborators = self._makeIntAttribute(attributes["collaborators"])
if "company" in attributes: # pragma no branch
self._company = self._makeStringAttribute(attributes["company"])
if "created_at" in attributes: # pragma no branch
self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
if "disk_usage" in attributes: # pragma no branch
self._disk_usage = self._makeIntAttribute(attributes["disk_usage"])
if "email" in attributes: # pragma no branch
self._email = self._makeStringAttribute(attributes["email"])
if "events_url" in attributes: # pragma no branch
self._events_url = self._makeStringAttribute(attributes["events_url"])
if "followers" in attributes: # pragma no branch
self._followers = self._makeIntAttribute(attributes["followers"])
if "followers_url" in attributes: # pragma no branch
self._followers_url = self._makeStringAttribute(attributes["followers_url"])
if "following" in attributes: # pragma no branch
self._following = self._makeIntAttribute(attributes["following"])
if "following_url" in attributes: # pragma no branch
self._following_url = self._makeStringAttribute(attributes["following_url"])
if "gists_url" in attributes: # pragma no branch
self._gists_url = self._makeStringAttribute(attributes["gists_url"])
if "gravatar_id" in attributes: # pragma no branch
self._gravatar_id = self._makeStringAttribute(attributes["gravatar_id"])
if "hireable" in attributes: # pragma no branch
self._hireable = self._makeBoolAttribute(attributes["hireable"])
if "html_url" in attributes: # pragma no branch
self._html_url = self._makeStringAttribute(attributes["html_url"])
if "id" in attributes: # pragma no branch
self._id = self._makeIntAttribute(attributes["id"])
if "location" in attributes: # pragma no branch
self._location = self._makeStringAttribute(attributes["location"])
if "login" in attributes: # pragma no branch
self._login = self._makeStringAttribute(attributes["login"])
if "name" in attributes: # pragma no branch
self._name = self._makeStringAttribute(attributes["name"])
if "node_id" in attributes: # pragma no branch
self._node_id = self._makeStringAttribute(attributes["node_id"])
if "organizations_url" in attributes: # pragma no branch
self._organizations_url = self._makeStringAttribute(
attributes["organizations_url"]
)
if "owned_private_repos" in attributes: # pragma no branch
self._owned_private_repos = self._makeIntAttribute(
attributes["owned_private_repos"]
)
if "plan" in attributes: # pragma no branch
self._plan = self._makeClassAttribute(github.Plan.Plan, attributes["plan"])
if "private_gists" in attributes: # pragma no branch
self._private_gists = self._makeIntAttribute(attributes["private_gists"])
if "public_gists" in attributes: # pragma no branch
self._public_gists = self._makeIntAttribute(attributes["public_gists"])
if "public_repos" in attributes: # pragma no branch
self._public_repos = self._makeIntAttribute(attributes["public_repos"])
if "received_events_url" in attributes: # pragma no branch
self._received_events_url = self._makeStringAttribute(
attributes["received_events_url"]
)
if "repos_url" in attributes: # pragma no branch
self._repos_url = self._makeStringAttribute(attributes["repos_url"])
if "site_admin" in attributes: # pragma no branch
self._site_admin = self._makeBoolAttribute(attributes["site_admin"])
if "starred_url" in attributes: # pragma no branch
self._starred_url = self._makeStringAttribute(attributes["starred_url"])
if "subscriptions_url" in attributes: # pragma no branch
self._subscriptions_url = self._makeStringAttribute(
attributes["subscriptions_url"]
)
if "total_private_repos" in attributes: # pragma no branch
self._total_private_repos = self._makeIntAttribute(
attributes["total_private_repos"]
)
if "type" in attributes: # pragma no branch
self._type = self._makeStringAttribute(attributes["type"])
if "updated_at" in attributes: # pragma no branch
self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
if "url" in attributes: # pragma no branch
self._url = self._makeStringAttribute(attributes["url"])
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/AuthenticatedUser.pyi 0000644 0001751 0000171 00000021132 00000000000 020164 0 ustar 00runner docker from datetime import datetime
from typing import Any, Dict, List, Optional, Union, NamedTuple
from github.Authorization import Authorization
from github.Event import Event
from github.Gist import Gist
from github.GithubObject import CompletableGithubObject, _NotSetType
from github.InputFileContent import InputFileContent
from github.Invitation import Invitation
from github.Issue import Issue
from github.Label import Label
from github.Membership import Membership
from github.Migration import Migration
from github.NamedUser import NamedUser
from github.Notification import Notification
from github.Organization import Organization
from github.PaginatedList import PaginatedList
from github.Plan import Plan
from github.Repository import Repository
from github.Team import Team
from github.UserKey import UserKey
class EmailData(NamedTuple):
email: str
primary: bool
verified: bool
visibility: str
class AuthenticatedUser(CompletableGithubObject):
def __repr__(self) -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
def accept_invitation(self, invitation: Union[int, Invitation]) -> None: ...
def add_to_emails(self, *emails: List[str]) -> None: ...
def add_to_following(self, following: NamedUser) -> None: ...
def add_to_starred(self, starred: Repository) -> None: ...
def add_to_subscriptions(self, subscription: Repository) -> None: ...
def add_to_watched(self, watched: Repository) -> None: ...
@property
def avatar_url(self) -> str: ...
@property
def bio(self) -> str: ...
@property
def blog(self) -> str: ...
@property
def collaborators(self) -> int: ...
@property
def company(self) -> str: ...
def create_authorization(
self,
scopes: Union[List[str], _NotSetType] = ...,
note: Union[str, _NotSetType] = ...,
note_url: Union[str, _NotSetType] = ...,
client_id: Union[str, _NotSetType] = ...,
client_secret: Union[str, _NotSetType] = ...,
onetime_password: Union[str, None] = ...,
) -> Authorization: ...
def create_fork(self, repo: Repository) -> Repository: ...
def create_gist(
self,
public: bool,
files: Dict[str, InputFileContent],
description: Union[str, _NotSetType] = ...,
) -> Gist: ...
def create_key(self, title: str, key: str) -> UserKey: ...
def create_migration(
self,
repos: List[str],
lock_repositories: Union[bool, _NotSetType] = ...,
exclude_attachments: Union[bool, _NotSetType] = ...,
) -> Migration: ...
def create_repo(
self,
name: str,
description: Union[str, _NotSetType] = ...,
homepage: Union[str, _NotSetType] = ...,
private: Union[bool, _NotSetType] = ...,
has_issues: Union[bool, _NotSetType] = ...,
has_wiki: Union[bool, _NotSetType] = ...,
has_downloads: Union[bool, _NotSetType] = ...,
has_projects: Union[bool, _NotSetType] = ...,
auto_init: Union[bool, _NotSetType] = ...,
license_template: _NotSetType = ...,
gitignore_template: Union[str, _NotSetType] = ...,
allow_squash_merge: Union[bool, _NotSetType] = ...,
allow_merge_commit: Union[bool, _NotSetType] = ...,
allow_rebase_merge: Union[bool, _NotSetType] = ...,
) -> Repository: ...
@property
def created_at(self) -> datetime: ...
@property
def disk_usage(self) -> int: ...
def edit(
self,
name: Union[str, _NotSetType] = ...,
email: Union[str, _NotSetType] = ...,
blog: Union[str, _NotSetType] = ...,
company: Union[str, _NotSetType] = ...,
location: Union[str, _NotSetType] = ...,
hireable: Union[bool, _NotSetType] = ...,
bio: Union[str, _NotSetType] = ...,
) -> None: ...
@property
def email(self) -> str: ...
@property
def events_url(self) -> str: ...
@property
def followers(self) -> int: ...
@property
def followers_url(self) -> str: ...
@property
def following(self) -> int: ...
@property
def following_url(self) -> str: ...
def get_authorization(self, id: int) -> Authorization: ...
def get_authorizations(self) -> PaginatedList[Authorization]: ...
def get_emails(self) -> List[EmailData]: ...
def get_events(self) -> PaginatedList[Event]: ...
def get_followers(self) -> PaginatedList[NamedUser]: ...
def get_following(self) -> PaginatedList[NamedUser]: ...
def get_gists(
self, since: Union[datetime, _NotSetType] = ...
) -> PaginatedList[Gist]: ...
def get_invitations(self) -> PaginatedList[Invitation]: ...
def get_issues(
self,
filter: Union[str, _NotSetType] = ...,
state: Union[str, _NotSetType] = ...,
labels: Union[List[Label], _NotSetType] = ...,
sort: Union[str, _NotSetType] = ...,
direction: Union[str, _NotSetType] = ...,
since: Union[_NotSetType, datetime] = ...,
) -> PaginatedList[Issue]: ...
def get_key(self, id: int) -> UserKey: ...
def get_keys(self) -> PaginatedList[UserKey]: ...
def get_migrations(self) -> PaginatedList[Migration]: ...
def get_notification(self, id: str) -> Notification: ...
def get_notifications(
self,
all: Union[bool, _NotSetType] = ...,
participating: Union[bool, _NotSetType] = ...,
since: Union[datetime, _NotSetType] = ...,
before: Union[datetime, _NotSetType] = ...,
) -> PaginatedList[Notification]: ...
def get_organization_events(self, org: Organization) -> PaginatedList[Event]: ...
def get_organization_membership(self, org: int) -> Membership: ...
def get_orgs(self) -> PaginatedList[Organization]: ...
def get_repo(self, name: str) -> Repository: ...
def get_repos(
self,
visibility: Union[str, _NotSetType] = ...,
affiliation: Union[str, _NotSetType] = ...,
type: Union[str, _NotSetType] = ...,
sort: Union[str, _NotSetType] = ...,
direction: Union[str, _NotSetType] = ...,
) -> PaginatedList[Repository]: ...
def get_starred(self) -> PaginatedList[Repository]: ...
def get_starred_gists(self) -> PaginatedList[Gist]: ...
def get_subscriptions(self) -> PaginatedList[Repository]: ...
def get_teams(self) -> PaginatedList[Team]: ...
def get_user_issues(
self,
filter: Union[str, _NotSetType] = ...,
state: Union[str, _NotSetType] = ...,
labels: Union[List[Label], _NotSetType] = ...,
sort: Union[str, _NotSetType] = ...,
direction: Union[str, _NotSetType] = ...,
since: Union[_NotSetType, datetime] = ...,
) -> PaginatedList[Issue]: ...
def get_watched(self) -> PaginatedList[Repository]: ...
@property
def gists_url(self) -> str: ...
@property
def gravatar_id(self) -> str: ...
def has_in_following(self, following: NamedUser) -> bool: ...
def has_in_starred(self, starred: Repository) -> bool: ...
def has_in_subscriptions(self, subscription: Repository) -> bool: ...
def has_in_watched(self, watched: Repository) -> bool: ...
@property
def hireable(self) -> bool: ...
@property
def html_url(self) -> str: ...
@property
def id(self) -> int: ...
@property
def location(self) -> str: ...
@property
def login(self) -> str: ...
def mark_notifications_as_read(self, last_read_at: datetime = ...) -> None: ...
@property
def name(self) -> str: ...
@property
def node_id(self) -> str: ...
@property
def organizations_url(self) -> str: ...
@property
def owned_private_repos(self) -> int: ...
@property
def plan(self) -> Plan: ...
@property
def private_gists(self) -> int: ...
@property
def public_gists(self) -> int: ...
@property
def public_repos(self) -> int: ...
@property
def received_events_url(self) -> str: ...
def remove_from_emails(self, *emails: str) -> None: ...
def remove_from_following(self, following: NamedUser) -> None: ...
def remove_from_starred(self, starred: Repository) -> None: ...
def remove_from_subscriptions(self, subscription: Repository) -> None: ...
def remove_from_watched(self, watched: Repository) -> None: ...
@property
def repos_url(self) -> str: ...
@property
def site_admin(self) -> bool: ...
@property
def starred_url(self) -> str: ...
@property
def subscriptions_url(self) -> str: ...
@property
def total_private_repos(self) -> int: ...
@property
def type(self) -> str: ...
@property
def updated_at(self) -> datetime: ...
@property
def url(self) -> str: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/Authorization.py 0000644 0001751 0000171 00000020173 00000000000 017236 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques #
# Copyright 2012 Zearin #
# Copyright 2013 AKFish #
# Copyright 2013 Vincent Jacques #
# Copyright 2014 Vincent Jacques #
# Copyright 2016 Jannis Gebauer #
# Copyright 2016 Peter Buckley #
# Copyright 2018 Wan Liuyang #
# Copyright 2018 sfdye #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
import github.AuthorizationApplication
import github.GithubObject
class Authorization(github.GithubObject.CompletableGithubObject):
"""
This class represents Authorizations. The reference can be found here https://docs.github.com/en/enterprise-server@3.0/rest/reference/oauth-authorizations
"""
def __repr__(self):
return self.get__repr__({"scopes": self._scopes.value})
@property
def app(self):
"""
:type: :class:`github.AuthorizationApplication.AuthorizationApplication`
"""
self._completeIfNotSet(self._app)
return self._app.value
@property
def created_at(self):
"""
:type: datetime.datetime
"""
self._completeIfNotSet(self._created_at)
return self._created_at.value
@property
def id(self):
"""
:type: integer
"""
self._completeIfNotSet(self._id)
return self._id.value
@property
def note(self):
"""
:type: string
"""
self._completeIfNotSet(self._note)
return self._note.value
@property
def note_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._note_url)
return self._note_url.value
@property
def scopes(self):
"""
:type: list of string
"""
self._completeIfNotSet(self._scopes)
return self._scopes.value
@property
def token(self):
"""
:type: string
"""
self._completeIfNotSet(self._token)
return self._token.value
@property
def updated_at(self):
"""
:type: datetime.datetime
"""
self._completeIfNotSet(self._updated_at)
return self._updated_at.value
@property
def url(self):
"""
:type: string
"""
self._completeIfNotSet(self._url)
return self._url.value
def delete(self):
"""
:calls: `DELETE /authorizations/{id} `_
:rtype: None
"""
headers, data = self._requester.requestJsonAndCheck("DELETE", self.url)
def edit(
self,
scopes=github.GithubObject.NotSet,
add_scopes=github.GithubObject.NotSet,
remove_scopes=github.GithubObject.NotSet,
note=github.GithubObject.NotSet,
note_url=github.GithubObject.NotSet,
):
"""
:calls: `PATCH /authorizations/{id} `_
:param scopes: list of string
:param add_scopes: list of string
:param remove_scopes: list of string
:param note: string
:param note_url: string
:rtype: None
"""
assert scopes is github.GithubObject.NotSet or all(
isinstance(element, str) for element in scopes
), scopes
assert add_scopes is github.GithubObject.NotSet or all(
isinstance(element, str) for element in add_scopes
), add_scopes
assert remove_scopes is github.GithubObject.NotSet or all(
isinstance(element, str) for element in remove_scopes
), remove_scopes
assert note is github.GithubObject.NotSet or isinstance(note, str), note
assert note_url is github.GithubObject.NotSet or isinstance(
note_url, str
), note_url
post_parameters = dict()
if scopes is not github.GithubObject.NotSet:
post_parameters["scopes"] = scopes
if add_scopes is not github.GithubObject.NotSet:
post_parameters["add_scopes"] = add_scopes
if remove_scopes is not github.GithubObject.NotSet:
post_parameters["remove_scopes"] = remove_scopes
if note is not github.GithubObject.NotSet:
post_parameters["note"] = note
if note_url is not github.GithubObject.NotSet:
post_parameters["note_url"] = note_url
headers, data = self._requester.requestJsonAndCheck(
"PATCH", self.url, input=post_parameters
)
self._useAttributes(data)
def _initAttributes(self):
self._app = github.GithubObject.NotSet
self._created_at = github.GithubObject.NotSet
self._id = github.GithubObject.NotSet
self._note = github.GithubObject.NotSet
self._note_url = github.GithubObject.NotSet
self._scopes = github.GithubObject.NotSet
self._token = github.GithubObject.NotSet
self._updated_at = github.GithubObject.NotSet
self._url = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "app" in attributes: # pragma no branch
self._app = self._makeClassAttribute(
github.AuthorizationApplication.AuthorizationApplication,
attributes["app"],
)
if "created_at" in attributes: # pragma no branch
self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
if "id" in attributes: # pragma no branch
self._id = self._makeIntAttribute(attributes["id"])
if "note" in attributes: # pragma no branch
self._note = self._makeStringAttribute(attributes["note"])
if "note_url" in attributes: # pragma no branch
self._note_url = self._makeStringAttribute(attributes["note_url"])
if "scopes" in attributes: # pragma no branch
self._scopes = self._makeListOfStringsAttribute(attributes["scopes"])
if "token" in attributes: # pragma no branch
self._token = self._makeStringAttribute(attributes["token"])
if "updated_at" in attributes: # pragma no branch
self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
if "url" in attributes: # pragma no branch
self._url = self._makeStringAttribute(attributes["url"])
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/Authorization.pyi 0000644 0001751 0000171 00000002326 00000000000 017407 0 ustar 00runner docker from datetime import datetime
from typing import Any, Dict, List, Optional, Union
from github.AuthorizationApplication import AuthorizationApplication
from github.GithubObject import CompletableGithubObject, _NotSetType
class Authorization(CompletableGithubObject):
def __repr__(self) -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
@property
def app(self) -> AuthorizationApplication: ...
@property
def created_at(self) -> datetime: ...
def delete(self) -> None: ...
def edit(
self,
scopes: Union[_NotSetType, List[str]] = ...,
add_scopes: Union[_NotSetType, List[str]] = ...,
remove_scopes: Union[_NotSetType, List[str]] = ...,
note: Union[_NotSetType, str] = ...,
note_url: Union[_NotSetType, str] = ...,
) -> None: ...
@property
def id(self) -> int: ...
@property
def note(self) -> Optional[str]: ...
@property
def note_url(self) -> Optional[str]: ...
@property
def scopes(self) -> List[str]: ...
@property
def token(self) -> str: ...
@property
def updated_at(self) -> datetime: ...
@property
def url(self) -> str: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/AuthorizationApplication.py 0000644 0001751 0000171 00000006405 00000000000 021424 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques #
# Copyright 2012 Zearin #
# Copyright 2013 AKFish #
# Copyright 2013 Vincent Jacques #
# Copyright 2014 Vincent Jacques #
# Copyright 2016 Jannis Gebauer #
# Copyright 2016 Peter Buckley #
# Copyright 2018 Wan Liuyang #
# Copyright 2018 sfdye #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
import github.GithubObject
class AuthorizationApplication(github.GithubObject.CompletableGithubObject):
"""
This class represents AuthorizationApplications
"""
def __repr__(self):
return self.get__repr__({"name": self._name.value})
@property
def name(self):
"""
:type: string
"""
self._completeIfNotSet(self._name)
return self._name.value
@property
def url(self):
"""
:type: string
"""
self._completeIfNotSet(self._url)
return self._url.value
def _initAttributes(self):
self._name = github.GithubObject.NotSet
self._url = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "name" in attributes: # pragma no branch
self._name = self._makeStringAttribute(attributes["name"])
if "url" in attributes: # pragma no branch
self._url = self._makeStringAttribute(attributes["url"])
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/AuthorizationApplication.pyi 0000644 0001751 0000171 00000000525 00000000000 021572 0 ustar 00runner docker from typing import Dict
from github.GithubObject import CompletableGithubObject
class AuthorizationApplication(CompletableGithubObject):
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, str]) -> None: ...
@property
def name(self) -> str: ...
@property
def url(self) -> str: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/Branch.py 0000644 0001751 0000171 00000057250 00000000000 015601 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques #
# Copyright 2012 Zearin #
# Copyright 2013 AKFish #
# Copyright 2013 Vincent Jacques #
# Copyright 2013 martinqt #
# Copyright 2014 Vincent Jacques #
# Copyright 2015 Kyle Hornberg #
# Copyright 2016 Jannis Gebauer #
# Copyright 2016 Peter Buckley #
# Copyright 2018 Steve Kowalik #
# Copyright 2018 Wan Liuyang #
# Copyright 2018 sfdye #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
import github.BranchProtection
import github.Commit
import github.GithubObject
import github.RequiredPullRequestReviews
import github.RequiredStatusChecks
from . import Consts
class Branch(github.GithubObject.NonCompletableGithubObject):
"""
This class represents Branches. The reference can be found here https://docs.github.com/en/rest/reference/repos#branches
"""
def __repr__(self):
return self.get__repr__({"name": self._name.value})
@property
def commit(self):
"""
:type: :class:`github.Commit.Commit`
"""
return self._commit.value
@property
def name(self):
"""
:type: string
"""
return self._name.value
@property
def protected(self):
"""
:type: bool
"""
return self._protected.value
@property
def protection_url(self):
"""
:type: string
"""
return self._protection_url.value
def _initAttributes(self):
self._commit = github.GithubObject.NotSet
self._name = github.GithubObject.NotSet
self._protection_url = github.GithubObject.NotSet
self._protected = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "commit" in attributes: # pragma no branch
self._commit = self._makeClassAttribute(
github.Commit.Commit, attributes["commit"]
)
if "name" in attributes: # pragma no branch
self._name = self._makeStringAttribute(attributes["name"])
if "protection_url" in attributes: # pragma no branch
self._protection_url = self._makeStringAttribute(
attributes["protection_url"]
)
if "protected" in attributes: # pragma no branch
self._protected = self._makeBoolAttribute(attributes["protected"])
def get_protection(self):
"""
:calls: `GET /repos/{owner}/{repo}/branches/{branch}/protection `_
"""
headers, data = self._requester.requestJsonAndCheck(
"GET",
self.protection_url,
headers={"Accept": Consts.mediaTypeRequireMultipleApprovingReviews},
)
return github.BranchProtection.BranchProtection(
self._requester, headers, data, completed=True
)
def edit_protection(
self,
strict=github.GithubObject.NotSet,
contexts=github.GithubObject.NotSet,
enforce_admins=github.GithubObject.NotSet,
dismissal_users=github.GithubObject.NotSet,
dismissal_teams=github.GithubObject.NotSet,
dismiss_stale_reviews=github.GithubObject.NotSet,
require_code_owner_reviews=github.GithubObject.NotSet,
required_approving_review_count=github.GithubObject.NotSet,
user_push_restrictions=github.GithubObject.NotSet,
team_push_restrictions=github.GithubObject.NotSet,
):
"""
:calls: `PUT /repos/{owner}/{repo}/branches/{branch}/protection `_
:strict: bool
:contexts: list of strings
:enforce_admins: bool
:dismissal_users: list of strings
:dismissal_teams: list of strings
:dismiss_stale_reviews: bool
:require_code_owner_reviews: bool
:required_approving_review_count: int
:user_push_restrictions: list of strings
:team_push_restrictions: list of strings
NOTE: The GitHub API groups strict and contexts together, both must
be submitted. Take care to pass both as arguments even if only one is
changing. Use edit_required_status_checks() to avoid this.
"""
assert strict is github.GithubObject.NotSet or isinstance(strict, bool), strict
assert contexts is github.GithubObject.NotSet or all(
isinstance(element, str) for element in contexts
), contexts
assert enforce_admins is github.GithubObject.NotSet or isinstance(
enforce_admins, bool
), enforce_admins
assert dismissal_users is github.GithubObject.NotSet or all(
isinstance(element, str) for element in dismissal_users
), dismissal_users
assert dismissal_teams is github.GithubObject.NotSet or all(
isinstance(element, str) for element in dismissal_teams
), dismissal_teams
assert dismiss_stale_reviews is github.GithubObject.NotSet or isinstance(
dismiss_stale_reviews, bool
), dismiss_stale_reviews
assert require_code_owner_reviews is github.GithubObject.NotSet or isinstance(
require_code_owner_reviews, bool
), require_code_owner_reviews
assert (
required_approving_review_count is github.GithubObject.NotSet
or isinstance(required_approving_review_count, int)
), (required_approving_review_count)
post_parameters = {}
if (
strict is not github.GithubObject.NotSet
or contexts is not github.GithubObject.NotSet
):
if strict is github.GithubObject.NotSet:
strict = False
if contexts is github.GithubObject.NotSet:
contexts = []
post_parameters["required_status_checks"] = {
"strict": strict,
"contexts": contexts,
}
else:
post_parameters["required_status_checks"] = None
if enforce_admins is not github.GithubObject.NotSet:
post_parameters["enforce_admins"] = enforce_admins
else:
post_parameters["enforce_admins"] = None
if (
dismissal_users is not github.GithubObject.NotSet
or dismissal_teams is not github.GithubObject.NotSet
or dismiss_stale_reviews is not github.GithubObject.NotSet
or require_code_owner_reviews is not github.GithubObject.NotSet
or required_approving_review_count is not github.GithubObject.NotSet
):
post_parameters["required_pull_request_reviews"] = {}
if dismiss_stale_reviews is not github.GithubObject.NotSet:
post_parameters["required_pull_request_reviews"][
"dismiss_stale_reviews"
] = dismiss_stale_reviews
if require_code_owner_reviews is not github.GithubObject.NotSet:
post_parameters["required_pull_request_reviews"][
"require_code_owner_reviews"
] = require_code_owner_reviews
if required_approving_review_count is not github.GithubObject.NotSet:
post_parameters["required_pull_request_reviews"][
"required_approving_review_count"
] = required_approving_review_count
if dismissal_users is not github.GithubObject.NotSet:
post_parameters["required_pull_request_reviews"][
"dismissal_restrictions"
] = {"users": dismissal_users}
if dismissal_teams is not github.GithubObject.NotSet:
if (
"dismissal_restrictions"
not in post_parameters["required_pull_request_reviews"]
):
post_parameters["required_pull_request_reviews"][
"dismissal_restrictions"
] = {}
post_parameters["required_pull_request_reviews"][
"dismissal_restrictions"
]["teams"] = dismissal_teams
else:
post_parameters["required_pull_request_reviews"] = None
if (
user_push_restrictions is not github.GithubObject.NotSet
or team_push_restrictions is not github.GithubObject.NotSet
):
if user_push_restrictions is github.GithubObject.NotSet:
user_push_restrictions = []
if team_push_restrictions is github.GithubObject.NotSet:
team_push_restrictions = []
post_parameters["restrictions"] = {
"users": user_push_restrictions,
"teams": team_push_restrictions,
}
else:
post_parameters["restrictions"] = None
headers, data = self._requester.requestJsonAndCheck(
"PUT",
self.protection_url,
headers={"Accept": Consts.mediaTypeRequireMultipleApprovingReviews},
input=post_parameters,
)
def remove_protection(self):
"""
:calls: `DELETE /repos/{owner}/{repo}/branches/{branch}/protection `_
"""
headers, data = self._requester.requestJsonAndCheck(
"DELETE",
self.protection_url,
)
def get_required_status_checks(self):
"""
:calls: `GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks `_
:rtype: :class:`github.RequiredStatusChecks.RequiredStatusChecks`
"""
headers, data = self._requester.requestJsonAndCheck(
"GET", f"{self.protection_url}/required_status_checks"
)
return github.RequiredStatusChecks.RequiredStatusChecks(
self._requester, headers, data, completed=True
)
def edit_required_status_checks(
self, strict=github.GithubObject.NotSet, contexts=github.GithubObject.NotSet
):
"""
:calls: `PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks `_
:strict: bool
:contexts: list of strings
"""
assert strict is github.GithubObject.NotSet or isinstance(strict, bool), strict
assert contexts is github.GithubObject.NotSet or all(
isinstance(element, str) for element in contexts
), contexts
post_parameters = {}
if strict is not github.GithubObject.NotSet:
post_parameters["strict"] = strict
if contexts is not github.GithubObject.NotSet:
post_parameters["contexts"] = contexts
headers, data = self._requester.requestJsonAndCheck(
"PATCH",
f"{self.protection_url}/required_status_checks",
input=post_parameters,
)
def remove_required_status_checks(self):
"""
:calls: `DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks `_
"""
headers, data = self._requester.requestJsonAndCheck(
"DELETE",
f"{self.protection_url}/required_status_checks",
)
def get_required_pull_request_reviews(self):
"""
:calls: `GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews `_
:rtype: :class:`github.RequiredPullRequestReviews.RequiredPullRequestReviews`
"""
headers, data = self._requester.requestJsonAndCheck(
"GET",
f"{self.protection_url}/required_pull_request_reviews",
headers={"Accept": Consts.mediaTypeRequireMultipleApprovingReviews},
)
return github.RequiredPullRequestReviews.RequiredPullRequestReviews(
self._requester, headers, data, completed=True
)
def edit_required_pull_request_reviews(
self,
dismissal_users=github.GithubObject.NotSet,
dismissal_teams=github.GithubObject.NotSet,
dismiss_stale_reviews=github.GithubObject.NotSet,
require_code_owner_reviews=github.GithubObject.NotSet,
required_approving_review_count=github.GithubObject.NotSet,
):
"""
:calls: `PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews `_
:dismissal_users: list of strings
:dismissal_teams: list of strings
:dismiss_stale_reviews: bool
:require_code_owner_reviews: bool
:required_approving_review_count: int
"""
assert dismissal_users is github.GithubObject.NotSet or all(
isinstance(element, str) for element in dismissal_users
), dismissal_users
assert dismissal_teams is github.GithubObject.NotSet or all(
isinstance(element, str) for element in dismissal_teams
), dismissal_teams
assert dismiss_stale_reviews is github.GithubObject.NotSet or isinstance(
dismiss_stale_reviews, bool
), dismiss_stale_reviews
assert require_code_owner_reviews is github.GithubObject.NotSet or isinstance(
require_code_owner_reviews, bool
), require_code_owner_reviews
assert (
required_approving_review_count is github.GithubObject.NotSet
or isinstance(required_approving_review_count, int)
), (required_approving_review_count)
post_parameters = {}
if dismissal_users is not github.GithubObject.NotSet:
post_parameters["dismissal_restrictions"] = {"users": dismissal_users}
if dismissal_teams is not github.GithubObject.NotSet:
if "dismissal_restrictions" not in post_parameters:
post_parameters["dismissal_restrictions"] = {}
post_parameters["dismissal_restrictions"]["teams"] = dismissal_teams
if dismiss_stale_reviews is not github.GithubObject.NotSet:
post_parameters["dismiss_stale_reviews"] = dismiss_stale_reviews
if require_code_owner_reviews is not github.GithubObject.NotSet:
post_parameters["require_code_owner_reviews"] = require_code_owner_reviews
if required_approving_review_count is not github.GithubObject.NotSet:
post_parameters[
"required_approving_review_count"
] = required_approving_review_count
headers, data = self._requester.requestJsonAndCheck(
"PATCH",
f"{self.protection_url}/required_pull_request_reviews",
headers={"Accept": Consts.mediaTypeRequireMultipleApprovingReviews},
input=post_parameters,
)
def remove_required_pull_request_reviews(self):
"""
:calls: `DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews `_
"""
headers, data = self._requester.requestJsonAndCheck(
"DELETE",
f"{self.protection_url}/required_pull_request_reviews",
)
def get_admin_enforcement(self):
"""
:calls: `GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins `_
:rtype: bool
"""
headers, data = self._requester.requestJsonAndCheck(
"GET", f"{self.protection_url}/enforce_admins"
)
return data["enabled"]
def set_admin_enforcement(self):
"""
:calls: `POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins `_
"""
headers, data = self._requester.requestJsonAndCheck(
"POST", f"{self.protection_url}/enforce_admins"
)
def remove_admin_enforcement(self):
"""
:calls: `DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins `_
"""
headers, data = self._requester.requestJsonAndCheck(
"DELETE", f"{self.protection_url}/enforce_admins"
)
def get_user_push_restrictions(self):
"""
:calls: `GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
"""
return github.PaginatedList.PaginatedList(
github.NamedUser.NamedUser,
self._requester,
f"{self.protection_url}/restrictions/users",
None,
)
def get_team_push_restrictions(self):
"""
:calls: `GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Team.Team`
"""
return github.PaginatedList.PaginatedList(
github.Team.Team,
self._requester,
f"{self.protection_url}/restrictions/teams",
None,
)
def add_user_push_restrictions(self, *users):
"""
:calls: `POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users `_
:users: list of strings (user names)
"""
assert all(isinstance(element, str) for element in users), users
headers, data = self._requester.requestJsonAndCheck(
"POST", f"{self.protection_url}/restrictions/users", input=users
)
def replace_user_push_restrictions(self, *users):
"""
:calls: `PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users `_
:users: list of strings (user names)
"""
assert all(isinstance(element, str) for element in users), users
headers, data = self._requester.requestJsonAndCheck(
"PUT", f"{self.protection_url}/restrictions/users", input=users
)
def remove_user_push_restrictions(self, *users):
"""
:calls: `DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users `_
:users: list of strings (user names)
"""
assert all(isinstance(element, str) for element in users), users
headers, data = self._requester.requestJsonAndCheck(
"DELETE", f"{self.protection_url}/restrictions/users", input=users
)
def add_team_push_restrictions(self, *teams):
"""
:calls: `POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams `_
:teams: list of strings (team slugs)
"""
assert all(isinstance(element, str) for element in teams), teams
headers, data = self._requester.requestJsonAndCheck(
"POST", f"{self.protection_url}/restrictions/teams", input=teams
)
def replace_team_push_restrictions(self, *teams):
"""
:calls: `PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams `_
:teams: list of strings (team slugs)
"""
assert all(isinstance(element, str) for element in teams), teams
headers, data = self._requester.requestJsonAndCheck(
"PUT", f"{self.protection_url}/restrictions/teams", input=teams
)
def remove_team_push_restrictions(self, *teams):
"""
:calls: `DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams `_
:teams: list of strings (team slugs)
"""
assert all(isinstance(element, str) for element in teams), teams
headers, data = self._requester.requestJsonAndCheck(
"DELETE", f"{self.protection_url}/restrictions/teams", input=teams
)
def remove_push_restrictions(self):
"""
:calls: `DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions `_
"""
headers, data = self._requester.requestJsonAndCheck(
"DELETE", f"{self.protection_url}/restrictions"
)
def get_required_signatures(self):
"""
:calls: `GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures `
"""
headers, data = self._requester.requestJsonAndCheck(
"GET",
f"{self.protection_url}/required_signatures",
headers={"Accept": Consts.signaturesProtectedBranchesPreview},
)
return data["enabled"]
def add_required_signatures(self):
"""
:calls: `POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures `
"""
headers, data = self._requester.requestJsonAndCheck(
"POST",
f"{self.protection_url}/required_signatures",
headers={"Accept": Consts.signaturesProtectedBranchesPreview},
)
def remove_required_signatures(self):
"""
:calls: `DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures `
"""
headers, data = self._requester.requestJsonAndCheck(
"DELETE",
f"{self.protection_url}/required_signatures",
headers={"Accept": Consts.signaturesProtectedBranchesPreview},
)
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/Branch.pyi 0000644 0001751 0000171 00000006047 00000000000 015750 0 ustar 00runner docker from typing import Any, Dict, List, Union
from github.BranchProtection import BranchProtection
from github.Commit import Commit
from github.GithubObject import NonCompletableGithubObject, _NotSetType
from github.NamedUser import NamedUser
from github.PaginatedList import PaginatedList
from github.RequiredPullRequestReviews import RequiredPullRequestReviews
from github.RequiredStatusChecks import RequiredStatusChecks
from github.Team import Team
class Branch(NonCompletableGithubObject):
def __repr__(self) -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
def add_required_signatures(self) -> None: ...
@property
def commit(self) -> Commit: ...
def edit_protection(
self,
strict: Union[bool, _NotSetType] = ...,
contexts: Union[List[str], _NotSetType] = ...,
enforce_admins: Union[bool, _NotSetType] = ...,
dismissal_users: Union[_NotSetType, List[str]] = ...,
dismissal_teams: Union[_NotSetType, List[str]] = ...,
dismiss_stale_reviews: Union[bool, _NotSetType] = ...,
require_code_owner_reviews: Union[bool, _NotSetType] = ...,
required_approving_review_count: Union[int, _NotSetType] = ...,
user_push_restrictions: Union[_NotSetType, List[str]] = ...,
team_push_restrictions: Union[_NotSetType, List[str]] = ...,
) -> None: ...
def edit_required_pull_request_reviews(
self,
dismissal_users: Union[_NotSetType, List[str]] = ...,
dismissal_teams: Union[_NotSetType, List[str]] = ...,
dismiss_stale_reviews: Union[bool, _NotSetType] = ...,
require_code_owner_reviews: Union[_NotSetType, bool] = ...,
required_approving_review_count: Union[int, _NotSetType] = ...,
) -> None: ...
def edit_required_status_checks(
self,
strict: Union[_NotSetType, bool] = ...,
contexts: Union[List[str], _NotSetType] = ...,
) -> None: ...
def edit_team_push_restrictions(self, *teams: str) -> None: ...
def edit_user_push_restrictions(self, *users: str) -> None: ...
def get_admin_enforcement(self) -> bool: ...
def get_protection(self) -> BranchProtection: ...
def get_required_pull_request_reviews(self) -> RequiredPullRequestReviews: ...
def get_required_signatures(self) -> bool: ...
def get_required_status_checks(self) -> RequiredStatusChecks: ...
def get_team_push_restrictions(self) -> PaginatedList[Team]: ...
def get_user_push_restrictions(self) -> PaginatedList[NamedUser]: ...
@property
def name(self) -> str: ...
@property
def protected(self) -> bool: ...
@property
def protection_url(self) -> str: ...
def remove_admin_enforcement(self) -> None: ...
def remove_protection(self) -> None: ...
def remove_push_restrictions(self) -> None: ...
def remove_required_pull_request_reviews(self) -> None: ...
def remove_required_signatures(self) -> None: ...
def remove_required_status_checks(self) -> None: ...
def set_admin_enforcement(self) -> None: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/BranchProtection.py 0000644 0001751 0000171 00000012543 00000000000 017644 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2018 Steve Kowalik #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
import github.GithubObject
import github.NamedUser
import github.RequiredPullRequestReviews
import github.RequiredStatusChecks
import github.Team
class BranchProtection(github.GithubObject.CompletableGithubObject):
"""
This class represents Branch Protection. The reference can be found here https://docs.github.com/en/rest/reference/repos#get-branch-protection
"""
def __repr__(self):
return self.get__repr__({"url": self._url.value})
@property
def url(self):
"""
:type: string
"""
self._completeIfNotSet(self._url)
return self._url.value
@property
def required_status_checks(self):
"""
:type: :class:`github.RequiredStatusChecks.RequiredStatusChecks`
"""
self._completeIfNotSet(self._required_status_checks)
return self._required_status_checks.value
@property
def enforce_admins(self):
"""
:type: bool
"""
self._completeIfNotSet(self._enforce_admins)
return self._enforce_admins.value
@property
def required_pull_request_reviews(self):
"""
:type: :class:`github.RequiredPullRequestReviews.RequiredPullRequestReviews`
"""
self._completeIfNotSet(self._required_pull_request_reviews)
return self._required_pull_request_reviews.value
def get_user_push_restrictions(self):
"""
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
"""
if self._user_push_restrictions is github.GithubObject.NotSet:
return None
return github.PaginatedList.PaginatedList(
github.NamedUser.NamedUser,
self._requester,
self._user_push_restrictions,
None,
)
def get_team_push_restrictions(self):
"""
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Team.Team`
"""
if self._team_push_restrictions is github.GithubObject.NotSet:
return None
return github.PaginatedList.PaginatedList(
github.Team.Team, self._requester, self._team_push_restrictions, None
)
def _initAttributes(self):
self._url = github.GithubObject.NotSet
self._required_status_checks = github.GithubObject.NotSet
self._enforce_admins = github.GithubObject.NotSet
self._required_pull_request_reviews = github.GithubObject.NotSet
self._user_push_restrictions = github.GithubObject.NotSet
self._team_push_restrictions = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "url" in attributes: # pragma no branch
self._url = self._makeStringAttribute(attributes["url"])
if "required_status_checks" in attributes: # pragma no branch
self._required_status_checks = self._makeClassAttribute(
github.RequiredStatusChecks.RequiredStatusChecks,
attributes["required_status_checks"],
)
if "enforce_admins" in attributes: # pragma no branch
self._enforce_admins = self._makeBoolAttribute(
attributes["enforce_admins"]["enabled"]
)
if "required_pull_request_reviews" in attributes: # pragma no branch
self._required_pull_request_reviews = self._makeClassAttribute(
github.RequiredPullRequestReviews.RequiredPullRequestReviews,
attributes["required_pull_request_reviews"],
)
if "restrictions" in attributes: # pragma no branch
self._user_push_restrictions = attributes["restrictions"]["users_url"]
self._team_push_restrictions = attributes["restrictions"]["teams_url"]
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/BranchProtection.pyi 0000644 0001751 0000171 00000001665 00000000000 020020 0 ustar 00runner docker from typing import Any, Dict
from github.GithubObject import CompletableGithubObject
from github.NamedUser import NamedUser
from github.PaginatedList import PaginatedList
from github.RequiredPullRequestReviews import RequiredPullRequestReviews
from github.RequiredStatusChecks import RequiredStatusChecks
from github.Team import Team
class BranchProtection(CompletableGithubObject):
def __repr__(self) -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
@property
def enforce_admins(self) -> bool: ...
def get_team_push_restrictions(self) -> PaginatedList[NamedUser]: ...
def get_user_push_restrictions(self) -> PaginatedList[Team]: ...
@property
def required_pull_request_reviews(self) -> RequiredPullRequestReviews: ...
@property
def required_status_checks(self) -> RequiredStatusChecks: ...
@property
def url(self) -> str: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/CheckRun.py 0000644 0001751 0000171 00000030644 00000000000 016104 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2020 Dhruv Manilawala #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
import datetime
import github.CheckRunAnnotation
import github.CheckRunOutput
import github.GithubApp
import github.GithubObject
import github.PaginatedList
import github.PullRequest
class CheckRun(github.GithubObject.CompletableGithubObject):
"""
This class represents check runs.
The reference can be found here https://docs.github.com/en/rest/reference/checks#check-runs
"""
def __repr__(self):
return self.get__repr__(
{"id": self._id.value, "conclusion": self._conclusion.value}
)
@property
def app(self):
"""
:type: :class:`github.GithubApp.GithubApp`
"""
self._completeIfNotSet(self._app)
return self._app.value
@property
def check_suite_id(self):
"""
:type: integer
"""
self._completeIfNotSet(self._check_suite_id)
return self._check_suite_id.value
@property
def completed_at(self):
"""
:type: datetime.datetime
"""
self._completeIfNotSet(self._completed_at)
return self._completed_at.value
@property
def conclusion(self):
"""
:type: string
"""
self._completeIfNotSet(self._conclusion)
return self._conclusion.value
@property
def details_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._details_url)
return self._details_url.value
@property
def external_id(self):
"""
:type: string
"""
self._completeIfNotSet(self._external_id)
return self._external_id.value
@property
def head_sha(self):
"""
:type: string
"""
self._completeIfNotSet(self._head_sha)
return self._head_sha.value
@property
def html_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._html_url)
return self._html_url.value
@property
def id(self):
"""
:type: integer
"""
self._completeIfNotSet(self._id)
return self._id.value
@property
def name(self):
"""
:type: string
"""
self._completeIfNotSet(self._name)
return self._name.value
@property
def node_id(self):
"""
:type: string
"""
self._completeIfNotSet(self._node_id)
return self._node_id.value
@property
def output(self):
"""
:type: :class:`github.CheckRunOutput.CheckRunOutput`
"""
self._completeIfNotSet(self._output)
return self._output.value
@property
def pull_requests(self):
"""
:type: list of :class:`github.PullRequest.PullRequest`
"""
self._completeIfNotSet(self._pull_requests)
return self._pull_requests.value
@property
def started_at(self):
"""
:type: datetime.datetime
"""
self._completeIfNotSet(self._started_at)
return self._started_at.value
@property
def status(self):
"""
:type: string
"""
self._completeIfNotSet(self._status)
return self._status.value
@property
def url(self):
"""
:type: string
"""
self._completeIfNotSet(self._url)
return self._url.value
def get_annotations(self):
"""
:calls: `GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.CheckRunAnnotation.CheckRunAnnotation`
"""
return github.PaginatedList.PaginatedList(
github.CheckRunAnnotation.CheckRunAnnotation,
self._requester,
f"{self.url}/annotations",
None,
headers={"Accept": "application/vnd.github.v3+json"},
)
def edit(
self,
name=github.GithubObject.NotSet,
head_sha=github.GithubObject.NotSet,
details_url=github.GithubObject.NotSet,
external_id=github.GithubObject.NotSet,
status=github.GithubObject.NotSet,
started_at=github.GithubObject.NotSet,
conclusion=github.GithubObject.NotSet,
completed_at=github.GithubObject.NotSet,
output=github.GithubObject.NotSet,
actions=github.GithubObject.NotSet,
):
"""
:calls: `PATCH /repos/{owner}/{repo}/check-runs/{check_run_id} `_
:param name: string
:param head_sha: string
:param details_url: string
:param external_id: string
:param status: string
:param started_at: datetime.datetime
:param conclusion: string
:param completed_at: datetime.datetime
:param output: dict
:param actions: list of dict
:rtype: None
"""
assert name is github.GithubObject.NotSet or isinstance(name, str), name
assert head_sha is github.GithubObject.NotSet or isinstance(
head_sha, str
), head_sha
assert details_url is github.GithubObject.NotSet or isinstance(
details_url, str
), details_url
assert external_id is github.GithubObject.NotSet or isinstance(
external_id, str
), external_id
assert status is github.GithubObject.NotSet or isinstance(status, str), status
assert started_at is github.GithubObject.NotSet or isinstance(
started_at, datetime.datetime
), started_at
assert conclusion is github.GithubObject.NotSet or isinstance(
conclusion, str
), conclusion
assert completed_at is github.GithubObject.NotSet or isinstance(
completed_at, datetime.datetime
), completed_at
assert output is github.GithubObject.NotSet or isinstance(output, dict), output
assert actions is github.GithubObject.NotSet or all(
isinstance(element, dict) for element in actions
), actions
post_parameters = dict()
if name is not github.GithubObject.NotSet:
post_parameters["name"] = name
if head_sha is not github.GithubObject.NotSet:
post_parameters["head_sha"] = head_sha
if details_url is not github.GithubObject.NotSet:
post_parameters["details_url"] = details_url
if external_id is not github.GithubObject.NotSet:
post_parameters["external_id"] = external_id
if status is not github.GithubObject.NotSet:
post_parameters["status"] = status
if started_at is not github.GithubObject.NotSet:
post_parameters["started_at"] = started_at.strftime("%Y-%m-%dT%H:%M:%SZ")
if completed_at is not github.GithubObject.NotSet:
post_parameters["completed_at"] = completed_at.strftime(
"%Y-%m-%dT%H:%M:%SZ"
)
if conclusion is not github.GithubObject.NotSet:
post_parameters["conclusion"] = conclusion
if output is not github.GithubObject.NotSet:
post_parameters["output"] = output
if actions is not github.GithubObject.NotSet:
post_parameters["actions"] = actions
headers, data = self._requester.requestJsonAndCheck(
"PATCH", self.url, input=post_parameters
)
self._useAttributes(data)
def _initAttributes(self):
self._app = github.GithubObject.NotSet
self._check_suite_id = github.GithubObject.NotSet
self._completed_at = github.GithubObject.NotSet
self._conclusion = github.GithubObject.NotSet
self._details_url = github.GithubObject.NotSet
self._external_id = github.GithubObject.NotSet
self._head_sha = github.GithubObject.NotSet
self._html_url = github.GithubObject.NotSet
self._id = github.GithubObject.NotSet
self._name = github.GithubObject.NotSet
self._node_id = github.GithubObject.NotSet
self._output = github.GithubObject.NotSet
self._output = github.GithubObject.NotSet
self._pull_requests = github.GithubObject.NotSet
self._started_at = github.GithubObject.NotSet
self._status = github.GithubObject.NotSet
self._url = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "app" in attributes: # pragma no branch
self._app = self._makeClassAttribute(
github.GithubApp.GithubApp, attributes["app"]
)
# This only gives us a dictionary with `id` attribute of `check_suite`
if (
"check_suite" in attributes and "id" in attributes["check_suite"]
): # pragma no branch
self._check_suite_id = self._makeIntAttribute(
attributes["check_suite"]["id"]
)
if "completed_at" in attributes: # pragma no branch
self._completed_at = self._makeDatetimeAttribute(attributes["completed_at"])
if "conclusion" in attributes: # pragma no branch
self._conclusion = self._makeStringAttribute(attributes["conclusion"])
if "details_url" in attributes: # pragma no branch
self._details_url = self._makeStringAttribute(attributes["details_url"])
if "external_id" in attributes: # pragma no branch
self._external_id = self._makeStringAttribute(attributes["external_id"])
if "head_sha" in attributes: # pragma no branch
self._head_sha = self._makeStringAttribute(attributes["head_sha"])
if "html_url" in attributes: # pragma no branch
self._html_url = self._makeStringAttribute(attributes["html_url"])
if "id" in attributes: # pragma no branch
self._id = self._makeIntAttribute(attributes["id"])
if "name" in attributes: # pragma no branch
self._name = self._makeStringAttribute(attributes["name"])
if "node_id" in attributes: # pragma no branch
self._node_id = self._makeStringAttribute(attributes["node_id"])
if "output" in attributes: # pragma no branch
self._output = self._makeClassAttribute(
github.CheckRunOutput.CheckRunOutput, attributes["output"]
)
if "pull_requests" in attributes: # pragma no branch
self._pull_requests = self._makeListOfClassesAttribute(
github.PullRequest.PullRequest, attributes["pull_requests"]
)
if "started_at" in attributes: # pragma no branch
self._started_at = self._makeDatetimeAttribute(attributes["started_at"])
if "status" in attributes: # pragma no branch
self._status = self._makeStringAttribute(attributes["status"])
if "url" in attributes: # pragma no branch
self._url = self._makeStringAttribute(attributes["url"])
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/CheckRun.pyi 0000644 0001751 0000171 00000004073 00000000000 016252 0 ustar 00runner docker from datetime import datetime
from typing import Any, Dict, List, Union
from github.CheckRunAnnotation import CheckRunAnnotation
from github.CheckRunOutput import CheckRunOutput
from github.GithubApp import GithubApp
from github.GithubObject import CompletableGithubObject, _NotSetType
from github.PaginatedList import PaginatedList
from github.PullRequest import PullRequest
class CheckRun(CompletableGithubObject):
def __repr__(self) -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
def get_annotations(self) -> PaginatedList[CheckRunAnnotation]: ...
def edit(
self,
name: Union[_NotSetType, str] = ...,
head_sha: Union[_NotSetType, str] = ...,
details_url: Union[_NotSetType, str] = ...,
external_id: Union[_NotSetType, str] = ...,
status: Union[_NotSetType, str] = ...,
started_at: Union[_NotSetType, datetime] = ...,
conclusion: Union[_NotSetType, str] = ...,
completed_at: Union[_NotSetType, datetime] = ...,
output: Union[
_NotSetType, Dict[str, Union[str, List[Dict[str, Union[str, int]]]]]
] = ...,
actions: Union[_NotSetType, List[Dict[str, str]]] = ...,
) -> None: ...
@property
def app(self) -> GithubApp: ...
@property
def check_suite_id(self) -> int: ...
@property
def completed_at(self) -> datetime: ...
@property
def conclusion(self) -> str: ...
@property
def details_url(self) -> str: ...
@property
def external_id(self) -> str: ...
@property
def head_sha(self) -> str: ...
@property
def html_url(self) -> str: ...
@property
def id(self) -> int: ...
@property
def name(self) -> str: ...
@property
def node_id(self) -> str: ...
@property
def output(self) -> CheckRunOutput: ...
@property
def pull_requests(self) -> List[PullRequest]: ...
@property
def started_at(self) -> datetime: ...
@property
def status(self) -> str: ...
@property
def url(self) -> str: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/CheckRunAnnotation.py 0000644 0001751 0000171 00000011626 00000000000 020136 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2020 Dhruv Manilawala #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
import github.GithubObject
class CheckRunAnnotation(github.GithubObject.NonCompletableGithubObject):
"""
This class represents check run annotations.
The reference can be found here: https://docs.github.com/en/rest/reference/checks#list-check-run-annotations
"""
def __repr__(self):
return self.get__repr__({"title": self._title.value})
@property
def annotation_level(self):
"""
:type: string
"""
return self._annotation_level.value
@property
def end_column(self):
"""
:type: integer
"""
return self._end_column.value
@property
def end_line(self):
"""
:type: integer
"""
return self._end_line.value
@property
def message(self):
"""
:type: string
"""
return self._message.value
@property
def path(self):
"""
:type: string
"""
return self._path.value
@property
def raw_details(self):
"""
:type: string
"""
return self._raw_details.value
@property
def start_column(self):
"""
:type: integer
"""
return self._start_column.value
@property
def start_line(self):
"""
:type: integer
"""
return self._start_line.value
@property
def title(self):
"""
:type: string
"""
return self._title.value
def _initAttributes(self):
self._annotation_level = github.GithubObject.NotSet
self._end_column = github.GithubObject.NotSet
self._end_line = github.GithubObject.NotSet
self._message = github.GithubObject.NotSet
self._path = github.GithubObject.NotSet
self._raw_details = github.GithubObject.NotSet
self._start_column = github.GithubObject.NotSet
self._start_line = github.GithubObject.NotSet
self._title = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "annotation_level" in attributes: # pragma no branch
self._annotation_level = self._makeStringAttribute(
attributes["annotation_level"]
)
if "end_column" in attributes: # pragma no branch
self._end_column = self._makeIntAttribute(attributes["end_column"])
if "end_line" in attributes: # pragma no branch
self._end_line = self._makeIntAttribute(attributes["end_line"])
if "message" in attributes: # pragma no branch
self._message = self._makeStringAttribute(attributes["message"])
if "path" in attributes: # pragma no branch
self._path = self._makeStringAttribute(attributes["path"])
if "raw_details" in attributes: # pragma no branch
self._raw_details = self._makeStringAttribute(attributes["raw_details"])
if "start_column" in attributes: # pragma no branch
self._start_column = self._makeIntAttribute(attributes["start_column"])
if "start_line" in attributes: # pragma no branch
self._start_line = self._makeIntAttribute(attributes["start_line"])
if "title" in attributes: # pragma no branch
self._title = self._makeStringAttribute(attributes["title"])
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/CheckRunAnnotation.pyi 0000644 0001751 0000171 00000001350 00000000000 020300 0 ustar 00runner docker from typing import Any, Dict
from github.GithubObject import NonCompletableGithubObject
class CheckRunAnnotation(NonCompletableGithubObject):
def __repr__(self) -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
@property
def annotation_level(self) -> str: ...
@property
def end_column(self) -> int: ...
@property
def end_line(self) -> int: ...
@property
def message(self) -> str: ...
@property
def path(self) -> str: ...
@property
def raw_details(self) -> str: ...
@property
def start_column(self) -> int: ...
@property
def start_line(self) -> int: ...
@property
def title(self) -> str: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/CheckRunOutput.py 0000644 0001751 0000171 00000007127 00000000000 017325 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2020 Dhruv Manilawala #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
import github.GithubObject
class CheckRunOutput(github.GithubObject.NonCompletableGithubObject):
"""This class represents the output of check run."""
def __repr__(self):
return self.get__repr__({"title": self._title.value})
@property
def annotations_count(self):
"""
:type: integer
"""
return self._annotations_count.value
@property
def annotations_url(self):
"""
:type: string
"""
return self._annotations_url.value
@property
def summary(self):
"""
:type: string
"""
return self._summary.value
@property
def text(self):
"""
:type: string
"""
return self._text.value
@property
def title(self):
"""
:type: string
"""
return self._title.value
def _initAttributes(self):
self._annotations_count = github.GithubObject.NotSet
self._annotations_url = github.GithubObject.NotSet
self._summary = github.GithubObject.NotSet
self._text = github.GithubObject.NotSet
self._title = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "annotations_count" in attributes: # pragma no branch
self._annotations_count = self._makeIntAttribute(
attributes["annotations_count"]
)
if "annotations_url" in attributes: # pragma no branch
self._annotations_url = self._makeStringAttribute(
attributes["annotations_url"]
)
if "summary" in attributes: # pragma no branch
self._summary = self._makeStringAttribute(attributes["summary"])
if "text" in attributes: # pragma no branch
self._text = self._makeStringAttribute(attributes["text"])
if "title" in attributes: # pragma no branch
self._title = self._makeStringAttribute(attributes["title"])
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/CheckRunOutput.pyi 0000644 0001751 0000171 00000001035 00000000000 017466 0 ustar 00runner docker from typing import Any, Dict
from github.GithubObject import NonCompletableGithubObject
class CheckRunOutput(NonCompletableGithubObject):
def __repr__(self) -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
@property
def annotations_count(self) -> int: ...
@property
def annotations_url(self) -> str: ...
@property
def summary(self) -> str: ...
@property
def text(self) -> str: ...
@property
def title(self) -> str: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/CheckSuite.py 0000644 0001751 0000171 00000024541 00000000000 016430 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2020 Raju Subramanian #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
import github
class CheckSuite(github.GithubObject.CompletableGithubObject):
"""
This class represents check suites. The reference can be found here https://docs.github.com/en/rest/reference/checks#check-suites
"""
def __repr__(self):
return self.get__repr__({"id": self._id.value, "url": self._url.value})
@property
def after(self):
"""
:type: string
"""
self._completeIfNotSet(self._after)
return self._after.value
@property
def app(self):
"""
:type: :class:`github.GithubApp.GithubApp`
"""
self._completeIfNotSet(self._app)
return self._app.value
@property
def before(self):
"""
:type: string
"""
self._completeIfNotSet(self._before)
return self._before.value
@property
def check_runs_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._check_runs_url)
return self._check_runs_url.value
@property
def conclusion(self):
"""
:type: string
"""
self._completeIfNotSet(self._conclusion)
return self._conclusion.value
@property
def created_at(self):
"""
:type: datetime.datetime
"""
self._completeIfNotSet(self._created_at)
return self._created_at.value
@property
def head_branch(self):
"""
:type: string
"""
self._completeIfNotSet(self._head_branch)
return self._head_branch.value
@property
def head_commit(self):
"""
:type: :class:`github.GitCommit.GitCommit`
"""
self._completeIfNotSet(self._head_commit)
return self._head_commit.value
@property
def head_sha(self):
"""
:type: string
"""
self._completeIfNotSet(self._head_sha)
return self._head_sha.value
@property
def id(self):
"""
:type: int
"""
self._completeIfNotSet(self._id)
return self._id.value
@property
def latest_check_runs_count(self):
"""
:type: int
"""
self._completeIfNotSet(self._latest_check_runs_count)
return self._latest_check_runs_count.value
@property
def pull_requests(self):
"""
:type: list of :class:`github.PullRequest.PullRequest`
"""
self._completeIfNotSet(self._pull_requests)
return self._pull_requests.value
@property
def repository(self):
"""
:type: :class:`github.Repository.Repository`
"""
self._completeIfNotSet(self._repository)
return self._repository.value
@property
def status(self):
"""
:type: string
"""
self._completeIfNotSet(self._status)
return self._status.value
@property
def updated_at(self):
"""
:type: datetime.datetime
"""
self._completeIfNotSet(self._updated_at)
return self._updated_at.value
@property
def url(self):
"""
:type: string
"""
self._completeIfNotSet(self._url)
return self._url.value
def rerequest(self):
"""
:calls: `POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest `_
:rtype: bool
"""
request_headers = {"Accept": "application/vnd.github.v3+json"}
status, _, _ = self._requester.requestJson(
"POST", f"{self.url}/rerequest", headers=request_headers
)
return status == 201
def get_check_runs(
self,
check_name=github.GithubObject.NotSet,
status=github.GithubObject.NotSet,
filter=github.GithubObject.NotSet,
):
"""
:calls: `GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs `_
:param check_name: string
:param status: string
:param filter: string
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.CheckRun.CheckRun`
"""
assert check_name is github.GithubObject.NotSet or isinstance(
check_name, str
), check_name
assert status is github.GithubObject.NotSet or isinstance(status, str), status
assert filter is github.GithubObject.NotSet or isinstance(filter, str), filter
url_parameters = dict()
if check_name is not github.GithubObject.NotSet:
url_parameters["check_name"] = check_name
if status is not github.GithubObject.NotSet:
url_parameters["status"] = status
if filter is not github.GithubObject.NotSet:
url_parameters["filter"] = filter
return github.PaginatedList.PaginatedList(
github.CheckRun.CheckRun,
self._requester,
f"{self.url}/check-runs",
url_parameters,
headers={"Accept": "application/vnd.github.v3+json"},
list_item="check_runs",
)
def _initAttributes(self):
self._after = github.GithubObject.NotSet
self._app = github.GithubObject.NotSet
self._before = github.GithubObject.NotSet
self._check_runs_url = github.GithubObject.NotSet
self._conclusion = github.GithubObject.NotSet
self._created_at = github.GithubObject.NotSet
self._head_branch = github.GithubObject.NotSet
self._head_commit = github.GithubObject.NotSet
self._head_sha = github.GithubObject.NotSet
self._id = github.GithubObject.NotSet
self._latest_check_runs_count = github.GithubObject.NotSet
self._pull_requests = github.GithubObject.NotSet
self._repository = github.GithubObject.NotSet
self._status = github.GithubObject.NotSet
self._updated_at = github.GithubObject.NotSet
self._url = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "after" in attributes: # pragma no branch
self._after = self._makeStringAttribute(attributes["after"])
if "app" in attributes: # pragma no branch
self._app = self._makeClassAttribute(
github.GithubApp.GithubApp, attributes["app"]
)
if "before" in attributes: # pragma no branch
self._before = self._makeStringAttribute(attributes["before"])
if "check_runs_url" in attributes: # pragma no branch
self._check_runs_url = self._makeStringAttribute(
attributes["check_runs_url"]
)
if "conclusion" in attributes: # pragma no branch
self._conclusion = self._makeStringAttribute(attributes["conclusion"])
if "created_at" in attributes: # pragma no branch
self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
if "head_branch" in attributes: # pragma no branch
self._head_branch = self._makeStringAttribute(attributes["head_branch"])
if "head_commit" in attributes: # pragma no branch
# This JSON swaps the 'sha' attribute for an 'id' attribute.
# The GitCommit object only looks for 'sha'
if "id" in attributes["head_commit"]:
attributes["head_commit"]["sha"] = attributes["head_commit"]["id"]
self._head_commit = self._makeClassAttribute(
github.GitCommit.GitCommit, attributes["head_commit"]
)
if "head_sha" in attributes: # pragma no branch
self._head_sha = self._makeStringAttribute(attributes["head_sha"])
if "id" in attributes: # pragma no branch
self._id = self._makeIntAttribute(attributes["id"])
if "latest_check_runs_count" in attributes: # pragma no branch
self._latest_check_runs_count = self._makeIntAttribute(
attributes["latest_check_runs_count"]
)
if "pull_requests" in attributes: # pragma no branch
self._pull_requests = self._makeListOfClassesAttribute(
github.PullRequest.PullRequest, attributes["pull_requests"]
)
if "repository" in attributes: # pragma no branch
self._repository = self._makeClassAttribute(
github.Repository.Repository, attributes["repository"]
)
if "status" in attributes: # pragma no branch
self._status = self._makeStringAttribute(attributes["status"])
if "updated_at" in attributes: # pragma no branch
self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
if "url" in attributes: # pragma no branch
self._url = self._makeStringAttribute(attributes["url"])
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/CheckSuite.pyi 0000644 0001751 0000171 00000003027 00000000000 016575 0 ustar 00runner docker from datetime import datetime
from typing import Any, Dict, List
from github.CheckRun import CheckRun
from github.GitCommit import GitCommit
from github.GithubApp import GithubApp
from github.GithubObject import CompletableGithubObject
from github.PaginatedList import PaginatedList
from github.PullRequest import PullRequest
from github.Repository import Repository
class CheckSuite(CompletableGithubObject):
def __repr__(self) -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
@property
def after(self) -> str: ...
@property
def app(self) -> GithubApp: ...
@property
def before(self) -> str: ...
@property
def check_runs_url(self) -> str: ...
@property
def conclusion(self) -> str: ...
@property
def created_at(self) -> datetime: ...
@property
def head_branch(self) -> str: ...
@property
def head_commit(self) -> GitCommit: ...
@property
def head_sha(self) -> str: ...
@property
def id(self) -> int: ...
@property
def latest_check_runs_count(self) -> int: ...
@property
def pull_requests(self) -> List[PullRequest]: ...
@property
def repository(self) -> Repository: ...
@property
def status(self) -> str: ...
@property
def updated_at(self) -> datetime: ...
@property
def url(self) -> str: ...
def rerequest(self) -> bool: ...
def get_check_runs(
self, check_name: str, status: str, filter: str
) -> PaginatedList[CheckRun]: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/Clones.py 0000644 0001751 0000171 00000006722 00000000000 015625 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2018 Justin Kufro #
# Copyright 2018 Ivan Minno #
# Copyright 2018 Zilei Gu #
# Copyright 2018 Yves Zumbach #
# Copyright 2018 Leying Chen #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
import github.GithubObject
class Clones(github.GithubObject.NonCompletableGithubObject):
"""
This class represents a popular Path for a GitHub repository.
The reference can be found here https://docs.github.com/en/rest/reference/repos#get-repository-clones
"""
def __repr__(self):
return self.get__repr__(
{
"timestamp": self._timestamp.value,
"count": self._count.value,
"uniques": self._uniques.value,
}
)
@property
def timestamp(self):
"""
:type: datetime.datetime
"""
return self._timestamp.value
@property
def count(self):
"""
:type: integer
"""
return self._count.value
@property
def uniques(self):
"""
:type: integer
"""
return self._uniques.value
def _initAttributes(self):
self._timestamp = github.GithubObject.NotSet
self._count = github.GithubObject.NotSet
self._uniques = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "timestamp" in attributes: # pragma no branch
self._timestamp = self._makeDatetimeAttribute(attributes["timestamp"])
if "count" in attributes: # pragma no branch
self._count = self._makeIntAttribute(attributes["count"])
if "uniques" in attributes: # pragma no branch
self._uniques = self._makeIntAttribute(attributes["uniques"])
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/Clones.pyi 0000644 0001751 0000171 00000000713 00000000000 015770 0 ustar 00runner docker from datetime import datetime
from typing import Any, Dict
from github.GithubObject import NonCompletableGithubObject
class Clones(NonCompletableGithubObject):
def __repr__(self) -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
@property
def count(self) -> int: ...
@property
def timestamp(self) -> datetime: ...
@property
def uniques(self) -> int: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/Commit.py 0000644 0001751 0000171 00000035316 00000000000 015633 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques #
# Copyright 2012 Zearin #
# Copyright 2013 AKFish #
# Copyright 2013 Vincent Jacques #
# Copyright 2013 martinqt #
# Copyright 2014 Andy Casey #
# Copyright 2014 Vincent Jacques #
# Copyright 2016 Jannis Gebauer #
# Copyright 2016 John Eskew #
# Copyright 2016 Peter Buckley #
# Copyright 2018 sfdye #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
import github.CheckRun
import github.CheckSuite
import github.CommitCombinedStatus
import github.CommitComment
import github.CommitStats
import github.CommitStatus
import github.File
import github.GitCommit
import github.GithubObject
import github.NamedUser
import github.PaginatedList
class Commit(github.GithubObject.CompletableGithubObject):
"""
This class represents Commits. The reference can be found here http://docs.github.com/en/rest/reference/git#commits
"""
def __repr__(self):
return self.get__repr__({"sha": self._sha.value})
@property
def author(self):
"""
:type: :class:`github.NamedUser.NamedUser`
"""
self._completeIfNotSet(self._author)
return self._author.value
@property
def comments_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._comments_url)
return self._comments_url.value
@property
def commit(self):
"""
:type: :class:`github.GitCommit.GitCommit`
"""
self._completeIfNotSet(self._commit)
return self._commit.value
@property
def committer(self):
"""
:type: :class:`github.NamedUser.NamedUser`
"""
self._completeIfNotSet(self._committer)
return self._committer.value
@property
def files(self):
"""
:type: list of :class:`github.File.File`
"""
self._completeIfNotSet(self._files)
return self._files.value
@property
def html_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._html_url)
return self._html_url.value
@property
def parents(self):
"""
:type: list of :class:`github.Commit.Commit`
"""
self._completeIfNotSet(self._parents)
return self._parents.value
@property
def sha(self):
"""
:type: string
"""
self._completeIfNotSet(self._sha)
return self._sha.value
@property
def stats(self):
"""
:type: :class:`github.CommitStats.CommitStats`
"""
self._completeIfNotSet(self._stats)
return self._stats.value
@property
def url(self):
"""
:type: string
"""
self._completeIfNotSet(self._url)
return self._url.value
def create_comment(
self,
body,
line=github.GithubObject.NotSet,
path=github.GithubObject.NotSet,
position=github.GithubObject.NotSet,
):
"""
:calls: `POST /repos/{owner}/{repo}/commits/{sha}/comments `_
:param body: string
:param line: integer
:param path: string
:param position: integer
:rtype: :class:`github.CommitComment.CommitComment`
"""
assert isinstance(body, str), body
assert line is github.GithubObject.NotSet or isinstance(line, int), line
assert path is github.GithubObject.NotSet or isinstance(path, str), path
assert position is github.GithubObject.NotSet or isinstance(
position, int
), position
post_parameters = {
"body": body,
}
if line is not github.GithubObject.NotSet:
post_parameters["line"] = line
if path is not github.GithubObject.NotSet:
post_parameters["path"] = path
if position is not github.GithubObject.NotSet:
post_parameters["position"] = position
headers, data = self._requester.requestJsonAndCheck(
"POST", f"{self.url}/comments", input=post_parameters
)
return github.CommitComment.CommitComment(
self._requester, headers, data, completed=True
)
def create_status(
self,
state,
target_url=github.GithubObject.NotSet,
description=github.GithubObject.NotSet,
context=github.GithubObject.NotSet,
):
"""
:calls: `POST /repos/{owner}/{repo}/statuses/{sha} `_
:param state: string
:param target_url: string
:param description: string
:param context: string
:rtype: :class:`github.CommitStatus.CommitStatus`
"""
assert isinstance(state, str), state
assert target_url is github.GithubObject.NotSet or isinstance(
target_url, str
), target_url
assert description is github.GithubObject.NotSet or isinstance(
description, str
), description
assert context is github.GithubObject.NotSet or isinstance(
context, str
), context
post_parameters = {
"state": state,
}
if target_url is not github.GithubObject.NotSet:
post_parameters["target_url"] = target_url
if description is not github.GithubObject.NotSet:
post_parameters["description"] = description
if context is not github.GithubObject.NotSet:
post_parameters["context"] = context
headers, data = self._requester.requestJsonAndCheck(
"POST",
f"{self._parentUrl(self._parentUrl(self.url))}/statuses/{self.sha}",
input=post_parameters,
)
return github.CommitStatus.CommitStatus(
self._requester, headers, data, completed=True
)
def get_comments(self):
"""
:calls: `GET /repos/{owner}/{repo}/commits/{sha}/comments `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.CommitComment.CommitComment`
"""
return github.PaginatedList.PaginatedList(
github.CommitComment.CommitComment,
self._requester,
f"{self.url}/comments",
None,
)
def get_statuses(self):
"""
:calls: `GET /repos/{owner}/{repo}/statuses/{ref} `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.CommitStatus.CommitStatus`
"""
return github.PaginatedList.PaginatedList(
github.CommitStatus.CommitStatus,
self._requester,
f"{self._parentUrl(self._parentUrl(self.url))}/statuses/{self.sha}",
None,
)
def get_combined_status(self):
"""
:calls: `GET /repos/{owner}/{repo}/commits/{ref}/status/ `_
:rtype: :class:`github.CommitCombinedStatus.CommitCombinedStatus`
"""
headers, data = self._requester.requestJsonAndCheck("GET", f"{self.url}/status")
return github.CommitCombinedStatus.CommitCombinedStatus(
self._requester, headers, data, completed=True
)
def get_pulls(self):
"""
:calls: `GET /repos/{owner}/{repo}/commits/{sha}/pulls `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.PullRequest.PullRequest`
"""
return github.PaginatedList.PaginatedList(
github.PullRequest.PullRequest,
self._requester,
f"{self.url}/pulls",
None,
headers={"Accept": "application/vnd.github.groot-preview+json"},
)
def get_check_runs(
self,
check_name=github.GithubObject.NotSet,
status=github.GithubObject.NotSet,
filter=github.GithubObject.NotSet,
):
"""
:calls: `GET /repos/{owner}/{repo}/commits/{sha}/check-runs `_
:param check_name: string
:param status: string
:param filter: string
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.CheckRun.CheckRun`
"""
assert check_name is github.GithubObject.NotSet or isinstance(
check_name, str
), check_name
assert status is github.GithubObject.NotSet or isinstance(status, str), status
assert filter is github.GithubObject.NotSet or isinstance(filter, str), filter
url_parameters = dict()
if check_name is not github.GithubObject.NotSet:
url_parameters["check_name"] = check_name
if status is not github.GithubObject.NotSet:
url_parameters["status"] = status
if filter is not github.GithubObject.NotSet:
url_parameters["filter"] = filter
return github.PaginatedList.PaginatedList(
github.CheckRun.CheckRun,
self._requester,
f"{self.url}/check-runs",
url_parameters,
headers={"Accept": "application/vnd.github.v3+json"},
list_item="check_runs",
)
def get_check_suites(
self, app_id=github.GithubObject.NotSet, check_name=github.GithubObject.NotSet
):
"""
:class: `GET /repos/{owner}/{repo}/commits/{ref}/check-suites `_
:param app_id: int
:param check_name: string
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.CheckSuite.CheckSuite`
"""
assert app_id is github.GithubObject.NotSet or isinstance(app_id, int), app_id
assert check_name is github.GithubObject.NotSet or isinstance(
check_name, str
), check_name
parameters = dict()
if app_id is not github.GithubObject.NotSet:
parameters["app_id"] = app_id
if check_name is not github.GithubObject.NotSet:
parameters["check_name"] = check_name
request_headers = {"Accept": "application/vnd.github.v3+json"}
return github.PaginatedList.PaginatedList(
github.CheckSuite.CheckSuite,
self._requester,
f"{self.url}/check-suites",
parameters,
headers=request_headers,
list_item="check_suites",
)
@property
def _identity(self):
return self.sha
def _initAttributes(self):
self._author = github.GithubObject.NotSet
self._comments_url = github.GithubObject.NotSet
self._commit = github.GithubObject.NotSet
self._committer = github.GithubObject.NotSet
self._files = github.GithubObject.NotSet
self._html_url = github.GithubObject.NotSet
self._parents = github.GithubObject.NotSet
self._sha = github.GithubObject.NotSet
self._stats = github.GithubObject.NotSet
self._url = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "author" in attributes: # pragma no branch
self._author = self._makeClassAttribute(
github.NamedUser.NamedUser, attributes["author"]
)
if "comments_url" in attributes: # pragma no branch
self._comments_url = self._makeStringAttribute(attributes["comments_url"])
if "commit" in attributes: # pragma no branch
self._commit = self._makeClassAttribute(
github.GitCommit.GitCommit, attributes["commit"]
)
if "committer" in attributes: # pragma no branch
self._committer = self._makeClassAttribute(
github.NamedUser.NamedUser, attributes["committer"]
)
if "files" in attributes: # pragma no branch
self._files = self._makeListOfClassesAttribute(
github.File.File, attributes["files"]
)
if "html_url" in attributes: # pragma no branch
self._html_url = self._makeStringAttribute(attributes["html_url"])
if "parents" in attributes: # pragma no branch
self._parents = self._makeListOfClassesAttribute(
Commit, attributes["parents"]
)
if "sha" in attributes: # pragma no branch
self._sha = self._makeStringAttribute(attributes["sha"])
if "stats" in attributes: # pragma no branch
self._stats = self._makeClassAttribute(
github.CommitStats.CommitStats, attributes["stats"]
)
if "url" in attributes: # pragma no branch
self._url = self._makeStringAttribute(attributes["url"])
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/Commit.pyi 0000644 0001751 0000171 00000004432 00000000000 015777 0 ustar 00runner docker from typing import Any, Dict, List, Union
from github.CheckRun import CheckRun
from github.CheckSuite import CheckSuite
from github.CommitCombinedStatus import CommitCombinedStatus
from github.CommitComment import CommitComment
from github.CommitStats import CommitStats
from github.CommitStatus import CommitStatus
from github.File import File
from github.GitCommit import GitCommit
from github.GithubObject import CompletableGithubObject, _NotSetType
from github.NamedUser import NamedUser
from github.PaginatedList import PaginatedList
class Commit(CompletableGithubObject):
def __repr__(self) -> str: ...
@property
def _identity(self) -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
@property
def author(self) -> NamedUser: ...
@property
def comments_url(self) -> str: ...
@property
def commit(self) -> GitCommit: ...
@property
def committer(self) -> NamedUser: ...
def create_comment(
self,
body: str,
line: Union[int, _NotSetType] = ...,
path: Union[_NotSetType, str] = ...,
position: Union[int, _NotSetType] = ...,
) -> CommitComment: ...
def create_status(
self,
state: str,
target_url: Union[_NotSetType, str] = ...,
description: Union[_NotSetType, str] = ...,
context: Union[_NotSetType, str] = ...,
) -> CommitStatus: ...
@property
def files(self) -> List[File]: ...
def get_check_suites(
self,
app_id: Union[_NotSetType, int],
check_name: Union[_NotSetType, str],
) -> PaginatedList[CheckSuite]: ...
def get_combined_status(self) -> CommitCombinedStatus: ...
def get_comments(self) -> PaginatedList[CommitComment]: ...
def get_statuses(self) -> PaginatedList[CommitStatus]: ...
def get_check_runs(
self,
check_name: Union[_NotSetType, str] = ...,
status: Union[_NotSetType, str] = ...,
filter: Union[_NotSetType, str] = ...,
) -> PaginatedList[CheckRun]: ...
@property
def html_url(self) -> str: ...
@property
def parents(self) -> List[Commit]: ...
@property
def sha(self) -> str: ...
@property
def stats(self) -> CommitStats: ...
@property
def url(self) -> str: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/CommitCombinedStatus.py 0000644 0001751 0000171 00000011341 00000000000 020470 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2016 Jannis Gebauer #
# Copyright 2016 John Eskew #
# Copyright 2016 Peter Buckley #
# Copyright 2018 Wan Liuyang #
# Copyright 2018 sfdye #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
import github.CommitStatus
import github.GithubObject
import github.Repository
class CommitCombinedStatus(github.GithubObject.NonCompletableGithubObject):
"""
This class represents CommitCombinedStatuses. The reference can be found here https://docs.github.com/en/rest/reference/repos#statuses
"""
def __repr__(self):
return self.get__repr__({"sha": self._sha.value, "state": self._state.value})
@property
def state(self):
"""
:type: string
"""
return self._state.value
@property
def sha(self):
"""
:type: string
"""
return self._sha.value
@property
def total_count(self):
"""
:type: integer
"""
return self._total_count.value
@property
def commit_url(self):
"""
:type: string
"""
return self._commit_url.value
@property
def url(self):
"""
:type: string
"""
return self._url.value
@property
def repository(self):
"""
:type: :class:`github.Repository.Repository`
"""
return self._repository.value
@property
def statuses(self):
"""
:type: list of :class:`CommitStatus`
"""
return self._statuses.value
def _initAttributes(self):
self._state = github.GithubObject.NotSet
self._sha = github.GithubObject.NotSet
self._total_count = github.GithubObject.NotSet
self._commit_url = github.GithubObject.NotSet
self._url = github.GithubObject.NotSet
self._repository = github.GithubObject.NotSet
self._statuses = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "state" in attributes: # pragma no branch
self._state = self._makeStringAttribute(attributes["state"])
if "sha" in attributes: # pragma no branch
self._sha = self._makeStringAttribute(attributes["sha"])
if "total_count" in attributes: # pragma no branch
self._total_count = self._makeIntAttribute(attributes["total_count"])
if "commit_url" in attributes: # pragma no branch
self._commit_url = self._makeStringAttribute(attributes["commit_url"])
if "url" in attributes: # pragma no branch
self._url = self._makeStringAttribute(attributes["url"])
if "repository" in attributes: # pragma no branch
self._repository = self._makeClassAttribute(
github.Repository.Repository, attributes["repository"]
)
if "statuses" in attributes: # pragma no branch
self._statuses = self._makeListOfClassesAttribute(
github.CommitStatus.CommitStatus, attributes["statuses"]
)
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/CommitCombinedStatus.pyi 0000644 0001751 0000171 00000001351 00000000000 020641 0 ustar 00runner docker from typing import Any, Dict, List
from github.CommitStatus import CommitStatus
from github.GithubObject import NonCompletableGithubObject
from github.Repository import Repository
class CommitCombinedStatus(NonCompletableGithubObject):
def __repr__(self) -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
@property
def commit_url(self) -> str: ...
@property
def repository(self) -> Repository: ...
@property
def sha(self) -> str: ...
@property
def state(self) -> str: ...
@property
def statuses(self) -> List[CommitStatus]: ...
@property
def total_count(self) -> int: ...
@property
def url(self) -> str: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/CommitComment.py 0000644 0001751 0000171 00000022674 00000000000 017161 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques #
# Copyright 2012 Zearin #
# Copyright 2013 AKFish #
# Copyright 2013 Vincent Jacques #
# Copyright 2014 Vincent Jacques #
# Copyright 2016 Jannis Gebauer #
# Copyright 2016 Peter Buckley #
# Copyright 2017 Nicolas AgustÃn Torres #
# Copyright 2018 Wan Liuyang #
# Copyright 2018 per1234 #
# Copyright 2018 sfdye #
# Copyright 2020 Huan-Cheng Chang #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
import github.GithubObject
import github.NamedUser
from . import Consts
class CommitComment(github.GithubObject.CompletableGithubObject):
"""
This class represents CommitComments. The reference can be found here https://docs.github.com/en/rest/reference/repos#comments
"""
def __repr__(self):
return self.get__repr__({"id": self._id.value, "user": self.user})
@property
def body(self):
"""
:type: string
"""
self._completeIfNotSet(self._body)
return self._body.value
@property
def commit_id(self):
"""
:type: string
"""
self._completeIfNotSet(self._commit_id)
return self._commit_id.value
@property
def created_at(self):
"""
:type: datetime.datetime
"""
self._completeIfNotSet(self._created_at)
return self._created_at.value
@property
def html_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._html_url)
return self._html_url.value
@property
def id(self):
"""
:type: integer
"""
self._completeIfNotSet(self._id)
return self._id.value
@property
def line(self):
"""
:type: integer
"""
self._completeIfNotSet(self._line)
return self._line.value
@property
def path(self):
"""
:type: string
"""
self._completeIfNotSet(self._path)
return self._path.value
@property
def position(self):
"""
:type: integer
"""
self._completeIfNotSet(self._position)
return self._position.value
@property
def updated_at(self):
"""
:type: datetime.datetime
"""
self._completeIfNotSet(self._updated_at)
return self._updated_at.value
@property
def url(self):
"""
:type: string
"""
self._completeIfNotSet(self._url)
return self._url.value
@property
def user(self):
"""
:type: :class:`github.NamedUser.NamedUser`
"""
self._completeIfNotSet(self._user)
return self._user.value
def delete(self):
"""
:calls: `DELETE /repos/{owner}/{repo}/comments/{id} `_
:rtype: None
"""
headers, data = self._requester.requestJsonAndCheck("DELETE", self.url)
def edit(self, body):
"""
:calls: `PATCH /repos/{owner}/{repo}/comments/{id} `_
:param body: string
:rtype: None
"""
assert isinstance(body, str), body
post_parameters = {
"body": body,
}
headers, data = self._requester.requestJsonAndCheck(
"PATCH", self.url, input=post_parameters
)
self._useAttributes(data)
def get_reactions(self):
"""
:calls: `GET /repos/{owner}/{repo}/comments/{id}/reactions
`_
:return: :class: :class:`github.PaginatedList.PaginatedList` of :class:`github.Reaction.Reaction`
"""
return github.PaginatedList.PaginatedList(
github.Reaction.Reaction,
self._requester,
f"{self.url}/reactions",
None,
headers={"Accept": Consts.mediaTypeReactionsPreview},
)
def create_reaction(self, reaction_type):
"""
:calls: `POST /repos/{owner}/{repo}/comments/{id}/reactions
`_
:param reaction_type: string
:rtype: :class:`github.Reaction.Reaction`
"""
assert isinstance(reaction_type, str), reaction_type
post_parameters = {
"content": reaction_type,
}
headers, data = self._requester.requestJsonAndCheck(
"POST",
f"{self.url}/reactions",
input=post_parameters,
headers={"Accept": Consts.mediaTypeReactionsPreview},
)
return github.Reaction.Reaction(self._requester, headers, data, completed=True)
def delete_reaction(self, reaction_id):
"""
:calls: `DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}
`_
:param reaction_id: integer
:rtype: bool
"""
assert isinstance(reaction_id, int), reaction_id
status, _, _ = self._requester.requestJson(
"DELETE",
f"{self.url}/reactions/{reaction_id}",
headers={"Accept": Consts.mediaTypeReactionsPreview},
)
return status == 204
def _initAttributes(self):
self._body = github.GithubObject.NotSet
self._commit_id = github.GithubObject.NotSet
self._created_at = github.GithubObject.NotSet
self._html_url = github.GithubObject.NotSet
self._id = github.GithubObject.NotSet
self._line = github.GithubObject.NotSet
self._path = github.GithubObject.NotSet
self._position = github.GithubObject.NotSet
self._updated_at = github.GithubObject.NotSet
self._url = github.GithubObject.NotSet
self._user = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "body" in attributes: # pragma no branch
self._body = self._makeStringAttribute(attributes["body"])
if "commit_id" in attributes: # pragma no branch
self._commit_id = self._makeStringAttribute(attributes["commit_id"])
if "created_at" in attributes: # pragma no branch
self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
if "html_url" in attributes: # pragma no branch
self._html_url = self._makeStringAttribute(attributes["html_url"])
if "id" in attributes: # pragma no branch
self._id = self._makeIntAttribute(attributes["id"])
if "line" in attributes: # pragma no branch
self._line = self._makeIntAttribute(attributes["line"])
if "path" in attributes: # pragma no branch
self._path = self._makeStringAttribute(attributes["path"])
if "position" in attributes: # pragma no branch
self._position = self._makeIntAttribute(attributes["position"])
if "updated_at" in attributes: # pragma no branch
self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
if "url" in attributes: # pragma no branch
self._url = self._makeStringAttribute(attributes["url"])
if "user" in attributes: # pragma no branch
self._user = self._makeClassAttribute(
github.NamedUser.NamedUser, attributes["user"]
)
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/CommitComment.pyi 0000644 0001751 0000171 00000002370 00000000000 017321 0 ustar 00runner docker from datetime import datetime
from typing import Any, Dict, Optional
from github.GithubObject import CompletableGithubObject
from github.NamedUser import NamedUser
from github.PaginatedList import PaginatedList
from github.Reaction import Reaction
class CommitComment(CompletableGithubObject):
def __repr__(self) -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
@property
def body(self) -> str: ...
@property
def commit_id(self) -> str: ...
def create_reaction(self, reaction_type: str) -> Reaction: ...
@property
def created_at(self) -> datetime: ...
def delete(self) -> None: ...
def delete_reaction(self, reaction_id: int) -> bool: ...
def edit(self, body: str) -> None: ...
def get_reactions(self) -> PaginatedList[Reaction]: ...
@property
def html_url(self) -> str: ...
@property
def id(self) -> int: ...
@property
def line(self) -> Optional[int]: ...
@property
def path(self) -> Optional[str]: ...
@property
def position(self) -> Optional[int]: ...
@property
def updated_at(self) -> datetime: ...
@property
def url(self) -> str: ...
@property
def user(self) -> NamedUser: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/CommitStats.py 0000644 0001751 0000171 00000006524 00000000000 016651 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques #
# Copyright 2012 Zearin #
# Copyright 2013 AKFish #
# Copyright 2013 Vincent Jacques #
# Copyright 2014 Vincent Jacques #
# Copyright 2016 Peter Buckley #
# Copyright 2018 Wan Liuyang #
# Copyright 2018 sfdye #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
import github.GithubObject
class CommitStats(github.GithubObject.NonCompletableGithubObject):
"""
This class represents CommitStatses.
"""
@property
def additions(self):
"""
:type: integer
"""
return self._additions.value
@property
def deletions(self):
"""
:type: integer
"""
return self._deletions.value
@property
def total(self):
"""
:type: integer
"""
return self._total.value
def _initAttributes(self):
self._additions = github.GithubObject.NotSet
self._deletions = github.GithubObject.NotSet
self._total = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "additions" in attributes: # pragma no branch
self._additions = self._makeIntAttribute(attributes["additions"])
if "deletions" in attributes: # pragma no branch
self._deletions = self._makeIntAttribute(attributes["deletions"])
if "total" in attributes: # pragma no branch
self._total = self._makeIntAttribute(attributes["total"])
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/CommitStats.pyi 0000644 0001751 0000171 00000000607 00000000000 017016 0 ustar 00runner docker from typing import Dict
from github.GithubObject import NonCompletableGithubObject
class CommitStats(NonCompletableGithubObject):
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, int]) -> None: ...
@property
def additions(self) -> int: ...
@property
def deletions(self) -> int: ...
@property
def total(self) -> int: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/CommitStatus.py 0000644 0001751 0000171 00000013451 00000000000 017033 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques #
# Copyright 2012 Zearin #
# Copyright 2013 AKFish #
# Copyright 2013 Vincent Jacques #
# Copyright 2014 Vincent Jacques #
# Copyright 2015 Matt Babineau #
# Copyright 2016 Jannis Gebauer #
# Copyright 2016 Martijn Koster #
# Copyright 2016 Peter Buckley #
# Copyright 2018 Wan Liuyang #
# Copyright 2018 sfdye #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
import github.GithubObject
import github.NamedUser
class CommitStatus(github.GithubObject.NonCompletableGithubObject):
"""
This class represents CommitStatuses.The reference can be found here https://docs.github.com/en/rest/reference/repos#statuses
"""
def __repr__(self):
return self.get__repr__(
{
"id": self._id.value,
"state": self._state.value,
"context": self._context.value,
}
)
@property
def created_at(self):
"""
:type: datetime.datetime
"""
return self._created_at.value
@property
def creator(self):
"""
:type: :class:`github.NamedUser.NamedUser`
"""
return self._creator.value
@property
def description(self):
"""
:type: string
"""
return self._description.value
@property
def id(self):
"""
:type: integer
"""
return self._id.value
@property
def state(self):
"""
:type: string
"""
return self._state.value
@property
def context(self):
"""
:type: string
"""
return self._context.value
@property
def target_url(self):
"""
:type: string
"""
return self._target_url.value
@property
def updated_at(self):
"""
:type: datetime.datetime
"""
return self._updated_at.value
@property
def url(self):
"""
:type: string
"""
return self._url.value
def _initAttributes(self):
self._created_at = github.GithubObject.NotSet
self._creator = github.GithubObject.NotSet
self._description = github.GithubObject.NotSet
self._id = github.GithubObject.NotSet
self._state = github.GithubObject.NotSet
self._context = github.GithubObject.NotSet
self._target_url = github.GithubObject.NotSet
self._updated_at = github.GithubObject.NotSet
self._url = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "created_at" in attributes: # pragma no branch
self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
if "creator" in attributes: # pragma no branch
self._creator = self._makeClassAttribute(
github.NamedUser.NamedUser, attributes["creator"]
)
if "description" in attributes: # pragma no branch
self._description = self._makeStringAttribute(attributes["description"])
if "id" in attributes: # pragma no branch
self._id = self._makeIntAttribute(attributes["id"])
if "state" in attributes: # pragma no branch
self._state = self._makeStringAttribute(attributes["state"])
if "context" in attributes: # pragma no branch
self._context = self._makeStringAttribute(attributes["context"])
if "target_url" in attributes: # pragma no branch
self._target_url = self._makeStringAttribute(attributes["target_url"])
if "updated_at" in attributes: # pragma no branch
self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
if "url" in attributes: # pragma no branch
self._url = self._makeStringAttribute(attributes["url"])
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/CommitStatus.pyi 0000644 0001751 0000171 00000001503 00000000000 017177 0 ustar 00runner docker from datetime import datetime
from typing import Any, Dict, Optional
from github.GithubObject import NonCompletableGithubObject
from github.NamedUser import NamedUser
class CommitStatus(NonCompletableGithubObject):
def __repr__(self) -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
@property
def context(self) -> str: ...
@property
def created_at(self) -> datetime: ...
@property
def creator(self) -> NamedUser: ...
@property
def description(self) -> Optional[str]: ...
@property
def id(self) -> int: ...
@property
def state(self) -> str: ...
@property
def target_url(self) -> Optional[str]: ...
@property
def updated_at(self) -> datetime: ...
@property
def url(self) -> str: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/Comparison.py 0000644 0001751 0000171 00000016613 00000000000 016514 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques #
# Copyright 2012 Zearin #
# Copyright 2013 AKFish #
# Copyright 2013 Vincent Jacques #
# Copyright 2014 Vincent Jacques #
# Copyright 2016 Peter Buckley #
# Copyright 2018 Wan Liuyang #
# Copyright 2018 sfdye #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
import github.Commit
import github.File
import github.GithubObject
class Comparison(github.GithubObject.CompletableGithubObject):
"""
This class represents Comparisons
"""
@property
def ahead_by(self):
"""
:type: integer
"""
self._completeIfNotSet(self._ahead_by)
return self._ahead_by.value
@property
def base_commit(self):
"""
:type: :class:`github.Commit.Commit`
"""
self._completeIfNotSet(self._base_commit)
return self._base_commit.value
@property
def behind_by(self):
"""
:type: integer
"""
self._completeIfNotSet(self._behind_by)
return self._behind_by.value
@property
def commits(self):
"""
:type: list of :class:`github.Commit.Commit`
"""
self._completeIfNotSet(self._commits)
return self._commits.value
@property
def diff_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._diff_url)
return self._diff_url.value
@property
def files(self):
"""
:type: list of :class:`github.File.File`
"""
self._completeIfNotSet(self._files)
return self._files.value
@property
def html_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._html_url)
return self._html_url.value
@property
def merge_base_commit(self):
"""
:type: :class:`github.Commit.Commit`
"""
self._completeIfNotSet(self._merge_base_commit)
return self._merge_base_commit.value
@property
def patch_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._patch_url)
return self._patch_url.value
@property
def permalink_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._permalink_url)
return self._permalink_url.value
@property
def status(self):
"""
:type: string
"""
self._completeIfNotSet(self._status)
return self._status.value
@property
def total_commits(self):
"""
:type: integer
"""
self._completeIfNotSet(self._total_commits)
return self._total_commits.value
@property
def url(self):
"""
:type: string
"""
self._completeIfNotSet(self._url)
return self._url.value
def _initAttributes(self):
self._ahead_by = github.GithubObject.NotSet
self._base_commit = github.GithubObject.NotSet
self._behind_by = github.GithubObject.NotSet
self._commits = github.GithubObject.NotSet
self._diff_url = github.GithubObject.NotSet
self._files = github.GithubObject.NotSet
self._html_url = github.GithubObject.NotSet
self._merge_base_commit = github.GithubObject.NotSet
self._patch_url = github.GithubObject.NotSet
self._permalink_url = github.GithubObject.NotSet
self._status = github.GithubObject.NotSet
self._total_commits = github.GithubObject.NotSet
self._url = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "ahead_by" in attributes: # pragma no branch
self._ahead_by = self._makeIntAttribute(attributes["ahead_by"])
if "base_commit" in attributes: # pragma no branch
self._base_commit = self._makeClassAttribute(
github.Commit.Commit, attributes["base_commit"]
)
if "behind_by" in attributes: # pragma no branch
self._behind_by = self._makeIntAttribute(attributes["behind_by"])
if "commits" in attributes: # pragma no branch
self._commits = self._makeListOfClassesAttribute(
github.Commit.Commit, attributes["commits"]
)
if "diff_url" in attributes: # pragma no branch
self._diff_url = self._makeStringAttribute(attributes["diff_url"])
if "files" in attributes: # pragma no branch
self._files = self._makeListOfClassesAttribute(
github.File.File, attributes["files"]
)
if "html_url" in attributes: # pragma no branch
self._html_url = self._makeStringAttribute(attributes["html_url"])
if "merge_base_commit" in attributes: # pragma no branch
self._merge_base_commit = self._makeClassAttribute(
github.Commit.Commit, attributes["merge_base_commit"]
)
if "patch_url" in attributes: # pragma no branch
self._patch_url = self._makeStringAttribute(attributes["patch_url"])
if "permalink_url" in attributes: # pragma no branch
self._permalink_url = self._makeStringAttribute(attributes["permalink_url"])
if "status" in attributes: # pragma no branch
self._status = self._makeStringAttribute(attributes["status"])
if "total_commits" in attributes: # pragma no branch
self._total_commits = self._makeIntAttribute(attributes["total_commits"])
if "url" in attributes: # pragma no branch
self._url = self._makeStringAttribute(attributes["url"])
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/Comparison.pyi 0000644 0001751 0000171 00000001727 00000000000 016665 0 ustar 00runner docker from typing import Any, Dict, List
from github.Commit import Commit
from github.File import File
from github.GithubObject import CompletableGithubObject
class Comparison(CompletableGithubObject):
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
@property
def ahead_by(self) -> int: ...
@property
def base_commit(self) -> Commit: ...
@property
def behind_by(self) -> int: ...
@property
def commits(self) -> List[Commit]: ...
@property
def diff_url(self) -> str: ...
@property
def files(self) -> List[File]: ...
@property
def html_url(self) -> str: ...
@property
def merge_base_commit(self) -> Commit: ...
@property
def patch_url(self) -> str: ...
@property
def permalink_url(self) -> str: ...
@property
def status(self) -> str: ...
@property
def total_commits(self) -> int: ...
@property
def url(self) -> str: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/Consts.py 0000644 0001751 0000171 00000015336 00000000000 015654 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2013 AKFish #
# Copyright 2013 Vincent Jacques #
# Copyright 2014 Vincent Jacques #
# Copyright 2016 Jakub Wilk #
# Copyright 2016 Peter Buckley #
# Copyright 2018 Maarten Fonville #
# Copyright 2018 Wan Liuyang #
# Copyright 2018 sfdye #
# Copyright 2019 Nick Campbell #
# Copyright 2020 Pascal Hofmann #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
REQ_IF_NONE_MATCH = "If-None-Match"
REQ_IF_MODIFIED_SINCE = "If-Modified-Since"
PROCESSING_202_WAIT_TIME = 2
# ##############################################################################
# Response Header #
# (Lower Case) #
# ##############################################################################
RES_ETAG = "etag"
RES_LAST_MODIFIED = "last-modified"
# Inspired by https://github.com/google/go-github
# Headers
headerRateLimit = "x-ratelimit-limit"
headerRateRemaining = "x-ratelimit-remaining"
headerRateReset = "x-ratelimit-reset"
headerOAuthScopes = "x-oauth-scopes"
headerOTP = "x-github-otp"
defaultMediaType = "application/octet-stream"
# Custom media type for preview API
# https://developer.github.com/changes/2014-12-09-new-attributes-for-stars-api/
mediaTypeStarringPreview = "application/vnd.github.v3.star+json"
# https://developer.github.com/changes/2016-02-19-source-import-preview-api/
mediaTypeImportPreview = "application/vnd.github.barred-rock-preview"
# https://developer.github.com/changes/2016-05-12-reactions-api-preview/
mediaTypeReactionsPreview = "application/vnd.github.squirrel-girl-preview"
# https://developer.github.com/changes/2016-09-14-Integrations-Early-Access/
mediaTypeIntegrationPreview = "application/vnd.github.machine-man-preview+json"
# https://developer.github.com/changes/2016-09-14-projects-api/
mediaTypeProjectsPreview = "application/vnd.github.inertia-preview+json"
# https://developer.github.com/changes/2017-01-05-commit-search-api/
mediaTypeCommitSearchPreview = "application/vnd.github.cloak-preview"
# https://developer.github.com/changes/2017-02-28-user-blocking-apis-and-webhook/
mediaTypeBlockUsersPreview = "application/vnd.github.giant-sentry-fist-preview+json"
# https://developer.github.com/changes/2017-07-17-update-topics-on-repositories/
mediaTypeTopicsPreview = "application/vnd.github.mercy-preview+json"
# https://developer.github.com/changes/2018-02-22-label-description-search-preview/
mediaTypeLabelDescriptionSearchPreview = "application/vnd.github.symmetra-preview+json"
# https://developer.github.com/changes/2018-01-10-lock-reason-api-preview/
mediaTypeLockReasonPreview = "application/vnd.github.sailor-v-preview+json"
# https://developer.github.com/changes/2018-01-25-organization-invitation-api-preview/
mediaTypeOrganizationInvitationPreview = "application/vnd.github.dazzler-preview+json"
# https://developer.github.com/changes/2018-02-07-team-discussions-api
mediaTypeTeamDiscussionsPreview = "application/vnd.github.echo-preview+json"
# https://developer.github.com/changes/2018-03-16-protected-branches-required-approving-reviews/
mediaTypeRequireMultipleApprovingReviews = (
"application/vnd.github.luke-cage-preview+json"
)
# https://developer.github.com/changes/2018-05-24-user-migration-api/
mediaTypeMigrationPreview = "application/vnd.github.wyandotte-preview+json"
# https://docs.github.com/en/rest/reference/search#highlighting-code-search-results-1
highLightSearchPreview = "application/vnd.github.v3.text-match+json"
# https://developer.github.com/changes/2018-02-22-protected-branches-required-signatures/
signaturesProtectedBranchesPreview = "application/vnd.github.zzzax-preview+json"
# https://developer.github.com/changes/2019-04-24-vulnerability-alerts/
vulnerabilityAlertsPreview = "application/vnd.github.dorian-preview+json"
# https://developer.github.com/changes/2019-06-04-automated-security-fixes/
automatedSecurityFixes = "application/vnd.github.london-preview+json"
# https://developer.github.com/changes/2019-05-29-update-branch-api/
updateBranchPreview = "application/vnd.github.lydian-preview+json"
# https://developer.github.com/changes/2016-05-23-timeline-preview-api/
issueTimelineEventsPreview = "application/vnd.github.mockingbird-preview"
# https://docs.github.com/en/rest/reference/teams#check-if-a-team-manages-a-repository
teamRepositoryPermissions = "application/vnd.github.v3.repository+json"
# https://developer.github.com/changes/2016-04-06-deployment-and-deployment-status-enhancements/
deploymentEnhancementsPreview = "application/vnd.github.ant-man-preview+json"
# https://developer.github.com/changes/2018-10-16-deployments-environments-states-and-auto-inactive-updates/
deploymentStatusEnhancementsPreview = "application/vnd.github.flash-preview+json"
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/ContentFile.py 0000644 0001751 0000171 00000020643 00000000000 016612 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques #
# Copyright 2012 Zearin #
# Copyright 2013 AKFish #
# Copyright 2013 Vincent Jacques #
# Copyright 2014 Thialfihar #
# Copyright 2014 Vincent Jacques #
# Copyright 2016 Jannis Gebauer #
# Copyright 2016 Peter Buckley #
# Copyright 2018 Wan Liuyang #
# Copyright 2018 sfdye #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
import base64
import github.GithubObject
import github.Repository
class ContentFile(github.GithubObject.CompletableGithubObject):
"""
This class represents ContentFiles. The reference can be found here https://docs.github.com/en/rest/reference/repos#contents
"""
def __repr__(self):
return self.get__repr__({"path": self._path.value})
@property
def content(self):
"""
:type: string
"""
self._completeIfNotSet(self._content)
return self._content.value
@property
def decoded_content(self):
"""
:type: bytes
"""
assert self.encoding == "base64", f"unsupported encoding: {self.encoding}"
return base64.b64decode(bytearray(self.content, "utf-8"))
@property
def download_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._download_url)
return self._download_url.value
@property
def encoding(self):
"""
:type: string
"""
self._completeIfNotSet(self._encoding)
return self._encoding.value
@property
def git_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._git_url)
return self._git_url.value
@property
def html_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._html_url)
return self._html_url.value
@property
def license(self):
"""
:type: :class:`github.License.License`
"""
self._completeIfNotSet(self._license)
return self._license.value
@property
def name(self):
"""
:type: string
"""
self._completeIfNotSet(self._name)
return self._name.value
@property
def path(self):
"""
:type: string
"""
self._completeIfNotSet(self._path)
return self._path.value
@property
def repository(self):
"""
:type: :class:`github.Repository.Repository`
"""
if self._repository is github.GithubObject.NotSet:
# The repository was not set automatically, so it must be looked up by url.
repo_url = "/".join(
self.url.split("/")[:6]
) # pragma no cover (Should be covered)
self._repository = github.GithubObject._ValuedAttribute(
github.Repository.Repository(
self._requester, self._headers, {"url": repo_url}, completed=False
)
) # pragma no cover (Should be covered)
return self._repository.value
@property
def sha(self):
"""
:type: string
"""
self._completeIfNotSet(self._sha)
return self._sha.value
@property
def size(self):
"""
:type: integer
"""
self._completeIfNotSet(self._size)
return self._size.value
@property
def type(self):
"""
:type: string
"""
self._completeIfNotSet(self._type)
return self._type.value
@property
def url(self):
"""
:type: string
"""
self._completeIfNotSet(self._url)
return self._url.value
@property
def text_matches(self):
"""
:type: string
"""
self._completeIfNotSet(self._text_matches)
return self._text_matches.value
def _initAttributes(self):
self._content = github.GithubObject.NotSet
self._text_matches = github.GithubObject.NotSet
self._encoding = github.GithubObject.NotSet
self._download_url = github.GithubObject.NotSet
self._git_url = github.GithubObject.NotSet
self._html_url = github.GithubObject.NotSet
self._license = github.GithubObject.NotSet
self._name = github.GithubObject.NotSet
self._path = github.GithubObject.NotSet
self._repository = github.GithubObject.NotSet
self._sha = github.GithubObject.NotSet
self._size = github.GithubObject.NotSet
self._type = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "content" in attributes: # pragma no branch
self._content = self._makeStringAttribute(attributes["content"])
if "download_url" in attributes: # pragma no branch
self._download_url = self._makeStringAttribute(attributes["download_url"])
if "encoding" in attributes: # pragma no branch
self._encoding = self._makeStringAttribute(attributes["encoding"])
if "git_url" in attributes: # pragma no branch
self._git_url = self._makeStringAttribute(attributes["git_url"])
if "html_url" in attributes: # pragma no branch
self._html_url = self._makeStringAttribute(attributes["html_url"])
if "license" in attributes: # pragma no branch
self._license = self._makeClassAttribute(
github.License.License, attributes["license"]
)
if "name" in attributes: # pragma no branch
self._name = self._makeStringAttribute(attributes["name"])
if "path" in attributes: # pragma no branch
self._path = self._makeStringAttribute(attributes["path"])
if "repository" in attributes: # pragma no branch
self._repository = self._makeClassAttribute(
github.Repository.Repository, attributes["repository"]
)
if "sha" in attributes: # pragma no branch
self._sha = self._makeStringAttribute(attributes["sha"])
if "size" in attributes: # pragma no branch
self._size = self._makeIntAttribute(attributes["size"])
if "type" in attributes: # pragma no branch
self._type = self._makeStringAttribute(attributes["type"])
if "url" in attributes: # pragma no branch
self._url = self._makeStringAttribute(attributes["url"])
if "text_matches" in attributes: # pragma no branch
self._text_matches = self._makeListOfDictsAttribute(
attributes["text_matches"]
)
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/ContentFile.pyi 0000644 0001751 0000171 00000002156 00000000000 016762 0 ustar 00runner docker from typing import Any, Dict, List, Optional
from github.GithubObject import CompletableGithubObject
from github.License import License
from github.Repository import Repository
class ContentFile(CompletableGithubObject):
def __repr__(self) -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
@property
def content(self) -> Optional[str]: ...
@property
def decoded_content(self) -> bytes: ...
@property
def download_url(self) -> str: ...
@property
def encoding(self) -> str: ...
@property
def git_url(self) -> str: ...
@property
def html_url(self) -> str: ...
@property
def name(self) -> str: ...
@property
def path(self) -> str: ...
@property
def repository(self) -> Repository: ...
@property
def sha(self) -> str: ...
@property
def size(self) -> int: ...
@property
def text_matches(self) -> List[Dict[str, Any]]: ...
@property
def type(self) -> str: ...
@property
def url(self) -> str: ...
@property
def license(self) -> License: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/Deployment.py 0000644 0001751 0000171 00000027372 00000000000 016526 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2020 Steve Kowalik #
# Copyright 2020 Colby Gallup #
# Copyright 2020 Pascal Hofmann #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
import github.Consts
import github.DeploymentStatus
import github.GithubObject
class Deployment(github.GithubObject.CompletableGithubObject):
"""
This class represents Deployments. The reference can be found here https://docs.github.com/en/rest/reference/repos#deployments
"""
def __repr__(self):
return self.get__repr__({"id": self._id.value, "url": self._url.value})
@property
def id(self):
"""
:type: int
"""
self._completeIfNotSet(self._id)
return self._id.value
@property
def url(self):
"""
:type: string
"""
self._completeIfNotSet(self._url)
return self._url.value
@property
def sha(self):
"""
:type: string
"""
self._completeIfNotSet(self._sha)
return self._sha.value
@property
def task(self):
"""
:type: string
"""
self._completeIfNotSet(self._task)
return self._task.value
@property
def payload(self):
"""
:type: dict
"""
self._completeIfNotSet(self._payload)
return self._payload.value
@property
def original_environment(self):
"""
:type: string
"""
self._completeIfNotSet(self._original_environment)
return self._original_environment.value
@property
def environment(self):
"""
:type: string
"""
self._completeIfNotSet(self._environment)
return self._environment.value
@property
def production_environment(self):
"""
:type: bool
"""
self._completeIfNotSet(self._production_environment)
return self._production_environment.value
@property
def transient_environment(self):
"""
:type: bool
"""
self._completeIfNotSet(self._transient_environment)
return self._transient_environment.value
@property
def description(self):
"""
:type: string
"""
self._completeIfNotSet(self._description)
return self._description.value
@property
def creator(self):
"""
:type: :class:`github.NamedUser.NamedUser`
"""
self._completeIfNotSet(self._creator)
return self._creator.value
@property
def created_at(self):
"""
:type: datetime
"""
self._completeIfNotSet(self._created_at)
return self._created_at.value
@property
def updated_at(self):
"""
:type: datetime
"""
self._completeIfNotSet(self._updated_at)
return self._updated_at.value
@property
def statuses_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._statuses_url)
return self._statuses_url.value
@property
def repository_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._repository_url)
return self._repository_url.value
def get_statuses(self):
"""
:calls: `GET /repos/{owner}/deployments/{deployment_id}/statuses `_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.DeploymentStatus.DeploymentStatus`
"""
return github.PaginatedList.PaginatedList(
github.DeploymentStatus.DeploymentStatus,
self._requester,
f"{self.url}/statuses",
None,
headers={"Accept": self._get_accept_header()},
)
def get_status(self, id_):
"""
:calls: `GET /repos/{owner}/deployments/{deployment_id}/statuses/{status_id} `_
:param id_: int
:rtype: :class:`github.DeploymentStatus.DeploymentStatus`
"""
assert isinstance(id_, int), id_
headers, data = self._requester.requestJsonAndCheck(
"GET",
f"{self.url}/statuses/{id_}",
headers={"Accept": self._get_accept_header()},
)
return github.DeploymentStatus.DeploymentStatus(
self._requester, headers, data, completed=True
)
def create_status(
self,
state,
target_url=github.GithubObject.NotSet,
description=github.GithubObject.NotSet,
environment=github.GithubObject.NotSet,
environment_url=github.GithubObject.NotSet,
auto_inactive=github.GithubObject.NotSet,
):
"""
:calls: `POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses `_
:param: state: string
:param: target_url: string
:param: description: string
:param: environment: string
:param: environment_url: string
:param: auto_inactive: bool
:rtype: :class:`github.DeploymentStatus.DeploymentStatus`
"""
assert isinstance(state, str), state
assert target_url is github.GithubObject.NotSet or isinstance(
target_url, str
), target_url
assert description is github.GithubObject.NotSet or isinstance(
description, str
), description
assert environment is github.GithubObject.NotSet or isinstance(
environment, str
), environment
assert environment_url is github.GithubObject.NotSet or isinstance(
environment_url, str
), environment_url
assert auto_inactive is github.GithubObject.NotSet or isinstance(
auto_inactive, bool
), auto_inactive
post_parameters = {"state": state}
if target_url is not github.GithubObject.NotSet:
post_parameters["target_url"] = target_url
if description is not github.GithubObject.NotSet:
post_parameters["description"] = description
if environment is not github.GithubObject.NotSet:
post_parameters["environment"] = environment
if environment_url is not github.GithubObject.NotSet:
post_parameters["environment_url"] = environment_url
if auto_inactive is not github.GithubObject.NotSet:
post_parameters["auto_inactive"] = auto_inactive
headers, data = self._requester.requestJsonAndCheck(
"POST",
f"{self.url}/statuses",
input=post_parameters,
headers={"Accept": self._get_accept_header()},
)
return github.DeploymentStatus.DeploymentStatus(
self._requester, headers, data, completed=True
)
@staticmethod
def _get_accept_header():
return ", ".join(
[
github.Consts.deploymentEnhancementsPreview,
github.Consts.deploymentStatusEnhancementsPreview,
]
)
def _initAttributes(self):
self._id = github.GithubObject.NotSet
self._production_environment = github.GithubObject.NotSet
self._transient_environment = github.GithubObject.NotSet
self._url = github.GithubObject.NotSet
self._sha = github.GithubObject.NotSet
self._task = github.GithubObject.NotSet
self._payload = github.GithubObject.NotSet
self._original_environment = github.GithubObject.NotSet
self._environment = github.GithubObject.NotSet
self._description = github.GithubObject.NotSet
self._creator = github.GithubObject.NotSet
self._created_at = github.GithubObject.NotSet
self._updated_at = github.GithubObject.NotSet
self._statuses_url = github.GithubObject.NotSet
self._repository_url = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "id" in attributes: # pragma no branch
self._id = self._makeIntAttribute(attributes["id"])
if "production_environment" in attributes: # pragma no branch
self._production_environment = self._makeBoolAttribute(
attributes["production_environment"]
)
if "transient_environment" in attributes: # pragma no branch
self._transient_environment = self._makeBoolAttribute(
attributes["transient_environment"]
)
if "url" in attributes: # pragma no branch
self._url = self._makeStringAttribute(attributes["url"])
if "sha" in attributes: # pragma no branch
self._sha = self._makeStringAttribute(attributes["sha"])
if "task" in attributes: # pragma no branch
self._task = self._makeStringAttribute(attributes["task"])
if "payload" in attributes: # pragma no branch
self._payload = self._makeDictAttribute(attributes["payload"])
if "original_environment" in attributes: # pragma no branch
self._original_environment = self._makeStringAttribute(
attributes["original_environment"]
)
if "environment" in attributes: # pragma no branch
self._environment = self._makeStringAttribute(attributes["environment"])
if "description" in attributes: # pragma no branch
self._description = self._makeStringAttribute(attributes["description"])
if "creator" in attributes: # pragma no branch
self._creator = self._makeClassAttribute(
github.NamedUser.NamedUser, attributes["creator"]
)
if "created_at" in attributes: # pragma no branch
self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
if "updated_at" in attributes: # pragma no branch
self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
if "statuses_url" in attributes: # pragma no branch
self._statuses_url = self._makeStringAttribute(attributes["statuses_url"])
if "repository_url" in attributes: # pragma no branch
self._repository_url = self._makeStringAttribute(
attributes["repository_url"]
)
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/Deployment.pyi 0000644 0001751 0000171 00000003420 00000000000 016663 0 ustar 00runner docker from datetime import datetime
from typing import Any, Dict, Union
from github.DeploymentStatus import DeploymentStatus
from github.GithubObject import CompletableGithubObject, _NotSetType
from github.NamedUser import NamedUser
from github.PaginatedList import PaginatedList
class Deployment(CompletableGithubObject):
def __repr__(self) -> str: ...
@staticmethod
def _get_accept_header() -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
def get_statuses(self) -> PaginatedList[DeploymentStatus]: ...
def get_status(self, id_: int) -> DeploymentStatus: ...
def create_status(
self,
state: str,
target_url: Union[str, _NotSetType] = ...,
description: Union[str, _NotSetType] = ...,
environment: Union[str, _NotSetType] = ...,
environment_url: Union[str, _NotSetType] = ...,
auto_inactive: Union[bool, _NotSetType] = ...,
) -> DeploymentStatus: ...
@property
def id(self) -> int: ...
@property
def url(self) -> str: ...
@property
def sha(self) -> str: ...
@property
def task(self) -> str: ...
@property
def payload(self) -> Dict[str, Any]: ...
@property
def original_environment(self) -> str: ...
@property
def environment(self) -> str: ...
@property
def production_environment(self) -> bool: ...
@property
def transient_environment(self) -> bool: ...
@property
def description(self) -> str: ...
@property
def creator(self) -> NamedUser: ...
@property
def created_at(self) -> datetime: ...
@property
def updated_at(self) -> datetime: ...
@property
def statuses_url(self) -> str: ...
@property
def repository_url(self) -> str: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/DeploymentStatus.py 0000644 0001751 0000171 00000015751 00000000000 017730 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2020 Colby Gallup #
# Copyright 2020 Pascal Hofmann #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see . #
# #
################################################################################
import github.GithubObject
class DeploymentStatus(github.GithubObject.CompletableGithubObject):
"""
This class represents Deployment Statuses. The reference can be found here https://docs.github.com/en/rest/reference/repos#deployments
"""
def __repr__(self):
return self.get__repr__({"id": self._id.value, "url": self._url.value})
@property
def created_at(self):
"""
:type: datetime.datetime
"""
self._completeIfNotSet(self._created_at)
return self._created_at.value
@property
def creator(self):
"""
:type: :class:`github.NamedUser.NamedUser`
"""
self._completeIfNotSet(self._creator)
return self._creator.value
@property
def deployment_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._deployment_url)
return self._deployment_url.value
@property
def description(self):
"""
:type: string
"""
self._completeIfNotSet(self._description)
return self._description.value
@property
def environment(self):
"""
:type: string
"""
self._completeIfNotSet(self._environment)
return self._environment.value
@property
def environment_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._environment_url)
return self._environment_url.value
@property
def repository_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._repository_url)
return self._repository_url.value
@property
def state(self):
"""
:type: string
"""
self._completeIfNotSet(self._state)
return self._state.value
@property
def target_url(self):
"""
:type: string
"""
self._completeIfNotSet(self._target_url)
return self._target_url.value
@property
def updated_at(self):
"""
:type: datetime.datetime
"""
self._completeIfNotSet(self._updated_at)
return self._updated_at.value
@property
def url(self):
"""
:type: string
"""
self._completeIfNotSet(self._url)
return self._url.value
@property
def id(self):
"""
:type: int
"""
self._completeIfNotSet(self._id)
return self._id.value
@property
def node_id(self):
"""
:type: string
"""
self._completeIfNotSet(self._node_id)
return self._node_id.value
def _initAttributes(self):
self._created_at = github.GithubObject.NotSet
self._creator = github.GithubObject.NotSet
self._deployment_url = github.GithubObject.NotSet
self._description = github.GithubObject.NotSet
self._environment = github.GithubObject.NotSet
self._environment_url = github.GithubObject.NotSet
self._repository_url = github.GithubObject.NotSet
self._state = github.GithubObject.NotSet
self._target_url = github.GithubObject.NotSet
self._updated_at = github.GithubObject.NotSet
self._url = github.GithubObject.NotSet
self._id = github.GithubObject.NotSet
self._node_id = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "environment_url" in attributes: # pragma no branch
self._environment_url = self._makeStringAttribute(
attributes["environment_url"]
)
if "url" in attributes: # pragma no branch
self._url = self._makeStringAttribute(attributes["url"])
if "id" in attributes: # pragma no branch
self._id = self._makeIntAttribute(attributes["id"])
if "node_id" in attributes: # pragma no branch
self._node_id = self._makeStringAttribute(attributes["node_id"])
if "created_at" in attributes: # pragma no branch
self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
if "creator" in attributes: # pragma no branch
self._creator = self._makeClassAttribute(
github.NamedUser.NamedUser, attributes["creator"]
)
if "deployment_url" in attributes: # pragma no branch
self._deployment_url = self._makeStringAttribute(
attributes["deployment_url"]
)
if "description" in attributes: # pragma no branch
self._description = self._makeStringAttribute(attributes["description"])
if "environment" in attributes: # pragma no branch
self._environment = self._makeStringAttribute(attributes["environment"])
if "repository_url" in attributes: # pragma no branch
self._repository_url = self._makeStringAttribute(
attributes["repository_url"]
)
if "state" in attributes: # pragma no branch
self._state = self._makeStringAttribute(attributes["state"])
if "target_url" in attributes: # pragma no branch
self._target_url = self._makeStringAttribute(attributes["target_url"])
if "updated_at" in attributes: # pragma no branch
self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/DeploymentStatus.pyi 0000644 0001751 0000171 00000001776 00000000000 020103 0 ustar 00runner docker from datetime import datetime
from typing import Any, Dict
from github.GithubObject import CompletableGithubObject
from github.NamedUser import NamedUser
class DeploymentStatus(CompletableGithubObject):
def __repr__(self) -> str: ...
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
@property
def created_at(self) -> datetime: ...
@property
def creator(self) -> NamedUser: ...
@property
def deployment_url(self) -> str: ...
@property
def description(self) -> str: ...
@property
def environment(self) -> str: ...
@property
def environment_url(self) -> str: ...
@property
def repository_url(self) -> str: ...
@property
def state(self) -> str: ...
@property
def target_url(self) -> str: ...
@property
def updated_at(self) -> datetime: ...
@property
def url(self) -> str: ...
@property
def id(self) -> int: ...
@property
def node_id(self) -> str: ...
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1619412308.0
PyGithub-1.55/github/Download.py 0000644 0001751 0000171 00000026015 00000000000 016146 0 ustar 00runner docker ############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques #
# Copyright 2012 Zearin #
# Copyright 2013 AKFish #
# Copyright 2013 Vincent Jacques #
# Copyright 2014 Vincent Jacques #
# Copyright 2016 Jannis Gebauer #
# Copyright 2016 Peter Buckley #
# Copyright 2018 Wan Liuyang #
# Copyright 2018 sfdye #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see