File tree Expand file tree Collapse file tree 9 files changed +151
-1
lines changed Expand file tree Collapse file tree 9 files changed +151
-1
lines changed Original file line number Diff line number Diff line change @@ -157,4 +157,7 @@ cython_debug/
157
157
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158
158
# and can be added to the global gitignore or merged into this file. For a more nuclear
159
159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160
- # .idea/
160
+ .idea /
161
+
162
+ # Version file
163
+ /src /posit /_version.py
Original file line number Diff line number Diff line change
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version" : " 0.2.0" ,
6
+ "configurations" : [
7
+ {
8
+ "name" : " Python: Current File" ,
9
+ "type" : " python" ,
10
+ "request" : " launch" ,
11
+ "program" : " ${file}" ,
12
+ "console" : " integratedTerminal" ,
13
+ "justMyCode" : true
14
+ }
15
+ ]
16
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "python.testing.pytestArgs" : [
3
+ " src"
4
+ ],
5
+ "python.testing.unittestEnabled" : false ,
6
+ "python.testing.pytestEnabled" : true
7
+ }
Original file line number Diff line number Diff line change
1
+ PIP := " pip3"
2
+ PYTHON := " python3"
3
+
4
+ OPTIONS := if env (" DEBUG" , " false" ) == " true" {
5
+ " set -eoux pipefail"
6
+ } else {
7
+ " set -eou pipefail"
8
+ }
9
+
10
+ default :
11
+ #!/usr/bin/env bash
12
+ {{ OPTIONS }}
13
+
14
+ just clean
15
+ just deps
16
+ just test
17
+ just cov
18
+ just build
19
+
20
+ build :
21
+ #!/usr/bin/env bash
22
+ {{ OPTIONS }}
23
+
24
+ {{ PYTHON }} -m build
25
+
26
+
27
+ cov * args = " report":
28
+ #!/usr/bin/env bash
29
+ {{ OPTIONS }}
30
+
31
+ {{ PYTHON }} -m coverage {{ args }}
32
+
33
+ clean :
34
+ #!/usr/bin/env bash
35
+ {{ OPTIONS }}
36
+
37
+ find . -name " *.pyc" -exec rm -f {} +
38
+ find . -name " __pycache__" -exec rm -rf {} +
39
+ rm -rf\
40
+ .coverage\
41
+ .pytest_cache\
42
+ *.egg-info\
43
+ build\
44
+ dist\
45
+ htmlcov
46
+
47
+ deps :
48
+ #!/usr/bin/env bash
49
+ {{ OPTIONS }}
50
+
51
+ {{ PIP }} install -e ' .[test]'
52
+
53
+ test :
54
+ #!/usr/bin/env bash
55
+ {{ OPTIONS }}
56
+
57
+ {{ PYTHON }} -m coverage run --source=src --omit=_version.py -m pytest
58
+
59
+ version :
60
+ #!/usr/bin/env bash
61
+ {{ OPTIONS }}
62
+
63
+ {{ PYTHON }} -m setuptools_scm
Original file line number Diff line number Diff line change
1
+ [build-system ]
2
+ requires = [" setuptools>=60" , " setuptools-scm>=8.0" ]
3
+ build-backend = " setuptools.build_meta"
4
+
5
+ [project ]
6
+ name = " posit-sdk"
7
+ description = " Posit SDK for Python"
8
+ readme = " README.md"
9
+ requires-python = " >=3.8"
10
+ license = { file = " LICENSE" }
11
+ keywords = [" posit" , " sdk" ]
12
+ classifiers = [
13
+ " Development Status :: 1 - Planning" ,
14
+ " Intended Audience :: Developers" ,
15
+ " License :: OSI Approved :: MIT License" ,
16
+ " Programming Language :: Python :: 3" ,
17
+ " Topic :: Software Development :: Libraries" ,
18
+ " Typing :: Typed" ,
19
+ ]
20
+ dynamic = [" version" ]
21
+ dependencies = [
22
+ " requests==2.31.0"
23
+ ]
24
+
25
+ [project .optional-dependencies ]
26
+ test = [
27
+ " coverage" ,
28
+ " pytest" ,
29
+ " setuptools-scm"
30
+ ]
31
+
32
+ [project .urls ]
33
+ Source = " https://github.com/posit-dev/posit-sdk-py"
34
+ Issues = " https://github.com/posit-dev/posit-sdk-py/issues"
35
+
36
+ [tool .hatch .build .targets .wheel ]
37
+ packages = [" src/posit" ]
38
+
39
+ [tool .hatch .build .hooks .vcs ]
40
+ version-file = " src/posit/_version.py"
41
+
42
+ [tool .hatch .build .targets .sdist ]
43
+ exclude = [
44
+ " /.github" ,
45
+ " /.pytest_cache" ,
46
+ " /.vscode" ,
47
+ ]
48
+
49
+ [tool .setuptools_scm ]
50
+ version_file = " src/posit/_version.py"
Original file line number Diff line number Diff line change
1
+ def say_hello (msg : str ):
2
+ print (f"Hello, { msg } !" ) # noqa: T201
Original file line number Diff line number Diff line change
1
+ from unittest .mock import patch
2
+
3
+ from posit .say_hello import say_hello
4
+
5
+
6
+ def test_say_hello ():
7
+ with patch ("builtins.print" ) as mock_print :
8
+ say_hello ("World" )
9
+ mock_print .assert_called_once_with ("Hello, World!" )
You can’t perform that action at this time.
0 commit comments