diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a10dba..346524b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 diff --git a/copier.yml b/copier.yml index 2c99f3c..1590fde 100644 --- a/copier.yml +++ b/copier.yml @@ -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 \ No newline at end of file diff --git a/project_template/.github/workflows/cd.yml b/project_template/.github/workflows/cd.yml index addabaa..65114ca 100644 --- a/project_template/.github/workflows/cd.yml +++ b/project_template/.github/workflows/cd.yml @@ -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 @@ -51,3 +52,4 @@ jobs: with: # Remove this line to publish to PyPI repository-url: https://test.pypi.org/legacy/ +{%- endif %} \ No newline at end of file diff --git a/project_template/README.md b/project_template/README.md index 32c737a..11df56d 100644 --- a/project_template/README.md +++ b/project_template/README.md @@ -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 @@ -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}}