Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Commit 24d49dd

Browse files
support python 3.12 (#458)
* fix: use raw strings for SyntaxWarning on 3.12 As show with: `python3.12 -m compileall -f $(git ls-files '*.py')` * ci: add python 3.12 thanks @branchvincent for these changes
1 parent bd4f749 commit 24d49dd

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ jobs:
3535
with:
3636
submodules: true
3737
fetch-depth: 2
38-
- uses: actions/setup-python@v3
38+
- uses: actions/setup-python@v5
3939
with:
40-
# Because of https://github.com/tree-sitter/py-tree-sitter/issues/162
41-
python-version: '3.11.x'
40+
python-version: "3.12"
4241
- name: Install CLI
4342
run: |
4443
pip install codecov-cli
@@ -55,6 +54,7 @@ jobs:
5554
fail-fast: false
5655
matrix:
5756
include:
57+
- python-version: "3.12"
5858
- python-version: "3.11"
5959
- python-version: "3.10"
6060
- python-version: "3.9"
@@ -65,14 +65,14 @@ jobs:
6565
submodules: true
6666
fetch-depth: 2
6767
- name: Set up Python ${{matrix.python-version}}
68-
uses: actions/setup-python@v3
68+
uses: actions/setup-python@v5
6969
with:
7070
python-version: "${{matrix.python-version}}"
7171
- name: Install dependencies
7272
run: |
7373
python -m pip install --upgrade pip
7474
pip install -r requirements.txt
75-
python setup.py develop
75+
python -m pip install -e .
7676
pip install -r tests/requirements.txt
7777
- name: Test with pytest
7878
run: |
@@ -92,10 +92,9 @@ jobs:
9292
with:
9393
submodules: true
9494
fetch-depth: 2
95-
- uses: actions/setup-python@v3
95+
- uses: actions/setup-python@v5
9696
with:
97-
# Because of https://github.com/tree-sitter/py-tree-sitter/issues/162
98-
python-version: '3.11.x'
97+
python-version: "3.12"
9998
- name: Install CLI
10099
run: |
101100
pip install codecov-cli
@@ -116,10 +115,9 @@ jobs:
116115
with:
117116
submodules: true
118117
fetch-depth: 0
119-
- uses: actions/setup-python@v3
118+
- uses: actions/setup-python@v5
120119
with:
121-
# Because of https://github.com/tree-sitter/py-tree-sitter/issues/162
122-
python-version: '3.11.x'
120+
python-version: "3.12"
123121
- name: Install CLI
124122
run: |
125123
pip install -r requirements.txt -r tests/requirements.txt
@@ -141,6 +139,7 @@ jobs:
141139
fail-fast: false
142140
matrix:
143141
include:
142+
- python-version: "3.12"
144143
- python-version: "3.11"
145144
- python-version: "3.10"
146145
- python-version: "3.9"
@@ -151,14 +150,14 @@ jobs:
151150
submodules: true
152151
fetch-depth: 2
153152
- name: Set up Python ${{matrix.python-version}}
154-
uses: actions/setup-python@v3
153+
uses: actions/setup-python@v5
155154
with:
156155
python-version: "${{matrix.python-version}}"
157156
- name: Install dependencies
158157
run: |
159158
python -m pip install --upgrade pip
160159
pip install -r requirements.txt
161-
python setup.py develop
160+
python -m pip install -e .
162161
pip install -r tests/requirements.txt
163162
- name: Test with pytest
164163
run: |

codecov_cli/helpers/ci_adapters/codebuild.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def detect(self) -> bool:
1212
def _get_branch(self):
1313
branch = os.getenv("CODEBUILD_WEBHOOK_HEAD_REF")
1414
if branch:
15-
return re.sub("^refs\/heads\/", "", branch)
15+
return re.sub(r"^refs\/heads\/", "", branch)
1616
return None
1717

1818
def _get_build_code(self):
@@ -27,10 +27,10 @@ def _get_commit_sha(self):
2727
def _get_slug(self):
2828
slug = os.getenv("CODEBUILD_SOURCE_REPO_URL")
2929
if slug:
30-
slug = re.sub("^.*github.com\/", "", slug)
31-
slug = re.sub("^.*gitlab.com\/", "", slug)
32-
slug = re.sub("^.*bitbucket.com\/", "", slug)
33-
return re.sub("\.git$", "", slug)
30+
slug = re.sub(r"^.*github.com\/", "", slug)
31+
slug = re.sub(r"^.*gitlab.com\/", "", slug)
32+
slug = re.sub(r"^.*bitbucket.com\/", "", slug)
33+
return re.sub(r"\.git$", "", slug)
3434
return None
3535

3636
def _get_service(self):
@@ -39,7 +39,7 @@ def _get_service(self):
3939
def _get_pull_request_number(self):
4040
pr = os.getenv("CODEBUILD_SOURCE_VERSION")
4141
if pr and pr.startswith("pr/"):
42-
return re.sub("^pr\/", "", pr)
42+
return re.sub(r"^pr\/", "", pr)
4343
return None
4444

4545
def _get_job_code(self):

0 commit comments

Comments
 (0)