27 Commits

Author SHA1 Message Date
Sigurd Spieckermann
b42a032f7b style: fix formatter and linter errors 2025-04-22 12:20:23 +02:00
Axel H.
0a9644d249 feat(settings): add user settings support with defaults values (fix #235) 2025-01-29 19:46:06 +01:00
Sigurd Spieckermann
0258635da7 fix: support Git config without user identity 2024-07-30 13:40:17 +02:00
danieleades
0c6b0b96fe
build(typing): enable 'strict' mypy linting (#1527)
---------

Co-authored-by: Timothée Mazzucotelli <dev@pawamoy.fr>
2024-03-23 12:58:20 +01:00
danieleades
878c4d4f40
style: add 'flake-future-annotations' lint group (#1506)
* add ruff 'flake8-future-annotations' (FA) lint group
2024-02-22 06:19:17 +00:00
Axel H
37391820ad
fix(vcs): prevent local clone from being stuck by gpg prompts (#1360)
A quick and simple PR preventing the `copy` command to get stuck if you have `commit.gpgSign` and try to run the `copy` command on WIP local project for trial.

Fixes #856
Fixes #1224
Fixes #616

Co-authored-by: Jairo Llopis <yajo.sk8@gmail.com>
2023-10-22 13:20:43 +00:00
Sigurd Spieckermann
5029b6e7a9
test: add type hints and clean up (#985)
* refactor(tests): add type hints and clean up

* fix: import `Protocol` from `typing-extensions` when using Python 3.7

* fix: import `Literal` from `typing-extensions` when using Python 3.7

* refactor(tests): create template and subproject directory using `tmp_path_factory` fixture

* refactor(tests): use OS-agnostic file path separator

* refactor(tests): use `/` separator for `skip_if_exists` paths

* style: fix formatting error

* refactor(tests): expect POSIX path for local repo URL
2023-03-21 16:31:11 +00:00
Talley Lambert
6fcd7e02b8
feat: add validator field to Question (#719)
* docs: add note to docstring

* feat: print spawn logs on failure, and fix failure in test

The test was failing because it turns out that `tui` won't print letters that must not change, when running an interactive TUI.

I changed the error message for something that will force all letters to change. This way it works as expected.

Co-authored-by: Jairo Llopis <yajo.sk8@gmail.com>
2022-08-06 15:48:21 +00:00
Jairo Llopis
23dd5dbf8f fix: remove files on update
When a template gets updated and a file gets deleted within, subproject updates should delete that file automatically too.

Fix https://github.com/copier-org/copier/issues/461
2022-04-13 19:53:53 +01:00
Jairo Llopis
9de3dd0574 fix: respect spawn timeout when doing coverage
It appeared as a debugger and resulted in endless test runs on CI.
2021-06-11 07:19:46 +01:00
Jairo Llopis
5b6cd052da fix: detect properly debugging context 2021-05-21 16:54:30 +01:00
Jairo Llopis
0500a617c0 test: make spawned processes debuggable
Implement the workaround from https://github.com/microsoft/debugpy/issues/596#issuecomment-824643237 to allow debugging pexpect subprocesses.
2021-04-23 17:45:25 +01:00
Jairo Llopis
a15da2d511 Run updated pre-commit 2020-10-16 11:47:57 +00:00
Jairo Llopis
cda93273c1
Enhanced user input (#260)
* use a new toolkit for user prompting: questionary (patched).
* multiline questions.
* conditional questions.
* new toolkit for ui tests: pexpect.
* fix lots of tests.
* fix windows builds with newer poetry-dynamic-versioning.
* linters and mypy are now tests, to have faster ci.
* update deprecated ci commands.
* removed dependencies from old times.
* Remove toml 0.5+ syntax (dotted keys)
* Use powershell where syntax is compatible
* Change skip to xfail
* xfail pexpect tests on windows. I'm tired of trying to make it work
* more docs
* possibly something more.
2020-10-12 08:56:46 +01:00
Jairo Llopis
403183c78d Fix wrong prompt when updating
#221 introduced a regression that made the user prompt always display the default value from `copier.yml` file instead of the last answer from `.copier-answers.yml` when the latter one was available.

Here I fix that and test it too. Added a new dev dependency (pytest-timeout) to use it in tests that expect responses from STDIN and for some reason fail to obtain them do not hang in and endless loop.

I also removed the `conftest.py` file, which was only declaring a fixture that is no longer used and can actually be fixed easily using https://stackoverflow.com/a/51893526/1468388.

@Tecnativa TT23705
2020-06-23 09:33:43 +00:00
Jairo Llopis
823f3a1935 Remove dst fixture
This is redundant with pytest's native `tmp_path` fixture, so we use that one instead now.
2020-06-23 07:58:03 +00:00
Jairo Llopis
c4726b4fe7
Prefix all temp directories
This way it's easier to track where each one is created. Most usefil while debugging tests.
2020-04-06 13:43:13 +01:00
Jairo Llopis
2241d8fcb9
Add advanced questions format
Fix #89 and fix #89 by adding a new extended syntax to make prompts way more usable.

Leverages plumbum's helpers, so prompt code is removed from Copier codebase, making it smaller BTW.

See README and the new test to understand the new features.

@Tecnativa TT20357
2020-01-13 10:49:59 +01:00
Ben Felder
69760a583a Cleaned up imports. 2019-08-08 23:16:47 +02:00
Juan-Pablo Scaletti
4c286ea6bd Fix for Python 3.5 2019-06-12 23:54:21 -05:00
Juan-Pablo Scaletti
5b52b37662 pathlib.Path ALL the paths! 2019-04-03 23:22:25 -05:00
Juan-Pablo Scaletti
9c9f5e7821 black-styled 2019-03-07 22:07:51 -05:00
Juan-Pablo Scaletti
5cea5d7ac7 Voodoo -> Copier 2019-02-11 22:32:34 -05:00
Tim Heap
3a9f53dbf4 Add tests for the prompt functions 2017-03-01 15:49:26 +11:00
Juan-Pablo Scaletti
e00a3dc466 voodo_setup 2015-03-26 20:55:50 -05:00
Juan-Pablo Scaletti
5b10715b33 VCS support 2013-08-17 12:15:54 -05:00
Juan-Pablo Scaletti
d2926c210d refactor tests to use only py.test 2013-06-30 13:00:15 -05:00