Comparing timestamps returned by the API with naive datetime objects (without timezone information) will raise an error. Add `tzinfo=datetime.timezone.utc` to your datetime instance.
Co-authored-by: John T. Wodder II <git@varonathe.org>
* chore(dependency): flake8 has moved to github
* feat: add allow_forking to Repository
* chore: linting
Co-authored-by: hussaiia <ibrahim.hussaini@cba.com.au>
The docstring stated that `"*"` and `"none"` were valid values for the
organization, but neither was actually supported (unless your
organization was called `"none"`).
Remove the misleading information from the docstring, and add support
for passing in an actual `Organization` object, for better typing and
reliability properties.
Fixes#2116
The GitHub API exposes an endpoint to rename a branch, so we should
support calling it. Sadly, there is not enough information to add
that method to the Branch class, so expose it in the Repository object.
Fixes#1901
* Adding attributes "maintain" and "triage" to class "github.Permissions.Permissions"
* Fix for failed test due to extended attribute list
* Adding new simplistic test case for class Permissions
Fixes#1809
When a previous commit added support for creating secrets on repository
objects, support was not added to also remove them. Since the GitHub API
does support that, add a method to do so.
* Add missing preview features of Deployment and Deployment Statuses API
- Enable support for deployment status states in_progress and queued
- Add arguments production_environment and transient_environment to Repository.create_deployment()
- Add attributes production_environment and transient_environment to Deployment
- Use correct type in assertion for Deployment.payload
- Fix incorrect assertion for description in Deployment.create_status()
- Add arguments environment, environment_url, auto_inactive to Deployment.create_status()
- Add attribute environment_url to DeploymentStatus
Black is very opinionated, but sometimes those opinions change. Run the
new black version across the codebase, and lock down the version used by
pre-commit so we don't get surprised like this again.
To build on the previous work supporting querying Workflows for GitHub
Actions, add a class and relevant methods to support querying runs of a
workflow.
A lot of our missing coverage is caused by not checking repr(), which is
trivial enough to test against -- do so, and also clean up existing repr
tests to look the same by calling repr(). Where it was trivial, add a
few assertions about missing attributes.
To start supporting GitHub Actions, add the first part of that,
Workflow, which encapsulates a workflow over the API, along with
two methods on Repository to query them.
The testStatistics testcase takes over ten seconds to run on my laptop,
and it does an awful lot of work. Split up the disparate parts into
seperate testcases.
Add a new class, Deployment to describe a deployment performed utilising
GitHub. Add three methods onto Repository to list them and create them.
Fixes#1117
InputGitTreeElement is used to build tree objects for
Repository.create_git_tree(). However, the GitHub API allows passing
sha=null to delete a file, which we don't allow. Extend the checking in
InputGitTreeElement to also allow None, and add a test for good measure.
Fixes#1318
* Support for create_fork
http://developer.github.com/v3/repos/forks
* Add test case for create_fork
* Add param doc and fix extra line
* Specify the organization to increase line coverage
* Update test data
* Add type assert for organization param
If a byte object (for Python 3) was passed into either create_file or
update_file, it was attempted to be co-erced into a bytearray, which
failed. Check for encoded content before we encode it into bytes and
then base64 encode it.
Fixes#1266
* Add functions about automated security fixes and vulnerability alerts
* Refine methods and add unit test
* Add record
* Update record file - change user name
* Add get vulnerability alert function
* Fix typo
* Create file for testCreateFile
* Add tests
* Add unit test
* Simplify assert statement
With the Python 2.7 deadline fast approaching, modernize the codebase
making use of the modernize module to switch to using six, as well as
other upcoming features, such as absolute imports . Stop using 2to3
for Travis, yay!
Continue my crusade to running flake8 against new contributions by
cleaning up whitespace (and wierdly, the entire indentation of
Migration) to silence most flake8 warnings. AllTests is the remaining
outlier, and requires some thought on how to approach.
The path requested in Repository.get_contents() is appended to the URL,
so the root path should be requested with the empty string. If path is
'/', set it to the empty string. Copy the replay data from the original
test, since it is identical.
Drive-by renaming the test to include the missing 's'.
Closes#1059
# Problem #
The `.whl` available on PyPi for this repository contains its entire `tests` submodule.
The total size of the `pygithub` module is less than `1mb` without tests and `>23mb` with.
Previous discussions on this topic indicated the removal of tests would be accepted if someone created a pull request to do so: https://github.com/PyGithub/PyGithub/issues/672
This is that pull request! 😄
# Solution/Implementation #
- Moved "tests" to root of the repository ( outside the package )
- Added `tests.` module path to the imports in `AllTests.py`
- Updated `setup.py`
- Removed `package_data` from product
- Removed "tests" from packages definition
- Repointed `test_suite` to new location
- Updated `travis.yml`
- Added conditional ( if not `py2.7` ) conversion of code to `py3`
_... apologies for all the failed build spam below - new to working with Travis CI / had some gotcha moments!_