Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiline input #260

Merged
merged 54 commits into from
Oct 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
de95399
Allow multiline input
Aug 17, 2020
5fe0683
Use PyInquirer
Sep 24, 2020
ba14f16
fixup! Use PyInquirer
Sep 24, 2020
56e7f2b
fixup! Use PyInquirer
Sep 24, 2020
b5dafb6
fixup! Use PyInquirer
Sep 24, 2020
b27f561
fixup! Use PyInquirer
Sep 24, 2020
5b43159
fixup! Use PyInquirer
Sep 24, 2020
6669c44
fixup! Use PyInquirer
Sep 24, 2020
f19ec06
Merge branch 'master' of github.com:copier-org/copier into improve-pr…
Sep 28, 2020
0f39e31
update deps
Sep 28, 2020
0f6b7cc
Use pexpect to test new TUI
Sep 29, 2020
b2f7af4
Merge branch 'master' of github.com:copier-org/copier into improve-pr…
Oct 1, 2020
d41fc8c
Fix test_complex_questions
Oct 3, 2020
215be4a
fix test_templated_prompt_invalid
Oct 3, 2020
2f09988
Fix test
Oct 3, 2020
459e3e0
Fix test_copy_default_advertised and add -n auto -ra in all pytest co…
Oct 4, 2020
f0a59e7
Fix remaining tests
Oct 4, 2020
701ead2
Install from pypi
Oct 4, 2020
e46f432
fix
Oct 4, 2020
90f392d
Add docs
Oct 4, 2020
0140ee3
More docs
Oct 4, 2020
d60811a
Test "when"
Oct 4, 2020
67e3a80
Update to questionary 1.6.0
Oct 5, 2020
54a8feb
Test placeholder, update deps
Oct 5, 2020
99be89a
wip
Oct 5, 2020
1e88c58
Fix pytest arg
Oct 5, 2020
8d682e4
Fix test
Oct 5, 2020
9910b64
Remove obsolete xfails and move pytest.ini to root of project, to inc…
yajo Oct 6, 2020
95fab37
more fixes
yajo Oct 6, 2020
3714541
Fix type
yajo Oct 6, 2020
2cf1cb9
Add on/off
yajo Oct 6, 2020
6b2f1e7
Fix install on windows
yajo Oct 6, 2020
eea3ba5
Update windows install fix
yajo Oct 6, 2020
0b8a9a9
fixup! Update windows install fix
yajo Oct 6, 2020
7f3477d
Increase timeout for pexpect and use yaml.load_safe
Oct 8, 2020
2993b26
fixup! Increase timeout for pexpect and use yaml.load_safe
Oct 8, 2020
546ec8d
Update ci.yml
yajo Oct 9, 2020
6735d15
fixup! Update ci.yml
Oct 9, 2020
fe7fbbc
Remove toml 0.5+ syntax (dotted keys)
Oct 9, 2020
a1449fd
Switch to poetry_core + poetry-dynamic-versioning as build system, an…
Oct 9, 2020
62f7cea
Use PopenSpawn for Windows compatibility
Oct 9, 2020
a0adbd3
Increase timeout
yajo Oct 9, 2020
ac627f1
windows fixes
yajo Oct 11, 2020
aea2c4b
Change skip to xfail
yajo Oct 11, 2020
6c1f377
fixup! Change skip to xfail
Oct 11, 2020
769d24d
Remove deprecated add-path and set-env calls in CI
Oct 11, 2020
f303aab
Add kwargs to xfail
Oct 11, 2020
9f00bbc
xfail pexpect tests on windows. I'm tired of trying to make it work.
Oct 11, 2020
86a5e6b
fixup! xfail pexpect tests on windows. I'm tired of trying to make it…
Oct 12, 2020
7495dca
Run pre-commit and mypy as tests
Oct 12, 2020
d4dec14
Use inner poe
Oct 12, 2020
0baab6e
Remove dependencies from old times
Oct 12, 2020
f208867
Fix $PATH using powershell syntax
Oct 12, 2020
66d34d1
Use powershell where syntax is compatible
Oct 12, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 8 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,11 @@ jobs:
- name: Enable msys binaries
if: ${{ runner.os == 'Windows' }}
run: |
echo "::add-path::C:\msys64\usr\bin"
echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
rm C:\msys64\usr\bin\bash.exe
- run: git config --global user.name copier-ci
shell: bash
- run: git config --global user.email copier@copier
shell: bash
- run: git config --global core.autocrlf input
shell: bash
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
Expand All @@ -58,8 +55,8 @@ jobs:
- name: generate cache key PY
shell: bash
run:
echo "::set-env name=PY::$((python -VV; pip freeze) | sha256sum | cut -d' '
-f1)"
echo "PY=$((python -VV; pip freeze) | sha256sum | cut -d' ' -f1)" >>
$GITHUB_ENV
- uses: actions/[email protected]
with:
path: |
Expand All @@ -69,22 +66,11 @@ jobs:
cache|${{ runner.os }}|${{ env.PY }}|${{ hashFiles('pyproject.toml') }}|${{
hashFiles('poetry.lock') }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install dependencies
shell: bash
run: |
python -m pip install poetry poetry-dynamic-versioning poethepoet
poetry run python -m pip install pip -U
poetry install
- name: Run pre-commit
shell: bash
run: poe lint --color=always
# FIXME Make pre-commit pass reliably on Windows, and remove this
continue-on-error: ${{ runner.os == 'Windows' }}
- name: Run mypy
shell: bash
run: poe types
python -m pip install poetry
poetry install -vvv
- name: Run pytest
shell: bash
run: poe test -ra .
run: poetry run poe test -ra .

publish:
if: github.event_name == 'release'
Expand All @@ -98,8 +84,8 @@ jobs:
python-version: 3.8
- name: generate cache key PY
run:
echo "::set-env name=PY::$((python -VV; pip freeze) | sha256sum | cut -d' '
-f1)"
echo "PY=$((python -VV; pip freeze) | sha256sum | cut -d' ' -f1)" >>
$GITHUB_ENV
- uses: actions/[email protected]
with:
path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
- run: python -m pip install poetry poetry-dynamic-versioning
- name: generate cache key PY
run:
echo "::set-env name=PY::$((python -VV; pip freeze) | sha256sum | cut -d' '
-f1)"
echo "PY=$((python -VV; pip freeze) | sha256sum | cut -d' ' -f1)" >>
$GITHUB_ENV
- uses: actions/[email protected]
with:
path: |
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ repos:
# hooks running from local virtual environment
- repo: local
hooks:
- id: autoflake
name: autoflake
entry: poetry run autoflake
language: system
types: [python]
args: ["-i", "--remove-all-unused-imports", "--ignore-init-module-imports"]
- id: black
name: black
entry: poetry run black
Expand Down
2 changes: 2 additions & 0 deletions copier/config/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def make_config(
{k: v for k, v in questions_data.items() if k in data},
{},
data,
init_args["data_from_template_defaults"],
False,
init_args["envops"],
),
Expand All @@ -141,6 +142,7 @@ def make_config(
questions_data,
init_args["data_from_answers_file"],
init_args["data_from_init"],
init_args["data_from_template_defaults"],
not force,
init_args["envops"],
)
Expand Down
13 changes: 5 additions & 8 deletions copier/config/objects.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Pydantic models, exceptions and default values."""

import datetime
from collections import ChainMap
from copy import deepcopy
Expand All @@ -8,7 +7,7 @@
from pathlib import Path
from typing import Any, ChainMap as t_ChainMap, Sequence, Tuple, Union

from pydantic import BaseModel, Extra, StrictBool, validator
from pydantic import BaseModel, Extra, Field, StrictBool, validator

from ..types import AnyByStrDict, OptStr, PathSeq, StrOrPathSeq, StrSeq

Expand All @@ -35,8 +34,6 @@
class UserMessageError(Exception):
"""Exit the program giving a message to the user."""

pass


class NoSrcPathError(UserMessageError):
pass
Expand Down Expand Up @@ -91,10 +88,10 @@ class ConfigData(BaseModel):
migrations: Sequence[Migrations] = ()
secret_questions: StrSeq = ()
answers_file: Path = Path(".copier-answers.yml")
data_from_init: AnyByStrDict = {}
data_from_asking_user: AnyByStrDict = {}
data_from_answers_file: AnyByStrDict = {}
data_from_template_defaults: AnyByStrDict = {}
data_from_init: AnyByStrDict = Field(default_factory=dict)
data_from_asking_user: AnyByStrDict = Field(default_factory=dict)
data_from_answers_file: AnyByStrDict = Field(default_factory=dict)
data_from_template_defaults: AnyByStrDict = Field(default_factory=dict)

# Private
_data_mutable: AnyByStrDict
Expand Down
Loading