feat(python): add pyproject.toml support for Python projects#311
feat(python): add pyproject.toml support for Python projects#311
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #311 +/- ##
==========================================
+ Coverage 64.88% 64.93% +0.04%
==========================================
Files 212 212
Lines 17555 17623 +68
==========================================
+ Hits 11391 11443 +52
- Misses 5095 5104 +9
- Partials 1069 1076 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| // Check if slack-cli-hooks is already declared | ||
| if strings.Contains(fileData, slackCLIHooksPackageName) { | ||
| return fmt.Sprintf("Found pyproject.toml with %s", style.Highlight(slackCLIHooksPackageName)), nil | ||
| } |
There was a problem hiding this comment.
🧠 praise: Nice check for optional dependencies too!
| // Provide appropriate install command based on which file exists | ||
| if hasRequirementsTxt { | ||
| outputs = append(outputs, fmt.Sprintf(" Install project dependencies: %s", style.CommandText("pip install -r requirements.txt"))) | ||
| } | ||
| if hasPyProjectToml { | ||
| outputs = append(outputs, fmt.Sprintf(" Install project dependencies: %s", style.CommandText("pip install -e ."))) | ||
| } |
There was a problem hiding this comment.
🐍 praise: Supporting both together is a good call! IIRC pyproject.toml is recommended in current versions - we can follow up with findings across samples later too!
|
Thanks for the review @zimeg! 🙇🏻 I'm happy to hear that it's looking good and running smooth on your end too. 🧈 It feels like a healthy improvement for the CLI to support the |
Changelog
Summary
This pull request adds
pyproject.tomlsupport for Python projects with the following features:pyproject.tomlsupport for Python projects when usingslack initandslack create, complementing existingrequirements.txtsupportslack-cli-hooks<1.0.0pyproject.toml(comments, whitespace, indentation)🧪 50% of all +++ Additions are tests, so hopefully this isn't a scary PR review! 🙇🏻
Preview
2026-01-27-cli-pyproject-toml.mov
Reviewers
1. a)
pyproject.tomlexists withslack-cli-hooks1. b)
pyproject.tomlexists missingslack-cli-hooks2. a)
requirements.txtexists withslack-cli-hooks2. b)
requirements.txtexists missingslack-cli-hooks3. a) Both files exist with
slack-cli-hooks3. b) Both files exist missing
slack-cli-hooks4. Neither file exists
Requirements