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
tox and GitHub checks are not aligned #1556
Comments
Right, but the regex linter check requires make support, which tox doesn't, so it's not entirely clear to me how you want the tox check to run the same checks as the GitHub actions. The GitHub actions are a superset of tox; eventually I expect things to shift even further in GitHub's favor (i.e. once we get In any case, I don't see how we can get the regex linter run on Windows out of the box. Do you have any suggestions how to fix this? |
Regexlint doesn't need make, it's just an external package and you call a script contained there. I guess you could use regexlint as a library and create a "test" that calls it. It's an abuse of unit tests though, in my opinion. Or does tox have a facility for integration of other types of checks? |
Yes, I've created an initial patch that runs on Windows. Tox supports running arbitrary commands and treating their return codes as a pass/fail so no need for regexlint to be part of the unit tests. It'll simply be a different tox environment that gets run.
|
Ah my bad, I thought it required some Linux-ism to run. Should we include |
No need to make it a git submodule. Tox can specify it as a dependency to be installed, and pip supports checking out and installing a package from a git repo if that's required (though regexlint is available PyPI).
…On September 27, 2020 4:57:14 PM UTC, "Matthäus G. Chajdas" ***@***.***> wrote:
Ah my bad, I thought it required some Linux-ism to run. Should we include `regexlint` as a git submodule and run it through `tox`? It seems like a welcome addition (and potentially a better path forward for moving the other `make check` calls to?)
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#1556 (comment)
|
Ah, perfect. Let me look into this and see what I can do. |
Tested on Windows. Closes pygments#1556
Regarding migrating commands out of make, tox might not be the right tool for arbitrary build or release commands. For example, tox is probably not the right tool for managing the build of the Pygments demo. doit may be more appropriate -- it has strong support for specifying input file dependencies and output files, for skipping steps if the inputs and outputs aren't going to change, and running arbitrary commands. I've found it to be an powerful tool for automating builds and releases. |
There's no need to replace make; even if tox runs the linter (which I approve, of course) the standalone make target is still useful. |
I was mostly hoping to reduce duplication, i.e. have I don't want to remove the make files wholesale; only the tests if that's feasible. |
Sure, as long as you can still call the different things individually (i.e. make check, make regexlint etc.) As for regexlint, I'd prefer to keep using our fork instead of upstream, since we can easily tweak some rules there when needed. |
I updated #1557 to depend on Pygments' regexlint git master branch. regexlint depends on Pygments, so tox is installing the latest Pygments release in the testing environment. I think this is probably unnecessary, but please evaluate. It may be worthwhile to remove that dependency from regexlint. Here's the output from tox when I ran
|
I just tried this locally and it seems to work. I did notice however that changing a rule like In any case, this seems to work, though it's significantly slower compared to running
In comparison,
Frankly I'd call this prohibitively slow. It's definitely not something I'd want |
* Add regexlint to tox so linting can be done during development Tested on Windows. Closes #1556 * Make regex linting depend on pygments/regexlint@master
Uh, that difference should be investigated. It looks like missing parallelism, although user time is significantly higher as well. |
As far as I can tell most of the time is spent in downloading/installing the package. The check itself is not much slower. This could be biased due to me running this on WSL2, but I thought the gap is big enough to not make |
Got it. |
I'll check on the performance issue. You're right that it's all happening in the setup phase prior to actually running regexlint. I think tox supports skipping building a clean environment so they may be a win available here.
|
Thanks. My suspicion is that the (dependent) Pygments installation takes most of the time, and WSL2 certainly doesn't help. If it's a one-time cost that's fine for local use, but it won't help the CI as it starts from scratch every time. |
There's no reason for the CI to change anyway. |
After opening #1555 the regex linter warned me about a problem in my patch. This was not caught during extensive testing using tox, and indicates that tox and the GitHub checks are not aligned with each other.
tox must be updated to use the same regex linter that GitHub checks is using so that contributors can catch problems before submitting PR's.
The text was updated successfully, but these errors were encountered: