Skip to content

Commit f3e99df

Browse files
committed
Revert #236 - env already supported
1 parent 597777b commit f3e99df

File tree

6 files changed

+2
-34
lines changed

6 files changed

+2
-34
lines changed

CHANGELOG.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# Changelog
22

3-
## 1.0.8
4-
- Support providing GitHub Token via `APR_API_KEY` env var instead of `config.yaml`
5-
63
## 1.0.7
74
- Add `--exclude-missing` when running `auto-pr status`
85
- Allows you to remove the `Missing PRs` section from the output

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ update_command:
5959
- my-file
6060
```
6161
62-
If you wish to keep your API Key outside of `config.yaml`, set the env var `APR_API_KEY` with your GitHub Token
63-
6462
### Repositories
6563
6664
You can define the list of repositories to pull and build into the database to update using a list of rules.

autopr/config.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from dataclasses import dataclass, field
2-
from os import environ
32
from typing import List, Optional
43

54
import marshmallow_dataclass
@@ -18,8 +17,8 @@
1817

1918
@dataclass
2019
class Credentials:
20+
api_key: str
2121
ssh_key_file: str
22-
api_key: str = field(default_factory=(lambda: environ.get("APR_API_KEY", "")))
2322

2423

2524
CREDENTIALS_SCHEMA = marshmallow_dataclass.class_schema(Credentials)()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "auto-pr"
3-
version = "1.0.8"
3+
version = "1.0.7"
44
description = "Perform bulk updates across repositories"
55
license = "Apache-2.0"
66

test/test_run.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,3 @@ def test_create_files(_create_github_client: Mock, tmp_path):
4444
db=db,
4545
)
4646
print(result.output)
47-
48-
49-
@patch("autopr.repo.run_cmd", new=_test_cmd)
50-
@patch("autopr.github.create_github_client")
51-
def test_api_key_env_var(_create_github_client: Mock, monkeypatch, tmp_path):
52-
monkeypatch.setenv("APR_API_KEY", "env_var_test")
53-
wd = workdir.WorkDir(Path(tmp_path))
54-
db = simple_test_database()
55-
init_git_repos(wd, db)
56-
result = run_cli(
57-
wd,
58-
["run"],
59-
cfg=env_var_token_test_config(),
60-
db=db,
61-
)
62-
63-
assert (
64-
_create_github_client.call_args_list[0][0][0] == "env_var_test"
65-
), f"wrong api_key used for create_github_client: {_create_github_client.call_args_list}"

test/test_utils.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,6 @@ def simple_test_config() -> config.Config:
7272
return config.Config(credentials=credentials, pr=pr, update_command=cmd)
7373

7474

75-
def env_var_token_test_config() -> config.Config:
76-
credentials = config.Credentials(ssh_key_file="test")
77-
pr = config.PrTemplate()
78-
cmd = ["bash", "-c", "echo 'test' > testfile.txt"]
79-
return config.Config(credentials=credentials, pr=pr, update_command=cmd)
80-
81-
8275
def simple_test_database() -> database.Database:
8376
repo = database.Repository(
8477
owner="test", name="test", ssh_url="test@testytest.com", default_branch="master"

0 commit comments

Comments
 (0)