python-toolbox-przemek 0.5.0__tar.gz → 0.6.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-toolbox-przemek
3
- Version: 0.5.0
3
+ Version: 0.6.0
4
4
  Summary: We want to provide basic tools for our day-to-day work.
5
5
  Author: przemek@sagalo.pro
6
6
  Requires-Python: <4,>=3.11
@@ -8,6 +8,7 @@ Description-Content-Type: text/markdown
8
8
  Requires-Dist: poetry==2.2.0
9
9
  Requires-Dist: pynvim==0.5.2
10
10
  Requires-Dist: debugpy==1.8.14
11
+ Requires-Dist: click==8.1.7
11
12
  Provides-Extra: lint
12
13
  Requires-Dist: black==24.2.0; extra == "lint"
13
14
  Requires-Dist: isort==5.13.2; extra == "lint"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-toolbox-przemek"
3
- version = "0.5.0"
3
+ version = "0.6.0"
4
4
  description = "We want to provide basic tools for our day-to-day work."
5
5
  authors = [
6
6
  {name = "przemek@sagalo.pro"}
@@ -12,7 +12,8 @@ requires-python = ">=3.11,<4"
12
12
  dependencies = [
13
13
  "poetry==2.2.0",
14
14
  "pynvim==0.5.2",
15
- "debugpy==1.8.14"
15
+ "debugpy==1.8.14",
16
+ "click==8.1.7"
16
17
  ]
17
18
 
18
19
  [project.optional-dependencies]
@@ -28,6 +29,9 @@ tests = [
28
29
  "pytest-datadir==1.8.0" # pytest plugin for test data directories and files - https://pypi.org/project/pytest-datadir/
29
30
  ]
30
31
 
32
+ [project.scripts]
33
+ generate_dap_config = "python_toolbox_przemek.dap_cli:generate_dap_config"
34
+
31
35
  [build-system]
32
36
  requires = ["setuptools >= 79.0.1"]
33
37
  build-backend = "setuptools.build_meta"
@@ -0,0 +1,74 @@
1
+ import click
2
+ from pathlib import Path
3
+
4
+ LUA = '''-- I use dap-python as I don't want to manually set `adapters.python`.
5
+ local dap_python = require('dap-python')
6
+
7
+ dap_python.setup(os.getenv('PYTHON_INTERPRETER_PATH'))
8
+
9
+ require('dap').configurations.python = {
10
+ {
11
+ type = 'python',
12
+ request = 'launch',
13
+ name = "Run current file",
14
+ program = '${file}',
15
+ justMyCode = false,
16
+ },
17
+ {
18
+ type = 'python',
19
+ request = 'launch',
20
+ name = 'pytest run current file',
21
+ module = 'pytest',
22
+ args = {'${file}', '--log-cli-level=DEBUG'},
23
+ justMyCode = false,
24
+ },
25
+ {
26
+ type = 'python',
27
+ request = 'launch',
28
+ name = 'pytest run current file on many cores',
29
+ module = 'pytest',
30
+ args = {'-n', 'auto', '${file}', '--log-cli-level=DEBUG'},
31
+ justMyCode = false,
32
+ },
33
+ {
34
+ type = 'python',
35
+ request = 'launch',
36
+ name = 'pytest run all unit tests',
37
+ module = 'pytest',
38
+ args = {'tests/test_unit/', '--log-cli-level=DEBUG'},
39
+ justMyCode = false,
40
+ },
41
+ {
42
+ type = 'python',
43
+ request = 'launch',
44
+ name = 'pytest run godm unit tests',
45
+ module = 'pytest',
46
+ args = {'tests/test_unit/test_godm/', '--log-cli-level=DEBUG'},
47
+ justMyCode = false,
48
+ },
49
+ {
50
+ type = 'python',
51
+ request = 'launch',
52
+ name = 'Run current file with arguments',
53
+ program = '${file}',
54
+ args = {'--arg1', 'value1', '--arg2', 'value2'},
55
+ },
56
+ }
57
+ '''
58
+
59
+
60
+ @click.command()
61
+ @click.option('--output', '-o', default='dap_config.lua', type=click.Path(), help='Output file path')
62
+ @click.option('--force', '-f', is_flag=True, help='Overwrite existing file if present')
63
+ def generate_dap_config(output, force):
64
+ """Generate a dap_config.lua file with recommended Python dap configurations."""
65
+ out = Path(output)
66
+ if out.exists() and not force:
67
+ click.echo(f"{out} already exists. Use --force to overwrite.")
68
+ raise click.Abort()
69
+ out.write_text(LUA)
70
+ click.echo(f"Wrote dap config to: {out}")
71
+
72
+
73
+ if __name__ == '__main__':
74
+ generate_dap_config()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-toolbox-przemek
3
- Version: 0.5.0
3
+ Version: 0.6.0
4
4
  Summary: We want to provide basic tools for our day-to-day work.
5
5
  Author: przemek@sagalo.pro
6
6
  Requires-Python: <4,>=3.11
@@ -8,6 +8,7 @@ Description-Content-Type: text/markdown
8
8
  Requires-Dist: poetry==2.2.0
9
9
  Requires-Dist: pynvim==0.5.2
10
10
  Requires-Dist: debugpy==1.8.14
11
+ Requires-Dist: click==8.1.7
11
12
  Provides-Extra: lint
12
13
  Requires-Dist: black==24.2.0; extra == "lint"
13
14
  Requires-Dist: isort==5.13.2; extra == "lint"
@@ -1,8 +1,10 @@
1
1
  README.md
2
2
  pyproject.toml
3
3
  src/python_toolbox_przemek/__init__.py
4
+ src/python_toolbox_przemek/dap_cli.py
4
5
  src/python_toolbox_przemek.egg-info/PKG-INFO
5
6
  src/python_toolbox_przemek.egg-info/SOURCES.txt
6
7
  src/python_toolbox_przemek.egg-info/dependency_links.txt
8
+ src/python_toolbox_przemek.egg-info/entry_points.txt
7
9
  src/python_toolbox_przemek.egg-info/requires.txt
8
10
  src/python_toolbox_przemek.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ generate_dap_config = python_toolbox_przemek.dap_cli:generate_dap_config
@@ -1,6 +1,7 @@
1
1
  poetry==2.2.0
2
2
  pynvim==0.5.2
3
3
  debugpy==1.8.14
4
+ click==8.1.7
4
5
 
5
6
  [lint]
6
7
  black==24.2.0