From d27050592da8eb7b4ca358b57021060e5c97f94f Mon Sep 17 00:00:00 2001 From: Tyler Baur Date: Tue, 29 Aug 2023 09:50:48 -0500 Subject: [PATCH 01/10] github actions --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++++ .python-version | 2 +- pyproject.toml | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6b3f8df --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,27 @@ +name: CI + +on: + pull_request: + push: + branches: + - main + workflow_dispatch: + +jobs: + ci: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10", "3.11"] + steps: + - name: Setup Rye + uses: eifinger/setup-rye@v1 + with: + enable-cache: true + - name: Pin Python Version + run: rye pin ${{ matrix.python-version }} + - name: Sync Rye + run: rye sync + - name: Run Tests + run: \ + rye run pytest diff --git a/.python-version b/.python-version index 12398d7..9ac3804 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -cpython@3.11.3 +3.11.5 diff --git a/pyproject.toml b/pyproject.toml index 26fd474..ab2cb1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ dependencies = [ "pytest-copier>=0.1.0", ] readme = "README.md" -requires-python = ">= 3.8" +requires-python = ">= 3.10" [build-system] requires = ["hatchling"] From 6c4947f2e74b74b43e1b9a4e5af4aa339c9a2dc2 Mon Sep 17 00:00:00 2001 From: Tyler Baur Date: Tue, 29 Aug 2023 09:53:36 -0500 Subject: [PATCH 02/10] forgot to checkout --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b3f8df..20ec3e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,8 @@ jobs: matrix: python-version: ["3.10", "3.11"] steps: + - name: Checkout + uses: actions/checkout@v3 - name: Setup Rye uses: eifinger/setup-rye@v1 with: From 0a2d53d665f348b5db0961594e25022d470c2acc Mon Sep 17 00:00:00 2001 From: Tyler Baur Date: Tue, 29 Aug 2023 09:57:51 -0500 Subject: [PATCH 03/10] doh --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20ec3e0..c71dedd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,5 +25,4 @@ jobs: - name: Sync Rye run: rye sync - name: Run Tests - run: \ - rye run pytest + run: rye run pytest From 002cf87d04312aaa5b9d8d524127df738e17b04a Mon Sep 17 00:00:00 2001 From: Tyler Baur Date: Tue, 29 Aug 2023 10:23:13 -0500 Subject: [PATCH 04/10] test --- .github/workflows/ci.yml | 2 +- tests/test_project_generation.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c71dedd..b363bc0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,4 +25,4 @@ jobs: - name: Sync Rye run: rye sync - name: Run Tests - run: rye run pytest + run: rye run pytest -s diff --git a/tests/test_project_generation.py b/tests/test_project_generation.py index a79adc9..9e3f42e 100644 --- a/tests/test_project_generation.py +++ b/tests/test_project_generation.py @@ -20,7 +20,9 @@ def _check_contents( def test_default_values(copier_fixture: CopierFixture): copied = copier_fixture.copy() assert copied.exit_code == 0 + print(copied.directory) project_path = copied.project_path + print(project_path) agent = copied.agent assert (project_path / f"src/{agent.answers.user['package_name']}").exists() env_file = ( @@ -28,8 +30,6 @@ def test_default_values(copier_fixture: CopierFixture): .read_text() .strip() ) - print(copied.get_config) - print(env_file) assert f"session={copied.get_config['session_cookie']}" in env_file _check_contents( project_path / "README.md", From 29773a55b4e3cfd9943e3f2f31032fb603bca668 Mon Sep 17 00:00:00 2001 From: Tyler Baur Date: Tue, 29 Aug 2023 10:27:08 -0500 Subject: [PATCH 05/10] ... --- tests/test_project_generation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_project_generation.py b/tests/test_project_generation.py index 9e3f42e..5dce494 100644 --- a/tests/test_project_generation.py +++ b/tests/test_project_generation.py @@ -19,11 +19,11 @@ def _check_contents( def test_default_values(copier_fixture: CopierFixture): copied = copier_fixture.copy() - assert copied.exit_code == 0 print(copied.directory) project_path = copied.project_path print(project_path) agent = copied.agent + assert copied.exit_code == 0 assert (project_path / f"src/{agent.answers.user['package_name']}").exists() env_file = ( (project_path / f"src/{agent.answers.user['package_name']}/.env") From 8f12f5c39dd9dd6ad66d5fbc234e8d11bc3be4a0 Mon Sep 17 00:00:00 2001 From: Tyler Baur Date: Tue, 29 Aug 2023 10:30:40 -0500 Subject: [PATCH 06/10] ... --- tests/test_project_generation.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_project_generation.py b/tests/test_project_generation.py index 5dce494..cd9c482 100644 --- a/tests/test_project_generation.py +++ b/tests/test_project_generation.py @@ -20,6 +20,8 @@ def _check_contents( def test_default_values(copier_fixture: CopierFixture): copied = copier_fixture.copy() print(copied.directory) + print(copied.exc) + print(copied.exit_code) project_path = copied.project_path print(project_path) agent = copied.agent From c025070f42a3a942ee5f57a190e9fc00f93003ae Mon Sep 17 00:00:00 2001 From: Tyler Baur Date: Tue, 29 Aug 2023 10:41:35 -0500 Subject: [PATCH 07/10] setup git in CI --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b363bc0..178b296 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,10 @@ jobs: matrix: python-version: ["3.10", "3.11"] steps: + - name: Setup Git + run: | + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions" - name: Checkout uses: actions/checkout@v3 - name: Setup Rye From e91c6dadbc75cf9d839f0f977be5259b291b1b67 Mon Sep 17 00:00:00 2001 From: Tyler Baur Date: Tue, 29 Aug 2023 10:45:42 -0500 Subject: [PATCH 08/10] don't capture output --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 178b296..031c44d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,4 +29,4 @@ jobs: - name: Sync Rye run: rye sync - name: Run Tests - run: rye run pytest -s + run: rye run pytest From 2a9c05b3067d7131481002b2c90db784dca765c0 Mon Sep 17 00:00:00 2001 From: Tyler Baur Date: Tue, 29 Aug 2023 10:59:04 -0500 Subject: [PATCH 09/10] add dependabot --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..20569f4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 3 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" From 5ac124fc5bd2da7c79c3877740a056296e8d15d6 Mon Sep 17 00:00:00 2001 From: Tyler Baur <49296311+baurt@users.noreply.github.com> Date: Tue, 29 Aug 2023 15:06:49 -0500 Subject: [PATCH 10/10] Update dependabot.yml --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 20569f4..53f34f5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,4 +1,4 @@ -version: 3 +version: 2 updates: - package-ecosystem: "pip" directory: "/"