Merge pull request 'Uses flit and pyproject.toml' (#7) from pyproject into main

Reviewed-on: #7
pull/8/head
Micke Nordin 6 months ago
commit 2346c2de2e

@ -3,11 +3,15 @@
This is a commandline tool for knotapi: https://gitlab.nic.cz/knot/knot-dns-rest
## Build and install
To install using pip, run the following command:
To install using pip, run the following command in a virtual envrionment.
```
pip3 install git+https://code.smolnet.org/micke/knotctl
python -m pip install "knotctl @ git+https://code.smolnet.org/micke/knotctl
```
To build and install as a deb-package
```
sudo apt install python3-stdeb
git clone https://code.smolnet.org/micke/knotctl
@ -18,25 +22,34 @@ sudo dpkg -i deb_dist/knotctl_*_all.deb
A prebuilt deb-package is also available from the release page: https://code.smolnet.org/micke/knotctl/releases/
## Shell completion
For bash: add this to .bashrc
```
source <(knotctl completion)
```
For fish, run:
```
knotctl completion --shell fish > ~/.config/fish/completions/knotctl.fish
```
For tcsh: add this to .cshrc
```
complete "knotctl" 'p@*@`python-argcomplete-tcsh "knotctl"`@' ;
```
For zsh: add this to .zshrc
```
autoload -U bashcompinit
bashcompinit
source <(knotctl completion)
```
## Usage
```
usage: knotctl [-h] [--json | --no-json]
{add,completion,config,delete,list,update} ...
@ -48,7 +61,9 @@ options:
-h, --help show this help message and exit
--json, --no-json
```
### ADD
```
usage: knotctl add [-h] -d DATA -n NAME -r RTYPE [-t TTL] -z ZONE
@ -60,7 +75,9 @@ options:
-t TTL, --ttl TTL
-z ZONE, --zone ZONE
```
### COMPLETION
```
usage: knotctl completion [-h] [-s SHELL]
@ -68,7 +85,9 @@ options:
-h, --help show this help message and exit
-s SHELL, --shell SHELL
```
### CONFIG
```
usage: knotctl config [-h] [-c CONTEXT] [-b BASEURL] [-p PASSWORD] [-u USERNAME]
@ -79,7 +98,9 @@ options:
-p PASSWORD, --password PASSWORD
-u USERNAME, --username USERNAME
```
### DELETE
```
usage: knotctl delete [-h] [-d DATA] [-n NAME] [-r RTYPE] -z ZONE
@ -90,7 +111,9 @@ options:
-r RTYPE, --rtype RTYPE
-z ZONE, --zone ZONE
```
### LIST
```
usage: knotctl list [-h] [-d DATA] [-n NAME] [-r RTYPE] [-z ZONE]
@ -101,7 +124,9 @@ options:
-r RTYPE, --rtype RTYPE
-z ZONE, --zone ZONE
```
### UPDATE
```
usage: knotctl update [-h] -a [ARGUMENT ...] -d DATA -n NAME -r RTYPE [-t TTL]
-z ZONE

@ -0,0 +1,37 @@
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"
[project]
name="knotctl"
description="A CLI for knotapi."
authors = [
{name = "Micke Nordin", email = "hej@mic.ke"},
]
license= { file="LICENSE" }
readme= "README.md"
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
]
requires-python= ">=3.9"
version = "0.0.7"
dependencies = [
"argcomplete==2.0.0",
"pyyaml==6.0.1",
"requests==2.27.1",
"simplejson==3.17.6",
]
[project.urls]
Source="https://code.smolnet.org/micke/knotctl"
Documentation = "https://code.smolnet.org/micke/knotctl"
[project.scripts]
knotctl="knotctl:main"
[tool.flit.sdist]
include = ["LICENSE",]

@ -1,4 +1,4 @@
argcomplete==2.0.0
pyyaml==5.4.1
pyyaml==6.0.1
requests==2.27.1
simplejson==3.17.6

@ -1,26 +0,0 @@
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="knotctl",
version="0.0.7",
packages=setuptools.find_packages(),
author="Micke Nordin",
author_email="hej@mic.ke",
description="A cli for knotapi.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://code.smolnet.org/micke/knotctl",
project_urls={
"Bug Tracker": "https://code.smolnet.org/micke/knotctl/issues",
},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GPL-3.0",
"Operating System :: OS Independent",
],
python_requires=">=3.9",
scripts=["scripts/knotctl"],
)
Loading…
Cancel
Save