Skip to content

Commit

Permalink
Set placeholder environment variables for importcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Mar 13, 2024
1 parent 2c419cc commit c13d750
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
3 changes: 3 additions & 0 deletions repo_helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ mypy_plugins:
pre_commit_exclude: "^requirements.txt$"

mypy_version: "1.7.1"

tox_unmanaged:
- testenv
3 changes: 2 additions & 1 deletion repo_helper_bot/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
app_id=GITHUBAPP_ID,
)

context_switcher.login_as_app()
if not os.environ.get("RH_BOT_IMPORTCHECK", 0):
context_switcher.login_as_app()


def https_redirect() -> Optional["Response"]:
Expand Down
25 changes: 14 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# You may add new sections, but any changes made to the following sections will be lost:
# * tox
# * envlists
# * testenv
# * testenv:.package
# * testenv:py313-dev
# * testenv:py312-dev
Expand Down Expand Up @@ -31,16 +30,6 @@ requires =
test = py38, py39, py310, py311, py312
qa = mypy, lint

[testenv]
setenv =
PYTHONDEVMODE=1
PIP_DISABLE_PIP_VERSION_CHECK=1
SETUPTOOLS_USE_DISTUTILS=stdlib
deps = importcheck>=0.1.0
commands =
python --version
python -m importcheck {posargs:--show}

[testenv:.package]
setenv =
PYTHONDEVMODE=1
Expand Down Expand Up @@ -153,6 +142,20 @@ ignore = W002
toplevel = repo_helper_bot
package = repo_helper_bot
[testenv]
setenv =
PYTHONDEVMODE=1
PIP_DISABLE_PIP_VERSION_CHECK=1
SETUPTOOLS_USE_DISTUTILS=stdlib
GITHUBAPP_ID=1234
GITHUBAPP_SECRET=abc123
GITHUBAPP_KEY=ABCDEFG
RH_BOT_IMPORTCHECK=1
deps = importcheck>=0.1.0
commands =
python --version
python -m importcheck {posargs:--show}
[coverage:run]
plugins = coverage_pyver_pragma
Expand Down

0 comments on commit c13d750

Please sign in to comment.