Skip to content

Commit 1424b91

Browse files
authored
[NEW] Py Pkg Gen with Offline option
Release Version '1.12.5' into 'master' Branch
2 parents 09897e6 + 0c5ee09 commit 1424b91

File tree

12 files changed

+54
-11
lines changed

12 files changed

+54
-11
lines changed

CHANGELOG.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,29 @@
22
Changelog
33
=========
44

5+
1.12.5 (2024-02-11)
6+
===================
7+
8+
We add `--offline` as optional CLI flag to the `generate-python` CLI.
9+
We keep the default behaviour of the CLI to be `online`, ie to make Async Http requests.
10+
11+
12+
Changes
13+
^^^^^^^
14+
15+
feature
16+
"""""""
17+
- add CLI option to deactivate Async Http requests for PyPI and RTD web servers
18+
19+
dev
20+
"""
21+
- run with --offline flag the Snapshot Update Scripts
22+
23+
release
24+
"""""""
25+
- bump version to 1.12.5
26+
27+
528
1.12.5-dev1 (2024-02-10)
629
========================
730

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,9 @@ Free/Libre and Open Source Software (FLOSS)
275275

276276
.. Github Releases & Tags
277277
278-
.. |commits_since_specific_tag_on_master| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/v1.12.5-dev1/master?color=blue&logo=github
278+
.. |commits_since_specific_tag_on_master| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/v1.12.5/master?color=blue&logo=github
279279
:alt: GitHub commits since tagged version (branch)
280-
:target: https://github.com/boromir674/cookiecutter-python-package/compare/v1.12.5-dev1..master
280+
:target: https://github.com/boromir674/cookiecutter-python-package/compare/v1.12.5..master
281281

282282
.. |commits_since_latest_github_release| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/latest?color=blue&logo=semver&sort=semver
283283
:alt: GitHub commits since latest release (by SemVer)

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
author = 'Konstantinos Lampridis'
3131

3232
# The full version, including alpha/beta/rc tags
33-
release = '1.12.5-dev1'
33+
release = '1.12.5'
3434

3535
# -- General configuration ---------------------------------------------------
3636

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ build-backend = "poetry.core.masonry.api"
1010
## Also renders on pypi as 'subtitle'
1111
[tool.poetry]
1212
name = "cookiecutter_python"
13-
version = "1.12.5-dev1"
13+
version = "1.12.5"
1414
description = "1-click Generator of Python Project, from Template with streamlined \"DevOps\" using a powerful CI/CD Pipeline."
1515
authors = ["Konstantinos Lampridis <k.lampridis@hotmail.com>"]
1616
maintainers = ["Konstantinos Lampridis <k.lampridis@hotmail.com>"]

scripts/update-snapshot-interactive.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ set -e
1515

1616
### RUN Generator in Interactive Mode, prompting/asking for user input ###
1717
echo
18-
.tox/dev/bin/generate-python --config-file .github/biskotaki.yaml -o /tmp/
18+
.tox/dev/bin/generate-python --offline --config-file .github/biskotaki.yaml -o /tmp/
1919

2020
### UPDATE SHAPSHOT, by Copying all Generated files and folders recursively ###
2121
INTERACTIVE_SHAPSHOT=${INTERACTIVE_SHAPSHOT:-tests/data/snapshots/biskotaki-interactive}

scripts/update-snapshot.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ set -e
1414

1515
### RUN Generator in Non-Interactive Mode ###
1616
echo
17-
.tox/dev/bin/generate-python --no-input --config-file .github/biskotaki.yaml -o /tmp/
17+
.tox/dev/bin/generate-python --offline --no-input --config-file .github/biskotaki.yaml -o /tmp/
1818

1919

2020
### UPDATE SHAPSHOT, by Copying all Generated files and folders recursively ###
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__ = '1.12.5-dev1'
1+
__version__ = '1.12.5'
22

33
from . import _logging # noqa

src/cookiecutter_python/backend/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
def generate(
1818
# interactive=True,
1919
no_input=False, # INTERACTIVE ON by Default
20+
offline=False,
2021
extra_context=None,
2122
replay=False,
2223
overwrite=False,
@@ -49,10 +50,11 @@ def generate(
4950
web_servers=WEB_SERVERS,
5051
no_input=no_input,
5152
extra_context=extra_context,
53+
offline=offline,
5254
)
5355
)
5456
print('Extra context: ', request.extra_context)
55-
## GENERATION ##
57+
## GENERATION from Template; delegate to Cookiecutter callable ##
5658
project_dir = generator(
5759
os.path.abspath(os.path.join(my_dir, '..')), # template dir path
5860
checkout=checkout,

src/cookiecutter_python/backend/pre_main.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,18 @@ def pre_main(request):
1515
# making http request to web servers hosting endpoints for APIs
1616

1717
# Checkers are initialized as 'Activated'
18-
# if User Config is True and Default Config is False
1918

20-
request.check = Engine.create(request.config_file, request.default_config)
19+
# Activate Async HTTP only if all below are True:
20+
# - User did not pass the --offline CLI flag
21+
# - User did not pass the --default-config CLI flag
22+
# - User passed a Config file YAML
23+
24+
# Activate: if User Config is given and Default Config is False
25+
deactivate_signal: bool = bool(request.default_config)
26+
if request.offline:
27+
deactivate_signal = True
28+
29+
request.check = Engine.create(request.config_file, deactivate_signal)
2130

2231
# Start Requesting Futures! - Hosting Service: PyPI, Read The Docs
2332
request.check_results = request.check.check(request.web_servers)

src/cookiecutter_python/backend/request.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ class Request:
1414
extra_context: dict
1515
check: Any = attr.ib(default=None)
1616
check_results: Union[None, Iterable[CheckWebServerResult]] = attr.ib(default=None)
17+
offline: bool = False

0 commit comments

Comments
 (0)