8 Commits

Author SHA1 Message Date
Shushi Hong 795cd2dacf [CI] Fix CI script test subprocess environment (#19713)
This fixes CI script tests that accidentally run helper scripts with the
wrong Python interpreter.

Some tests call `run_script(..., env={...})` to pass test-specific
environment variables. `subprocess.run` treats `env` as a full
environment replacement, so the subprocess lost the current `PATH`.
Since these scripts use a shebang like:

```python
#!/usr/bin/env python3
```

they could fall back to the system Python instead of the active test
Python.

In the wheel test environment this caused the CI helper scripts to run
under Python 3.8, even though TVM requires Python >=3.10. Importing
`ci/scripts/jenkins/git_utils.py` then failed on PEP 604 annotations
such as:

```python
Any | None
tuple[str, str] | None
```

with:

```text
TypeError: unsupported operand type(s) for |: '_SpecialForm' and 'NoneType'
```

This patch updates `tests/python/ci/test_utils.py::run_script` to merge
test-provided environment variables into `os.environ` instead of
replacing the entire environment. This preserves the active Python/PATH
while still allowing each test to override or add variables.
2026-06-10 08:37:36 -04:00
Tianqi Chen 9a8320acbd [LINT][PYTHON] Modernize annotations with ruff UP rules (#18830)
This PR enables ruff pyupgrade (UP) rules with py310 target, auto-fixing
~5600 annotation modernizations (PEP 585 generics, PEP 604 unions,
deprecated typing imports).

Also removes from __future__ import annotations from ir/module.py and
rmsnorm.py, bumps requires-python to >=3.10, and removes absolute_import
aliases from topi/contrib files.
2026-02-27 21:29:47 -05:00
Tianqi Chen 33dcea1686 [REFACTOR][LINT] Modernize ruff config (#18810)
This PR removes the extra lint violations from the codebase so lint
aligns with the latest style
2026-02-23 07:29:21 -05:00
Tianqi Chen aa2e609136 [LINT] Modernize lint to use pre-commit hooks (#18807)
This PR migrates existing lint to use pre-commit hooks
2026-02-22 11:03:21 -05:00
Florin Blanaru 5a767d053d [CI] Separate the ci scripts into Github and Jenkins scripts (#13368)
This PR is a duplicate of #12940 and #12941. For some reason, I am unable to reopen #12940.
2022-11-14 09:32:12 -08:00
driazati 7c7b0f7a2f [ci][tvmbot] Trigger GitHub Actions after merging (#12361)
This fixes the issue where merging from GitHub Actions (i.e. with the default `GITHUB_TOKEN`) doesn't trigger post merge GitHub Actions on the commit it creates in `main`. Instead these jobs are triggered manually by a call to the Actions API after the merge has taken place.

This also updates the tvmbot testing code (and by extension some of the other CI testing code) to remove the fixtures for each test in favor of constructing them from a single sample at runtime, this makes it a lot easier to add new tests and see what is different between each data sample and clean up the testing anti-patterns that were there before (e.g. `run()` instead of `pytest.mark.parameterize`, but none of the tests in `test_ci.py` have changed)

Tested in https://github.com/driazati/tvm/pull/36 which ran https://github.com/driazati/tvm/actions/runs/2881047903
2022-09-02 09:44:22 -07:00
driazati 0d14519e14 [ci] Enable pylint for tests/python/ci (#11666)
This fixes up the pylint issues as part of #11414 for the CI tests
2022-06-23 14:18:35 -07:00
Mehrdad Hessar ed6e7c07a5 [microTVM] Enable micro tvmc tutorial testing in CI (#10555)
* Add script convertor

* Address comments: added test

* address comments
2022-03-16 14:38:33 -07:00