-
Notifications
You must be signed in to change notification settings - Fork 387
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
Migrate to Monorepo #4765
Comments
@bethac07 and I talked about it, and it may make sense just to do the latter thing, and build out the rest if/when desired. It's a bit inefficient, since for example core tests will run even if only changing cellprofiler-related code, but not that huge a deal. @callum-jpg would you want to give it a go? |
I have a working example of this on my cellprofiler fork Here's some notes:
To install (I did all of this inside a conda env with python 3.9 and had no issues):
|
This is fantastic, though I confess this gave me a bit of a heart attack until I remembered "wait, it has all the core commits in there". I look forward to chatting in person more tomorrow to help me wrap my head around, but one thing I think we should note here - we may have preserved the histories, but one thing that IS broken is that PRs reference the (wrong) CellProfiler PR/issue with the corresponding number aka core PR 126 points at CellProfiler issue 126, because of course it doesn't realize there should be two number 126's. I think in general we're getting far, far more value doing this than we lose with this messiness, and we can always keep the core repo (renamed if necessary to something like core-archive) around for when we want to do historical digging, but just want to make sure we make the choice conscious of all the tradeoffs/downsides. I tried a different approach that claimed to preserve histories in my fork, but it 100% did not |
@callum-jpg I know this isn't top of your to-do list right now, but I mentioned this to @hinerm he mentioned we might try using git filter-branch (presumably, specifically, |
Many motivations for this, but generally, it makes dev easier:
We've talked about moving to poetry as well. If we want to do this simultaneously, we have at least two paths forward:
We can wait until Support subprojects in a poetry project python-poetry/poetry#2270 is closed before doing anything. There is also Monorepo / Monobuild support? python-poetry/poetry#936, but that has been folded into the former.
Don't wait, and do what several others have done (eg here w/ src, or here, or here): move to a
pyproject.toml
per subpackage (one for core, one for library, and one at the top level for cellprofiler), with ascripts
directory that will runpoetry <cmd>
across all of them if/when necessary. Once the issue above is closed, we can migrate.The main priority with (2) is to avoid having to create a separate virtual environment (something poetry strongly nudges towards) for each package. We already go through the trouble to make sure dependencies are non-conflicting, so we only need a single virtual environment.
If we don't want to move to poetry (either at all or yet), we might like to have a monorepo-aware build system like pants for the reasons outlined here.
Ultimately, we don't have to prioritize that either. We'd just refactor the directory to include core, and put library in its own package, with a simple
setup.py
:The text was updated successfully, but these errors were encountered: