Skip to content

Commit 040c4c8

Browse files
authored
[NEW] Python Project Generator v2.7.1
Release v2.7.1
2 parents 2d6ae56 + 7d21a43 commit 040c4c8

File tree

8 files changed

+29
-28
lines changed

8 files changed

+29
-28
lines changed

.github/workflows/open-doors.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
tag: "${{ github.ref }}"
4040

4141
# Fail if the branch is not $RELEASE_BR
42-
- if: ${{ steps.release_contains_tag.outputs.retval }} != 'true'
42+
- if: steps.release_contains_tag.outputs.retval != 'true'
4343
run: |
4444
echo "[ERROR] Pushed tag '${{ github.ref }}' NOT on '${{ env.RELEASE_BR }}' branch!"
4545
echo "This action should only be run on the ${{ env.RELEASE_BR }} branch!"

.github/workflows/policy_lint.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,10 @@ jobs:
136136
137137
## Isort ##
138138
- name: 'Isort: Require Semantic and Alphabetic order of the Python Imports'
139-
if: ${{ matrix.platform != 'windows-latest' }}
140139
run: tox -e isort -vv -s false
141140

142141
## Black ##
143142
- name: 'Black: Require Project Style "opinion" to be followed by the Python Code'
144-
if: ${{ matrix.platform != 'windows-latest' }}
145143
run: tox -e black -vv -s false
146144

147145
## Ruff ##
@@ -150,7 +148,6 @@ jobs:
150148

151149
## Pyflakes, Pyroma, McCabe, DodgyRun, Profile Validator ##
152150
- name: Run tox -e prospector
153-
if: ${{ matrix.platform != 'windows-latest' }}
154151
run: tox -e prospector -vv -s false
155152

156153

@@ -291,7 +288,6 @@ jobs:
291288
- run: cat pylint-result.txt
292289

