-
Notifications
You must be signed in to change notification settings - Fork 36
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
Switch build from setuptools to Poetry and move tests path #303
Switch build from setuptools to Poetry and move tests path #303
Conversation
Codecov Report
@@ Coverage Diff @@
## master #303 +/- ##
==========================================
+ Coverage 95.34% 95.40% +0.06%
==========================================
Files 57 56 -1
Lines 3134 3134
==========================================
+ Hits 2988 2990 +2
+ Misses 146 144 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@gwaybio What are your thoughts about switching from |
I am in favor @kenibrewer , please make the switch if it's straightforward. Thanks! |
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.
Nice work! Excited to see the transition into a pyproject.toml
file and Poetry. I left a few comments regarding the changes and also wanted to follow up here with additional questions. Generally I'm requesting changes due to these more wide-reaching questions and hoping to better understand the development story behind your design considerations.
- Given how different Poetry and
pyproject.toml
development configuration can be, I highly recommend making documentation additions to theCONTRIBUTING.md
content or perhaps in the Sphinx docs. This would help support the current and future developer community surrounding Pycytominer. Without this and the current state of retaining therequirements*.txt
means developers may misinterpret how environment management is handled. - Regarding the changes to
tests/test_cyto_utils/test_DeepProfiler_processing.py
(and perhaps others): were these changes necessary in order to maintain passing tests in transitioning to the new setup? I appreciate the work towards changes in those files. At the same I felt that those changes might be different enough to become their own PR's to help distinguish the changes going on with the setup process. Reducing the number of additional changes alongside setup and environment management would decrease the chance for unintended or complex consequences and increase the overall assurance that the setup works like it did prior to the changes in this PR. Just the same, I'm seeking to understand and learn from you - so open to your thoughts and interested to hear more!
I agree. I added an additional todo item to this PR for documentation that I left unchecked. I wanted to get feedback on the initial set of changes that I proposed before doing the documentation changes.
The changes to the other test files were necessary as a part of changing their paths. In general I agree with the strategy of trying to limit the "bast radius" of PRs. However, in the case of this PR with changes to core aspects of the code is built I think it is worth being a bit more flexible in allowing a broader set of related changes required to allow the program to function as a whole. |
@d33bs I still have some outstanding changes related to versioning and documentation, but it would be good to get another review from you at this point for the changes so far. |
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.
Nice work @kenibrewer ! I left a couple comments about the additional changes added. I'm marking this as requesting changes due to what I felt like might be an unclosed database connection (which could result in unexpected behavior) - otherwise things looked good to me. Given the changes to collate.py
I recommend including those details upfront in the PR title or description to help observe and reason through what historically changed in this PR.
Thanks for this contribution @kenibrewer ! I have one question regarding the collate changes. Is it still possible to use collate from the command line? We have collaborators who use collate this way, and if we update collate usage, then they will not benefit from future pycytominer improvements. Is there a way to keep the collate CLI for now? FWIW, we believe CytoTable will supercede collate in the very near term, so we can stop supporting collate in future pycytominer versions. |
@gwaybio Nothing about the changes to |
Perhaps I should clarify. The problem the I also went ahead and double checked that all the CLI tools that vscode pytest couldn't find, were actually properly installed and available in the PATH when the poetry venv was properly initialized from the command line or when the built package was installed via pip. |
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.
Thanks for this explanation @kenibrewer ! And thank you for this important contribution :)
@d33bs - please feel free to merge when you are ready.
Thank you so much @kenibrewer for the tremendous contributions in this PR! I feel good about how things look and would like to merge. An aside: in the (I hope) kindest possible way I wanted to offer a suggestion for future work here or elsewhere (I have no qualms as is and these comments are intended as continuous improvement). There were a number of ideas in this PR which formed a larger and less modular group of code "chunks" to review (and historically understand). From a development standpoint, this is completely expected; when working on one thing we often can see other related things that need to get fixed. When a "big enough" (totally subjective to the project and developer community) related but somewhat isolated chunk of work like this comes up it can be a good idea to spur a "fix / related" branch and PR, updating the original feature branch after the "fix" is merged to help keep things modular and isolated. While this can take longer, it can help isolate the changes for the developer(s), reviewers, and those looking at the code in the future to understand why things changed. It also might effect how other in-flight PR's and feature branches grow. When we isolate the discussion around singular and smaller chunks of code this way we offer ourselves a chance to be more careful, deliberate, and descriptive about the changes taking place. A visual of how this might look would be the following: %%{init: { 'logLevel': 'debug', 'theme': 'default' , 'themeVariables': {
'git0': '#6366F1',
'git1': '#10B981',
'git2': '#F59E0B',
'gitBranchLabel1': '#ffffff',
'gitBranchLabel2': '#ffffff'
} } }%%
gitGraph
commit id: "..."
commit id: "original state"
branch feature
checkout feature
commit id: "discover new needs"
checkout main
branch related_fix
checkout related_fix
commit id: "fix those needs"
checkout main
merge related_fix id: "merged fix (main)"
checkout feature
merge main id: "merged fix (feature)"
checkout main
merge feature id: "merge feature"
Only offering this up as a suggestion for future consideration. Thank you again so much for your thoughtful and thorough contributions to Pycytominer! |
Thanks for this suggestion! This is definitely one of the more complicated software PR's I've worked on, so it is helpful to know about the best practices I can apply for future work. |
Description
This pull request implements #278 and switches the project build approach from setuptools to pyproject.toml using poetry for dependency management.
Additional changes made during conversion:
tests
directory moved frompycytominer/tests
to<root>/tests
tests/test_cyto_utils/test_DeepProfiler_processing.py
to move process heavy parts into test_functionspoetry.lock
up to date andrequirements{-dev}.txt
in sync withpyproject.toml
cyto_utils.collate.py
to use python functions instead of cli commands.CONTRIBUTING.md
about poetryWhat is the nature of your change?
Checklist
Please ensure that all boxes are checked before indicating that a pull request is ready for review.