1797 Commits

Author SHA1 Message Date
Jairo Llopis
f0a9d91b03
wip 2021-03-05 17:39:43 +00:00
Jairo Llopis
1482de4972
wip 2021-03-05 17:33:11 +00:00
Jairo Llopis
386e50ede9
wip 2021-03-05 15:52:28 +00:00
Jairo Llopis
b512e46d8a
wip 2021-03-05 15:52:28 +00:00
Jairo Llopis
e61beb23a1
Ignore pdm stuff
This won't be strictly necessary until #357 is merged, but it helps on the mean time when switching branches.
2021-03-05 15:52:27 +00:00
Timothée Mazzucotelli
76d6c2f502
Fix temporary directory removal on Windows (#358)
* tests: Add temporary directory deletion tests

* ci: Run tests on Windows for Python 3.6 and 3.7 again

* fix: Implement more robust temporary directory deletion

* docs: Document temporary directory class and error handler

* chore: Update poetry.lock

* style: Format code

Co-authored-by: Timothée Mazzucotelli <timothee.mazzucotelli@externe.e-i.com>
v6.0.0a6
2021-03-04 16:05:52 +00:00
Jairo Llopis
0eddab7da5 Increase checkout depth on CI
This will help tools that analyze tags, such as coverage, poetry or PDM.

I'm positive and I assume no release will take more than 500 commits.
2021-03-03 16:25:43 +00:00
Jairo Llopis
85c059a838 Update dependencies
Remove all git dependencies, which were blocking a release. Update broken pre-commit hooks.
2021-03-03 16:25:43 +00:00
Timothée Mazzucotelli
b4c54e5279 chore: Update poetry.lock 2021-03-01 07:43:45 +00:00
Timothée Mazzucotelli
456d2e94e4 ci: Stop using Poetry debug verbosity 2021-03-01 07:43:45 +00:00
Jairo Llopis
d86c88d051 Refactor a bit how version warnings are issued
- Move template methods to template module.
- Remove load_config_data.
- Verification on lazy property.
- Add Template.min_copier_version.
- Add tools.copier_version.
2021-02-17 07:53:15 +00:00
Jairo Llopis
448812fbbf Warn major version difference
Targeting #348, from now on, if we cannot check the copier version or the installed version's major part is bigger than the template's minimal major part, there'll be proper warnings.
2021-02-14 13:26:35 +00:00
Jairo Llopis
b3190c2abf Ensure empty-named dirs work as expected
Fix #285 and fix #350.
2021-02-12 08:28:47 +00:00
Jairo Llopis
423f6f9bad Build with poetry-core
This reverts commit 90b222377171c15964e7b68120a86430fe098f73, now that https://github.com/mtkennerly/poetry-dynamic-versioning/issues/35 is fixed.
2021-02-10 14:12:52 +00:00
Jairo Llopis
0441b86f0c
Refactor (#314)
* Refactor
* Fix #110.
* Rewrite test_config_exclude, test_config_exclude_overridden and test_config_include. These tests were badly designed, using a monkeypatch that would never happen in the real world, and actually producing false positives. I moved them to test_exclude.py and rewritten to test the what and not the how.
* Fix #214 by removing skip option. Relevant tests use the better skip_if_exists=["**"].
* Remove subdirectory flag from API/CLI. It was confusing and could lead to bad maintenance situations. Fixes #315.
* Remove extra_paths and fix #321
* Remember that you cannot use _copier_conf.src_path as a path now
* use dataclasses
* Create errors module, simplify some tests, fix many others
* Fix some tests, complete EnvOps removal
* Fix #214 and some tests related to it
* Reorder code
* Update docs and imports
* Modularize test_complex_questions
* Interlink worker and questionary a bit better
* Removal of Questionary class, which only had 1 meaningful method that is now merged into Worker to avoid circular dependencies.
* Fix #280 in a simple way: only user answers are type-casted inside API, and CLI transforms all `--data` using YAML always. Predictable.
* Use prereleases correctly.
* Reorder AnswersMap to have a more significative repr.
* Simpler cache for old `Question.get_choices()` method (renamed now).
* fix wrong test
* Fix test_subdirectory
* Fix test_tasks (and remove tests/demo_tasks)
* Fix path filter tests, and move it to test_exclude, where it belongs
* Make test_config pass
* Fix more wrongly designed tests
* Use cached_property backport if needed
* xfail test known to fail on mac
* force posix paths on windows
* Add typing_extensions for python < 3.8
* Sort dependencies in pyproject.toml
* Support python 3.6 str-to-datetime conversion
* Workaround https://bugs.python.org/issue43095
* xfail test_path_filter on windows
* Upgrade mkdocs and other dependencies to fix https://github.com/pawamoy/mkdocstrings/issues/222
* Add missing reference docs.
* Add workaround for https://github.com/pawamoy/mkdocstrings/pull/209
* Docs.
* Remove validators module
* Add workaround for https://github.com/pawamoy/mkdocstrings/issues/225
* Restore docs autorefs as explained in https://github.com/pawamoy/mkdocstrings/issues/226#issuecomment-775413562.
* Workaround https://github.com/pawamoy/pytkdocs/issues/86
2021-02-09 18:22:47 +00:00
Robin Schneider
07a66f793e Fix docs: Short version of --pretend is -n not -q 2021-01-28 08:33:34 +00:00
William Skertic
83b9b31591 Fix typos in help & docstring. 2021-01-02 12:05:55 +00:00
Timothée Mazzucotelli
60c5866a00 docs: Fix formatting 2020-12-30 05:43:22 +00:00
Jairo Llopis
62d38a801b Drop automerge bot
It turns out Github supports this feature as beta now, and it works just fine, so we don't need this bot anymore.
2020-12-18 10:36:04 +00:00
Jairo Llopis
90b2223771 Fix readthedocs build
Apply workaround from https://github.com/mtkennerly/poetry-dynamic-versioning/issues/35.
2020-12-18 10:09:46 +00:00
Jairo Llopis
c7b9f21f83 Advise users to never edit manually the copier answers file
This keeps happening once and again, and confuses users.

Let's clarify it here in the docs.

I also fix some broken links and update deps BTW.
2020-12-18 10:09:46 +00:00
Jairo Llopis
679fd7cd84 Upgrade pydantic and use PrivateAttr
Latest pydantic release lets me make use of `PrivateAttr` and remove some workarounds from code.
2020-11-28 10:33:57 +00:00
Jairo Llopis
83d8620c7e Update questionary
Latest questionary release let me remove some workarounds.
2020-11-28 09:42:59 +00:00
Jairo Llopis
6100556b59 Remove YAML casting for bool types
Their type_fn is just enough.
2020-11-28 09:25:46 +00:00
Jairo Llopis
401a50144d
Notify brand new discussion channel 2020-11-15 09:04:29 +00:00
Jairo Llopis
0002cd7317 Also consider none, null and ~ as false
Enhance #305 with null values.
2020-11-11 12:01:58 +00:00
Jairo Llopis
249e959145 Allow more types when casting values as booleans
Don't be so strict, because user input is sometimes unpredictable.
2020-11-11 11:48:00 +00:00
Jairo Llopis
9f63d5075f Allow updating a shallow-cloned repo
Before this patch, if the repo you were updating was shallow, Copier failed to update it.

Now it should update any repo, no matter its depth. We only need to fetch 1 commit from it, after all.
2020-11-11 09:53:06 +00:00
Nikolaus Schlemm
ef7ddd274e fixed typo
"-f" makes more sense and matches https://github.com/copier-org/copier/blob/master/copier/cli.py#L138 ;)
2020-10-31 12:03:43 +00:00
Jairo Llopis
7fc5fd1539 Support python 3.9
Fix #102.
2020-10-30 02:50:31 -07:00
Jairo Llopis
c93ef75521 Fix wrong default choice
When updating a project, a choice answer never got a good default value. Now it's properly selected, and interactive behavior is tested.
v6.0.0a5
2020-10-23 10:52:42 +00:00
Jairo Llopis
dfb7688910 Explain how to use multiple templates for the same project
This is very cool and it doesn't seem to be clearly explained anywhere.
2020-10-17 11:20:37 +00:00
Jairo Llopis
2b023417db Report coverage on every PR
Fix #279:

- Remove specific coverage workflow.
- Integrate coverage with normal unit tests, which run on every PR.
- Remove `yml` option, which has been deprecated.
- Remove token, unneeded for public repos.
- Add OS and PYTHON env vars to tag uploads.
2020-10-17 03:46:41 -07:00
Jairo Llopis
b0da7bead7 Add pygments dependency
Regression from 81e03a50e2f23a6f2b71ab0ae31776b61504d9bc.
v6.0.0a4
2020-10-16 12:13:13 +00:00
Jairo Llopis
ec5b0e0cb3 Try to support python 3.9
This includes updating dependencies, such as pydantic, and adding it to the test matrix.

However pydantic doesn't support python 3.9 yet, so we can't claim to support it yet.

Targets #102.
v6.0.0a3
2020-10-16 11:47:57 +00:00
Jairo Llopis
81e03a50e2 Revert "Remove support for custom lexers temporarily"
This reverts commit 598388af30e851c34fcd9bd76ee5aad2ce2fd039 because it's no longer needed with questionary 1.7.0.
2020-10-16 11:47:57 +00:00
Jairo Llopis
3a63b16717 Upgrade to latest questionary, released just for me 😊
See https://github.com/tmbo/questionary/pull/71#issuecomment-709574714 💚
2020-10-16 11:47:57 +00:00
Jairo Llopis
a5990dd067 Fix type problems
It's just a workaround for https://github.com/tmbo/questionary/pull/79 because my types should be OK.
2020-10-16 11:47:57 +00:00
Jairo Llopis
a15da2d511 Run updated pre-commit 2020-10-16 11:47:57 +00:00
Jairo Llopis
5c8751a840 Remove docs from dev dependenies
https://github.com/python-poetry/poetry/issues/2555 was fixed, so we should be able to use `poetry install -E docs`.
2020-10-16 11:47:57 +00:00
Jairo Llopis
90758e77b0 Update pre-commit configuration 2020-10-16 11:47:57 +00:00
Jairo Llopis
b83cb3c18f Pin latest versions of development dependencies 2020-10-16 11:47:57 +00:00
Jairo Llopis
598388af30 Remove support for custom lexers temporarily
When https://github.com/tmbo/questionary/pull/70 gets fixed, this commit should be rolled back.

For now, I have to remove this support because [otherwise I cannot publish Copier to Pypi](https://github.com/copier-org/copier/runs/1241180809?check_suite_focus=true).
v6.0.0a2
2020-10-14 07:07:42 +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.
v6.0.0a1
2020-10-12 08:56:46 +01:00
Yajo
a06ca18d7f Fix gitpod configuration
- Install basic development tools and configure them to work out of the box, based on gitpod's official ubuntu docker image.
- Disable $PIP_USER=yes, hardcoded by gitpod and unfriendly with poetry and pre-commit.
- Make Fish shell available.
- Add some basic settings.
- Add instructions to CONTRIBUTING.
2020-09-30 15:29:53 +01:00
Jairo Llopis
e28a20ac6c
Remove buggy image
It seems gitpod is only compatible with ubuntu/debian/alpine images.
2020-09-29 17:44:12 +01:00
Yajo
8fee9dfe07 Configure gitpod
Allow contributors to start hacking right away with a single click.
2020-09-29 16:37:14 +00:00
Timothée Mazzucotelli
9e3f151eec Document the update process
Co-authored-by: Jairo Llopis <Yajo@users.noreply.github.com>
2020-09-27 22:21:21 +02:00
Jairo Llopis
e92c5581fd Allow running copier when installed in editable mode
Without this patch, any template with `_min_copier_version` would fail without need.
2020-09-26 05:24:33 +02:00
Jairo Llopis
56bddd080e Remove --only-diff flag
This flag was not working fine, after all.

Also, the only difference between `copier copy` and `copier update` is that copying should ignore subproject history, while updating should respect it.

Thus, the real CLI reflection of the `only_diff` option is whether you're using `copier copy` or `copier update`. Well, that's how it is now.

Besides all this, the real behavior of `only_diff=False` wasn't being tested. Fixed also, and updated docs.

Fixes #270.
v6.0.0a0
2020-09-18 11:21:04 +00:00