Skip to content

Commit

Permalink
Update some test environments to 3.10 (#3149)
Browse files Browse the repository at this point in the history
* Update some test environments to 3.10

Fixes #3148

* Update environments in workflows file as well
  • Loading branch information
ocelotl authored Feb 14, 2023
1 parent 6785335 commit 0f76769
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/public-api-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: '3.10'

- name: Install tox
run: pip install tox==3.27.1 -U tox-factor
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: '3.10'
architecture: 'x64'
- name: Install tox
run: pip install tox==3.27.1
Expand Down
20 changes: 12 additions & 8 deletions scripts/public_symbols_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ def get_symbols(change_type, diff_lines_getter, prefix):
def a_diff_lines_getter(diff_lines):
return diff_lines.b_blob.data_stream.read().decode("utf-8").split("\n")


def d_diff_lines_getter(diff_lines):
return diff_lines.a_blob.data_stream.read().decode("utf-8").split("\n")


def m_diff_lines_getter(diff_lines):
return unified_diff(
diff_lines.a_blob.data_stream.read().decode("utf-8").split("\n"),
Expand All @@ -91,6 +93,7 @@ def m_diff_lines_getter(diff_lines):
get_symbols("M", m_diff_lines_getter, r"\+")
get_symbols("M", m_diff_lines_getter, r"\-")


def remove_common_symbols():
# For each file, we remove the symbols that are added and removed in the
# same commit.
Expand All @@ -115,17 +118,18 @@ def remove_common_symbols():
if not removed_symbols[file_path]:
del removed_symbols[file_path]


if added_symbols or removed_symbols:

# If a symbol is added and removed in the same commit, we consider it
# as not added or removed.
remove_common_symbols()
print("The code in this branch adds the following public symbols:")
print()
for file_path, symbols in added_symbols.items():
print(f"- {file_path}")
for symbol in symbols:
print(f"\t{symbol}")
for file_path_, symbols_ in added_symbols.items():
print(f"- {file_path_}")
for symbol_ in symbols_:
print(f"\t{symbol_}")
print()

print(
Expand All @@ -137,10 +141,10 @@ def remove_common_symbols():
print()
print("The code in this branch removes the following public symbols:")
print()
for file_path, symbols in removed_symbols.items():
print(f"- {file_path}")
for symbol in symbols:
print(f"\t{symbol}")
for file_path_, symbols_ in removed_symbols.items():
print(f"- {file_path_}")
for symbol_ in symbols_:
print(f"\t{symbol_}")
print()

print(
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ commands =
mypyinstalled: mypy --install-types --non-interactive --namespace-packages opentelemetry-api/tests/mypysmoke.py --strict

[testenv:spellcheck]
basepython: python3.9
basepython: python3.10
recreate = True
deps =
codespell
Expand Down Expand Up @@ -254,7 +254,7 @@ commands =
sphinx-build -E -a -W -b html -T . _build/html

[testenv:tracecontext]
basepython: python3.9
basepython: python3.10
deps =
# needed for tracecontext
aiohttp~=3.6
Expand Down Expand Up @@ -312,7 +312,7 @@ commands_post =
docker-compose down -v

[testenv:public-symbols-check]
basepython: python3.9
basepython: python3.10
recreate = True
deps =
GitPython
Expand Down

0 comments on commit 0f76769

Please sign in to comment.