Skip to content

Commit

Permalink
Merge pull request #1621 from ozer550/1619-fix-python-version-number
Browse files Browse the repository at this point in the history
Fix Python version number in `cookiecutter --version` and test on Python 3.10
  • Loading branch information
michaeljoseph committed Dec 18, 2021
2 parents bb643eb + 11743af commit 3ece249
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/main.yml
Expand Up @@ -37,14 +37,17 @@ jobs:
- "ubuntu-py37"
- "ubuntu-py38"
- "ubuntu-py39"
- "ubuntu-py310"

- "macos-py37"
- "macos-py38"
- "macos-py39"
- "macos-py310"

- "windows-py37"
- "windows-py38"
- "windows-py39"
- "windows-py310"

include:
- name: "ubuntu-py37"
Expand All @@ -59,6 +62,10 @@ jobs:
python: "3.9"
os: ubuntu-latest
tox_env: "py39"
- name: "ubuntu-py310"
python: "3.10"
os: ubuntu-latest
tox_env: "py310"

- name: "macos-py37"
python: "3.7"
Expand All @@ -72,6 +79,10 @@ jobs:
python: "3.9"
os: macos-latest
tox_env: "py39"
- name: "macos-py310"
python: "3.10"
os: macos-latest
tox_env: "py310"

- name: "windows-py37"
python: "3.7"
Expand All @@ -85,6 +96,10 @@ jobs:
python: "3.9"
os: windows-latest
tox_env: "py39"
- name: "windows-py310"
python: "3.10"
os: windows-latest
tox_env: "py310"

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion cookiecutter/cli.py
Expand Up @@ -25,7 +25,7 @@

def version_msg():
"""Return the Cookiecutter version, location and Python powering it."""
python_version = sys.version[:3]
python_version = sys.version
location = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
message = 'Cookiecutter %(version)s from {} (Python {})'
return message.format(location, python_version)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_cli.py
Expand Up @@ -4,6 +4,7 @@
import os
import re


import pytest
from click.testing import CliRunner

Expand Down Expand Up @@ -48,7 +49,7 @@ def version_cli_flag(request):


def test_cli_version(cli_runner, version_cli_flag):
"""Verify correct version output by `cookiecutter` on cli invocation."""
"""Verify Cookiecutter version output by `cookiecutter` on cli invocation."""
result = cli_runner(version_cli_flag)
assert result.exit_code == 0
assert result.output.startswith('Cookiecutter')
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Expand Up @@ -4,6 +4,7 @@ envlist =
py37
py38
py39
py310
minversion = 3.14.2
requires =
virtualenv >= 20.4.5
Expand Down

0 comments on commit 3ece249

Please sign in to comment.