Skip to content

Modify existing tool.poetry section instead of creating new one #4

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

Merged
merged 1 commit into from
Mar 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions 20-poetry.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

# Check if Poetry is installed
if ! command -v poetry &> /dev/null
then
Expand All @@ -15,21 +17,15 @@ fi
# Initialize a new Poetry project with the project name
poetry init --name "$POETRY_PROJECT_NAME" --no-interaction

# Switch to non-package-mode
cat <<EOF >> pyproject.toml

[tool.poetry]
package-mode = false
EOF
# Modify the existing [tool.poetry] section to add package-mode = false
sed -i '/^\[tool.poetry\]/a package-mode = false' pyproject.toml

# add python stuff to gitignore
echo "__pycache__/" >> .gitignore

# describe in the README
cat <<EOF >> "README.md"
# $POETRY_PROJECT_NAME

## Python deps
## Python dependencies

This project uses Poetry for dependency management. To install the dependencies, run:

Expand Down
Loading