codecov[bot]: # [Codecov](https://codecov.io/gh/repobee/repobee/pull/457?src=pr&el=h1) Report
> Merging [#457](https://codecov.io/gh/repobee/repobee/pull/457?src=pr&el=desc) into [master](https://codecov.io/gh/repobee/repobee/commit/74d7e576978e03e43e3ae0c3639f299a61e8e507&el=desc) will **decrease** coverage by `4.25%`.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/repobee/repobee/pull/457/graphs/tree.svg?width=650&height=150&src=pr&token=5vOKgkphZe)](https://codecov.io/gh/repobee/repobee/pull/457?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master     #457      +/-   ##
==========================================
- Coverage   92.82%   88.56%   -4.26%     
==========================================
  Files          40       40              
  Lines        2173     2151      -22     
  Branches      372      370       -2     
==========================================
- Hits         2017     1905     -112     
- Misses        124      212      +88     
- Partials       32       34       +2     
```


| [Impacted Files](https://codecov.io/gh/repobee/repobee/pull/457?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/\_repobee/constants.py](https://codecov.io/gh/repobee/repobee/pull/457/diff?src=pr&el=tree#diff-c3JjL19yZXBvYmVlL2NvbnN0YW50cy5weQ==) | `100.00% <ø> (ø)` | |
| [src/\_repobee/config.py](https://codecov.io/gh/repobee/repobee/pull/457/diff?src=pr&el=tree#diff-c3JjL19yZXBvYmVlL2NvbmZpZy5weQ==) | `98.38% <100.00%> (-0.15%)` | :arrow_down: |
| [src/\_repobee/ext/gitlab.py](https://codecov.io/gh/repobee/repobee/pull/457/diff?src=pr&el=tree#diff-c3JjL19yZXBvYmVlL2V4dC9naXRsYWIucHk=) | `63.86% <0.00%> (-28.56%)` | :arrow_down: |
| [src/\_repobee/git.py](https://codecov.io/gh/repobee/repobee/pull/457/diff?src=pr&el=tree#diff-c3JjL19yZXBvYmVlL2dpdC5weQ==) | `96.62% <0.00%> (-3.38%)` | :arrow_down: |
| [src/\_repobee/command/repos.py](https://codecov.io/gh/repobee/repobee/pull/457/diff?src=pr&el=tree#diff-c3JjL19yZXBvYmVlL2NvbW1hbmQvcmVwb3MucHk=) | `92.62% <0.00%> (-2.46%)` | :arrow_down: |
| [src/\_repobee/plugin.py](https://codecov.io/gh/repobee/repobee/pull/457/diff?src=pr&el=tree#diff-c3JjL19yZXBvYmVlL3BsdWdpbi5weQ==) | `93.07% <0.00%> (-2.35%)` | :arrow_down: |
| [src/\_repobee/cli/mainparser.py](https://codecov.io/gh/repobee/repobee/pull/457/diff?src=pr&el=tree#diff-c3JjL19yZXBvYmVlL2NsaS9tYWlucGFyc2VyLnB5) | `94.64% <0.00%> (-1.79%)` | :arrow_down: |
| [src/\_repobee/ext/query.py](https://codecov.io/gh/repobee/repobee/pull/457/diff?src=pr&el=tree#diff-c3JjL19yZXBvYmVlL2V4dC9xdWVyeS5weQ==) | `48.48% <0.00%> (-1.52%)` | :arrow_down: |
| [src/\_repobee/cli/parsing.py](https://codecov.io/gh/repobee/repobee/pull/457/diff?src=pr&el=tree#diff-c3JjL19yZXBvYmVlL2NsaS9wYXJzaW5nLnB5) | `92.26% <0.00%> (-1.20%)` | :arrow_down: |
| [src/\_repobee/ext/defaults/github.py](https://codecov.io/gh/repobee/repobee/pull/457/diff?src=pr&el=tree#diff-c3JjL19yZXBvYmVlL2V4dC9kZWZhdWx0cy9naXRodWIucHk=) | `90.29% <0.00%> (-0.11%)` | :arrow_down: |
| ... and [5 more](https://codecov.io/gh/repobee/repobee/pull/457/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/repobee/repobee/pull/457?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/repobee/repobee/pull/457?src=pr&el=footer). Last update [74d7e57...e38679b](https://codecov.io/gh/repobee/repobee/pull/457?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

slarse: Coverage decrease is fine, this PR only removes code.
diff --git a/src/_repobee/config.py b/src/_repobee/config.py
index 1a1b194..59aabe2 100644
--- a/src/_repobee/config.py
+++ b/src/_repobee/config.py
@@ -11,7 +11,7 @@ Contains the code required for pre-configuring user interfaces.
 import os
 import pathlib
 import configparser
-from typing import Union, List, Mapping, Optional
+from typing import Union, List, Mapping
 
 import daiquiri
 import repobee_plug as plug
@@ -137,21 +137,8 @@ def get_all_tasks() -> List[plug.Task]:
     return plug.manager.hook.setup_task() + plug.manager.hook.clone_task()
 
 
-def _fetch_token() -> Optional[str]:
-    token = os.getenv(constants.TOKEN_ENV)
-    token_from_old = os.getenv(constants.TOKEN_ENV_OLD)
-    if token_from_old:
-        LOGGER.warning(
-            "The {} environment variable has been deprecated, "
-            "use {} instead".format(
-                constants.TOKEN_ENV_OLD, constants.TOKEN_ENV
-            )
-        )
-    return token or token_from_old
-
-
 def _read_defaults(config_file: pathlib.Path) -> dict:
-    token = _fetch_token()
+    token = os.getenv(constants.TOKEN_ENV)
     if not config_file.is_file():
         return {} if not token else dict(token=token)
     defaults = dict(_read_config(config_file)[constants.DEFAULTS_SECTION_HDR])
diff --git a/src/_repobee/constants.py b/src/_repobee/constants.py
index 5a55a27..a174027 100644
--- a/src/_repobee/constants.py
+++ b/src/_repobee/constants.py
@@ -39,4 +39,3 @@ ORDERED_CONFIGURABLE_ARGS = (
 CONFIGURABLE_ARGS = set(ORDERED_CONFIGURABLE_ARGS)
 
 TOKEN_ENV = "REPOBEE_TOKEN"
-TOKEN_ENV_OLD = "REPOBEE_OAUTH"

Remove REPOBEE_OAUTH environment variable
It has been deprecated for a long time now, since it was replaced with `REPOBEE_TOKEN`
diff --git a/tests/unit_tests/repobee/conftest.py b/tests/unit_tests/repobee/conftest.py
index 8d004ed..5b8d481 100644
--- a/tests/unit_tests/repobee/conftest.py
+++ b/tests/unit_tests/repobee/conftest.py
@@ -21,7 +21,6 @@ import _repobee  # noqa: E402
 
 EXPECTED_ENV_VARIABLES = [
     _repobee.constants.TOKEN_ENV,
-    _repobee.constants.TOKEN_ENV_OLD,
     "REPOBEE_NO_VERIFY_SSL",
 ]
 
diff --git a/tests/unit_tests/repobee/test_config.py b/tests/unit_tests/repobee/test_config.py
index 7466b82..7e88fa5 100644
--- a/tests/unit_tests/repobee/test_config.py
+++ b/tests/unit_tests/repobee/test_config.py
@@ -55,23 +55,6 @@ class TestGetConfiguredDefaults:
         defaults = config.get_configured_defaults(str(config_mock))
         assert defaults["token"] == constants.TOKEN
 
-    @pytest.mark.skipif(
-        "_repobee.__version__ >= '3.0.0'",
-        msg="Old token should have been removed",
-    )
-    def test_deprecated_token_env(self, config_mock, mock_getenv):
-        token = "superdupertoken"
-
-        def _env(name):
-            if name == _repobee.constants.TOKEN_ENV_OLD:
-                return token
-            return None
-
-        mock_getenv.side_effect = _env
-
-        defaults = config.get_configured_defaults(str(config_mock))
-        assert defaults["token"] == token
-
     def test_get_configured_defaults_raises_on_invalid_keys(
         self, empty_config_mock, students_file
     ):

pip install -e .[TEST]
parse_log_pytest
requirements.txt
pytest
3.7
requirements/app.txt requirements/test.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
appdirs==1.4.4
certifi @ file:///croot/certifi_1671487769961/work/certifi
cffi==1.15.1
charset-normalizer==3.4.1
codecov==2.1.13
colored==1.4.4
coverage==7.2.7
cryptography==44.0.2
daiquiri==3.2.1
Deprecated==1.2.18
exceptiongroup==1.2.2
idna==3.10
importlib-metadata==6.7.0
iniconfig==2.0.0
packaging==24.0
pluggy==0.13.1
pycparser==2.21
PyGithub==2.3.0
PyJWT==2.8.0
PyNaCl==1.5.0
pytest==7.4.4
pytest-cov==4.1.0
pytest-mock==3.11.1
python-gitlab==1.15.0
python-json-logger==3.0.1
-e git+https://github.com/repobee/repobee.git@74d7e576978e03e43e3ae0c3639f299a61e8e507#egg=repobee
requests==2.31.0
six==1.17.0
tomli==2.0.1
typing_extensions==4.7.1
urllib3==2.0.7
wrapt==1.16.0
zipp==3.15.0

name: repobee
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - appdirs==1.4.4
      - cffi==1.15.1
      - charset-normalizer==3.4.1
      - codecov==2.1.13
      - colored==1.4.4
      - coverage==7.2.7
      - cryptography==44.0.2
      - daiquiri==3.2.1
      - deprecated==1.2.18
      - exceptiongroup==1.2.2
      - idna==3.10
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - packaging==24.0
      - pluggy==0.13.1
      - pycparser==2.21
      - pygithub==2.3.0
      - pyjwt==2.8.0
      - pynacl==1.5.0
      - pytest==7.4.4
      - pytest-cov==4.1.0
      - pytest-mock==3.11.1
      - python-gitlab==1.15.0
      - python-json-logger==3.0.1
      - repobee==3.0.0a1
      - requests==2.31.0
      - six==1.17.0
      - tomli==2.0.1
      - typing-extensions==4.7.1
      - urllib3==2.0.7
      - wrapt==1.16.0
      - zipp==3.15.0
prefix: /opt/conda/envs/repobee

tests/unit_tests/repobee/test_config.py::TestGetConfiguredDefaults::test_get_configured_defaults_no_config_file tests/unit_tests/repobee/test_config.py::TestGetConfiguredDefaults::test_get_configured_defaults_empty_file tests/unit_tests/repobee/test_config.py::TestGetConfiguredDefaults::test_token_in_env_variable_overrides_configuration_file tests/unit_tests/repobee/test_config.py::TestGetConfiguredDefaults::test_get_configured_defaults_raises_on_invalid_keys tests/unit_tests/repobee/test_config.py::TestGetConfiguredDefaults::test_get_configured_defaults_raises_on_missing_header tests/unit_tests/repobee/test_config.py::TestCheckConfigIntegrity::test_with_well_formed_config tests/unit_tests/repobee/test_config.py::TestCheckConfigIntegrity::test_with_invalid_defaults_key_raises tests/unit_tests/repobee/test_config.py::TestCheckConfigIntegrity::test_with_valid_but_malformed_default_args_raises
tests/unit_tests/repobee/test_config.py::TestGetConfiguredDefaults::test_get_configured_defaults_reads_full_config tests/unit_tests/repobee/test_config.py::TestGetPluginNames::test_with_full_config tests/unit_tests/repobee/test_config.py::TestGetPluginNames::test_with_only_plugins[javac,pylint-expected_plugins0] tests/unit_tests/repobee/test_config.py::TestGetPluginNames::test_with_only_plugins[javac, tests/unit_tests/repobee/test_config.py::TestGetPluginNames::test_with_only_plugins[javac-expected_plugins2] tests/unit_tests/repobee/test_config.py::TestGetPluginNames::test_with_only_plugins[-expected_plugins3] tests/unit_tests/repobee/test_config.py::TestExecuteConfigHooks::test_with_no_config_file tests/unit_tests/repobee/test_config.py::TestExecuteConfigHooks::test_with_config_file tests/unit_tests/repobee/test_config.py::TestCheckConfigIntegrity::test_with_well_formed_plugin_options tests/unit_tests/repobee/test_config.py::TestCheckConfigIntegrity::test_with_no_config_file_raises
src/_repobee/config.py src/_repobee/constants.py
src/_repobee/config.py src/_repobee/constants.py