Skip to content

Commit 7f9524f

Browse files
authored
Merge pull request #58 from chkware/docs/update-zipapp
Docs/update zipapp
2 parents e577828 + 3c52be7 commit 7f9524f

9 files changed

Lines changed: 348 additions & 207 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
- name: Set up Node
1717
uses: actions/setup-node@v3
1818
with:
19-
node-version: 16.x
19+
node-version: 18.x
2020

2121
- name: Cache dependencies
22-
uses: actions/cache@v2
22+
uses: actions/cache@v3
2323
with:
2424
path: |
2525
**/node_modules

.github/workflows/test-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
- name: Set up Node
1717
uses: actions/setup-node@v3
1818
with:
19-
node-version: 16.x
19+
node-version: 18.x
2020

2121
- name: Cache dependencies
22-
uses: actions/cache@v2
22+
uses: actions/cache@v3
2323
with:
2424
path: |
2525
**/node_modules

docs/introduction.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ title: Introduction
44

55
![CHKware | Low-code API quality testing, and automation toolbox](./assets/github-hero-01.png)
66

7-
87
*CHKware* (pronounced as */check:ware/*) is a low-code API testing tool, a script-able HTTP client, and an API test automation tool for the API era.
98

109
It is available as a command-line application. You write test specification files in a [YAML](https://yaml.org/)-based [DSL](https://en.wikipedia.org/wiki/Domain-specific_language). In that specification file you will define some structured configurations to be used for the following purpose:
1110

12-
- Create reusable http request specification. [alpha]
13-
- Create reusable test specifications. [alpha]
11+
- Create reusable http request specification.
12+
- Create reusable test specifications.
1413

1514
Afterward, you run those test specification files with *CHKware*, and get test results or even reuse them.
1615

1716
---
17+
1818
### Motivation
1919

2020
In today's world, API is one of the key fuels that drive business. It is the way web applications consume services from self-hosted or 3rd-party vendors. Recent technology movements are going to a fluid internet direction, where *vendor_A* have one API, *vendor_B* is another API provider, while we are the consumers (e-commerce, fin-tech) of those vendor APIs. We use those APIs to host our contents based on those APIs. Maybe we are *vendor_U* hosting more complex APIs on top of those. So, with the upcoming complexity of integration we need better tooling for API testing. Testing tools for modularize api testing.
@@ -63,5 +63,5 @@ There is no native binary dependency, therefore it is expected on all the platfo
6363

6464
Command name | Specification document | Stability
6565
---|---|---
66-
`http`| Http | _alpha_
67-
`testcase`| Testcase | _alpha_
66+
`chk http`| Http | *alpha*
67+
`chk testcase`| Testcase | *alpha*

docs/setup.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ pipx upgrade chk
2323
```
2424

2525
Otherwise, if _pip_ was used to install then same process given above should work for upgrade as well.
26+
27+
Alternatively, chkware tool can be build and use as a zipapp, [following this instruction](/setup/build-zipapp).

docs/setup/build-wheel.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
title: Pypi release process
3+
---
4+
5+
Follow the steps to do a manual release on PyPi.
6+
7+
- Please confirm that [Python 3.11.x](https://www.python.org/downloads) with [Pipenv](https://pipenv.pypa.io/en/latest/#install-pipenv-today) is installed and setup on this machine
8+
9+
- Clone the repo
10+
11+
```bash
12+
git clone https://github.com/chkware/cli.git cli-wheel
13+
```
14+
15+
- Change to the directory
16+
17+
```bash
18+
cd cli-wheel
19+
```
20+
21+
- Update version number on `setup.cfg`
22+
23+
```ini
24+
version = 0.X.X
25+
```
26+
27+
- Update version number on `chk/console/main.py`
28+
29+
```python
30+
"""v0.X.X | supported version strings: 0.7.2, ..."""
31+
```
32+
33+
- Update *docs/CHANGELOG.md* with the release *0.X.X* information
34+
35+
- Make directory for local *virtualenv* setup
36+
37+
```bash
38+
mkdir ./.venv
39+
```
40+
41+
- Install all required packages
42+
43+
```bash
44+
pipenv install
45+
```
46+
47+
- Install all required packages for build and push to PyPI
48+
49+
```bash
50+
pipenv run pip install -U build twine
51+
```
52+
53+
- Use the environment's python to build
54+
55+
```bash
56+
pipenv run python -m build --wheel --sdist
57+
```
58+
59+
- Push the packages to PyPi. This setup will require your PyPi username and password. So, make sure to setup an account, and have permission to push setup ready on the `chk` package repository.
60+
61+
```bash
62+
pipenv run twine upload dist/*
63+
```
64+
65+
- Publish and push an annotated tag
66+
67+
```bash
68+
git tag -a v0.X.X -m "..."
69+
git push -u origin v0.X.X
70+
```
71+
72+
- [_OPTIONAL_] [build a zipapp](build-zipapp.md), and release a version
73+
74+
A new version is release.

docs/setup/build-zipapp.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: Build cli zipapp
3+
---
4+
5+
CHKware `zipapp` is a self contained executable alike utility that once build can be used from anywhere. However, it have python version dependency.
6+
7+
Follow these steps to bundle `chkware` as [zipapp](https://docs.python.org/3/library/zipapp.html).
8+
9+
- Please confirm that [Python 3.11.x](https://www.python.org/downloads) is installed and setup on this machine
10+
11+
- Clone the repo
12+
13+
```bash
14+
git clone https://github.com/chkware/cli.git cli-zip
15+
```
16+
17+
- Change to the directory
18+
19+
```bash
20+
cd cli-zip
21+
```
22+
23+
- Make directory for local _virtualenv_ setup
24+
25+
```bash
26+
python -m venv .venv
27+
```
28+
29+
- Switch to the _virtualenv_
30+
31+
```bash
32+
source .venv/bin/activate
33+
```
34+
35+
or on windows
36+
37+
```bash
38+
.venv/Scripts/activate.bat
39+
```
40+
41+
- Install all required packages
42+
43+
```bash
44+
pip install -U -r requirements.txt
45+
```
46+
47+
- Install shiv for building the zipapp
48+
49+
```bash
50+
pip install -U shiv
51+
```
52+
53+
- Use the environment's python to build the zipapp. Refer to shiv [documentation](https://shiv.readthedocs.io/en/latest/#:~:text=let%E2%80%99s%20break%20this%20command%20down%2C) for further explanation.
54+
55+
```bash
56+
python -m shiv -c chk -o chk.pyz .
57+
```
58+
59+
- `chk.pyz` is generated in the project folder. You can move it to anywhere on your machine, and put it on your machine's environment variable or `$PATH`. Then, use it as follows:
60+
61+
```bash
62+
chk.pyz http tests/resources/storage/sample_config/xkcd-joke.chk
63+
```

0 commit comments

Comments
 (0)