mirror of
https://github.com/simonw/dclient.git
synced 2026-09-27 12:24:13 +02:00
Initial library structure
This commit is contained in:
parent
ac7aaab22d
commit
56c4672f37
9 changed files with 311 additions and 85 deletions
41
README.md
41
README.md
|
|
@ -1,27 +1,40 @@
|
|||
# Template repository for creating new Python Click CLI tools
|
||||
# dclient
|
||||
|
||||
This GitHub [template repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/creating-a-repository-from-a-template) can be used to create a new repository with the skeleton of a Python [Click](https://click.palletsprojects.com/) CLI tool, based on the [click-app](https://github.com/simonw/click-app) cookiecutter.
|
||||
[](https://pypi.org/project/dclient/)
|
||||
[](https://github.com/simonw/dclient/releases)
|
||||
[](https://github.com/simonw/dclient/actions?query=workflow%3ATest)
|
||||
[](https://github.com/simonw/dclient/blob/master/LICENSE)
|
||||
|
||||
Start here: https://github.com/simonw/click-app-template-repository/generate
|
||||
A client CLI utility for Datasette instances
|
||||
|
||||
The name of your repository will be the name of the CLI tool, and also the name of the Python package that you publish to [PyPI](https://pypi.org/) - so make sure that name is not taken already!
|
||||
## Installation
|
||||
|
||||
Add a one-line description of your CLI tool, then click "Create repository from template".
|
||||
Install this tool using `pip`:
|
||||
|
||||

|
||||
pip install dclient
|
||||
|
||||
Once created, your new repository will execute a GitHub Actions workflow that uses cookiecutter to rewrite the repository to the desired state. This make take 30 seconds or so.
|
||||
## Usage
|
||||
|
||||
You can see an example of a repository generated using this template here:
|
||||
For help, run:
|
||||
|
||||
- https://github.com/simonw/click-app-template-repository-demo
|
||||
dclient --help
|
||||
|
||||
## GitHub Actions setup by this repository
|
||||
You can also use:
|
||||
|
||||
The `test.yml` GitHub Actions workflow will run your tests automatically any time you push a change to the repo.
|
||||
python -m dclient --help
|
||||
|
||||
The `publish.yml` Action runs when you create a new GitHub release. It can build and upload your package to [PyPI](https://pypi.org/).
|
||||
## Development
|
||||
|
||||
For this to work, you need to create an API token for your PyPI account and add that to your repository as a secret called `PYPI_TOKEN`.
|
||||
To contribute to this tool, first checkout the code. Then create a new virtual environment:
|
||||
|
||||
See [Publishing your library as a package to PyPI](https://github.com/simonw/click-app#publishing-your-library-as-a-package-to-pypi) for details.
|
||||
cd dclient
|
||||
python -m venv venv
|
||||
source venv/bin/activate
|
||||
|
||||
Now install the dependencies and test dependencies:
|
||||
|
||||
pip install -e '.[test]'
|
||||
|
||||
To run the tests:
|
||||
|
||||
pytest
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue