Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
ric-evans committed May 31, 2024
1 parent 87bbe7e commit 2823fd4
Showing 1 changed file with 82 additions and 22 deletions.
104 changes: 82 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,23 @@ setting `git_committer_name` and `git_committer_email`.

In order to use the action, a few files need to have the following:

1. Client repo provides:
- Python package source code
- GitHub Action package, see [GitHub Action YAML](#github-action-yaml) and its [inputs](#inputs)
- `setup.py` with `setuptools.setup()`,
*this is the entire file:*
```
from setuptools import setup # type: ignore[import]
setup()
```
- **Note:** a `pyproject.toml` file is not needed since it will be autogenerated. However, if one does already
exist (
ie. the most common scenario), then sections and/or attributes will be inserted. Any conflicting
sections/attributes will be overwritten.
2. Run as GitHub Action
3. Source code updates are committed and pushed by the `github-actions` bot (by default)
### GitHub Action YAML
```
Expand Down Expand Up @@ -59,7 +76,6 @@ The following are inputted to the GitHub Action package in its `with` block:
| `keywords` | Space-separated list of keywords | required if `pypi_name==True` | (see left) |
| `author` | Author of the package | required if `pypi_name==True` | (see left) |
| `author_email` | Email of the package's author | required if `pypi_name==True` | (see left) |
| `license` | Repository's license type | False | `MIT` |
| `git_committer_name` | Name used for `git config user.name` | False | `github-actions` |
| `git_committer_email` | Email used for `git config user.email` | False | `[email protected]` |
Expand All @@ -69,31 +85,53 @@ There are several [input attributes](#inputs). However, these broadly can be gro
[PyPI enabled](#outputs-for-pypi-enabled-packages)
and [non-PyPI enabled](#outputs-for-non-pypi-enabled-packages).
1. Client repo provides:
- Python package source code
- GitHub Action package [inputs](#inputs)
- `setup.py` with `setuptools.setup()`,
*this is the entire file:*
```
from setuptools import setup # type: ignore[import]
setup()
```
- **Note:** a `pyproject.toml` file is not needed since it will be autogenerated. However, if one does already
exist (
ie. the most common scenario), then sections and/or attributes will be inserted. Any conflicting
sections/attributes will be overwritten.
2. Run as GitHub Action
3. This GitHub Action package autogenerates...
### Outputs for PyPI-Enabled Packages
When the `pypi_name` input is `True` and other relevant inputs are given (see [inputs](#inputs)), the following is
autogenerated:
- `pyproject.toml` with all the original, non-conflicting sections *plus*:
```
# TODO
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
version = "1.2.3"
name = "wipac-dev-tools"
description = "Common, basic, and reusable development tools"
readme = "README.md"
keywords = ["WIPAC", "python", "tools", "utilities"]
classifiers = ["Development Status :: 5 - Production/Stable", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12"]
requires-python = ">=3.8, <3.13"
[[project.authors]]
name = "WIPAC Developers"
email = "[email protected]"
[project.license]
file = "LICENSE"
[project.urls]
Homepage = "https://pypi.org/project/wipac-dev-tools/"
Tracker = "https://github.com/WIPACrepo/wipac-dev-tools/issues"
Source = "https://github.com/WIPACrepo/wipac-dev-tools"
[tool.semantic_release]
version_toml = ["pyproject.toml:project.version"]
commit_parser = "emoji"
[tool.semantic_release.commit_parser_options]
major_tags = ["[major]"]
minor_tags = ["[minor]", "[feature]"]
patch_tags = ["[patch]", "[fix]", " ", "!", "#", "$", "%", "&", "'", "(", ")", "*", "+", "-", ".", "/", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", "=", ">", "?", "@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "]", "^", "_", "`", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "{", "|", "}", "~"]
[tool.setuptools.package-data]
"*" = ["py.typed"]
[tool.setuptools.packages.find]
namespaces = false
exclude = ["test", "tests", "doc", "docs", "resource", "resources", "example", "examples"]
```
- `README.md` prepended with hyperlink-embedded badges:
+ [![CircleCI](https://img.shields.io/circleci/build/github/WIPACrepo/wipac-dev-tools)](https://app.circleci.com/pipelines/github/WIPACrepo/wipac-dev-tools?branch=main&filter=all) [![PyPI](https://img.shields.io/pypi/v/wipac-dev-tools)](https://pypi.org/project/wipac-dev-tools/) [![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/WIPACrepo/wipac-dev-tools?include_prereleases)](https://github.com/WIPACrepo/wipac-dev-tools/) [![PyPI - License](https://img.shields.io/pypi/l/wipac-dev-tools)](https://github.com/WIPACrepo/wipac-dev-tools/blob/main/LICENSE) [![Lines of code](https://img.shields.io/tokei/lines/github/WIPACrepo/wipac-dev-tools)](https://github.com/WIPACrepo/wipac-dev-tools/) [![GitHub issues](https://img.shields.io/github/issues/WIPACrepo/wipac-dev-tools)](https://github.com/WIPACrepo/wipac-dev-tools/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aopen) [![GitHub pull requests](https://img.shields.io/github/issues-pr/WIPACrepo/wipac-dev-tools)](https://github.com/WIPACrepo/wipac-dev-tools/pulls?q=is%3Apr+sort%3Aupdated-desc+is%3Aopen)
Expand All @@ -113,8 +151,30 @@ The following is autogenerated for the absolute minimal input (see [inputs](#inp
- `pyproject.toml` with all the original, non-conflicting sections *plus*:
```
# TODO
```
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
version = "1.2.3"
name = "wipac-dev-tools"

[tool.semantic_release]
version_toml = ["pyproject.toml:project.version"]
commit_parser = "emoji"

[tool.semantic_release.commit_parser_options]
major_tags = ["[major]"]
minor_tags = ["[minor]", "[feature]"]
patch_tags = ["[patch]", "[fix]", " ", "!", "#", "$", "%", "&", "'", "(", ")", "*", "+", "-", ".", "/", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", "=", ">", "?", "@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "]", "^", "_", "`", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "{", "|", "}", "~"]

[tool.setuptools.package-data]
"*" = ["py.typed"]

[tool.setuptools.packages.find]
namespaces = false
exclude = ["test", "tests", "doc", "docs", "resource", "resources", "example", "examples"]
```
- `README.md` prepended with hyperlink-embedded badges (*note the lack of PyPI badges*):
+ [![CircleCI](https://img.shields.io/circleci/build/github/WIPACrepo/wipac-dev-tools)](https://app.circleci.com/pipelines/github/WIPACrepo/wipac-dev-tools?branch=main&filter=all) [![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/WIPACrepo/wipac-dev-tools?include_prereleases)](https://github.com/WIPACrepo/wipac-dev-tools/) [![Lines of code](https://img.shields.io/tokei/lines/github/WIPACrepo/wipac-dev-tools)](https://github.com/WIPACrepo/wipac-dev-tools/) [![GitHub issues](https://img.shields.io/github/issues/WIPACrepo/wipac-dev-tools)](https://github.com/WIPACrepo/wipac-dev-tools/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aopen) [![GitHub pull requests](https://img.shields.io/github/issues-pr/WIPACrepo/wipac-dev-tools)](https://github.com/WIPACrepo/wipac-dev-tools/pulls?q=is%3Apr+sort%3Aupdated-desc+is%3Aopen)
+ Note: The CircleCI badge is only auto-generated if the client repo uses CircleCI.
Expand All @@ -135,4 +195,4 @@ packages:
- This bumps the client package dependencies' versions in `dependencies.log` (and similar files)
1. [`python-semantic-release/python-semantic-release` _(
source)_](https://python-semantic-release.readthedocs.io/en/latest/)
- This will make a new GitHub Release and a PyPI Release (if not disabled with `patch_without_tag = False`).
- This will make a new GitHub Release and a PyPI Release (if not disabled with `patch_without_tag = False`).

0 comments on commit 2823fd4

Please sign in to comment.