Repository: aazuspan/eerepr (language: python)

Issue:
Fix failing CI
See aazuspan/sankee#53


Discussion / hints:

Fix patch:
diff --git a/.github/scripts/make_ee_token.py b/.github/scripts/make_ee_token.py
deleted file mode 100644
index 6535165..0000000
--- a/.github/scripts/make_ee_token.py
+++ /dev/null
@@ -1,9 +0,0 @@
-import os
-
-credentials = f'{{"refresh_token": "{os.environ["EE_TOKEN"]}"}}'
-
-credential_dir = os.path.expanduser("~/.config/earthengine/")
-os.makedirs(credential_dir, exist_ok=True)
-
-with open(os.path.join(credential_dir, "credentials"), "w") as dst:
-    dst.write(credentials)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..1b12ee2
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,45 @@
+name: tests
+
+on: push
+
+jobs:
+  test:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
+
+    steps:
+    - uses: actions/checkout@v3
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v4
+      with:
+        python-version: ${{ matrix.python-version }}
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        pip install hatch
+    - name: Write persistent EE credentials
+      env:
+        EE_TOKEN: ${{ secrets.EE_TOKEN }}
+      run: |
+        mkdir -p /home/runner/.config/earthengine
+        echo $EE_TOKEN > /home/runner/.config/earthengine/credentials
+    - name: Test with pytest
+      run: |
+        hatch run test:all
+  
+  lint:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v4
+
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install hatch
+
+      - name: Run pre-commit hooks
+        uses: pre-commit/action@v3.0.0
\ No newline at end of file


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
deleted file mode 100644
index f5227d9..0000000
--- a/.github/workflows/tests.yml
+++ /dev/null
@@ -1,40 +0,0 @@
-name: Test and lint
-
-on: [push, pull_request]
-
-permissions:
-  contents: read
-
-jobs:
-  test:
-    runs-on: ubuntu-latest
-    strategy:
-      matrix:
-        python-version: [ '3.8', '3.9', '3.10', '3.11' ]
-
-    steps:
-    - name: Checkout
-      uses: actions/checkout@v3
-
-    - name: Set up Python ${{ matrix.python-version }}
-      uses: actions/setup-python@v3
-      with:
-        python-version: ${{ matrix.python-version }}
-
-    - name: Install dependencies
-      run: |
-        python -m pip install --upgrade pip
-        pip install hatch
-
-    - name: Store EE token
-      run: |
-        python ./.github/scripts/make_ee_token.py
-      env:
-        EE_TOKEN: ${{ secrets.EE_TOKEN }}
-
-    - name: Test
-      run: |
-        hatch run test:all
-
-    - name: Pre-commit
-      uses: pre-commit/action@v3.0.0
\ No newline at end of file
diff --git a/tests/test_reprs.py b/tests/test_reprs.py
index 41ad490..76cea7e 100644
--- a/tests/test_reprs.py
+++ b/tests/test_reprs.py
@@ -10,4 +10,4 @@ def test_error():
     """
     with pytest.warns(UserWarning):
         rep = ee.Projection("not a real epsg")._repr_html_()
-    assert "ee.Projection object" in rep
+    assert "Projection object" in rep