All notable changes to this project will be documented in this file. This project adheres to PEP 440 versioning schema, and the changelog itself conforms to Keep A Changelog.
- Updates will overwrite existing files always. If you need to select only some files,
just use
git mergetoolorgit difftoolafter updating. - Flag
--overwrite/-wdisappeared fromcopier update. It is now implicit. - To update via API,
overwrite=Trueis now required. - The default update conflict mode is now
inlineinstead ofrej. - By default, updates now consider 3 lines of context instead of just 1.
- All CLI calls to Copier must now include the subcommand as the 1st argument. For
example,
copiermust become nowcopier update; alsocopier ./tpl ./dstmust becomecopier copy ./tpl ./dst. - All flags must go after the subcommand now. For example,
copier -r HEAD update ./dstmust now becomecopier update -r HEAD ./dstorcopier update ./dst -r HEAD. - Automatic mode removed. Since now subcommands are required, the automatic mode is removed.
- Deprecated
copier.copyfunction is removed. Usecopier.run_copy,copier.run_updateorcopier.run_recopyexplicitly as needed. - default values must be of the same type than the question.
- disable unsafe features by default and add
--UNSAFEswitch (#1171) - basic nixpkgs overlay
- add
recopycommand and function - support conditional choices (#1010)
- validate default values (#1075)
- explain better why an answer casting fails
- cli: display subcommand args meaning
- preserver recursive symlinks
- work around Pydantic bug when parsing choices
- skip validating question and generating its default value when its skip condition is met
- overwrite always on updates
- update: default to inline markers and 3 lines of context
- remove unused local overrides to answers
- customizable update accuracy
- fix using a branch name as VCS ref
- answer validation for question with complex choices (#1110)
- include git in flake app
- support preserving symlinks when copying templates (#938)
- allow imports in inline templates (#986)
- properly support update in repo subdirectory (#1069)
- allow templating
_answers_filesetting (#1027) - let answers file exist in a subdirectory
- validate answers given via CLI/API
- exclude nothing by default when using subdirectory
- add native OS directory separator variable in
_copier_conf.septo allow generating dynamic directory structures - nix support
- include dirty local changes when copying HEAD
- require answer for questions without default value (#958)
- cleanup: don't clean up local template in parent folder
- delete conditionally created file when answer changes (#982)
- properly support diffs over updates with new interactive answers
- ignore Git hooks during project update (#1066)
- properly support diffs over updates with new answers
- skip tasks in pretend mode (#970)
- parse CLI data using question's answer parser
- don't set YAML
!includeconstructor globally (#947) - cli: use
--conflictflag only incopier updatesubcommand - ignore template repo tags that aren't valid PEP 440 versions
- --skip option was ignored (#966)
- Remove useless is_dir check
- don't attempt to render a file if its name is empty
- warn users against using shallow clones as template source
- tests: remove unknown timeout marker
- deduplicate code
- remove unused method argument
- simplify casting boolean question settings
- remove useless code related to not asking a question
- typing: use
Mappinginstead ofChainMaptype - move unrelated code out of try-except block
- inline: smarter inline conflict markers algorithm
- experimental inline conflict markers when updating
- merge copier settings from multiple documents
- remove dependency on iteration_utilities
- remove deprecated code scheduled for removal in Copier v7 (#843)
- expand tilde in template source path (#835)
- delete temporary clones after execution automatically (#802)
- typing: remove invalid migration task stage "task"
- typing: use abstract container types where possible (#832)
- use
dictconstructor as default factory - typing: remove unused types
- remove unreachable code (#826)
- model a task to execute using a dataclass
- reduce module imports
- add validator field to Question (#719)
- support passing github or gitlab urls without the .git suffix (#677)
- compatibility with pydantic 1.10
- git bundle support breaks with relative paths
- prevent name collision for question var name "value"
- add "flake8-simplify" plugin and simplify code
- support getting template commit hash with
{{ _copier_conf.vcs_ref_hash }} - simplify the format of the question prompt (#689)
- ignore non-PEP-440-compliant tags (#676)
All changes here. Summary:
- Allow using additional Jinja 2 extensions.
- Major version mismatch warning. If your Copier version is too new, you'll be warned.
- Specific exceptions, which will help on error detection for API usages.
- Multiline questions.
- Conditional questions.
- Placeholders.
- Interactive TUI for questionaries. Prompts are way cooler now. 😎
- Python 3.9 support.
- Python 3.10 support.
- Support empty templates suffix, telling Copier to render every file.
- Added
--defaultsflag to use default answers to questions, which might be null if not specified. - Added
--overwriteflag to overwrite files that already exist, without asking. - In migration scripts, we have the new environment variables
$VERSION_PEP440_FROM,$VERSION_PEP440_CURRENTand$VERSION_PEP440_TO, which will always get a valid PEP440 version identifier, without thevprefix, allowing your migration scripts to have a valid standard where to base their logic. - Raise a CopierAnswersInterrupt instead of a bare KeyboardInterrupt to provide callers with additional context - such as the partially completed AnswersMap.
- Support for
user_defaults, which take precedence over template defaults. - Copy dirty changes from a Git-tracked template to the project by default, to make testing easier.
- Advertise clearly which version is being copied or updated in the CLI.
- Add jinja variable
_copier_pythonto provide Pythonsys.executable.
- Fully refactored core.
- Running
copier copyon a preexisting project now recopies the project instead of updating it. That means that it respects old answers, but ignores history diff. - We use Jinja 2 defaults now.
{{ }}instead of[[ ]]and similar. - We keep trailing newlines by default for Jinja 2 templates.
- Copier will never ask for overwriting the answers file.
- Multi-typed choices follow the same type-casting logic as any other question, so
it's easier to reason about them. However, if you were using this feature, you might
be surprised about its side effects if you don't specify the type explicitly. Just
add
type: yamlto make it behave mostly as before. Or just don't use that, it's complicated anyway (warn added to docs). - Changed
--forceto be the same as--defaults --overwrite. - Copied files will reflect permissions on the same files in the template.
- Copier now uses
git clone --filter=blob:nonewhen cloning, to be faster. - Removing files from templates will remove them too from the subprojects when they get updated.
- Deprecated
nowandmake_secretfunctions. If your template used those, Copier will emit warnings leading you on how to upgrade it. - Templates marked with
_min_copier_versionbelow 6 will still default to use bracket-based Jinja defaults, but that will disappear soon. If you want your template to work on Copier 5 and 6, make sure to declare_envopsexplicitly in yourcopier.yaml. copier.copy()is confusing, now that actually copying and updating are 2 completely different actions (before, you were actually always updating if possible). Its direct equivalent is nowcopier.run_auto(), andcopier.copy()will disappear in the future.
- Minimal supported Python version is now 3.7 (dropped Python 3.6 support).
- Removed the
jsonmethod on_copier_conf. Where you would previously use_copier_conf.json()in your templates, please now use_copier_conf|to_jsoninstead. --subdirectoryflag, which was confusing... and probably useless.- Lots of dead code.
- A directory that gets an empty name works as expected: not copied (nor its contents).
- When comparing versions to update, PEP 440 is always used now. This way, we avoid fake ordering when Git commit descriptions happen to be ordered in a non-predictable way.
- Answers file will only remember answers to questions specified in the questionary.
All changes here. Summary:
- Forbid downgrades.
- Print all logs to STDERR.
All changes here. Summary:
- Add
--prereleaseflag, which will beFalseby default. This is a behavioral change and that's basically why I'm doing a new major release. All other changes are minor here. - Better docs.
All changes here. Summary:
- Make Copier work fine with Git 2.28.
- We have docs!
- Polish docs a little bit.
- We now run tests on macOS and Windows!
All changes here. Summary:
- Fix wrong templated default answers classification, which produced some questions being ignored.
All changes here. Summary:
- Fix wrong prompt regression when updating.
- Remove redundant
dstfixture in tests.
All changes here. Summary:
- Remove semver to avoid having 2 different versioning systems. We stick to PEP 440 now.
- Remember where an answer comes from.
- Do not re-ask to the user if already answer via
--data. - Support pre-migration scripts that modify the answers file.
All changes here. Summary:
- Templates can now use a subdirectory instead of always the template root.
All changes here. Summary:
- Assert minimum Copier version.
- Prettier prompts.
- Prompt self-templating.
- Better README.
This is a big release with many new features added and improved. The code base also received a lot of love and hardening.
- Minimal supported Python version is now 3.6.
- Dropped support for deprecated
voodoo.json. - Introduced gitignore-style patterns for
excludeundskip-if-exists. - Dropped support for
includeoption. - Added support for extending content of config files via content of other files via
pyaml-include. - Customizable template extension.
- Ability to remember last answers.
- Ability to choose where to remember them.
- Template upgrades support, (based on the previous points) with migration tasks specification.
- Extended questions format, supporting help, format, choices and secrets.
- More beautiful prompts.
- New CLI experience.
- Moved to
poetryfor package management. - Type annotated entire code base.
- Increased test coverage.
- Ditched
ruamel.yamlforPyYaml. - Ditched Travis CI for GitHub Actions.
- Added
pre-commitfor enforced linting. - Added
prettier,blackandisortfor code formatting. - Added
pytestfor running tests. - Use
plumbumas CLI and subprocess engine.
- Expanduser on all paths (so "~/foo/bar" is expanded to "<YOUR_HOME_FOLDER>/foo/bar").
- Improve the output when running tasks.
- Remove the destination folder if the copy process or one of the tasks fail.
- Add a
cleanup_on_errorflag to optionally disable the cleanup feature. - Add the
skip_if_existsoption to skip files, without asking, if they already exists in the destination folder.
- Fix MAJOR bug that was preventing the
_exclude,_includeand_taskskeys fromcopier.yml(or alternatives) to be used at all. It also interpreted_tasksas a user-provided variable.
- Empty folders are now copied. The folders are also displayed in the console output instead of just the files.
prompt_boolcan now have an undefined default (and answer is mandatory in that case).- Reactivates the
copier.ymlandcopier.yamlas configuration files. - The new
extra_pathsargument specifies additional paths to find templates to inherit from.
- Back to using a setup.py instead of a pyproject.toml.
- The recommended configuration file is now
copier.toml.
- The
copiercommand-line script now accepts "help" and "version" as commands.
- Task runner 🎉.
- Use
_exclude,_include, and_taskskeys incopier.ymlas the default values for the.copy()argumentsexclude,include, andtasks.
- Rebranded from
VoodootoCopier! - Dropped support for Python 2.x, the minimal version is now Python 3.5.
- Cleanup and 100% test coverage.
- The recommended configuration file is now
copier.yaml, but acopier.jsoncan be used as well. The oldvoodoo.jsonis also supported for now but is deprecated and will be removed in version 2.2. - Python package format updated to the latest standard (no
setup.py😵). - Renamed the
render_skeleton()function tocopy(). The function signature remains almost the same, the only changes are:filter_thisparameter is now calledexclude.ignore_thisparameter is now called justignore.
- Dropped the idea of storing the templates in a hidden
$HOMEfolder.