Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Python version number in cookiecutter --version and test on Python 3.10 #1621

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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