Skip to content

Commit

Permalink
Add support for Python 3.13 and remove for Python 3.8
Browse files Browse the repository at this point in the history
Internal-tag: [#67183]
Signed-off-by: bbrzyski <[email protected]>
  • Loading branch information
bbrzyski committed Oct 28, 2024
1 parent 151d4a7 commit c72afd1
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 30 deletions.
12 changes: 6 additions & 6 deletions .ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ lint:
script:
- ./.github/scripts/ci.sh lint

test_python_3_8:
stage: test
image: debian:bookworm
script:
- ./.github/scripts/ci.sh test_python 3.8

test_python_3_9:
stage: test
image: debian:bookworm
Expand All @@ -50,6 +44,12 @@ test_python_3_12:
script:
- ./.github/scripts/ci.sh test_python 3.12

test_python_3_13:
stage: test
image: debian:bookworm
script:
- ./.github/scripts/ci.sh test_python 3.13

package_test:
variables:
SCALENODE_CPU: 4
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ install_pyenv() {

log_cmd export PYENV_ROOT="$HOME/.pyenv"
log_cmd export PATH="$PYENV_ROOT/bin:$PATH"
log_cmd export PYENV_GIT_TAG=v2.4.10
log_cmd export PYENV_GIT_TAG=v2.4.15
log_cmd "curl https://pyenv.run | bash"
end_command_group
}
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,24 @@ jobs:
run: |
./.github/scripts/ci.sh test_python 3.12
test_python_3_13:
runs-on: ubuntu-latest
container:
image: debian:bookworm
name: "Run tests on python 3.13"

steps:
- name: Install git package
run: |
apt-get update -qq
apt-get install -y git
- uses: actions/checkout@v4

- name: Run Python tests on python 3.13
run: |
./.github/scripts/ci.sh test_python 3.13
package_test:
runs-on: ubuntu-latest
container:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Added "IP Cores", "Externals", and "Constants" layers to the GUI which you can hide/show from the settings
- Nox session for downloading and packaging FuseSoc libraries
- Support Python 3.13 and dropped support for Python 3.8

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import nox
from nox.command import CommandFailed

PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12"]
PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"]


def argument(session: nox.Session, *args: str) -> bool:
Expand Down
28 changes: 14 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "topwrap"
version = "0.0.1"
requires-python = ">=3.8"
requires-python = ">=3.9"
authors = [{name = "Antmicro"}]
description = "Package for generating HDL wrappers and top modules for your HDL sources"
readme = "README.md"
Expand All @@ -28,29 +28,29 @@ dependencies = [
"pygtrie",
"pipeline_manager_backend_communication @ git+https://github.com/antmicro/kenning-pipeline-manager-backend-communication@eb690cfb7766bfbd85a4eff2a1e809573b8b72d0",
"pipeline_manager @ git+https://github.com/antmicro/kenning-pipeline-manager@f45289d7073e885b5e3f461db9a8667807b69380",
"soc_generator @ git+https://github.com/antmicro/soc-generator@76ac5b3743bea1bb6e5d2ac7ecae31ab39d5e8b3",
"soc_generator @ git+https://github.com/antmicro/soc-generator@4141f5c5720c9355d859d6098523173bdc306916",
]

[project.optional-dependencies]
topwrap-parse = [
"hdlConvertor @ git+https://github.com/Nic30/hdlConvertor@fae60effdb16574de152bf9bf7bc2e225b729797",
]
lint = [
"nox==2023.4.22",
"flake8==7.0.0",
"nox==2024.10.09",
"flake8==7.1.1",
"pre-commit==3.5.0",
"black==23.12.1",
"black==24.10.0",
"isort==5.13.2",
"codespell==2.2.6",
"codespell==2.3.0",
]
tests = [
"nox==2023.4.22",
"pytest==7.4.4",
"pytest-cov==4.1.0",
"pytest-lazy-fixtures==1.0.1",
"pyfakefs==5.3.5",
"deepdiff==7.0.1",
"pyright==1.1.378",
"nox==2024.10.09",
"pytest==8.3.3",
"pytest-cov==5.0.0",
"pytest-lazy-fixtures==1.1.1",
"pyfakefs==5.7.1",
"deepdiff==8.0.1",
"pyright==1.1.385",
"prettytable==3.11.0",
]
deploy = [
Expand Down Expand Up @@ -95,7 +95,7 @@ exclude = '''
)/
)
'''
target-version = ["py38", "py39", "py310", "py311", "py312"]
target-version = ["py39", "py310", "py311", "py312", "py313"]

[tool.isort]
profile = "black"
Expand Down
4 changes: 2 additions & 2 deletions topwrap/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def load_interface_definitions(dir_name: Optional[Path] = None):
"""

defs = []
with as_file(files("topwrap.interfaces")) if dir_name is None else nullcontext(
dir_name
with (
as_file(files("topwrap.interfaces")) if dir_name is None else nullcontext(dir_name)
) as dir_name:
for path in dir_name.glob("**/*"):
if path.suffix.lower() in (".yaml", ".yml"):
Expand Down
8 changes: 2 additions & 6 deletions topwrap/ip_desc.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ def from_port_def_list(ports: Collection[PortDefinition]) -> "IPCorePorts":
(
inp
if port.direction == PortDirection.IN
else out
if port.direction == PortDirection.OUT
else ino
else out if port.direction == PortDirection.OUT else ino
).add(IPCorePort.from_port_def(port).raw)
return IPCorePorts(input=inp, output=out, inout=ino)

Expand Down Expand Up @@ -152,9 +150,7 @@ def from_port_def_map(ports: Mapping[str, PortDefinition]) -> "IPCoreIntfPorts":
(
inp
if port.direction == PortDirection.IN
else out
if port.direction == PortDirection.OUT
else ino
else out if port.direction == PortDirection.OUT else ino
)[name] = IPCorePort.from_port_def(port).raw
return IPCoreIntfPorts(input=inp, output=out, inout=ino)

Expand Down

0 comments on commit c72afd1

Please sign in to comment.