-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* πͺ π fix action yml automatic python selection * π· upgrade to 3.11 * β add test to check python version * β»οΈ β refactor test to no repeat code
- Loading branch information
1 parent
36035d5
commit 7e0ecb5
Showing
4 changed files
with
31 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
def test_cookiecutter_python_version(cookies) -> None: # type: ignore | ||
"""check correct python version in the generated files.""" | ||
versions = ["3.10", "3.11"] | ||
file_paths = [ | ||
".github/actions/python-poetry-env/action.yml", | ||
".github/workflows/test.yml", | ||
"pyproject.toml", | ||
] | ||
|
||
for python_ver in versions: | ||
result = cookies.bake(extra_context={"compatible_python_versions": python_ver}) | ||
|
||
for file_path in file_paths: | ||
env_path = result.project_path / file_path | ||
assert env_path.is_file() | ||
|
||
with open(env_path) as f: | ||
file_content = f.read() | ||
assert python_ver in file_content |
5 changes: 3 additions & 2 deletions
5
{{cookiecutter.repo_name}}/.github/actions/python-poetry-env/action.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters