Skip to content

Commit 4dbfb90

Browse files
Merge pull request #241 from jaltmayerpizzorno/master
Reverted to using signal.raise_signal on Windows
2 parents a832497 + 124c755 commit 4dbfb90

File tree

5 files changed

+18
-10
lines changed

5 files changed

+18
-10
lines changed

.github/workflows/release-pypi-upload.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@ jobs:
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
matrix:
15-
os: [ ubuntu-latest, macos-latest, windows-latest ]
1615
include:
16+
- os: macos-latest
17+
python_version: 3.7
1718
- os: ubuntu-latest
19+
python_version: 3.7
1820
container: quay.io/pypa/manylinux_2_24_x86_64 # https://github.com/pypa/manylinux
21+
- os: windows-latest
22+
python_version: 3.8
1923

2024
container: ${{ matrix.container }}
2125

@@ -26,7 +30,7 @@ jobs:
2630
if: matrix.container == ''
2731
uses: actions/setup-python@v2
2832
with:
29-
python-version: 3.7
33+
python-version: ${{ matrix.python_version }}
3034

3135
- name: Set up python (container version)
3236
if: matrix.container != ''

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ code...
201201
<details open>
202202
<summary>Using <code>pip</code> (Mac OS X, Linux, Windows, and WSL2)</summary>
203203

204-
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.)
204+
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.)
205205

206206
You can install it as follows:
207207
```console

scalene/scalene_profiler.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@
6565
from scalene.scalene_parseargs import ScaleneParseArgs, StopJupyterExecution
6666
from scalene.scalene_sigqueue import ScaleneSigQueue
6767

68-
assert (sys.version_info >= (3,7)), "Scalene requires Python version 3.7 or above."
68+
def require_python(version: Tuple[int, int]):
69+
assert (sys.version_info >= version), \
70+
f"Scalene requires Python version {version[0]}.{version[1]} or above."
71+
72+
require_python((3,7) if sys.platform != "win32" else (3,8))
6973

7074

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

308311
@staticmethod
309312
def set_timer_signals() -> None:

scalene/scalene_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
scalene_version = "1.3.11"
1+
scalene_version = "1.3.12"

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ def build_libscalene(self):
105105
"Topic :: Software Development :: Debuggers",
106106
"Programming Language :: Python",
107107
"Programming Language :: Python :: 3 :: Only",
108-
"Programming Language :: Python :: 3",
109-
"Programming Language :: Python :: 3.7",
108+
"Programming Language :: Python :: 3"
109+
] + (["Programming Language :: Python :: 3.7"] if sys.platform != 'win32' else []) +
110+
[
110111
"Programming Language :: Python :: 3.8",
111112
"Programming Language :: Python :: 3.9",
112113
"License :: OSI Approved :: Apache Software License",
@@ -129,5 +130,5 @@ def build_libscalene(self):
129130
setup_requires=['setuptools_scm'],
130131
include_package_data=True,
131132
entry_points={"console_scripts": ["scalene = scalene.__main__:main"]},
132-
python_requires=">=3.7",
133+
python_requires=">=3.7" if sys.platform != 'win32' else ">=3.8",
133134
)

0 commit comments

Comments
 (0)