symbex 1.4__tar.gz → 1.4.1__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: symbex
3
- Version: 1.4
3
+ Version: 1.4.1
4
4
  Summary: Find the Python code for specified symbols
5
5
  Home-page: https://github.com/simonw/symbex
6
6
  Author: Simon Willison
@@ -10,10 +10,26 @@ Project-URL: CI, https://github.com/simonw/symbex/actions
10
10
  Project-URL: Changelog, https://github.com/simonw/symbex/releases
11
11
  Requires-Python: >=3.8
12
12
  Description-Content-Type: text/markdown
13
- Provides-Extra: test
14
13
  License-File: LICENSE
15
-
16
- # symbex
14
+ Requires-Dist: click
15
+ Provides-Extra: test
16
+ Requires-Dist: pytest; extra == "test"
17
+ Requires-Dist: pytest-icdiff; extra == "test"
18
+ Requires-Dist: cogapp; extra == "test"
19
+ Requires-Dist: PyYAML; extra == "test"
20
+ Requires-Dist: ruff; extra == "test"
21
+ Dynamic: author
22
+ Dynamic: description
23
+ Dynamic: description-content-type
24
+ Dynamic: home-page
25
+ Dynamic: license
26
+ Dynamic: project-url
27
+ Dynamic: provides-extra
28
+ Dynamic: requires-dist
29
+ Dynamic: requires-python
30
+ Dynamic: summary
31
+
32
+ # Symbex
17
33
 
18
34
  [![PyPI](https://img.shields.io/pypi/v/symbex.svg)](https://pypi.org/project/symbex/)
19
35
  [![Changelog](https://img.shields.io/github/v/release/simonw/symbex?include_prereleases&label=changelog)](https://github.com/simonw/symbex/releases)
@@ -22,7 +38,7 @@ License-File: LICENSE
22
38
 
23
39
  Find the Python code for specified symbols
24
40
 
25
- Read [symbex: search Python code for functions and classes, then pipe them into a LLM](https://simonwillison.net/2023/Jun/18/symbex/) for background on this project.
41
+ Read [Symbex: search Python code for functions and classes, then pipe them into a LLM](https://simonwillison.net/2023/Jun/18/symbex/) for background on this project.
26
42
 
27
43
  ## Installation
28
44
 
@@ -1,4 +1,4 @@
1
- # symbex
1
+ # Symbex
2
2
 
3
3
  [![PyPI](https://img.shields.io/pypi/v/symbex.svg)](https://pypi.org/project/symbex/)
4
4
  [![Changelog](https://img.shields.io/github/v/release/simonw/symbex?include_prereleases&label=changelog)](https://github.com/simonw/symbex/releases)
@@ -7,7 +7,7 @@
7
7
 
8
8
  Find the Python code for specified symbols
9
9
 
10
- Read [symbex: search Python code for functions and classes, then pipe them into a LLM](https://simonwillison.net/2023/Jun/18/symbex/) for background on this project.
10
+ Read [Symbex: search Python code for functions and classes, then pipe them into a LLM](https://simonwillison.net/2023/Jun/18/symbex/) for background on this project.
11
11
 
12
12
  ## Installation
13
13
 
@@ -1,7 +1,7 @@
1
1
  from setuptools import setup
2
2
  import os
3
3
 
4
- VERSION = "1.4"
4
+ VERSION = "1.4.1"
5
5
 
6
6
 
7
7
  def get_long_description():
@@ -396,7 +396,7 @@ def cli(
396
396
  for directory in directories:
397
397
  for path in pathlib.Path(directory).rglob("*.py"):
398
398
  # Skip if path is inside any of 'excludes'
399
- if any(is_subpath(path, exclude) for exclude in excludes):
399
+ if any(path.resolve().is_relative_to(exclude) for exclude in excludes):
400
400
  continue
401
401
  if path.is_file():
402
402
  yield path
@@ -601,14 +601,6 @@ def cli(
601
601
  filepath.write_text(new, "utf-8")
602
602
 
603
603
 
604
- def is_subpath(path: pathlib.Path, parent: pathlib.Path) -> bool:
605
- try:
606
- path.relative_to(parent)
607
- return True
608
- except ValueError:
609
- return False
610
-
611
-
612
604
  def is_dunder(name):
613
605
  return name.startswith("__") and name.endswith("__")
614
606
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: symbex
3
- Version: 1.4
3
+ Version: 1.4.1
4
4
  Summary: Find the Python code for specified symbols
5
5
  Home-page: https://github.com/simonw/symbex
6
6
  Author: Simon Willison
@@ -10,10 +10,26 @@ Project-URL: CI, https://github.com/simonw/symbex/actions
10
10
  Project-URL: Changelog, https://github.com/simonw/symbex/releases
11
11
  Requires-Python: >=3.8
12
12
  Description-Content-Type: text/markdown
13
- Provides-Extra: test
14
13
  License-File: LICENSE
15
-
16
- # symbex
14
+ Requires-Dist: click
15
+ Provides-Extra: test
16
+ Requires-Dist: pytest; extra == "test"
17
+ Requires-Dist: pytest-icdiff; extra == "test"
18
+ Requires-Dist: cogapp; extra == "test"
19
+ Requires-Dist: PyYAML; extra == "test"
20
+ Requires-Dist: ruff; extra == "test"
21
+ Dynamic: author
22
+ Dynamic: description
23
+ Dynamic: description-content-type
24
+ Dynamic: home-page
25
+ Dynamic: license
26
+ Dynamic: project-url
27
+ Dynamic: provides-extra
28
+ Dynamic: requires-dist
29
+ Dynamic: requires-python
30
+ Dynamic: summary
31
+
32
+ # Symbex
17
33
 
18
34
  [![PyPI](https://img.shields.io/pypi/v/symbex.svg)](https://pypi.org/project/symbex/)
19
35
  [![Changelog](https://img.shields.io/github/v/release/simonw/symbex?include_prereleases&label=changelog)](https://github.com/simonw/symbex/releases)
@@ -22,7 +38,7 @@ License-File: LICENSE
22
38
 
23
39
  Find the Python code for specified symbols
24
40
 
25
- Read [symbex: search Python code for functions and classes, then pipe them into a LLM](https://simonwillison.net/2023/Jun/18/symbex/) for background on this project.
41
+ Read [Symbex: search Python code for functions and classes, then pipe them into a LLM](https://simonwillison.net/2023/Jun/18/symbex/) for background on this project.
26
42
 
27
43
  ## Installation
28
44
 
@@ -89,6 +89,8 @@ def directory_full_of_code(tmpdir):
89
89
  ["baz", "-d", "nested.py", "-x", "nested.py/x/", "--silent"],
90
90
  "",
91
91
  ),
92
+ # -x to exclude top level directory
93
+ (["baz", "-x", "nested.py", "--silent"], ""),
92
94
  # Classes
93
95
  (
94
96
  ["MyClass", "--silent"],
@@ -164,10 +166,10 @@ def test_fixture(directory_full_of_code, monkeypatch, args, expected):
164
166
  'def baz(delimiter=", ", type=str):'
165
167
  ),
166
168
  ),
167
- # Test for the --module option
169
+ # Tests for the --module option
168
170
  (
169
- ["-m", "pathlib", "Path", "--silent", "-in"],
170
- ("# from pathlib import Path\nclass Path(PurePath):"),
171
+ ["-m", "contextlib", "suppress", "--silent", "-sn"],
172
+ ("class suppress(AbstractContextManager):"),
171
173
  ),
172
174
  ),
173
175
  )
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes