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

Making CI green #1071

Merged
merged 4 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/publish_site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set -e

echo "isVUnit: $isVUnit"

cd $(dirname "$0")/../.tox/py312-docs/tmp/docsbuild/
cd $(dirname "$0")/../.tox/py313-docs/tmp/docsbuild/
touch .nojekyll
git init

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'

- name: Run coverage
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'

- name: Install dependencies
run: |
pip install -U pip --progress-bar off
pip install -U virtualenv tox --progress-bar off

- name: Build docs
run: tox -e py312-docs -- --color
run: tox -e py313-docs -- --color

- uses: actions/upload-artifact@v4
with:
name: VUnit-site
path: .tox/py312-docs/tmp/docsbuild/
path: .tox/py313-docs/tmp/docsbuild/

- name: '🚀 Publish site'
if: github.event_name != 'pull_request' && github.ref_name == 'master'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: '🛳️ Build container image'
run: |
docker build -t ghcr.io/vunit/dev/nvc -<<EOF
FROM gcr.io/hdl-containers/nvc
FROM hdlc/nvc

RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ jobs:
- name: '🐍 Setup Python'
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'

- name: '🐍 Install dependencies'
run: |
pip install -U pip --progress-bar off
pip install -U virtualenv tox --progress-bar off

- name: '🐍 Run black'
run: tox -e py312-fmt -- --diff --color
run: tox -e py313-fmt -- --diff --color

#
# Linux linting and unit tests
Expand All @@ -48,9 +48,9 @@ jobs:
fail-fast: false
matrix:
include:
- { py: '3.12' , task: 312-lint }
- { py: '3.13' , task: 313-lint }
- { py: '3.7' , task: 37-unit }
- { py: '3.12' , task: 312-unit }
- { py: '3.13' , task: 313-unit }
name: '🐧 Ubuntu · ${{ matrix.task }}'
steps:

Expand Down Expand Up @@ -80,8 +80,8 @@ jobs:
fail-fast: false
matrix:
task: [
{do: 312-acceptance, tag: llvm},
{do: 312-vcomponents, tag: mcode},
{do: 313-acceptance, tag: llvm},
{do: 313-vcomponents, tag: mcode},
]
name: '🛳️ Container · ${{ matrix.task.do }} · ${{ matrix.task.tag }}'
steps:
Expand Down Expand Up @@ -188,7 +188,7 @@ jobs:
- name: '🐍 Setup Python'
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'

- name: '🐍 Install dependencies'
run: |
Expand Down
5 changes: 4 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,14 @@
# -- InterSphinx --------------------------------------------------------------

intersphinx_mapping = {
"python": ("https://docs.python.org/3.8/", None),
"python": ("https://docs.python.org/3.13/", None),
"pytest": ("https://docs.pytest.org/en/latest/", None),
"osvb": ("https://umarcor.github.io/osvb", None),
}

nitpick_ignore_regex = [
("py:class", r".*"),
]
# -- ExtLinks -----------------------------------------------------------------

