kattis-cli 1.0.2__py3-none-any.whl → 1.0.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
kattis_cli/main.py CHANGED
@@ -1,5 +1,13 @@
1
- """ Main module for the kattis_cli package."""
2
- __version__ = '1.0.2'
1
+ """ Main module for the kattis_cli package.
2
+ This is the main.py file for the kattis_cli package.
3
+
4
+ Change the contents here instead of main.py.
5
+ build.sh script copies the contents of this file to main.py.
6
+
7
+ Change the __version__ to match in pyproject.toml
8
+ Has to be higher than the pypi version.
9
+ """
10
+ __version__ = '1.0.3'
3
11
 
4
12
  from math import inf
5
13
  from typing import Tuple
@@ -15,10 +23,12 @@ import kattis_cli.kattis_setup as kattis_setup
15
23
 
16
24
 
17
25
  @click.group()
26
+ @click.version_option(version=__version__, prog_name='kattis-cli')
18
27
  def main() -> None:
19
28
  """
20
29
  CLI for downloading, testing and submitting Kattis problems.
21
30
  """
31
+ pass
22
32
 
23
33
 
24
34
  @main.command(help='Download sample data & metadata.')
@@ -34,7 +44,7 @@ def get(problemid: str) -> None:
34
44
  except requests.exceptions.InvalidURL:
35
45
  console.print(
36
46
  f"""Sample data for Problem ID: [bold blue]
37
- {problemid}[/bold blue] not found.")
47
+ {problemid}[/bold blue] not found.")
38
48
  """)
39
49
  console.print(
40
50
  f"Downloading metadata: [bold blue]{problemid}[/bold blue]")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kattis-cli
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: A command-line tool for Kattis
5
5
  Home-page: https://github.com/rambasnet/kattis-cli
6
6
  Author: Ram Basnet
@@ -75,21 +75,25 @@ If you've Python version 3.8 or higher, you can skip creating virtual environmen
75
75
  ```bash
76
76
  pip install kattis-cli
77
77
  python -m pip install kattis-cli
78
+ kattis --version
78
79
  ```
79
80
 
80
81
  - on Windows add the path shown in the output of the above command to your PATH environment variable
81
82
 
82
-
83
- ## Update Kattis-CLI
83
+ ## Update/Upgrade Kattis-CLI
84
84
 
85
85
  - remove or rename **.kattis-cli.toml** file in your home directory
86
86
  - activate virtual environment if you've created one for kattis-cli
87
87
 
88
88
  ```bash
89
+ kattis --version
89
90
  pip install kattis-cli --upgrade
90
91
  python -m pip install kattis-cli --upgrade
91
92
  ```
92
93
 
94
+ - on Windows add the path shown in the output of the above command to your PATH environment variable
95
+
96
+
93
97
  ## Kattis configuration
94
98
 
95
99
  - run the following command and enter your Kattis credentials
@@ -113,13 +117,13 @@ kattis --help
113
117
  - problem id can be found in the last part of the URL of the problem
