diff --git a/pyproject.toml b/pyproject.toml index 1289fc5f..e449c656 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -130,6 +130,10 @@ ignore = [ "EM101", # String literals in exception ] +[tool.ruff.lint.flake8-copyright] +# Our headers carry no year, which ruff's default notice-rgx requires. +notice-rgx = "(?i)Copyright lowRISC contributors" + [tool.ruff.lint.per-file-ignores] # Top-level CLIs should be allowed to print if needed "src/dvsim/cli/**.py" = ["T201"] diff --git a/ruff-ci.toml b/ruff-ci.toml index c4f05178..051295d5 100644 --- a/ruff-ci.toml +++ b/ruff-ci.toml @@ -114,6 +114,10 @@ ignore = [ "UP031", ] +[lint.flake8-copyright] +# Our headers carry no year, which ruff's default notice-rgx requires. +notice-rgx = "(?i)Copyright lowRISC contributors" + [lint.per-file-ignores] # Less strict in the tests "tests/**.py" = [ diff --git a/src/dvsim/cli/run.py b/src/dvsim/cli/run.py index 691164bd..60d36877 100644 --- a/src/dvsim/cli/run.py +++ b/src/dvsim/cli/run.py @@ -21,7 +21,7 @@ """ import argparse -import datetime +import datetime as dt import os import random import shlex @@ -1064,7 +1064,7 @@ def main(argv: list[str] | None = None) -> None: args.cfg = os.path.join(proj_root, cfg_path) # Add timestamp to args that all downstream objects can use. - curr_ts = datetime.datetime.now(datetime.timezone.utc) + curr_ts = dt.datetime.now(dt.timezone.utc) args.timestamp_long = curr_ts.strftime(TS_FORMAT_LONG) args.timestamp = curr_ts.strftime(TS_FORMAT) diff --git a/src/dvsim/launcher/base.py b/src/dvsim/launcher/base.py index 536af357..917d152a 100644 --- a/src/dvsim/launcher/base.py +++ b/src/dvsim/launcher/base.py @@ -4,7 +4,7 @@ """Launcher abstract base class.""" -import datetime +import datetime as dt import os import re import sys @@ -233,7 +233,7 @@ def _pre_launch(self) -> None: """ self.job_spec.pre_launch() self._make_odir() - self.start_time = datetime.datetime.now() + self.start_time = dt.datetime.now() @abstractmethod def _do_launch(self) -> None: diff --git a/src/dvsim/launcher/nc.py b/src/dvsim/launcher/nc.py index 710b7cf0..6eda5b04 100644 --- a/src/dvsim/launcher/nc.py +++ b/src/dvsim/launcher/nc.py @@ -4,7 +4,7 @@ """Altair nc job launcher.""" -import datetime +import datetime as dt import os import pathlib import subprocess @@ -164,7 +164,7 @@ def _do_launch(self) -> None: self._close_process() def minutes_since_start(self): - return (datetime.datetime.now() - self.start_time).total_seconds() / 60 + return (dt.datetime.now() - self.start_time).total_seconds() / 60 def poll(self) -> JobStatus: """Check status of the running process. @@ -194,7 +194,7 @@ def poll(self) -> JobStatus: # If the job log size is more than the threshold, # declare the job to have started running # capture the run start time - self.start_time = datetime.datetime.now() + self.start_time = dt.datetime.now() self.nc_job_state = "running" if self.nc_job_state == "waiting": # noqa: SIM102 diff --git a/src/dvsim/tool/meridianrdc.py b/src/dvsim/tool/meridianrdc.py index 36855cc4..f68eb28c 100644 --- a/src/dvsim/tool/meridianrdc.py +++ b/src/dvsim/tool/meridianrdc.py @@ -212,16 +212,18 @@ def main() -> None: # #39491: parameter in package ( "flow_warning", - r"^ " - r"(?!WARN \[#25010\])" - r"(?!WARN \[#25011\])" - r"(?!WARN \[#25012\])" - r"(?!WARN \[#25013\])" - r"(?!WARN \[#26038\])" - r"(?!WARN \[#39035\])" - r"(?!WARN \[#39122\])" - r"(?!WARN \[#39491\])" - r"WARN .*", + ( + r"^ " + r"(?!WARN \[#25010\])" + r"(?!WARN \[#25011\])" + r"(?!WARN \[#25012\])" + r"(?!WARN \[#25013\])" + r"(?!WARN \[#26038\])" + r"(?!WARN \[#39035\])" + r"(?!WARN \[#39122\])" + r"(?!WARN \[#39491\])" + r"WARN .*" + ), ), ("flow_info", r"^ INFO .*"), ], diff --git a/src/dvsim/tool/verilator.py b/src/dvsim/tool/verilator.py index d831808b..c9ad6f31 100644 --- a/src/dvsim/tool/verilator.py +++ b/src/dvsim/tool/verilator.py @@ -69,9 +69,11 @@ def main() -> None: # TODO(#10071) remove countermeasure waiver. ( "flow_warning", - r"^(?!WARNING: Unknown item formal in section Target)" - r"(?!WARNING: Countermeasure.*)" - r"WARNING: .*", + ( + r"^(?!WARNING: Unknown item formal in section Target)" + r"(?!WARNING: Countermeasure.*)" + r"WARNING: .*" + ), ), ("flow_warning", r"^.*Warning: .* "), ("flow_warning", r"^W .*"), diff --git a/tests/job/test_deploy.py b/tests/job/test_deploy.py index 99716d31..b6f130f6 100644 --- a/tests/job/test_deploy.py +++ b/tests/job/test_deploy.py @@ -120,33 +120,37 @@ class TestCompileSim: ( {"dry_run": True}, {}, - "make -f path/to/makefile build " - "-n " - "build_cmd=path/to/build_name/build_cmd " - "build_dir=build/dir " - "build_opts='-b path/here -a \"Quoted\"' " - "post_build_cmds='C && D' " - "post_build_opts=E " - "pre_build_cmds='A && B' " - "proj_root=/project " - "sv_flist_gen_cmd=gen_cmd " - "sv_flist_gen_dir=path/to/gen " - "sv_flist_gen_opts=''", + ( + "make -f path/to/makefile build " + "-n " + "build_cmd=path/to/build_name/build_cmd " + "build_dir=build/dir " + "build_opts='-b path/here -a \"Quoted\"' " + "post_build_cmds='C && D' " + "post_build_opts=E " + "pre_build_cmds='A && B' " + "proj_root=/project " + "sv_flist_gen_cmd=gen_cmd " + "sv_flist_gen_dir=path/to/gen " + "sv_flist_gen_opts=''" + ), ), ( {"dry_run": False}, {}, - "make -f path/to/makefile build " - "build_cmd=path/to/build_name/build_cmd " - "build_dir=build/dir " - "build_opts='-b path/here -a \"Quoted\"' " - "post_build_cmds='C && D' " - "post_build_opts=E " - "pre_build_cmds='A && B' " - "proj_root=/project " - "sv_flist_gen_cmd=gen_cmd " - "sv_flist_gen_dir=path/to/gen " - "sv_flist_gen_opts=''", + ( + "make -f path/to/makefile build " + "build_cmd=path/to/build_name/build_cmd " + "build_dir=build/dir " + "build_opts='-b path/here -a \"Quoted\"' " + "post_build_cmds='C && D' " + "post_build_opts=E " + "pre_build_cmds='A && B' " + "proj_root=/project " + "sv_flist_gen_cmd=gen_cmd " + "sv_flist_gen_dir=path/to/gen " + "sv_flist_gen_opts=''" + ), ), ], ) diff --git a/uv.lock b/uv.lock index d3dc1e38..b5d7026b 100644 --- a/uv.lock +++ b/uv.lock @@ -2788,27 +2788,27 @@ wheels = [ [[package]] name = "ruff" -version = "0.15.15" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/84/6f/a76f7d96e5c962f5b69cee865e49c15c1116897c01990faa8a57edb62e7f/ruff-0.15.15.tar.gz", hash = "sha256:b8dff018130b46d8e5bf0f926ef6b60cf871d6d5ae45fc9334e09632daa741d6", size = 4706985, upload-time = "2026-05-28T14:16:57.784Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/fa/9d/3a45c05b8ab04b4705989de70a79008e27c8003296a0feaee9edc18dd7e9/ruff-0.15.15-py3-none-linux_armv6l.whl", hash = "sha256:cf93e5388f412e1b108b1f8b34a6e036b70fe8aff89393befad96fe48670311b", size = 10710652, upload-time = "2026-05-28T14:16:06.701Z" }, - { url = "https://files.pythonhosted.org/packages/05/66/da974431624bf3b49f6ee1f9543c02d929ff1cba78b0d5a79c38cf21f744/ruff-0.15.15-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:ac5a646d1f6a7dadd5d50842dae2c1f9862ac887ef5d1b1375e02def791fde6e", size = 11096615, upload-time = "2026-05-28T14:16:23.313Z" }, - { url = "https://files.pythonhosted.org/packages/8c/09/7443452e5d290230a712103f2fdceeef7184f3ec99a2bd01c8be78aaceb5/ruff-0.15.15-py3-none-macosx_11_0_arm64.whl", hash = "sha256:77d955a431430c66f72dd94e379ad38a16daea3d25094872ac4edf9e797be530", size = 10436683, upload-time = "2026-05-28T14:16:40.974Z" }, - { url = "https://files.pythonhosted.org/packages/53/01/d330c26a57fa4f3943a14424904027428315b700fe4d14a84bb123a649e5/ruff-0.15.15-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7614ee79c69788cf6cedd568069ade9cecc22a1ad20494efe8d0c9ebb4b622d4", size = 10769064, upload-time = "2026-05-28T14:16:28.905Z" }, - { url = "https://files.pythonhosted.org/packages/1d/85/cc8770f8bdff541b1da8392d1634141fe4a0e3f4ee596605959b7906c27f/ruff-0.15.15-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3cdb1679e06a1f6b47bc384714ae96f6e2fb65ca441eb78c43d2ca554176ce1f", size = 10511987, upload-time = "2026-05-28T14:16:43.732Z" }, - { url = "https://files.pythonhosted.org/packages/7c/29/8c190c1472b63013583ba391f3342036e02010544c1270455ed8e519bdf3/ruff-0.15.15-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2728b93d7b23a603ea2c0ac6eb73d760bd38ec9de35f35fb41e18f7a3fee7622", size = 11275100, upload-time = "2026-05-28T14:16:55.244Z" }, - { url = "https://files.pythonhosted.org/packages/9f/6b/7e145ce2cc8e63d6834eca03d83a0e18d121def5c69f91b4cf4011ed4879/ruff-0.15.15-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:be582fcc0db438902c7792b08d6ddf6c9b9e21addaa10092c2c741cfb09e5a45", size = 12176903, upload-time = "2026-05-28T14:16:14.368Z" }, - { url = "https://files.pythonhosted.org/packages/80/a3/d5974637f68e451f7fadf015cf3101d1cd7d8ba5027cffe0b9e3826ebe6b/ruff-0.15.15-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7aa77465b8ecaf1a27bea098d696f7fed5e1eccbd10b321b682d6de586ae5627", size = 11404550, upload-time = "2026-05-28T14:16:20.138Z" }, - { url = "https://files.pythonhosted.org/packages/fe/1c/e6e5e568f22be4fb05d6244234aba384c06b451252453b821e1a529263cf/ruff-0.15.15-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:48decfa11d740de4889de623be1463308346312f2409a56e24aa280c86162dc4", size = 11382027, upload-time = "2026-05-28T14:16:46.615Z" }, - { url = "https://files.pythonhosted.org/packages/1d/01/170921b49fcd2e8858825593f91cf7146c3e40a5c3e6df763e4bb0484dde/ruff-0.15.15-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:a5015088452ca0081387063649ec67f06d3d1d6b8b936a1f836b5e9657ecd48c", size = 11366041, upload-time = "2026-05-28T14:16:26.247Z" }, - { url = "https://files.pythonhosted.org/packages/87/54/a7bad711d7de93254e15e06a4c375b89a03d18de45d3e5dcc86a4472fb1a/ruff-0.15.15-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:f5294aab6356c81600fcdea3a62bb1b924dfd5e91767c12318d3f68f86af57cd", size = 10741795, upload-time = "2026-05-28T14:16:17.11Z" }, - { url = "https://files.pythonhosted.org/packages/c9/31/38c075963668f8b41c6914ee0f6f318727fbe30ab9145cb29e6df464c5fa/ruff-0.15.15-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:db5bd4d802415cca656dc1616070b725952d6ae95eb5d4831e49fbd94a38f75f", size = 10511117, upload-time = "2026-05-28T14:16:31.767Z" }, - { url = "https://files.pythonhosted.org/packages/9d/96/6ff689e1f7e375d1d97075eca022f74c2bab59554a432fe4d2e6f091986a/ruff-0.15.15-py3-none-musllinux_1_2_i686.whl", hash = "sha256:587a6278ed42059191c1a466e490bd7930fb50bd2e255398bc29616c895a61cb", size = 10994867, upload-time = "2026-05-28T14:16:35.149Z" }, - { url = "https://files.pythonhosted.org/packages/c3/c2/5dce0ab9f92a8d534fa62b9bf9caca3eddb8c1a81b616f5e195ada4f0d6e/ruff-0.15.15-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:df0c1c084f5f4be9812f61518a45c440d3c30d69ce4bf6c5270e66d38338f02a", size = 11482101, upload-time = "2026-05-28T14:16:49.598Z" }, - { url = "https://files.pythonhosted.org/packages/b1/c0/1003b60edd697c649faf61f1a34094b1abb38fb3d1181e3f895781250a08/ruff-0.15.15-py3-none-win32.whl", hash = "sha256:29428ea79694afbe756d45fd59b36f22b6b020dc0443cf7de0173046236964b9", size = 10716774, upload-time = "2026-05-28T14:16:52.337Z" }, - { url = "https://files.pythonhosted.org/packages/02/a8/1269eddd6945a06c23f055ef7848886e37cf9d6a8bebb386a3115f01470c/ruff-0.15.15-py3-none-win_amd64.whl", hash = "sha256:8df0323902e15e24bc4bf246da830573d3cf3352bd0b9a164eab335d111ff4a4", size = 11868463, upload-time = "2026-05-28T14:16:11.333Z" }, - { url = "https://files.pythonhosted.org/packages/4e/b2/920464c907b191e37469d477a1aa8bc048b8f36c4c1610dfa4ab87b39e18/ruff-0.15.15-py3-none-win_arm64.whl", hash = "sha256:3c8ceca6792f38196b8f589bc92eccd03eef286602da92e5dc05cc42ef6441b7", size = 11138498, upload-time = "2026-05-28T14:16:38.425Z" }, +version = "0.17.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/84/0e/3d154514b5bad104f7e1c13169c2d09aa9959fccdc06eb47610ccdfa83ed/ruff-0.17.4.tar.gz", hash = "sha256:f32d178b50e826e00f6c6c1be3f56333068acb9b67fe167143527fa9b81e890d", size = 5357750, upload-time = "2026-11-05T18:52:17.638Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e0/61/c83c78bbb6108f6c6270a106cf12b54175f4f42da088b9bb880f18e31289/ruff-0.17.4-py3-none-linux_armv6l.whl", hash = "sha256:2b08c4ff98dc234f4a3871a3105353b922fa875ea1073ca31001eb8c06bb4d89", size = 10252195, upload-time = "2026-11-05T18:51:36.594Z" }, + { url = "https://files.pythonhosted.org/packages/0a/12/dd158708378866e8b53e145a465dbc51a7cccb9fa197a74d67eaedde7234/ruff-0.17.4-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:13e781c3c5f663e7fba737eaaeb70dd943dd55171daf316afb25cd5268cfe0c7", size = 10266044, upload-time = "2026-11-05T18:51:39.502Z" }, + { url = "https://files.pythonhosted.org/packages/28/32/89a94a8eb11fd505a381ae6f04e190d038d9958695209dc1786ce5cfcda3/ruff-0.17.4-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7ed2f416349944f908f9574215994602242b0836844eba48eec61473033afca0", size = 9432227, upload-time = "2026-11-05T18:51:41.968Z" }, + { url = "https://files.pythonhosted.org/packages/58/de/a392dc38b215798ae72e639d228b7f6c02d826a95d1c0ad7c4c0ee49ef5b/ruff-0.17.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8ea6e0017c785f7282092b11e46338e4ebed1b9e575ebf2e55a8a1eda968241a", size = 10136900, upload-time = "2026-11-05T18:51:44.562Z" }, + { url = "https://files.pythonhosted.org/packages/b7/8f/a880f60f42005f6ffdf58f77af34c7ee327000b5607f48a2f6a69d8b242c/ruff-0.17.4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7e061dcc0933c7031a616ac8d66ac540309b2aa21ab558101a8f53e9ac7a1185", size = 10051245, upload-time = "2026-11-05T18:51:46.7Z" }, + { url = "https://files.pythonhosted.org/packages/09/55/98844264108af7d5ec27ca3a9cd5a989094ca657a14599c4b69a537a0e9a/ruff-0.17.4-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f99e95a1515161138be3cbd1b06c06e739d8feb38ade35564556999fffc3686e", size = 10704341, upload-time = "2026-11-05T18:51:49.228Z" }, + { url = "https://files.pythonhosted.org/packages/28/a2/5edf97659c3ac7c73f978003bd314936f671037fdac6b978e9de3e4b2b65/ruff-0.17.4-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5f28cf0dd37cb172fa5a8d2e92e6ada3a9dbd0609f094ed24039929eef0b7524", size = 11394465, upload-time = "2026-11-05T18:51:51.534Z" }, + { url = "https://files.pythonhosted.org/packages/f2/8f/51371ae856b2bef4d15a044a574695fbc0f6ae63aafa42a2a22428070fb6/ruff-0.17.4-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6b21c771b296888e8a35c6f48555f4b44e4483f61675d6ed51810a5203469ce6", size = 10988262, upload-time = "2026-11-05T18:51:53.91Z" }, + { url = "https://files.pythonhosted.org/packages/af/1b/62874f14c7873f27c7887d2b1ea41de990e14ba9518801ffe8eacb5d51a6/ruff-0.17.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2cd025509b2e15721b426fc70fd946d71f43b3db3b08e946dfec2d696d911690", size = 10572829, upload-time = "2026-11-05T18:51:56.129Z" }, + { url = "https://files.pythonhosted.org/packages/98/30/860b9dae67432b16b88558a9cb2d3194825fa62838f8b9cc49f5d9022095/ruff-0.17.4-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:49b77f7b3921669466882a4881168801bdb06ec2cd83fb936049016cf5fdece1", size = 10617545, upload-time = "2026-11-05T18:51:58.172Z" }, + { url = "https://files.pythonhosted.org/packages/0f/08/781a4b41a1c83fd6e30fea610d6502a6f94e49cf94693fd37bdcbc6bfe11/ruff-0.17.4-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:e3b84eb74f260d1c2dbd236fd9d4c011d4fdd0a52bdf8aea57a10e3a1b71fca5", size = 10111955, upload-time = "2026-11-05T18:52:00.59Z" }, + { url = "https://files.pythonhosted.org/packages/3c/e9/94b1c7b677120f30839254518924f73a8157e9bcfa200edcd5796fecdb99/ruff-0.17.4-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:20e43d7a08e712e33067ba887e6574546c79bd4831596ce8f16803ac7ff9ad90", size = 10058355, upload-time = "2026-11-05T18:52:03.61Z" }, + { url = "https://files.pythonhosted.org/packages/27/5f/a825910b9f309336dc33cb8c0774126662c1d2f765699b3e0a1bd538d01f/ruff-0.17.4-py3-none-musllinux_1_2_i686.whl", hash = "sha256:0d1f4848fd2ec0499be4046db9b7dfcc952666885f00233cc7033515282556a8", size = 10415932, upload-time = "2026-11-05T18:52:06.264Z" }, + { url = "https://files.pythonhosted.org/packages/8b/b8/0796468423413ea4df1a6e2442ae26cf49b8f7dda0eecf246e0d5d0dde54/ruff-0.17.4-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:6007e7f3a0e55b0fbdb947af69cf24c21b4928df6be8ef3e767c69b5ccccf496", size = 10826033, upload-time = "2026-11-05T18:52:08.675Z" }, + { url = "https://files.pythonhosted.org/packages/b9/ab/d8e407669ffe5014429baf780c2df47e001968a6e4c17f615e2e7b13a9ba/ruff-0.17.4-py3-none-win32.whl", hash = "sha256:3971a78cba76298b284c8321e6d40d93045ed348bec5c369d85099efc97fb7cf", size = 9931993, upload-time = "2026-11-05T18:52:11.169Z" }, + { url = "https://files.pythonhosted.org/packages/bd/15/42af8a72d8946e3c9efd2bbf6641e462b6832783b0d043d63ef5b280ba7f/ruff-0.17.4-py3-none-win_amd64.whl", hash = "sha256:67c5a894fc054cf41f75f7afa24815de5a74329d97634126c2a1015740ff4e8c", size = 10292922, upload-time = "2026-11-05T18:52:13.436Z" }, + { url = "https://files.pythonhosted.org/packages/68/9e/f1dbffcfb8ff25dadbc21f87a8b73c3848abe4abada9d4b08ccef8bec40c/ruff-0.17.4-py3-none-win_arm64.whl", hash = "sha256:181ae38a9a8fb94925bf7d0794327b48d7fd7f4b50cfd84c0e999cc09ef8d131", size = 9889396, upload-time = "2026-11-05T18:52:15.549Z" }, ] [[package]]