Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smoketest fixes #818

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
17 changes: 13 additions & 4 deletions .github/workflows/test-smoketests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,18 @@ jobs:
timeout-minutes: 15
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ] # disabling windows-latest for now
os: [ ubuntu-latest, macos-13 ] # disabling windows-latest for now
python: [ '3.8', '3.9', '3.10', '3.11', '3.12']

exclude:
- os: macos-latest
python: 3.8
- os: macos-latest
python: 3.9
include:
- os: macos-13
python: 3.8
- os: macos-13
python: 3.9
steps:
- uses: actions/checkout@v4

Expand All @@ -26,7 +35,7 @@ jobs:

- name: Work around arm64 support on MacOS
# https://github.com/actions/virtual-environments/issues/2557
if: matrix.os == 'macos-latest'
if: matrix.os == 'macos-latest' || matrix.os == 'macos-13'
run: sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*

- name: Install dependencies
Expand Down Expand Up @@ -57,4 +66,4 @@ jobs:
- name: -m invocation smoketest
run: |
python -m pip install git+https://github.com/sternj/import_stress_test
python -m scalene --cli --- -m import_stress_test
python -m scalene --cli --- -m import_stress_test
19 changes: 14 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,18 @@ jobs:
timeout-minutes: 15
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
python: [ '3.9', '3.10', '3.11', '3.12' ]

os: [ ubuntu-latest, macos-13 ] # disabling windows-latest for now
python: [ '3.8', '3.9', '3.10', '3.11', '3.12']
exclude:
- os: macos-latest
python: 3.8
- os: macos-latest
python: 3.9
include:
- os: macos-13
python: 3.8
- os: macos-13
python: 3.9
steps:
- uses: actions/checkout@v4

Expand All @@ -33,7 +42,7 @@ jobs:

- name: Work around arm64 support on MacOS
# https://github.com/actions/virtual-environments/issues/2557
if: matrix.os == 'macos-latest'
if: matrix.os == 'macos-latest' || matrix.os == 'macos-13'
run: sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*

- name: Install dependencies
Expand All @@ -52,4 +61,4 @@ jobs:

- name: run tests
run: |
python3 -m pytest
pytest
4 changes: 2 additions & 2 deletions scalene/scalene_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def get_imported_modules(source: str) -> List[str]:
if isinstance(node, (ast.Import, ast.ImportFrom)):
imported_modules.append(ast.unparse(node))

return imported_modules
return list(map(str.strip, imported_modules))

@staticmethod
def get_native_imported_modules(source: str) -> List[str]:
Expand Down Expand Up @@ -96,7 +96,7 @@ def get_native_imported_modules(source: str) -> List[str]:
if ScaleneAnalysis.is_native(node.module):
imported_modules.append(ast.unparse(node))

return imported_modules
return list(map(str.strip, imported_modules))

@staticmethod
def find_regions(src: str) -> Dict[int, Tuple[int, int]]:
Expand Down