Skip to content

Commit

Permalink
test: update tests to match new expectations, given biskotaki.yml upd…
Browse files Browse the repository at this point in the history
…ates
  • Loading branch information
boromir674 committed Feb 17, 2024
1 parent e6734a6 commit 8168006
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/generate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ jobs:
tox -e 'edit,sdist,wheel'
tox -e wheel-test
tox -e coverage
## Verify all Tox Envs PASS, as intented, out of the box ##

# Running Type Check, on src and Test code: Passes
- name: 'Mypy: Static Type Checker -> PASS'
Expand All @@ -80,7 +82,6 @@ jobs:
tox -e pin-deps -- -E typing
tox -e type
## Verify Development Scripts operate as intented out of the box
- name: 'Ruff: Fast Python Linter -> PASS'
run: |
cd gen/biskotaki
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def parse_dockerfile(dockerfile_path):
)

copy_from_reg = re.compile(
rf'^COPY\s+\-\-from=(?P<prev_stage>{stage_name_reg})\s+' + r'(?P<path>[\w\.\-:/_\${}]+)\s+'
rf'^COPY\s+\-\-from=(?P<prev_stage>{stage_name_reg})\s+'
+ r'(?P<path>[\w\.\-:/_\${}]+)\s+'
)

with open(dockerfile_path, 'r') as f:
Expand Down Expand Up @@ -76,7 +77,11 @@ def generate_mermaid_flow_chart(dockerfile_dag):
prev_stage: str = prev_copy[0]
# write copied path in arrow text
path_copied: str = prev_copy[1]
chart += f" {prev_stage} " + dotted_arrow_with_text.format(text=path_copied) + f" {stage}\n"
chart += (
f" {prev_stage} "
+ dotted_arrow_with_text.format(text=path_copied)
+ f" {stage}\n"
)
# write COPY (literal) in arrow text
# chart += (
# f" {prev_stage} " + dotted_arrow_with_text.format(text='COPY') + f" {stage}\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def parse_dockerfile(dockerfile_path):
)

copy_from_reg = re.compile(
rf'^COPY\s+\-\-from=(?P<prev_stage>{stage_name_reg})\s+' + r'(?P<path>[\w\.\-:/_\${}]+)\s+'
rf'^COPY\s+\-\-from=(?P<prev_stage>{stage_name_reg})\s+'
+ r'(?P<path>[\w\.\-:/_\${}]+)\s+'
)

with open(dockerfile_path, 'r') as f:
Expand Down Expand Up @@ -76,7 +77,11 @@ def generate_mermaid_flow_chart(dockerfile_dag):
prev_stage: str = prev_copy[0]
# write copied path in arrow text
path_copied: str = prev_copy[1]
chart += f" {prev_stage} " + dotted_arrow_with_text.format(text=path_copied) + f" {stage}\n"
chart += (
f" {prev_stage} "
+ dotted_arrow_with_text.format(text=path_copied)
+ f" {stage}\n"
)
# write COPY (literal) in arrow text
# chart += (
# f" {prev_stage} " + dotted_arrow_with_text.format(text='COPY') + f" {stage}\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:

env:
### STRESS TEST Job MATRIX ###
FULL_MATRIX_STRATEGY: "{\"platform\": [\"ubuntu-latest\", \"macos-latest\", \"windows-latest\"], \"python-version\": [\"3.6\", \"3.7\", \"3.8\", \"3.9\", \"3.10\"]}"
FULL_MATRIX_STRATEGY: "{\"platform\": [\"ubuntu-latest\", \"macos-latest\", \"windows-latest\"], \"python-version\": [\"3.7\", \"3.8\", \"3.9\", \"3.10\", \"3.11\"]}"
# Python 3.7 has reached End of Life (EOL) on June 27th, 2023
# Python 3.12 is in bugfix mode, same as 3.11 -> can start supporting 3.12 it
UBUNTU_PY310_STRATEGY: "{\"platform\":[\"ubuntu-latest\"], \"python-version\":[\"3.10\"]}"
Expand Down
2 changes: 1 addition & 1 deletion tests/data/snapshots/biskotaki-no-input/README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BISKOTAKI

Project generated from the https://github.com/boromir674/cookiecutter-python-package/tree/master/src/cookiecutter_python cookiecutter
Project generated using https://github.com/boromir674/cookiecutter-python-package

.. start-badges
Expand Down
2 changes: 1 addition & 1 deletion tests/data/snapshots/biskotaki-no-input/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "biskotaki"
version = "0.0.1"
description = "Project generated from the https://github.com/boromir674/cookiecutter-python-package/tree/master/src/cookiecutter_python cookiecutter"
description = "Project generated using https://github.com/boromir674/cookiecutter-python-package"
authors = ["Konstantinos Lampridis <[email protected]>"]
maintainers = ["Konstantinos Lampridis <[email protected]>"]
license = "AGPL-3.0-only"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def assert_project_generated_without_cli(project_dir: str) -> None:
@pytest.mark.parametrize(
'config_file, expected_interpreters',
[
('.github/biskotaki.yaml', ['3.6', '3.7', '3.8', '3.9', '3.10']),
('.github/biskotaki.yaml', ['3.7', '3.8', '3.9', '3.10', '3.11']),
(None, ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']),
(
'tests/data/biskotaki-without-interpreters.yaml',
Expand Down

0 comments on commit 8168006

Please sign in to comment.