Skip to content

Commit

Permalink
Merge pull request #3 from siliconcompiler/python313
Browse files Browse the repository at this point in the history
add python3.13 build
  • Loading branch information
gadfort committed Aug 26, 2024
2 parents e6a5317 + dadb9cc commit ee47382
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- {python: "3.10", os: "ubuntu-latest"}
- {python: "3.11", os: "ubuntu-latest"}
- {python: "3.12", os: "ubuntu-latest"}
- {python: "3.13", os: "ubuntu-latest"}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -37,7 +38,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version.python }}
cache: pip
allow-prereleases: true

- name: Run Python tests
run: |
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ jobs:
with:
python-version: 3.8
architecture: x64
cache: pip

- name: Build Surelog (Windows)
if: matrix.platform.os == 'windows-latest' && steps.surelog-cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -120,7 +119,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [cp38, cp39, cp310, cp311, cp312]
python-version: [cp38, cp39, cp310, cp311, cp312, cp313]
platform:
- os: ubuntu-latest
arch: x86_64
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def has_ext_modules(foo):

include_package_data=True,

python_requires=">=3.8,<3.13",
python_requires=">=3.8",
install_requires=install_reqs,
extras_require=extras_req,
distclass=BinaryDistribution
Expand Down
6 changes: 4 additions & 2 deletions surelog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ def get_path():
return pathlib.Path(__file__).parent / "bin"


def get_bin():
def get_bin(platform=None):
exe = "surelog"
if sys.platform.startswith("win32"):
if not platform:
platform = sys.platform
if platform.startswith("win32"):
exe = f"{exe}.exe"

return exe
13 changes: 12 additions & 1 deletion tests/test_lib.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pathlib
import surelog
from unittest.mock import patch
import pytest


def test_path():
Expand All @@ -12,6 +13,16 @@ def test_has_system(monkeypatch):
assert surelog.has_system_surelog() is False


@pytest.mark.parametrize("platform,ext", [
("linux", ""),
("darwin", ""),
("macos", ""),
("win32", ".exe"),
])
def test_get_bin(platform, ext):
assert surelog.get_bin(platform) == f'surelog{ext}'


@patch('sys.platform', 'linux')
def test_get_bin_linux():
assert surelog.get_bin() == 'surelog'
Expand All @@ -30,4 +41,4 @@ def test_get_bin_windows():
def test_version(monkeypatch):
import _tools

assert _tools.tools['surelog']["git-commit"] == f"v{surelog.__version__}"
assert f"v{surelog.__version__}".startswith(_tools.tools['surelog']["git-commit"])

0 comments on commit ee47382

Please sign in to comment.