extlinks = {
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ underlines = ["-", "~"]
[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py{36,37,38,39,310,311,312}-{fmt,unit,lint,docs}, py{36,37,38,39,310,311,312}-{acceptance,vcomponents}-{activehdl,ghdl,modelsim,nvc,rivierapro}, py{36,37,38,39,310,311,312}-coverage
envlist = py{36,37,38,39,310,311,312,313}-{fmt,unit,lint,docs}, py{36,37,38,39,310,311,312,313}-{acceptance,vcomponents}-{activehdl,ghdl,modelsim,nvc,rivierapro}, py{36,37,38,39,310,311,312,313}-coverage
isolated_build = True

[testenv]
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def find_all_files(directory, endings=None):
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
Expand Down
1 change: 1 addition & 0 deletions tools/doc_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def highlight_code(
code_path,
output_path,
snippet_name=None,
*,
line_no_offset=None,
functions=None,
types=None,
Expand Down
2 changes: 1 addition & 1 deletion vunit/cached.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from vunit.ostools import read_file


def cached(key, function, file_name, encoding, database=None, newline=None):
def cached(key, function, file_name, encoding, *, database=None, newline=None):
"""
Call function with file content if an update is needed
"""
Expand Down
2 changes: 2 additions & 0 deletions vunit/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def __init__( # pylint: disable=too-many-arguments
self,
name,
design_unit,
*,
generics=None,
sim_options=None,
pre_config=None,
Expand Down Expand Up @@ -282,6 +283,7 @@ def _check_architectures(design_unit):
def add_config( # pylint: disable=too-many-arguments
self,
name,
*,
generics=None,
pre_config=None,
post_check=None,
Expand Down
3 changes: 2 additions & 1 deletion vunit/design_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def __init__(
name,
source_file,
unit_type,
*,
is_primary=True,
primary_design_unit=None,
):
Expand All @@ -66,7 +67,7 @@ class Entity(VHDLDesignUnit):
"""

def __init__(self, name, source_file, generic_names=None):
VHDLDesignUnit.__init__(self, name, source_file, "entity", True)
VHDLDesignUnit.__init__(self, name, source_file, "entity", is_primary=True)
self.generic_names = [] if generic_names is None else generic_names
self._add_architecture_callback = None
self._architecture_names = {}
Expand Down
1 change: 1 addition & 0 deletions vunit/parsing/verilog/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ class VerilogDesignFile(object):

def __init__( # pylint: disable=too-many-arguments
self,
*,
modules=None,
packages=None,
imports=None,
Expand Down
8 changes: 5 additions & 3 deletions vunit/parsing/verilog/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def _preprocess(self, tokens, defines=None, include_paths=None, included_files=N

return result

def preprocessor( # pylint: disable=too-many-arguments,too-many-branches
def preprocessor( # pylint: disable=too-many-arguments,too-many-branches,too-many-positional-arguments
self, token, stream, defines, include_paths, included_files
):
"""
Expand Down Expand Up @@ -162,7 +162,7 @@ def _skip_protected_region(stream):
if token.value == "end_protected":
return

def expand_macro( # pylint: disable=too-many-arguments
def expand_macro( # pylint: disable=too-many-arguments,too-many-positional-arguments
self, macro_token, stream, defines, include_paths, included_files
):
"""
Expand Down Expand Up @@ -254,7 +254,9 @@ def determine_if_taken(if_token, arg):
stream.skip_while(NEWLINE)
return result

def include(self, token, stream, include_paths, included_files, defines): # pylint: disable=too-many-arguments
def include(
self, token, stream, include_paths, included_files, defines
): # pylint: disable=too-many-arguments,too-many-positional-arguments
"""
Handle `include directive
"""
Expand Down
1 change: 1 addition & 0 deletions vunit/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def add_source_file( # pylint: disable=too-many-arguments
self,
file_name,
library_name,
*,
file_type="vhdl",
include_dirs=None,
defines=None,
Expand Down
12 changes: 8 additions & 4 deletions vunit/sim_if/ghdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def __init__( # pylint: disable=too-many-arguments
self,
output_path,
prefix,
*,
gui=False,
viewer_fmt=None,
viewer_args="",
Expand Down Expand Up @@ -286,7 +287,7 @@ def compile_vhdl_file_command(self, source_file):

def _get_command(
self, config, output_path, elaborate_only, ghdl_e, test_suite_name, wave_file
): # pylint: disable=too-many-branches,too-many-arguments
): # pylint: disable=too-many-branches,too-many-arguments,too-many-positional-arguments
"""
Return GHDL simulation command
"""
Expand Down Expand Up @@ -392,9 +393,12 @@ def simulate(self, output_path, test_suite_name, config, elaborate_only): # pyl
status = False

if config.sim_options.get(self.name + ".gtkwave_script.gui", None):
LOGGER.warning("%s.gtkwave_script.gui is deprecated and will be removed "
"in a future version, use %s.viewer_script.gui instead",
self.name, self.name)
LOGGER.warning(
"%s.gtkwave_script.gui is deprecated and will be removed "
"in a future version, use %s.viewer_script.gui instead",
self.name,
self.name,
)

if self._gui and not elaborate_only:
cmd = [self._get_viewer(config)] + shlex.split(self._viewer_args) + [data_file_name]
Expand Down
2 changes: 1 addition & 1 deletion vunit/sim_if/incisive.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def supports_vhdl_contexts():
return False

def __init__( # pylint: disable=too-many-arguments
self, prefix, output_path, gui=False, log_level=None, cdslib=None, hdlvar=None
self, prefix, output_path, *, gui=False, log_level=None, cdslib=None, hdlvar=None
):
SimulatorInterface.__init__(self, output_path, gui)
self._prefix = prefix
Expand Down
11 changes: 7 additions & 4 deletions vunit/sim_if/nvc.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def find_prefix_from_path(cls):
return cls.find_toolchain([cls.executable])

def __init__( # pylint: disable=too-many-arguments
self, output_path, prefix, num_threads, gui=False, viewer_fmt=None, viewer_args="", viewer=None
self, output_path, prefix, *, num_threads, gui=False, viewer_fmt=None, viewer_args="", viewer=None
):
SimulatorInterface.__init__(self, output_path, gui)
if viewer_fmt == "ghw":
Expand Down Expand Up @@ -305,9 +305,12 @@ def simulate(
status = False

if config.sim_options.get(self.name + ".gtkwave_script.gui", None):
LOGGER.warning("%s.gtkwave_script.gui is deprecated and will be removed "
"in a future version, use %s.viewer_script.gui instead",
self.name, self.name)
LOGGER.warning(
"%s.gtkwave_script.gui is deprecated and will be removed "
"in a future version, use %s.viewer_script.gui instead",
self.name,
self.name,
)

if self._gui and not elaborate_only:
cmd = [self._get_viewer(config)] + shlex.split(self._viewer_args) + [str(wave_file)]
Expand Down
12 changes: 9 additions & 3 deletions vunit/source_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def __init__( # pylint: disable=too-many-arguments
file_type,
name,
library,
*,
verilog_parser,
database,
include_dirs=None,
Expand Down Expand Up @@ -206,6 +207,7 @@ def __init__( # pylint: disable=too-many-arguments
self,
name: Union[str, Path],
library: Library,
*,
vhdl_parser,
database,
vhdl_standard: VHDLStandard,
Expand Down Expand Up @@ -311,16 +313,20 @@ def _find_design_units(self, design_file):
architecture.identifier,
self,
"architecture",
False,
architecture.entity,
is_primary=False,
primary_design_unit=architecture.entity,
)
)

for configuration in design_file.configurations:
result.append(VHDLDesignUnit(configuration.identifier, self, "configuration"))

for body in design_file.package_bodies:
result.append(VHDLDesignUnit(body.identifier, self, "package body", False, body.identifier))
result.append(
VHDLDesignUnit(
body.identifier, self, "package body", is_primary=False, primary_design_unit=body.identifier
)
)

return result

Expand Down
11 changes: 10 additions & 1 deletion vunit/test/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ def set_attribute(self, name, value):
def add_config( # pylint: disable=too-many-arguments
self,
name,
*,
generics=None,
pre_config=None,
post_check=None,
Expand Down Expand Up @@ -257,7 +258,15 @@ def add_config( # pylint: disable=too-many-arguments
self._individual_tests = not run_all_in_same_sim and len(self._test_cases) > 0
del attributes["run_all_in_same_sim"]

super().add_config(name, generics, pre_config, post_check, sim_options, attributes, vhdl_configuration_name)
super().add_config(
name,
generics=generics,
pre_config=pre_config,
post_check=post_check,
sim_options=sim_options,
attributes=attributes,
vhdl_configuration_name=vhdl_configuration_name,
)


class FileLocation(object):
Expand Down
11 changes: 8 additions & 3 deletions vunit/test/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def __init__( # pylint: disable=too-many-arguments
self,
report,
output_path,
*,
verbosity=VERBOSITY_NORMAL,
num_threads=1,
fail_fast=False,
Expand Down Expand Up @@ -193,7 +194,9 @@ def _get_output_path(self, test_suite_name):

return str(Path(output_path) / full_name)

def _add_skipped_tests(self, test_suite, results, start_time, num_tests, output_file_name):
def _add_skipped_tests(
self, test_suite, results, start_time, num_tests, output_file_name
): # pylint: disable=too-many-positional-arguments
"""
Add skipped tests
"""
Expand All @@ -203,7 +206,7 @@ def _add_skipped_tests(self, test_suite, results, start_time, num_tests, output_

def _run_test_suite( # pylint: disable=too-many-locals
self, test_suite, write_stdout, num_tests, output_path, output_file_name
):
): # pylint: disable=too-many-positional-arguments
"""
Run the actual test suite
"""
Expand Down Expand Up @@ -313,7 +316,9 @@ def _print_output(self, output_file_name):
for line in fread.readlines():
self._stdout_ansi.write(line)

def _add_results(self, test_suite, results, start_time, num_tests, output_file_name):
def _add_results(
self, test_suite, results, start_time, num_tests, output_file_name
): # pylint: disable=too-many-positional-arguments
"""
Add results to test report
"""
Expand Down
Loading