File tree 3 files changed +37
-6
lines changed
3 files changed +37
-6
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,17 @@ pre-commit install
32
32
33
33
Committing will now automatically run the local hooks and ensure that your commit passes all lint checks.
34
34
35
+ ## Github Access Token
36
+
37
+ If you are a member of ApeWorX and would like to install private plugins,
38
+ [ create a Github access token] ( https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token ) .
39
+
40
+ Once you have your token, export it to your terminal session:
41
+
42
+ ``` bash
43
+ export GITHUB_ACCESS_TOKEN=< your-token>
44
+ ```
45
+
35
46
## Pull Requests
36
47
37
48
Pull requests are welcomed! Please adhere to the following:
Original file line number Diff line number Diff line change @@ -212,10 +212,6 @@ def ape_org(self):
212
212
213
213
@cached_property
214
214
def available_plugins (self ) -> Set [str ]:
215
- if not self .has_auth :
216
- logger .warning (f"${ self .TOKEN_KEY } not set, unable to list all plugins." )
217
- return set ()
218
-
219
215
return {
220
216
repo .name .replace ("-" , "_" )
221
217
for repo in self .ape_org .get_repos ()
Original file line number Diff line number Diff line change 1
1
import pytest
2
+ from github import RateLimitExceededException
3
+
4
+ from .utils import skip_projects_except
2
5
3
6
4
7
# NOTE: test all the things without a direct test elsewhere
13
16
["networks" ],
14
17
["networks" , "list" ],
15
18
["plugins" ],
16
- ["plugins" , "list" ],
17
- ["plugins" , "list" , "--all" ],
18
19
),
19
20
)
20
21
def test_invocation (ape_cli , runner , args ):
21
22
result = runner .invoke (ape_cli , args )
22
23
assert result .exit_code == 0
24
+
25
+
26
+ # Only run these tests once (limited to single arbitrary project).
27
+ # This is to prevent Github from rate limiting us and causing test failures.
28
+ @skip_projects_except (["empty-config" ])
29
+ @pytest .mark .parametrize (
30
+ "args" ,
31
+ (
32
+ ["plugins" , "list" ],
33
+ ["plugins" , "list" , "--all" ],
34
+ ),
35
+ )
36
+ def test_invocation_run_once (ape_cli , runner , args ):
37
+ result = runner .invoke (ape_cli , args )
38
+
39
+ if result .exit_code != 0 :
40
+ # Check if failed because we were rate-limited.
41
+ # If that is the case, consider the test as passing.
42
+ err = result .exception
43
+ if not isinstance (err , RateLimitExceededException ):
44
+ assert False , result .output
45
+
46
+ # Test Passed
You can’t perform that action at this time.
0 commit comments