diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0f20aa172..dad1da045 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,23 +19,18 @@ jobs: name: - "linting" - - "ubuntu-py27" - "ubuntu-py35" - "ubuntu-py36" - "ubuntu-py37" - "ubuntu-py38" - - "ubuntu-pypy" - "ubuntu-pypy3" - - "macos-py27" - "macos-py35" - "macos-py36" - "macos-py37" - "macos-py38" - - "macos-pypy" - "macos-pypy3" - - "windows-py27" - "windows-py35" - "windows-py36" - "windows-py37" @@ -47,10 +42,6 @@ jobs: os: ubuntu-latest tox_env: "lint" - - name: "ubuntu-py27" - python: "2.7" - os: ubuntu-latest - tox_env: "py27" - name: "ubuntu-py35" python: "3.5" os: ubuntu-latest @@ -67,19 +58,11 @@ jobs: python: "3.8" os: ubuntu-latest tox_env: "py38" - - name: "ubuntu-pypy" - python: "pypy2" - os: ubuntu-latest - tox_env: "pypy" - name: "ubuntu-pypy3" python: "pypy3" os: ubuntu-latest tox_env: "pypy3" - - name: "macos-py27" - python: "2.7" - os: macos-latest - tox_env: "py27" - name: "macos-py35" python: "3.5" os: macos-latest @@ -96,19 +79,11 @@ jobs: python: "3.8" os: macos-latest tox_env: "py38" - - name: "macos-pypy" - python: "pypy2" - os: macos-latest - tox_env: "pypy" - name: "macos-pypy3" python: "pypy3" os: macos-latest tox_env: "pypy3" - - name: "windows-py27" - python: "2.7" - os: windows-latest - tox_env: "py27" - name: "windows-py35" python: "3.5" os: windows-latest diff --git a/.travis.yml b/.travis.yml index 89bdc0867..717ecbf79 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,6 @@ jobs: include: - python: 3.7 env: TOXENV=lint - - python: 2.7 - env: TOXENV=py27 - python: 3.5 env: TOXENV=py35 - python: 3.6 @@ -17,23 +15,8 @@ jobs: env: TOXENV=py37 - python: 3.8 env: TOXENV=py38 - - python: pypy - env: TOXENV=pypy - python: pypy3 env: TOXENV=pypy3 - - name: "Python 2.7 on Windows" - os: windows - language: shell - before_install: - - choco install python2 - - python --version - - python -m pip install --upgrade pip - - pip install --upgrade virtualenv wheel - - virtualenv $HOME/venv - - source $HOME/venv/Scripts/activate - env: - - TOXENV=py27 - - PATH=/c/Python27:/c/Python27/Scripts:$PATH - name: "Python 3.5 on Windows" os: windows language: shell @@ -41,8 +24,8 @@ jobs: - choco install python --version 3.5.4 - python --version - python -m pip install --upgrade pip - - pip3 install --upgrade virtualenv wheel - - virtualenv $HOME/venv + - python -m pip install --upgrade virtualenv wheel + - python -m virtualenv $HOME/venv - source $HOME/venv/Scripts/activate env: - TOXENV=py35 @@ -54,8 +37,8 @@ jobs: - choco install python --version 3.6.7 - python --version - python -m pip install --upgrade pip - - pip3 install --upgrade virtualenv wheel - - virtualenv $HOME/venv + - python -m pip install --upgrade virtualenv wheel + - python -m virtualenv $HOME/venv - source $HOME/venv/Scripts/activate env: - TOXENV=py36 @@ -67,8 +50,8 @@ jobs: - choco install python --version 3.7.2 - python --version - python -m pip install --upgrade pip - - pip3 install --upgrade virtualenv wheel - - virtualenv $HOME/venv + - python -m pip install --upgrade virtualenv wheel + - python -m virtualenv $HOME/venv - source $HOME/venv/Scripts/activate env: - TOXENV=py37 @@ -80,8 +63,8 @@ jobs: - choco install python --version 3.8.0 - python --version - python -m pip install --upgrade pip - - pip3 install --upgrade virtualenv wheel - - virtualenv $HOME/venv + - python -m pip install --upgrade virtualenv wheel + - python -m virtualenv $HOME/venv - source $HOME/venv/Scripts/activate env: - TOXENV=py38 @@ -90,11 +73,10 @@ jobs: script: tox install: - - pip install tox - + - python -m pip install tox after_success: # Report coverage results to codecov.io # and export tox environment variables - - pip install codecov + - python -m pip install codecov - codecov -e TOXENV TRAVIS_OS_NAME diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 12d6c11bf..2f464d209 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -198,10 +198,10 @@ This configuration file setup the pytest-cov plugin and it is an additional depe It is possible to tests with some versions of python, to do this the command is: ```bash -tox -e py27,py35,pypy +tox -e py36,pypy3 ``` -Will run py.test with the python2.7, python3.5 and pypy interpreters, for example. +Will run py.test with the python3.6 and pypy3 interpreters, for example. ## Core Committer Guide diff --git a/README.md b/README.md index 8b796b0a9..b6a225649 100644 --- a/README.md +++ b/README.md @@ -28,9 +28,9 @@ Did someone say features? * Cross-platform: Windows, Mac, and Linux are officially supported. * You don't have to know/write Python code to use Cookiecutter -* Works with Python 2.7, 3.5, 3.6, 3.7, 3.8 ,PyPy and PyPy3. -* Project templates can be in any programming language or markup format: - Python, JavaScript, Ruby, CoffeeScript, RST, Markdown, CSS, HTML, you name it. +* Works with Python 3.5, 3.6, 3.7, 3.8 and PyPy3. +* Project templates can be in any programming language or markup format: + Python, JavaScript, Ruby, CoffeeScript, RST, Markdown, CSS, HTML, you name it. You can use multiple languages in the same project template. * Simple command line usage: diff --git a/cookiecutter/vcs.py b/cookiecutter/vcs.py index ee4feea51..4eaeb59ff 100644 --- a/cookiecutter/vcs.py +++ b/cookiecutter/vcs.py @@ -6,11 +6,8 @@ import logging import os import subprocess +from shutil import which -try: - from shutil import which -except ImportError: - from whichcraft import which from cookiecutter.exceptions import ( RepositoryNotFound, diff --git a/cookiecutter/zipfile.py b/cookiecutter/zipfile.py index 17db00517..a08edc31c 100644 --- a/cookiecutter/zipfile.py +++ b/cookiecutter/zipfile.py @@ -4,15 +4,10 @@ import os import tempfile +from zipfile import BadZipFile from zipfile import ZipFile - import requests -try: - # BadZipfile was renamed to BadZipFile in Python 3.2. - from zipfile import BadZipFile -except ImportError: - from zipfile import BadZipfile as BadZipFile from cookiecutter.exceptions import InvalidZipRepository from cookiecutter.prompt import read_repo_password diff --git a/docs/installation.rst b/docs/installation.rst index 457572346..6ef0ffa55 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -18,7 +18,6 @@ You can install the Python binaries from `python.org =2.7.9 or Python 3 >=3.5. See the Python Packaging Authority's (PyPA) documentation `Requirements for Installing Packages `_ for full details. +``pip`` and ``setuptools`` now come with Python 3 >=3.5. See the Python Packaging Authority's (PyPA) documentation `Requirements for Installing Packages `_ for full details. Install cookiecutter @@ -70,7 +69,7 @@ At the command line: .. code-block:: bash - $ pip install --user cookiecutter + $ python3 -m pip install --user cookiecutter Or, if you do not have pip: @@ -133,6 +132,6 @@ Or with pip: .. code-block:: bash - $ pip install --upgrade cookiecutter + $ python3 -m pip install --upgrade cookiecutter Then you should be good to go. diff --git a/pyproject.toml b/pyproject.toml index 96b448390..ee01a11ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,4 +2,4 @@ skip-string-normalization = true exclude = '/(tests/hooks-abort-render/hooks|docs\/HelloCookieCutter1)/' line-length = 88 -target-version = ['py27'] +target-version = ['py35'] diff --git a/setup.py b/setup.py index a23afa0ba..2be79b75d 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ from setuptools import setup -version = "1.7.2" +version = "2.0.0" if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') @@ -58,9 +58,8 @@ package_dir={'cookiecutter': 'cookiecutter'}, entry_points={'console_scripts': ['cookiecutter = cookiecutter.__main__:main']}, include_package_data=True, - python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*', + python_requires='>=3.5', install_requires=requirements, - extras_require={':python_version<"3.3"': ['whichcraft>=0.4.0']}, license='BSD', zip_safe=False, classifiers=[ @@ -69,9 +68,7 @@ "Intended Audience :: Developers", "Natural Language :: English", "License :: OSI Approved :: BSD License", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", @@ -79,6 +76,7 @@ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", + "Programming Language :: Python", "Topic :: Software Development", ], keywords=( diff --git a/tox.ini b/tox.ini index c9ddfa55c..c508dce8e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,10 @@ [tox] envlist = lint - py27 py35 py36 py37 py38 - pypy pypy3 minversion = 3.14.2 requires =