Minor cleanup

This commit is contained in:
Juan-Pablo Scaletti 2019-08-20 13:38:02 -05:00
parent 9b8ce8ad17
commit dabf9cf09f
9 changed files with 30 additions and 19 deletions

View File

@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
### Version 3.x (2019-xx) ### Version 3.0 (2019-xx)
- Dropped support for Python 3.5. - Dropped support for Python 3.5.
- Dropped support for deprecated `voodoo.json`. - Dropped support for deprecated `voodoo.json`.
- Type annotated entire code base. - Type annotated entire code base.

View File

@ -19,16 +19,16 @@ A library for rendering projects templates.
from copier import copy from copier import copy
# Create a project from a local path # Create a project from a local path
copy('path/to/project/template', 'path/to/destination') copy("path/to/project/template", "path/to/destination")
# Or from a git URL. # Or from a git URL.
copy('https://github.com/jpscaletti/copier.git', 'path/to/destination') copy("https://github.com/jpscaletti/copier.git", "path/to/destination")
# You can also use "gh:" as a shortcut of "https://github.com/" # You can also use "gh:" as a shortcut of "https://github.com/"
copy('gh:jpscaletti/copier.git', 'path/to/destination') copy("gh:jpscaletti/copier.git", "path/to/destination")
# Or "gl:" as a shortcut of "https://gitlab.com/" # Or "gl:" as a shortcut of "https://gitlab.com/"
copy('gl:jpscaletti/copier.git', 'path/to/destination') copy("gl:jpscaletti/copier.git", "path/to/destination")
``` ```
- Or as a command-line tool: - Or as a command-line tool:
@ -58,9 +58,10 @@ Use the `data` argument to pass whatever extra context you want to be available
in the templates. The arguments can be any valid Python value, even a in the templates. The arguments can be any valid Python value, even a
function. function.
Since X.X.X, only Python 3.6 or later are supported. Please use the 2.5.1 version if your project runs Since version 3.0, only Python 3.6 or later are supported. Please use the 2.5.1 version if your project runs
on a previous Python version. on a previous Python version.
## The copier.yml file ## The copier.yml file
If a `copier.yml`, `copier.toml`, or `copier.json` file is found in the root of the project, If a `copier.yml`, `copier.toml`, or `copier.json` file is found in the root of the project,

View File

@ -11,17 +11,17 @@ from typing import Callable, Dict, List, Optional, Tuple
from . import vcs from . import vcs
from .tools import ( from .tools import (
STYLE_DANGER,
STYLE_IGNORE,
STYLE_OK,
STYLE_WARNING,
Renderer,
copy_file, copy_file,
get_jinja_renderer, get_jinja_renderer,
get_name_filters, get_name_filters,
make_folder, make_folder,
printf, printf,
prompt_bool, prompt_bool,
Renderer,
STYLE_DANGER,
STYLE_IGNORE,
STYLE_OK,
STYLE_WARNING,
) )
from .types import AnyByStrDict, CheckPathFunc, OptStrOrPathSeq, OptStrSeq, StrOrPath from .types import AnyByStrDict, CheckPathFunc, OptStrOrPathSeq, OptStrSeq, StrOrPath
from .user_data import load_config_data, query_user_data from .user_data import load_config_data, query_user_data

View File

@ -14,6 +14,7 @@ from jinja2.sandbox import SandboxedEnvironment
from .types import AnyByStrDict, CheckPathFunc, OptStrOrPathSeq, StrOrPath, T from .types import AnyByStrDict, CheckPathFunc, OptStrOrPathSeq, StrOrPath, T
_all__: Tuple[str, ...] = ( _all__: Tuple[str, ...] = (
"STYLE_OK", "STYLE_OK",
"STYLE_WARNING", "STYLE_WARNING",

View File

@ -3,6 +3,7 @@ from pathlib import Path
from .tools import HLINE, INDENT, printf_block, prompt from .tools import HLINE, INDENT, printf_block, prompt
from .types import AnyByStrDict, StrOrPath from .types import AnyByStrDict, StrOrPath
__all__ = ("load_config_data", "query_user_data") __all__ = ("load_config_data", "query_user_data")

View File

@ -7,6 +7,7 @@ from typing import Optional
from .types import StrOrPath from .types import StrOrPath
__all__ = ("get_repo", "clone") __all__ = ("get_repo", "clone")
GIT_PREFIX = ("git@", "git://", "git+") GIT_PREFIX = ("git@", "git://", "git+")

17
mm.py
View File

@ -12,24 +12,31 @@ data = {
"title": "Copier", "title": "Copier",
"name": "copier", "name": "copier",
"pypi_name": "copier", "pypi_name": "copier",
"version": "2.5.1", "version": "3.0",
"author": "Juan-Pablo Scaletti", "author": "Juan-Pablo Scaletti",
"author_email": "juanpablo@jpscaletti.com", "author_email": "juanpablo@jpscaletti.com",
"description": "A library for rendering projects templates", "description": "A library for rendering projects templates.",
"copyright": "2011", "copyright": "2011",
"repo_name": "jpscaletti/copier", "repo_name": "jpscaletti/copier",
"home_url": "", "home_url": "",
"project_urls": {}, "project_urls": {},
"development_status": "5 - Production/Stable", "development_status": "5 - Production/Stable",
"minimal_python": 3.5, "minimal_python": 3.6,
"install_requires": [ "install_requires": [
"jinja2 ~= 2.10", "jinja2 ~= 2.10",
"colorama ~= 0.4", "colorama ~= 0.4",
"toml ~= 0.10", "toml ~= 0.10",
"ruamel.yaml ~= 0.15", "ruamel.yaml ~= 0.15",
], ],
"testing_requires": ["pytest", "pytest-mock"], "testing_requires": ["pytest", "pytest-mock", "pytest-mypy"],
"development_requires": ["pytest-cov", "pytest-flake8", "flake8", "ipdb", "tox"], "development_requires": [
"pytest-cov",
"pytest-flake8",
"pytest-mypy",
"flake8",
"ipdb",
"tox",
],
"entry_points": "copier = copier.cli:run", "entry_points": "copier = copier.cli:run",
"coverage_omit": [], "coverage_omit": [],
"has_docs": False, "has_docs": False,

View File

@ -1,14 +1,14 @@
[metadata] [metadata]
name = copier name = copier
version= 2.5.1 version= 3.0
author = Juan-Pablo Scaletti author = Juan-Pablo Scaletti
author_email = juanpablo@jpscaletti.com author_email = juanpablo@jpscaletti.com
description = A library for rendering projects templates description = A library for rendering projects templates.
long_description = file:README.md long_description = file:README.md
long_description_content_type = text/markdown long_description_content_type = text/markdown
url = https://github.com/jpscaletti/copier url = https://github.com/jpscaletti/copier
license = MIT license = MIT
license_file = LICENSE.txt license_file = LICENSE
classifiers = classifiers =
Development Status :: 5 - Production/Stable Development Status :: 5 - Production/Stable
Intended Audience :: Developers Intended Audience :: Developers