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

github actions #2

Merged
merged 10 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
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 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
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
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cpython@3.11.3
3.11.5
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
8 changes: 5 additions & 3 deletions tests/test_project_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@ def _check_contents(

def test_default_values(copier_fixture: CopierFixture):
copied = copier_fixture.copy()
assert copied.exit_code == 0
print(copied.directory)
print(copied.exc)
print(copied.exit_code)
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")
.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",
Expand Down