114
118
  - example: [https://open.kattis.com/problems/cold](https://open.kattis.com/problems/cold) => problem id: **cold**
115
119
 
116
- ![Problem id](images/problemid.png)
120
+ ![Problem id](./images/problemid.png)
117
121
 
118
122
  ```bash
119
123
  kattis get <problem_id>
120
124
  ```
121
125
 
122
- ![Get problem id from URL](images/kattis_get.png)
126
+ ![Get problem id from URL](./images/kattis_get.png)
123
127
 
124
128
  ### Display problem metadata
125
129
 
@@ -128,10 +132,12 @@ cd <problem_id>
128
132
  kattis info
129
133
  ```
130
134
 
131
- ![Problem info](images/kattis_info.png)
135
+ ![Problem info](./images/kattis_info.png)
132
136
 
133
137
  ### Test a solution locally
134
138
 
139
+ ![Test](images/kattis_test.png)
140
+
135
141
  - currently the following languages have been tested: Python 3, C++, NodeJS, C, Java
136
142
  - make sure CLI compilers are in your PATH
137
143
  - make sure python3 files have first line shebang: !/usr/bin/env python3
@@ -141,10 +147,20 @@ kattis info
141
147
 
142
148
  ```bash
143
149
  cd <problem_id>
144
- kattis test
150
+ kattis test # for exact comparion of answers (string and int)
151
+ kattis test -a 6 # Answer accepted upto 6 decimal places of accuracy
152
+ ```
153
+
154
+ ### Testing floating point results
155
+
156
+ - for floating point ouput, problem provides the tolerance or accuracy upto certain decimal points
157
+ - one can use `-a <N>` switch after kattis test command to provide the decimal places of accuracy
158
+ - e.g., the following command checks for accuracy upto 6 decimal points or absolute error upto $10^-6$
159
+
160
+ ```bash
161
+ kattis test -a 6
145
162
  ```
146
163
 
147
- ![Test](images/kattis_test.png)
148
164
 
149
165
  ### Submit a problem
150
166
 
@@ -3,7 +3,7 @@ kattis_cli/__init__.py,sha256=afN92pog2fGyicY6KNBofYbCBYbYj4Fpi_INUSpsc-E,402
3
3
  kattis_cli/download.py,sha256=aa0hBg_6Ou8SGrufgkNUjfWEHdmiu7U-W4d-yWHZNOA,5877
4
4
  kattis_cli/kattis.py,sha256=t5fog-tx1f1GeM-D3aa2YhuhxTnai_kV-x7miZbs6SI,13767
5
5
  kattis_cli/kattis_setup.py,sha256=rq_-Fz8oafxFJ8MOcxJqHQT8-bezgVHZXY2hm4EQF3U,4357
6
- kattis_cli/main.py,sha256=LDUUdG0eqiKL_zJX9V05OaqUIXKrOOwVAWOgN4TWWQQ,4121
6
+ kattis_cli/main.py,sha256=hTr63pQfRXxxIL-4G6EZ1g6qDFgaPd8PI35850PL0vs,4461
7
7
  kattis_cli/settings.py,sha256=d5q4dYj9VqDSqPalleh2oZWtND-1bPB0T2IwdajFrBg,591
8
8
  kattis_cli/test_solution.py,sha256=KKYedt3ISQYLIoahLPgPizpApLQnOrBhmkew5aHW9BM,6627
9
9
  kattis_cli/ui.py,sha256=dI06yncjm8sdLQkupPxGRODvQ6Gbawwuqn-67FrWg6I,2682
@@ -11,8 +11,8 @@ kattis_cli/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
11
11
  kattis_cli/utils/config.py,sha256=cr5ssEVWolDbqP8krts0YSK5vSLatKTveeHBRNsLRC8,2277
12
12
  kattis_cli/utils/run_program.py,sha256=NWQ6vtTeWgkaW75r91FIHGXR5cAbeu8yMb5hwzpYFsg,2613
13
13
  kattis_cli/utils/utility.py,sha256=JkypTfPOlDSxmZsh7KKcAVG2BC58t66corMBtcdvU7E,10532
14
- kattis_cli-1.0.2.dist-info/LICENSE,sha256=JmBa4SEKBCDWEgiOZcISU4tUCpli6xSpVlSYgkBXSNQ,1067
15
- kattis_cli-1.0.2.dist-info/METADATA,sha256=TImOazyOs7tJWBf_E-NP9x3-_InVey2bnqBxhjJMGOs,5961
16
- kattis_cli-1.0.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
17
- kattis_cli-1.0.2.dist-info/entry_points.txt,sha256=kyzGN20VqUPR_H0J_jJUKT-10-cAMFLVegQ6C7tbHss,47
18
- kattis_cli-1.0.2.dist-info/RECORD,,
14
+ kattis_cli-1.0.3.dist-info/LICENSE,sha256=JmBa4SEKBCDWEgiOZcISU4tUCpli6xSpVlSYgkBXSNQ,1067
15
+ kattis_cli-1.0.3.dist-info/METADATA,sha256=pOGeql7dMWdo0fVMb6N2TMYcb3zEHgq4a1aDDyzmfGw,6598
16
+ kattis_cli-1.0.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
17
+ kattis_cli-1.0.3.dist-info/entry_points.txt,sha256=kyzGN20VqUPR_H0J_jJUKT-10-cAMFLVegQ6C7tbHss,47
18
+ kattis_cli-1.0.3.dist-info/RECORD,,