Skip to content

Commit

Permalink
Merge pull request #241 from jaltmayerpizzorno/master
Browse files Browse the repository at this point in the history
Reverted to using signal.raise_signal on Windows
  • Loading branch information
jaltmayerpizzorno committed Jul 16, 2021
2 parents a832497 + 124c755 commit 4dbfb90
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/release-pypi-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
include:
- os: macos-latest
python_version: 3.7
- os: ubuntu-latest
python_version: 3.7
container: quay.io/pypa/manylinux_2_24_x86_64 # https://github.com/pypa/manylinux
- os: windows-latest
python_version: 3.8

container: ${{ matrix.container }}

Expand All @@ -26,7 +30,7 @@ jobs:
if: matrix.container == ''
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: ${{ matrix.python_version }}

- name: Set up python (container version)
if: matrix.container != ''
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ code...
<details open>
<summary>Using <code>pip</code> (Mac OS X, Linux, Windows, and WSL2)</summary>

Scalene is distributed as a `pip` package and works on Mac OS X, Linux (including Ubuntu in [Windows WSL2](docs.microsoft.com/en-us/windows/wsl/wsl2-index)) and (with limitations) Windows platforms. (**Note**: the Windows port isn't complete yet and should be considered early alpha.)
Scalene is distributed as a `pip` package and works on Mac OS X, Linux (including Ubuntu in [Windows WSL2](docs.microsoft.com/en-us/windows/wsl/wsl2-index)) and (with limitations) Windows platforms. (**Note**: the Windows port isn't complete yet and should be considered early alpha; it requires Python 3.8 or later.)

You can install it as follows:
```console
Expand Down
9 changes: 6 additions & 3 deletions scalene/scalene_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@
from scalene.scalene_parseargs import ScaleneParseArgs, StopJupyterExecution
from scalene.scalene_sigqueue import ScaleneSigQueue

assert (sys.version_info >= (3,7)), "Scalene requires Python version 3.7 or above."
def require_python(version: Tuple[int, int]):
assert (sys.version_info >= version), \
f"Scalene requires Python version {version[0]}.{version[1]} or above."

require_python((3,7) if sys.platform != "win32" else (3,8))


# Scalene fully supports Unix-like operating systems; in
Expand Down Expand Up @@ -300,10 +304,9 @@ def is_call_function(code: CodeType, bytei: ByteCodeIndex) -> bool:
def windows_timer_loop() -> None:
"""For Windows, send periodic timer signals; launch as a background thread."""
Scalene.timer_signals = True
pid = os.getpid()
while Scalene.timer_signals:
time.sleep(Scalene.__args.cpu_sampling_rate)
os.kill(pid, ScaleneSignals.cpu_signal)
signal.raise_signal(ScaleneSignals.cpu_signal)

@staticmethod
def set_timer_signals() -> None:
Expand Down
2 changes: 1 addition & 1 deletion scalene/scalene_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
scalene_version = "1.3.11"
scalene_version = "1.3.12"
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ def build_libscalene(self):
"Topic :: Software Development :: Debuggers",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3"
] + (["Programming Language :: Python :: 3.7"] if sys.platform != 'win32' else []) +
[
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"License :: OSI Approved :: Apache Software License",
Expand All @@ -129,5 +130,5 @@ def build_libscalene(self):
setup_requires=['setuptools_scm'],
include_package_data=True,
entry_points={"console_scripts": ["scalene = scalene.__main__:main"]},
python_requires=">=3.7",
python_requires=">=3.7" if sys.platform != 'win32' else ">=3.8",
)

0 comments on commit 4dbfb90

Please sign in to comment.