293290
- name: 'Check Pylint Score > ${{ inputs.pylint_threshold }}/10'
294-
if: ${{ matrix.platform != 'windows-latest' }}
295291
run: |
296292
SCORE=`sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' pylint-result.txt`
297293
echo "SCORE -> $SCORE"

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ This project adheres to [Semantic Versioning](https://semver.org/).
77
Only Major releases (bumps) contain breaking changes.
88

99

10+
## [2.7.1] (2025-11-05)
11+
12+
Apply Lint suggestions for `Dockerfile` and `Github Actions` Workflows.
13+
14+
1015
## [2.7.0] (2025-11-02)
1116

1217
The release introduces a complete observability stack

Dockerfile

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# FROM scratch as ENV_SETUP
22
# can be ovveriden by --build-arg PY_VERSION=3.9.16
33
ARG PY_VERSION=3.12.9
4-
FROM python:${PY_VERSION}-slim-bullseye as python_slim
4+
FROM python:${PY_VERSION}-slim-bullseye AS python_slim
55

66
# ENV PY_RUNTIME=${PY_VERSION}
77

8-
FROM python_slim as builder
8+
FROM python_slim AS builder
99

10+
WORKDIR /app
1011
COPY uv.lock pyproject.toml ./
1112

1213
# Install uv
@@ -29,11 +30,11 @@ FROM builder AS docs_live_builder
2930
RUN uv export --no-dev --frozen --no-emit-project -f requirements-txt -o requirements.txt --extra docslive
3031

3132

32-
FROM scratch as source
33+
FROM scratch AS source
3334

3435
WORKDIR /app
3536

36-
COPY --from=prod_builder requirements.txt .
37+
COPY --from=prod_builder /app/requirements.txt .
3738
# Copy Source Code
3839
# COPY . .
3940
COPY src src
@@ -43,7 +44,7 @@ COPY LICENSE .
4344
COPY README.md .
4445

4546

46-
FROM python_slim as base_env
47+
FROM python_slim AS base_env
4748

4849
# Wheels Directory for Distro and its Dependencies (aka requirements)
4950
ENV DISTRO_WHEELS=/app/dist
@@ -55,7 +56,7 @@ FROM base_env AS build_wheels
5556
# Essential build tools
5657
RUN apt-get update && \
5758
apt-get install -y --no-install-recommends build-essential && \
58-
pip install -U pip && \
59+
pip install --no-cache-dir -U pip && \
5960
apt-get clean && \
6061
rm -rf /var/lib/apt/lists/*
6162

@@ -69,10 +70,9 @@ WORKDIR /app
6970
COPY --from=source /app .
7071

7172
# Build Wheels for Distro's Dependencies, from /app/requirements.txt file
72-
RUN pip wheel --wheel-dir "${DISTRO_WHEELS}" -r ./requirements.txt
73-
7473
# Build Wheels for Distro's Package
75-
RUN uv build --wheel --out-dir "/tmp/build-wheels" && \
74+
RUN pip wheel --wheel-dir "${DISTRO_WHEELS}" -r ./requirements.txt && \
75+
uv build --wheel --out-dir "/tmp/build-wheels" && \
7676
mv /tmp/build-wheels/*.whl "${DISTRO_WHEELS}"
7777

7878
# Now all wheels are in DISTRO_WHEELS folder
@@ -102,13 +102,13 @@ RUN pip install --no-deps --no-cache-dir --user ./dist/*.whl
102102
FROM python_slim AS test_dev
103103
WORKDIR /app
104104

105-
COPY --from=test_builder requirements-test.txt .
105+
COPY --from=test_builder /app/requirements-test.txt .
106106
# Install uv for faster test dependencies installation than 'pip install'
107107
COPY --from=ghcr.io/astral-sh/uv@sha256:2381d6aa60c326b71fd40023f921a0a3b8f91b14d5db6b90402e65a635053709 /uv /uvx /bin/
108108

109109
# Install test dependencies
110-
RUN uv venv
111-
RUN uv pip install --no-cache-dir --no-deps -r requirements-test.txt
110+
RUN uv venv && \
111+
uv pip install --no-cache-dir --no-deps -r requirements-test.txt
112112

113113
# Copy Source Code
114114
COPY src src
@@ -146,7 +146,7 @@ RUN uv pip install --no-deps --no-cache-dir ./dist/*.whl
146146

147147

148148
# Install test dependencies (pytest, pytest-object-getter, etc) from pypi
149-
COPY --from=test_builder requirements-test.txt .
149+
COPY --from=test_builder /app/requirements-test.txt .
150150
RUN uv pip install --no-deps -r requirements-test.txt
151151

152152
# Add Pytest, installed in uv controlled venv to PATH
@@ -163,7 +163,7 @@ CMD [ "pytest", "-ra", "tests" ]
163163

164164

165165
###### DOCS BASE ######
166-
FROM python_slim as docs_base
166+
FROM python_slim AS docs_base
167167
WORKDIR /app
168168

169169
# Install libenchant using package manage either apt or apk
@@ -182,13 +182,13 @@ ENV PATH="/root/.local/bin:$PATH"
182182

183183

184184
###### DOCS - Build ######
185-
FROM docs_base as docs
185+
FROM docs_base AS docs
186186
# COPY --from=docs_builder requirements.txt .
187187
# Install Prod + Docs dependencies
188188
# RUN pip install --no-cache-dir --user -r requirements.txt
189189
# Install in Editable Mode, since we don't care about wheels
190-
RUN pip install --no-cache-dir --user -e .[docs]
191-
RUN pip install gitpython
190+
RUN pip install --no-cache-dir --user -e .[docs] && \
191+
pip install --no-cache-dir gitpython
192192

193193
# Copy Entrypoint inside the image (required since stage is not last in Dockerfile)
194194
COPY scripts/sphinx-process.sh /app/scripts/sphinx-process.sh
@@ -203,7 +203,7 @@ COPY scripts/sphinx-process.sh /app/scripts/sphinx-process.sh
203203

204204

205205
## DOCS with Live Dev Server - Build ##
206-
FROM docs_base as docs_live
206+
FROM docs_base AS docs_live
207207
WORKDIR /app
208208
# COPY --from=docs_live_builder requirements.txt .
209209
# RUN pip install --no-cache-dir --user -r requirements.txt

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Build Status](https://img.shields.io/github/actions/workflow/status/boromir674/cookiecutter-python-package/test.yaml?link=https%3A%2F%2Fgithub.com%2Fboromir674%2Fcookiecutter-python-package%2Factions%2Fworkflows%2Ftest.yaml%3Fquery%3Dbranch%253Amaster)](https://github.com/boromir674/cookiecutter-python-package/actions/workflows/test.yaml?query=branch%3Amaster) [![Coverage](https://img.shields.io/codecov/c/github/boromir674/cookiecutter-python-package/master?logo=codecov)](https://app.codecov.io/gh/boromir674/cookiecutter-python-package) [![Docs](https://img.shields.io/readthedocs/python-package-generator/master?logo=readthedocs&logoColor=lightblue)](https://python-package-generator.readthedocs.io/en/master/) [![Maintainability](https://api.codeclimate.com/v1/badges/1d347d7dfaa134fd944e/maintainability)](https://codeclimate.com/github/boromir674/cookiecutter-python-package/maintainability)
44
[![Release Version](https://img.shields.io/pypi/v/cookiecutter_python)](https://pypi.org/project/cookiecutter-python/) [![Wheel](https://img.shields.io/pypi/wheel/cookiecutter-python?color=green&label=wheel)](https://pypi.org/project/cookiecutter-python) [![Tech Debt](https://img.shields.io/codeclimate/tech-debt/boromir674/cookiecutter-python-package)](https://codeclimate.com/github/boromir674/cookiecutter-python-package/) [![Codacy](https://app.codacy.com/project/badge/Grade/5be4a55ff1d34b98b491dc05e030f2d7)](https://app.codacy.com/gh/boromir674/cookiecutter-python-package/dashboard?utm_source=github.com&utm_medium=referral&utm_content=boromir674/cookiecutter-python-package&utm_campaign=Badge_Grade)
55
[![Supported Versions](https://img.shields.io/pypi/pyversions/cookiecutter-python?color=blue&label=python&logo=python&logoColor=%23ccccff)](https://pypi.org/project/cookiecutter-python)
6-
[![PyPI Stats](https://img.shields.io/pypi/dm/cookiecutter-python?logo=pypi&logoColor=%23849ED9&color=%23849ED9)](https://pypistats.org/packages/cookiecutter-python) [![Commits Since Tag](https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/v2.7.0/master?color=blue&logo=github)](https://github.com/boromir674/cookiecutter-python-package/compare/v2.7.0..master) [![Commits Since Release](https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/latest?color=blue&logo=semver&sort=semver)](https://github.com/boromir674/cookiecutter-python-package/releases)
6+
[![PyPI Stats](https://img.shields.io/pypi/dm/cookiecutter-python?logo=pypi&logoColor=%23849ED9&color=%23849ED9)](https://pypistats.org/packages/cookiecutter-python) [![Commits Since Tag](https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/v2.7.1/master?color=blue&logo=github)](https://github.com/boromir674/cookiecutter-python-package/compare/v2.7.1..master) [![Commits Since Release](https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/latest?color=blue&logo=semver&sort=semver)](https://github.com/boromir674/cookiecutter-python-package/releases)
77
[![License](https://img.shields.io/github/license/boromir674/cookiecutter-python-package)](https://github.com/boromir674/cookiecutter-python-package/blob/master/LICENSE) [![OpenSSF](https://bestpractices.coreinfrastructure.org/projects/5988/badge)](https://bestpractices.coreinfrastructure.org/en/projects/5988) [![Ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://docs.astral.sh/ruff/) [![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
88

99

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ build-backend = "poetry.core.masonry.api"
1414
name = "cookiecutter_python"
1515
### ... ###
1616

17-
version = "2.7.0"
17+
version = "2.7.1"
1818
description = "1-click Generator of Python Project, from Template with streamlined \"DevOps\" using a powerful CI/CD Pipeline."
1919
readme = "README.md"
2020
license = "AGPL-3.0-only"
@@ -64,7 +64,7 @@ maintainers = [
6464
license = {text = "AGPL-3.0-only"}
6565

6666
name = "cookiecutter_python"
67-
version = "2.7.0"
67+
version = "2.7.1"
6868
description = "1-click Generator of Python Project, from Template with streamlined \"DevOps\" using a powerful CI/CD Pipeline."
6969
readme = "README.md"
7070
# keywords = []
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__ = '2.7.0'
1+
__version__ = '2.7.1'
22

33
from . import _logging # noqa

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)