-
Notifications
You must be signed in to change notification settings - Fork 0
Add initial setup for copier and add readme #9
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
28ab2e7
copy and paste Readme from cookiecutter
ahms5 b1541fa
migrate to copier
ahms5 b52e243
add tests
ahms5 77e532d
add initital test for testing the readme
ahms5 7e7c0af
Updated tests in the test_copier.py file
h-chmeruk 845af71
refer to help page for failed installation
ahms5 7fbb9da
parametrize the test readme file
ahms5 8435b7e
harmonize strings
ahms5 356d6f9
revert deleting other tests and init file
ahms5 633198f
revise copier.yml
ahms5 e052f79
add getting started parameter and fix refer to the correct contributi…
ahms5 4e8778f
fix ruff
ahms5 11a883e
Update copier.yml
ahms5 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,35 @@ | ||
| project_slug: | ||
| type: str | ||
| help: "The slug of the project (used in package names, etc.)" | ||
|
|
||
| project_long_description: | ||
| type: str | ||
| help: "A long description of the project. It will be added to the README.md of this project" | ||
| default: "" | ||
|
|
||
| project_getting_started: | ||
| type: str | ||
| help: "A short description of how to get started with the project" | ||
|
|
||
| git_username: | ||
| type: str | ||
| help: "The GitHub username or organization name" | ||
| default: "pyfar" | ||
|
|
||
| logo_path_gallery: | ||
| type: str | ||
| help: "What is the path to the logo image for the pyfar gallery?" | ||
| default: "resources/logos/pyfar_logos_fixed_size_{{ project_slug }}.png" | ||
|
|
||
| minimum_python_version: | ||
| type: str | ||
| help: "The minimum Python version required" | ||
| choices: | ||
| - "3.9" | ||
| - "3.10" | ||
| - "3.11" | ||
| - "3.12" | ||
| - "3.13" | ||
| - "3.14" | ||
|
|
||
| _subdirectory: "template" |
This file contains hidden or 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 hidden or 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,28 @@ | ||||||||||
| <h1 align="center"> | ||||||||||
| <img src="https://github.com/pyfar/gallery/raw/main/docs/{{ logo_path_gallery }}" width="300"> | ||||||||||
| </h1><br> | ||||||||||
|
|
||||||||||
| [](https://badge.fury.io/py/{{ project_slug }}) | ||||||||||
| [](https://{{ project_slug }}.readthedocs.io/en/latest/?badge=latest) | ||||||||||
| [ }}.svg?style=shield)](https://circleci.com/gh/{{ git_username }}/{{ project_slug | replace("_", "-") }}) | ||||||||||
| [](https://mybinder.org/v2/gh/pyfar/gallery/main?labpath=docs/gallery/interactive/pyfar_introduction.ipynb) | ||||||||||
|
||||||||||
| [](https://mybinder.org/v2/gh/pyfar/gallery/main?labpath=docs/gallery/interactive/pyfar_introduction.ipynb) | |
| {% if binder_url %} | |
| []({{ binder_url }}) | |
| {% endif %} |
ahms5 marked this conversation as resolved.
Show resolved
Hide resolved
ahms5 marked this conversation as resolved.
Show resolved
Hide resolved
This file contains hidden or 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,11 @@ | ||
| import pytest | ||
|
|
||
| @pytest.fixture(scope='session') | ||
| def copier_project_defaults(): | ||
| return { | ||
| "project_slug": "my_project", | ||
| "project_long_description": "my_project_description", | ||
| "project_getting_started": "This is how to get started.", | ||
| "git_username": "pyfar", | ||
| "minimum_python_version": "3.11", | ||
| } |
This file contains hidden or 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,37 @@ | ||
| import pytest | ||
|
|
||
|
|
||
| def test_project_folder(copie, copier_project_defaults): | ||
ahms5 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| project_defaults = copier_project_defaults | ||
| project = copie.copy(extra_answers=project_defaults) | ||
|
|
||
| assert project.exit_code == 0 | ||
| assert project.exception is None | ||
| assert project.project_dir.is_dir() | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("file_name", [ | ||
| "README.md", | ||
| ]) | ||
| def test_generated_file_exists(copie, copier_project_defaults, file_name): | ||
ahms5 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| project = copie.copy(extra_answers=copier_project_defaults) | ||
|
|
||
| assert project.project_dir.joinpath(file_name).exists() | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("desired", [ | ||
| "\nmy_project_description\n", | ||
| "pip install my_project", | ||
| "https://circleci.com/gh/pyfar/my-project", | ||
| "main/docs/resources/logos/pyfar_logos_fixed_size_my_project.png", | ||
| "Python 3.11 or higher", | ||
| "py/my_project.svg", | ||
ahms5 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "https://my_project.readthedocs.io/en/stable/contributing.html", | ||
| "\nThis is how to get started.\n", | ||
| ]) | ||
| def test_content_readme(copie, copier_project_defaults, desired): | ||
ahms5 marked this conversation as resolved.
Show resolved
Hide resolved
ahms5 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| project = copie.copy(extra_answers=copier_project_defaults) | ||
|
|
||
| content = project.project_dir.joinpath("README.md").read_text() | ||
| assert desired in content | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.