-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[CHIA-598] virtual project structure #18616
base: main
Are you sure you want to change the base?
Conversation
…ll files default to be treated as belonging to chia-blockchain project. No default annotations. no default exclusions.
209a2f2
to
d6c3f8d
Compare
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.
I'd prefer a version still with annotations (that all say chia-blockchain
) so that we are forced to think about it. I also don't really see the point of this step except to add pre-commit & CI overhead when the path forward is uncertain. Those concerns being stated, I won't block this if others care to see it merged.
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 file does not belong here. I'd prefer to see it in a whole other repo because I believe it it a generally useful tool that is more likely to evolve if it's not tied deeply to this chia-blockchain
repo. I realize that's a bit tricky because of the git pre-commit action. But at the very least, can we move it to tools
where quex had it?
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.
My stand-alone version here https://github.com/richardkiss/vpa changes ChiaFile
to PythonFile
(for example). It also fixes some a problem with finding imports of the form from .xxx import yyy
that this version misses, which could give false hope in places, and is part of the way to finding "local" imports hidden in function calls.
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.
I'd prefer to see it in a whole other repo because I believe it it a generally useful tool that is more likely to evolve if it's not tied deeply to this chia-blockchain repo
I agree with that sentiment, it's not very practical right now though, as it would add quite a lot of friction to iterate on the tool.
But at the very least, can we move it to tools where quex had it?
I'm pretty sure I didn't move any files from quex's PR. But tools seems reasonable to me.
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.
I moved it into tools/
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.
@richardkiss this worked locally for some reason, but I believe the issue of arbitrary directories in the root not being proper modules was the reason we moved tests
into chia
.
Did I misunderstand what you meant or is it OK to drop the last commit?
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.
can we please just ban new Python code outside of chia/
? i'm tired of maintaining the tool configs for all our Python code we've spread to the wind. if we do put the code outside then i guess we should recreate a tests directory outside. having a test in the package for code that is not in the package seems a touch silly. then we can update ci to account for multiple different tests directories. also, then we can have many more programs to run without being able to just to chia dev -h
and see all our tooling listed with brief descriptions. /s (except i'm serious about just banning new Python files outside of chia/
)
@richardkiss this worked locally for some reason, but I believe the issue of arbitrary directories in the root not being proper modules was the reason we moved
tests
intochia
.
other projects use our test tooling. that's why the tests directory moved into the chia directory, so it would be available to the other projects. also i like to have tests available with the package rather than requiring a vcs checkout for that, but this is a side note. also also, i like fewer directories to have to configure differently in different tools...
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.
I just dropped the last commit, to restore the PR to its original form
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.
Kyle doesn't think it should be outside chia
. I don't think it should be in chia
(or in this repo at all). But it's pretty hard (although not impossible) to incorporate it into github actions if it's outside this repo and Arvid thinks doing so would be impractical and increase friction. So we don't really have a consensus here.
What I think we should do: keep it external. Do a pip install git+https://
pinned by revision number (at least for now) in the github action. This allows extremely fine-grained use of the tool from an external repo without even doing a pypi release of it.
I am happy to take more ownership of this tool, externally, including some known bugs. But I don't want to get into the github action stuff because it seems like there are a lot of implicit opinions in how it works that I don't want to get involved in. And I don't know how this affects the check-in action. Although I think if there is a CI step that blocks PRs, that's probably enough.
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.
@richardkiss this worked locally for some reason, but I believe the issue of arbitrary directories in the root not being proper modules was the reason we moved
tests
intochia
.Did I misunderstand what you meant or is it OK to drop the last commit?
FYI: you can go python tools/virtual_project_analysis.py
to run things when there's no __init__.py
. Although I'm not sure that's what we should do here.
It's this: "The main point of the tool is of course to prevent people not working on refactoring from undo-ing the refactor-ers' progress" |
5569f6a
to
d6c3f8d
Compare
Yes, except the method with which to refactor has not been established and therefore progress cannot be made to potentially undo. |
Pull Request Test Coverage Report for Build 10994621633Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
you break something off by marking it as belonging to a different project. Then it can not be undone by mistake, only by changing back (or removing) the marking, or by disabling the CI job |
You would still need two steps to make a change. e.g. I might want to add a feature where you can label files based on a glob pattern in the yaml file. I would have to add that feature in a separate repo and (possibly) not be able to demonstrate that it works as intended until I update it in chia-blockchain. |
When you add a feature to |
Purpose:
Slightly modified subset of @Quexington 's virtual project structure tool. #17810
The main differences are:
chia-blockchain
project.This is immediately helpful for someone breaking out a sub-project to prevent other (unrelated) PRs re-introducing dependency cycles.
Current Behavior:
There is no way to "lock in" progress of breaking out sub-projects that should not have dependencies back into the core of chia-blockchain.
New Behavior:
This tool allows you to "lock in" progress of breaking out sub-projects. Once it lands, other PRs cannot re-introduce dependency cycles without CI turning red.
Changes:
Changes from Quexingtons patch (it's not so easy to compare on github because we have different base commits).
Whatever dict-like object
yaml.safe_load()
returns, it doesn't appear itsget()
function accepts a default value. Whith 0 exclusions, it returnedNone
instead of[]
.