Replies: 10 comments
-
I didn't know that the I'm curious about why the |
Beta Was this translation helpful? Give feedback.
-
The idea to run it in CI was to make sure nobody in the team forgets about it and thing falling out of sync. Yes I was actually testing it on the root pyproject so it is probably the reason why it didn't catched it. If there was a way for check to catch that to that would also be a good way to fix the issue |
Beta Was this translation helpful? Give feedback.
-
That makes sense! I have to think about this and how to solve it, because I also believe some teams (during development/feature branches) exclude some components and I don't want that to break the builds. It's not strictly a requirement to include all code in development, even if it is highly recommended. There is the |
Beta Was this translation helpful? Give feedback.
-
Would a pre-commit hook be a solution? |
Beta Was this translation helpful? Give feedback.
-
I think a pre-commit hook would be a great solution 😃 I was actually thinking of this flag as some per-requisite for building a hook |
Beta Was this translation helpful? Give feedback.
-
Would this simple pre-commit do what's needed?
(I created a file named There's of course also the |
Beta Was this translation helpful? Give feedback.
-
I was more thinking about the pre-commit library when I mentioned that as I'm looking for a reliable, consistent way to deploy it accross the team (or in CI) |
Beta Was this translation helpful? Give feedback.
-
I think it is possible without a dedicated published hook, by using the already installed poly tool. But I am not that experienced in how the I experimented with the uv add pre-commit
touch .pre-commit-config.yaml and added this content to the yaml: repos:
- repo: local
hooks:
- id: poly-sync
name: run poly sync
entry: bash -c "uv run poly sync"
pass_filenames: false
language: system As an alternative, you could also have a What do you think about that? (EDIT: this will probably be a problem for Windows users, when relying on bash) EDIT 2: here's a 🤪 inline Python equivalent |
Beta Was this translation helpful? Give feedback.
-
(moving this to the ideas section in discussions) |
Beta Was this translation helpful? Give feedback.
-
This is actually a great solution. I add no idea it was possible to use "local" as a repo. I'll try to implement that for our repo |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
There is no way to tell if the sync command made some changes or not. This makes it hard to run the command in CI and fail the job if the project is not in sync.
Describe the solution you'd like
Add a flag like
--exit-non-zero-on-fix
to the sync command to fail with non zero exit code if some changed occurred while running the command.Describe alternatives you've considered
The check commands seems like the command that should be used for that but it does not complain if I remove one of the component from the main pyproject file
Beta Was this translation helpful? Give feedback.
All reactions