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

Small fixes in documentation #121

Merged
merged 5 commits into from
Sep 3, 2024
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: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This is a modern Cookiecutter template that can be used to initiate a Python pro
- CI/CD with [GitHub Actions](https://github.com/features/actions)
- Pre-commit hooks with [pre-commit](https://pre-commit.com/)
- Code quality with [ruff](https://github.com/charliermarsh/ruff), [mypy](https://mypy.readthedocs.io/en/stable/), [deptry](https://github.com/fpgmaas/deptry/) and [prettier](https://prettier.io/)
- Publishing to [Pypi](https://pypi.org) or [Artifactory](https://jfrog.com/artifactory) by creating a new release on GitHub
- Publishing to [PyPI](https://pypi.org) or [Artifactory](https://jfrog.com/artifactory) by creating a new release on GitHub
- Testing and coverage with [pytest](https://docs.pytest.org/en/7.1.x/) and [codecov](https://about.codecov.io/)
- Documentation with [MkDocs](https://www.mkdocs.org/)
- Compatibility testing for multiple versions of Python with [Tox](https://tox.wiki/en/latest/)
Expand All @@ -27,7 +27,7 @@ This is a modern Cookiecutter template that can be used to initiate a Python pro

<p align="center">
<a href="https://fpgmaas.github.io/cookiecutter-poetry/">Documentation</a> - <a href="https://github.com/fpgmaas/cookiecutter-poetry-example">Example</a> -
<a href="https://pypi.org/project/cookiecutter-poetry/">PyPi</a>
<a href="https://pypi.org/project/cookiecutter-poetry/">PyPI</a>
</p>

---
Expand Down Expand Up @@ -72,7 +72,7 @@ You are now ready to start development on your project! The CI/CD
pipeline will be triggered when you open a pull request, merge to main,
or when you create a new release.

To finalize the set-up for publishing to PyPi or Artifactory, see
To finalize the set-up for publishing to PyPI or Artifactory, see
[here](https://fpgmaas.github.io/cookiecutter-poetry/features/publishing/#set-up-for-pypi).
For activating the automatic documentation with MkDocs, see
[here](https://fpgmaas.github.io/cookiecutter-poetry/features/mkdocs/#enabling-the-documentation-on-github).
Expand Down
4 changes: 2 additions & 2 deletions docs/features/cicd.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ formatting.

`on-release-main.yml` does all of the former whenever a new release is
made on the `main` branch. In addition, `on-release-main.yml` also
publishes the project to Pypi or Artifactory if `publish_to` is set to
publishes the project to PyPI or Artifactory if `publish_to` is set to
`"pypi"` or `"artifactory"`, and it builds and deploys the documentation
if `mkdocs` is set to `"y"`. To learn more about these features,
see [Publishing to PyPi or Artifactory](./publishing.md) and [Documentation with MkDocs](./mkdocs.md)
see [Publishing to PyPI or Artifactory](./publishing.md) and [Documentation with MkDocs](./mkdocs.md)

Additionally, all workflows check for compatibility with multiple Python
versions if `tox` is set to `"y"`.
Expand Down
4 changes: 3 additions & 1 deletion docs/features/mkdocs.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ This command will generate and build your documentation, and start the server lo

## Enabling the documentation on GitHub

To enable your documentation on GitHub, first create a [new release](./cicd.md#how-to-trigger-a-release).
To enable your documentation on GitHub, first `Settings > Actions > General` under `Workflow permissions` select `Read and write permissions`

Then, create a [new release](./cicd.md#how-to-trigger-a-release) for your project.

Then, in your repository, navigate to `Settings > Code and Automation > Pages`. If you succesfully created a new release,
you should see a notification saying ` Your site is ready to be published at https://<author_github_handle>.github.io/<project_name>/`.
Expand Down
10 changes: 5 additions & 5 deletions docs/features/publishing.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Publishing to Pypi or Artifactory
# Publishing to PyPI or Artifactory

## Releasing from Github

When `publish_to` is set to `"pypi"` or `"artifactory"`, the
`on-release-main.yml` workflow publishes the code to
[Pypi](https://pypi.org) or [Artifactory](https://jfrog.com/artifactory)
[PyPI](https://pypi.org) or [Artifactory](https://jfrog.com/artifactory)
respectively whenever a [new release](./cicd.md#how-to-trigger-a-release) is made.

Before you can succesfully publish your project from the release workflow, you need to add some secrets to your github repository so
they can be used as environment variables.

## Set-up for Pypi
## Set-up for PyPI

In order to publish to Pypi, the secret `PYPI_TOKEN` should be set in
In order to publish to PyPI, the secret `PYPI_TOKEN` should be set in
your repository. In your Github repository, navigate to
`Settings > Secrets > Actions` and press `New repository secret`. As the
name of the secret, set `PYPI_TOKEN`. Then, in a new tab go to your
[Pypi Account settings](https://pypi.org/manage/account/) and select
[PyPI Account settings](https://pypi.org/manage/account/) and select
`Add API token`. Copy and paste the token in the `Value`
field for the Github secret in your first tab, and you're all set!

Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This is a modern Cookiecutter template that can be used to initiate a Python pro
- CI/CD with [GitHub Actions](https://github.com/features/actions)
- Pre-commit hooks with [pre-commit](https://pre-commit.com/)
- Code quality with [ruff](https://github.com/charliermarsh/ruff), [mypy](https://mypy.readthedocs.io/en/stable/), [deptry](https://github.com/fpgmaas/deptry/) and [prettier](https://prettier.io/)
- Publishing to [Pypi](https://pypi.org) or [Artifactory](https://jfrog.com/artifactory) by creating a new release on GitHub
- Publishing to [PyPI](https://pypi.org) or [Artifactory](https://jfrog.com/artifactory) by creating a new release on GitHub
- Testing and coverage with [pytest](https://docs.pytest.org/en/7.1.x/) and [codecov](https://about.codecov.io/)
- Documentation with [MkDocs](https://www.mkdocs.org/)
- Compatibility testing for multiple versions of Python with [Tox](https://tox.wiki/en/latest/)
Expand Down Expand Up @@ -70,7 +70,7 @@ You are now ready to start development on your project! The CI/CD
pipeline will be triggered when you open a pull request, merge to main,
or when you create a new release.

To finalize the set-up for publishing to PyPi or Artifactory, see [here](./features/publishing.md#set-up-for-pypi). For activating the automatic documentation with MkDocs, see [here](./features/mkdocs.md#enabling-the-documentation-on-github). To enable the code coverage reports, see [here](./features/codecov).
To finalize the set-up for publishing to PyPI or Artifactory, see [here](./features/publishing.md#set-up-for-pypi). For activating the automatic documentation with MkDocs, see [here](./features/mkdocs.md#enabling-the-documentation-on-github). To enable the code coverage reports, see [here](./features/codecov).

## Acknowledgements

Expand Down
2 changes: 1 addition & 1 deletion docs/prompt_arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ and unittests.
`Makefile` and Github workflows to make publishing your code as
simple as creating a new release release on Github. For more info,
see
[Publishing to Pypi or Artifactory](./features/publishing.md).
[Publishing to PyPI or Artifactory](./features/publishing.md).

**deptry**

Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ If you enabled code coverage with codecov for your project, you should sign up w

## Step 8: Configure your repository secrets

If you want to deploy your project to Pypi or Artifactory using the
If you want to deploy your project to PyPI or Artifactory using the
Github Actions, you will have to set some repository secrets. For
instructions on how to do that, see [here](./features/publishing.md#set-up-for-pypi) for PyPi, or
instructions on how to do that, see [here](./features/publishing.md#set-up-for-pypi) for PyPI, or
[here](./features/publishing.md#set-up-for-artifactory) for Artifactory.

## Step 9: Create a new release
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ nav:
- Linting & code quality: features/linting.md
- Makefile: features/makefile.md
- Dependency management with Poetry: features/poetry.md
- Publishing to PyPi or Artifactory: features/publishing.md
- Publishing to PyPI or Artifactory: features/publishing.md
- Testing with Pytest: features/pytest.md
- Test coverage with codecov: features/codecov.md
- Documentation with MkDocs: features/mkdocs.md
Expand Down
4 changes: 2 additions & 2 deletions {{cookiecutter.project_name}}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ make install
You are now ready to start development on your project!
The CI/CD pipeline will be triggered when you open a pull request, merge to main, or when you create a new release.

To finalize the set-up for publishing to PyPi or Artifactory, see [here](https://fpgmaas.github.io/cookiecutter-poetry/features/publishing/#set-up-for-pypi).
To finalize the set-up for publishing to PyPI or Artifactory, see [here](https://fpgmaas.github.io/cookiecutter-poetry/features/publishing/#set-up-for-pypi).
For activating the automatic documentation with MkDocs, see [here](https://fpgmaas.github.io/cookiecutter-poetry/features/mkdocs/#enabling-the-documentation-on-github).
To enable the code coverage reports, see [here](https://fpgmaas.github.io/cookiecutter-poetry/features/codecov/).
{% if cookiecutter.publish_to == "pypi" %}
## Releasing a new version

- Create an API Token on [Pypi](https://pypi.org/).
- Create an API Token on [PyPI](https://pypi.org/).
- Add the API Token to your projects secrets with the name `PYPI_TOKEN` by visiting [this page](https://github.com/{{cookiecutter.author_github_handle}}/{{cookiecutter.project_name}}/settings/secrets/actions/new).
- Create a [new release](https://github.com/{{cookiecutter.author_github_handle}}/{{cookiecutter.project_name}}/releases/new) on Github.
- Create a new tag in the form `*.*.*`.
Expand Down
Loading