Closed dalonsoa closed 2 months ago
@dalonsoa I don't understand these ruff
errors - if I correct them to what is in the failed workflow action - it moves them back when I run pre-commit
on my machine...
For coverage
you need:
[tool.coverage.report]
exclude_lines = [
"if TYPE_CHECKING:",
]
omit = [
"**/__init__.py",
]
ignore_errors = true
[tool.coverage.paths]
source = [ "src", "*/site-packages" ]
omit = [
"**/__init__.py",
]
[tool.coverage.run]
branch = true
source = [
"swmmanywhere",
]
omit = [
"**/__init__.py",
]
Also, instead of:
only-include = ["src"]
sources = ["src"]
you can just do:
packages = [ "src" ]
@dalonsoa I don't understand these
ruff
errors - if I correct them to what is in the failed workflow action - it moves them back when I runpre-commit
on my machine...
Not sure. I've just re-run pre-commit locally and all works now.
I followed advice in : https://github.com/astral-sh/ruff/issues/5667 - not sure if that's what did it but the pre-commit seemed to correct itself now..
not sure this is satisfying as pre-commit will now fail locally...
For
coverage
you need:[tool.coverage.report] exclude_lines = [ "if TYPE_CHECKING:", ] omit = [ "**/__init__.py", ] ignore_errors = true [tool.coverage.paths] source = [ "src", "*/site-packages" ] omit = [ "**/__init__.py", ] [tool.coverage.run] branch = true source = [ "swmmanywhere", ] omit = [ "**/__init__.py", ]
Could you elaborate why we need all of these?
I followed advice in : astral-sh/ruff#5667 - not sure if that's what did it but the pre-commit seemed to correct itself now
I enabled precommit.ci, which heals some errors automatically, creating new commits with the fixes. See #296
I followed advice in : astral-sh/ruff#5667 - not sure if that's what did it but the pre-commit seemed to correct itself now
I enabled precommit.ci, which heals some errors automatically, creating new commits with the fixes. See #296
Not sure that fixes this though - since it is failing locally but passing after pre commit heal?
Runs locally for me locally on the latest version of this branch with no problems.
Everything nice and green :)
Could you elaborate why we need all of these?
Coverage doesn't work nice with src-layout by default, so some of these options are required to make it correctly detect the lines and report. Also, I usually omit the init to clean up the report.
Done!
I dunno - pre-commit run --all-files
is still doing ruff
corrections on this branch on my machine - I will try on a different machine, maybe I have some weirdness going on on here
OK, there's an important missing block:
license-files = { paths = ["LICENSE", "src/netcomp/LICENSE.txt"] }
Description
Moves
swmmanywhere
andnetcomp
to asrc
folder. And then updatespyproject.toml
and a variety of other paths here and there to work with this new layout.Tests pass, documentation builds and the generated wheel contains the right things (both
swmmanywhere
andnetcomp
can be imported after installing the wheel on a fresh environment), but I have not check trying to run a full script so I guess there might be some hidden things that need fixing.Fixes #290 again
Type of change
Key checklist
python -m pytest
)python -m sphinx -b html docs docs/build
)pre-commit run --all-files
)Further checks