Jetbase run anywhere#92
Conversation
4f87e0d to
67b6e2e
Compare
|
Thanks for the contribution! I'll have time to take a look at this tomorrow |
|
Hey, really sorry for the wait. This is a great idea to run I took a closer look at the PR, and I think there are a few changes that would be needed before this can be merged:
Overall, I think the idea is useful, but the implementation needs some cleanup before it can be merged. Thanks again for the contribution! |
|
Thank you for the review, I'll clean this up !
This would implies that the user should have a |
- use get_migrations_directory in upgrade/status commands - allow to provide an optional migration directory to repeatable helpers - fix related tests
475feff to
06f28f2
Compare
06f28f2 to
0eb23b3
Compare
|
PR updated, waiting for your answer on the mandatory pyproject.toml anchor or not. I have locally tested :
I didn't ran integration tests (regarding those I find it a bit misleading having test_integration and integration folders) for precommit, I've added it to the dev deps but maybe having pyrefly not |
PR Description
Overview
Hello ! Thanks for the tool, I like the simplicity of it but the
cd jetbasefeels a bit painfull.This PR updates Jetbase so CLI commands can run from any directory that contains or is under a directory containing a
jetbasefolder.Previously, commands required the user to be inside the
jetbasedirectory.Changes Made
Code
get_jetbase_directoryandget_migrations_directoryto find the root directory by looking atjetbasefolder.validate_jetbase_directory()docstring to reflect that it validates ajetbasedirectory in the current path or parent directories.test_validation.pyto state that validation searches the directory tree rather than requiring the current directory to be namedjetbase.Documentation
Removed outdated instructions and notes that required users to run commands from inside the
jetbasedirectory.Tests
Added some unit tests, looks fine but I didn't run other tests for now.
I'm thinking about removing the os.chdir('jetbase') from integration tests if I can run those.
Implementation Details
The root detection now works by:
jetbasejetbaseexists in the current directoryjetbaseDirectoryNotFoundErrorif not foundNote
I was thinking about using the pyproject.toml file as "anchor" while trying to find the
jetbasedir but idk since for monorepo we could have only one pyproject and multiple jetbases