Skip to content

Commit 35bae03

Browse files
committed
Adjust for poetry 2
1 parent 244c9f2 commit 35bae03

File tree

7 files changed

+157
-134
lines changed

7 files changed

+157
-134
lines changed

20-poetry.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@ fi
88
# Check if the POETRY_PROJECT_NAME environment variable is set
99
if [[ -z "$POETRY_PROJECT_NAME" ]]; then
1010
echo "POETRY_PROJECT_NAME environment variable is not set. Using the current directory name as the project name."
11-
POETRY_PROJECT_NAME=$(basename "$PWD")
11+
POETRY_PROJECT_NAME=$(basename "$PWD" | tr '.' '-')
1212
export POETRY_PROJECT_NAME
1313
fi
1414

1515
# Initialize a new Poetry project with the project name
1616
poetry init --name "$POETRY_PROJECT_NAME" --no-interaction
1717

1818
# Switch to non-package-mode
19-
sed -i '/^version =/c package-mode = false' pyproject.toml
19+
cat <<EOF >> pyproject.toml
2020
21-
# Create an empty virtual environment
22-
poetry install
21+
[tool.poetry]
22+
package-mode = false
23+
EOF
2324

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

example.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#!/bin/bash
22

3+
EXAMPLE_DIR="example"
4+
35
# recreate the example directory
4-
rm -rf example
5-
mkdir -p example
6+
rm -rf "$EXAMPLE_DIR"
7+
mkdir -p "$EXAMPLE_DIR"
68

79
# Navigate to the example directory
8-
pushd example
10+
pushd "$EXAMPLE_DIR"
911

1012
# Execute the initialization scripts
1113
../everything.sh
@@ -17,6 +19,6 @@ git log --format='%n--- %s' --stat --reverse > commits.txt
1719
popd
1820

1921
# make sure exmple project is not a git repo, becuase we want it under our vc
20-
rm -rf example/.git
22+
rm -rf "$EXAMPLE_DIR/.git"
2123

2224
echo "Example project initialized successfully!"

example/commits.txt

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,26 @@
55

66
.gitignore | 1 +
77
README.md | 11 +++++++++++
8-
poetry.lock | 7 +++++++
9-
pyproject.toml | 14 ++++++++++++++
10-
4 files changed, 33 insertions(+)
8+
pyproject.toml | 19 +++++++++++++++++++
9+
3 files changed, 31 insertions(+)
1110

1211
--- Install and configure Flake8 with flake8-pyproject
1312

14-
poetry.lock | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
15-
pyproject.toml | 9 ++++++++
16-
2 files changed, 75 insertions(+), 2 deletions(-)
13+
poetry.lock | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14+
pyproject.toml | 10 ++++++++
15+
2 files changed, 86 insertions(+)
1716

1817
--- Install and configure isort with flake8-isort
1918

20-
poetry.lock | 34 +++++++++++++++++++++++++++++++++-
19+
poetry.lock | 37 ++++++++++++++++++++++++++++++++++++-
2120
pyproject.toml | 8 ++++++++
22-
2 files changed, 41 insertions(+), 1 deletion(-)
21+
2 files changed, 44 insertions(+), 1 deletion(-)
2322

2423
--- Install and configure pytest
2524

26-
poetry.lock | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
25+
poetry.lock | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
2726
pyproject.toml | 4 ++++
28-
2 files changed, 73 insertions(+), 1 deletion(-)
27+
2 files changed, 79 insertions(+), 1 deletion(-)
2928

3029
--- Initialize Django project
3130

@@ -35,20 +34,20 @@
3534
example/urls.py | 23 ++++++++++
3635
example/wsgi.py | 17 +++++++
3736
manage.py | 22 ++++++++++
38-
poetry.lock | 80 ++++++++++++++++++++++++++++++++-
37+
poetry.lock | 86 +++++++++++++++++++++++++++++++++++-
3938
pyproject.toml | 4 ++
4039
test_no_smoke.py | 8 ++++
41-
9 files changed, 294 insertions(+), 1 deletion(-)
40+
9 files changed, 300 insertions(+), 1 deletion(-)
4241

4342
--- Configure Django settings with django-environ
4443

4544
.gitignore | 1 +
4645
README.md | 6 ++++++
4746
example.env | 3 +++
4847
example/settings.py | 15 ++++++++-------
49-
poetry.lock | 18 +++++++++++++++++-
50-
pyproject.toml | 1 +
51-
6 files changed, 36 insertions(+), 8 deletions(-)
48+
poetry.lock | 14 +++++++++++++-
49+
pyproject.toml | 3 ++-
50+
6 files changed, 33 insertions(+), 9 deletions(-)
5251

5352
--- Force HTTPS traffic
5453

@@ -58,32 +57,32 @@
5857

5958
--- Install psycopg for PostgreSQL support
6059

61-
poetry.lock | 36 +++++++++++++++++++++++++++++++++++-
62-
pyproject.toml | 1 +
63-
2 files changed, 36 insertions(+), 1 deletion(-)
60+
poetry.lock | 25 ++++++++++++++++++++++++-
61+
pyproject.toml | 3 ++-
62+
2 files changed, 26 insertions(+), 2 deletions(-)
6463

6564
--- Configure WhiteNoise for serving static files
6665

6766
.gitignore | 1 +
6867
example/settings.py | 9 +++++++++
69-
poetry.lock | 16 +++++++++++++++-
70-
pyproject.toml | 1 +
71-
4 files changed, 26 insertions(+), 1 deletion(-)
68+
poetry.lock | 17 ++++++++++++++++-
69+
pyproject.toml | 3 ++-
70+
4 files changed, 28 insertions(+), 2 deletions(-)
7271

7372
--- Install and configure Sentry
7473

75-
example/settings.py | 8 ++++++
76-
poetry.lock | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
77-
pyproject.toml | 1 +
78-
3 files changed, 90 insertions(+), 1 deletion(-)
74+
example/settings.py | 8 +++++
75+
poetry.lock | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
76+
pyproject.toml | 3 +-
77+
3 files changed, 99 insertions(+), 2 deletions(-)
7978

8079
--- Configure the project for Heroku deployment
8180

8281
Procfile | 2 ++
8382
app.json | 37 +++++++++++++++++++++++++++++++++++++
84-
poetry.lock | 23 ++++++++++++++++++++++-
85-
pyproject.toml | 5 +++++
86-
4 files changed, 66 insertions(+), 1 deletion(-)
83+
poetry.lock | 26 ++++++++++++++++++++++++--
84+
pyproject.toml | 7 ++++++-
85+
4 files changed, 69 insertions(+), 3 deletions(-)
8786

8887
--- Custom user model using UUID4 as the primary key
8988

example/example/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Django settings for example project.
33
4-
Generated by 'django-admin startproject' using Django 5.1.1.
4+
Generated by 'django-admin startproject' using Django 5.1.6.
55
66
For more information on this file, see
77
https://docs.djangoproject.com/en/5.1/topics/settings/

0 commit comments

Comments
 (0)