-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: rely on pypackage copier template for structure (#58)
- Loading branch information
Showing
14 changed files
with
163 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Changes here will be overwritten by Copier | ||
_commit: 0.1.5 | ||
_src_path: gh:12rambau/pypackage | ||
author_email: [email protected] | ||
author_first_name: Pierrick | ||
author_last_name: Rambaud | ||
author_orcid: 0000-0001-8764-5749 | ||
github_repo_name: pytest-copie | ||
github_user: 12rambau | ||
project_name: pytest-copie | ||
project_slug: pytest_copie | ||
short_description: The pytest plugin for your copier templates 📒 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: template update check | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 0 1 * *" # Run at 00:00 on the first day of each month | ||
|
||
jobs: | ||
check_version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: install dependencies | ||
run: pip install requests | ||
- name: get latest pypackage release | ||
id: get_latest_release | ||
run: | | ||
RELEASE=$(curl -s https://api.github.com/repos/12rambau/pypackage/releases | jq -r '.[0].tag_name') | ||
echo "latest=$RELEASE" >> $GITHUB_OUTPUT | ||
echo "latest release: $RELEASE" | ||
- name: get current pypackage version | ||
id: get_current_version | ||
run: | | ||
RELEASE=$(yq -r "._commit" .copier-answers.yml) | ||
echo "current=$RELEASE" >> $GITHUB_OUTPUT | ||
echo "current release: $RELEASE" | ||
- name: open issue | ||
if: steps.get_current_version.outputs.current != steps.get_latest_release.outputs.latest | ||
uses: rishabhgupta/git-action-issue@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
title: "Update template to ${{ steps.get_latest_release.outputs.latest }}" | ||
body: | | ||
The package is based on the ${{ steps.get_current_version.outputs.current }} version of [@12rambau/pypackage](https://github.com/12rambau/pypackage). | ||
The latest version of the template is ${{ steps.get_latest_release.outputs.latest }}. | ||
Please consider updating the template to the latest version to include all the latest developments. | ||
Run the following code in your project directory to update the template: | ||
``` | ||
copier update --trust --defaults --vcs-ref ${{ steps.get_latest_release.outputs.latest }} | ||
``` | ||
> **Note** | ||
> You may need to reinstall ``copier`` and ``jinja2-time`` if they are not available in your environment. | ||
After solving the merging issues you can push back the changes to your main branch. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Marker file for PEP 561. The mypy package uses inline types. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
__version__: str | ||
__author__: str | ||
__email__: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from dataclasses import dataclass | ||
from pathlib import Path | ||
from typing import Generator, Optional, Union | ||
|
||
@dataclass | ||
class Result: | ||
exception: Union[Exception, SystemExit, None] = ... | ||
exit_code: Union[str, int, None] = ... | ||
project_dir: Optional[Path] = ... | ||
answers: dict = ... | ||
def __repr__(self) -> str: ... | ||
def __init__(self, exception, exit_code, project_dir, answers) -> None: ... | ||
|
||
@dataclass | ||
class Copie: | ||
default_template_dir: Path | ||
test_dir: Path | ||
config_file: Path | ||
counter: int = ... | ||
def copy( | ||
self, extra_answers: dict = ..., template_dir: Optional[Path] = ... | ||
) -> Result: ... | ||
def __init__( | ||
self, default_template_dir, test_dir, config_file, counter | ||
) -> None: ... | ||
|
||
def _copier_config_file(tmp_path_factory) -> Path: ... | ||
def copie(request, tmp_path: Path, _copier_config_file: Path) -> Generator: ... | ||
def pytest_addoption(parser) -> None: ... | ||
def pytest_configure(config) -> None: ... |