-
Notifications
You must be signed in to change notification settings - Fork 1
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
Move packages within src and fix extra things #295
Conversation
@dalonsoa I don't understand these |
For [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" ] |
Not sure. I've just re-run pre-commit locally and all works now. |
for more information, see https://pre-commit.ci
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.. not sure this is satisfying as pre-commit will now fail locally... |
Could you elaborate why we need all of these? |
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. |
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 - |
OK, there's an important missing block: license-files = { paths = ["LICENSE", "src/netcomp/LICENSE.txt"] } |
src/swmmanywhere/metric_utilities.py
Outdated
@@ -12,13 +12,13 @@ | |||
import cytoolz.curried as tlz | |||
import geopandas as gpd | |||
import joblib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be for the import netcomp
line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this about isort
? If so, you need to specify what are the first-party packages.
lint.isort.known-first-party = [
"swmmanywhere",
"netcomp",
]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't include src
, just the name of the package. The pre-commit error sounds like an issue with the service.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK - shall I just abandon precommit.ci
and return it to what we had previously for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh lol it has passed now - maybe was a one off
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it sometimes happens, so don't sweat it 😄
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