Skip to content

Commit

Permalink
add codecov and pypi options
Browse files Browse the repository at this point in the history
  • Loading branch information
phinate committed Aug 1, 2024
1 parent ecb4781 commit 42d7ac3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ jobs:
-d backend=setuptools \
-d typing=${{ matrix.typing }} \
-d coc=our_coc \
-d pypi=yes_pypi \
-d codecov=true \
--vcs-ref HEAD \
. my-project
- name: Check generated project installs with pip
Expand Down Expand Up @@ -86,6 +88,8 @@ jobs:
-d backend=setuptools \
-d typing=${{ matrix.typing }} \
-d coc=our_coc \
-d pypi=yes_pypi \
-d codecov=true \
--vcs-ref HEAD \
. my-project
- name: Run formatting checks
Expand Down
12 changes: 12 additions & 0 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,15 @@ coc:
choices:
"I'll use/modify the basic Code of Conduct.": our_coc
"I'll write my own Code of Conduct.": their_coc

pypi:
type: str
help: Would you like to upload your package to PyPI?
choices:
"No/I'll configure it myself when I'm ready.": no_pypi
"Yes, I'll upload it.": yes_pypi

codecov:
type: bool
help: Would you like to upload your coverage report to Codecov?
default: true
4 changes: 3 additions & 1 deletion project_template/.github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ jobs:

- name: Check products
run: pipx run twine check dist/*


{%- if pypi == "yes_pypi" %}
publish:
needs: [dist]
name: Publish to PyPI
Expand All @@ -51,3 +52,4 @@ jobs:
with:
# Remove this line to publish to PyPI
repository-url: https://test.pypi.org/legacy/
{%- endif %}
20 changes: 10 additions & 10 deletions project_template/README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
# {{ project_name }}

[![Actions Status][actions-badge]][actions-link]
{% if pypi == "yes_pypi" -%}
[![PyPI version][pypi-version]][pypi-link]
[![PyPI platforms][pypi-platforms]][pypi-link]

{%- endif %}
{% if codecov -%}
[![Codecov][codecov-badge]][codecov-link]
{%- endif %}
{{ project_short_description }}

## Installation

{% if pypi == "yes_pypi" -%}
```bash
python -m pip install {{ python_name }}
```
{%- endif %}

From source:
{% if backend == "poetry" -%}
```bash
git clone {{ url }}
cd {{ project_name }}
poetry install
```
{% else -%}

```bash
git clone {{ url }}
cd {{ project_name }}
python -m pip install .
```
{%- endif %}

## Usage


Expand All @@ -45,4 +43,6 @@ Distributed under the terms of the [{{ license }} license](LICENSE).
[pypi-link]: https://pypi.org/project/{{project_name}}/
[pypi-platforms]: https://img.shields.io/pypi/pyversions/{{project_name}}
[pypi-version]: https://img.shields.io/pypi/v/{{project_name}}
[codecov-badge]: https://codecov.io/gh/{{org}}/{{project_name}}/branch/main/graph/badge.svg
[codecov-link]: https://codecov.io/gh/{{org}}/{{project_name}}
<!-- prettier-ignore-end -->

0 comments on commit 42d7ac3

Please sign in to comment.