symbex 1.4.1__tar.gz → 2.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,10 +1,10 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: symbex
3
- Version: 1.4.1
3
+ Version: 2.0
4
4
  Summary: Find the Python code for specified symbols
5
- Home-page: https://github.com/simonw/symbex
6
5
  Author: Simon Willison
7
- License: Apache License, Version 2.0
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/simonw/symbex
8
8
  Project-URL: Issues, https://github.com/simonw/symbex/issues
9
9
  Project-URL: CI, https://github.com/simonw/symbex/actions
10
10
  Project-URL: Changelog, https://github.com/simonw/symbex/releases
@@ -18,16 +18,7 @@ Requires-Dist: pytest-icdiff; extra == "test"
18
18
  Requires-Dist: cogapp; extra == "test"
19
19
  Requires-Dist: PyYAML; extra == "test"
20
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
21
+ Dynamic: license-file
31
22
 
32
23
  # Symbex
33
24
 
@@ -0,0 +1,32 @@
1
+ [project]
2
+ name = "symbex"
3
+ version = "2.0"
4
+ description = "Find the Python code for specified symbols"
5
+ readme = "README.md"
6
+ authors = [{name = "Simon Willison"}]
7
+ license = "Apache-2.0"
8
+ requires-python = ">=3.8"
9
+ dependencies = [
10
+ "click"
11
+ ]
12
+
13
+ [project.urls]
14
+ Homepage = "https://github.com/simonw/symbex"
15
+ Issues = "https://github.com/simonw/symbex/issues"
16
+ CI = "https://github.com/simonw/symbex/actions"
17
+ Changelog = "https://github.com/simonw/symbex/releases"
18
+
19
+ [project.scripts]
20
+ symbex = "symbex.cli:cli"
21
+
22
+ [project.optional-dependencies]
23
+ test = ["pytest", "pytest-icdiff", "cogapp", "PyYAML", "ruff"]
24
+
25
+ [build-system]
26
+ requires = ["setuptools"]
27
+ build-backend = "setuptools.build_meta"
28
+
29
+ [tool.setuptools.packages.find]
30
+ where = ["."]
31
+ include = ["symbex"]
32
+
@@ -538,11 +538,13 @@ def cli(
538
538
  )
539
539
 
540
540
  if sum(output_formats) == 0:
541
+ seen_imports = set()
541
542
  for item in stuff_to_output():
542
543
  if item.output_identifier_line:
543
544
  click.echo(item.output_identifier_line)
544
- if item.output_import_line:
545
+ if item.output_import_line and item.output_import_line not in seen_imports:
545
546
  click.echo(item.output_import_line)
547
+ seen_imports.add(item.output_import_line)
546
548
  click.echo(item.snippet)
547
549
  click.echo()
548
550
  else:
@@ -1,10 +1,10 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: symbex
3
- Version: 1.4.1
3
+ Version: 2.0
4
4
  Summary: Find the Python code for specified symbols
5
- Home-page: https://github.com/simonw/symbex
6
5
  Author: Simon Willison
7
- License: Apache License, Version 2.0
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/simonw/symbex
8
8
  Project-URL: Issues, https://github.com/simonw/symbex/issues
9
9
  Project-URL: CI, https://github.com/simonw/symbex/actions
10
10
  Project-URL: Changelog, https://github.com/simonw/symbex/releases
@@ -18,16 +18,7 @@ Requires-Dist: pytest-icdiff; extra == "test"
18
18
  Requires-Dist: cogapp; extra == "test"
19
19
  Requires-Dist: PyYAML; extra == "test"
20
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
21
+ Dynamic: license-file
31
22
 
32
23
  # Symbex
33
24
 
@@ -1,6 +1,6 @@
1
1
  LICENSE
2
2
  README.md
3
- setup.py
3
+ pyproject.toml
4
4
  symbex/__init__.py
5
5
  symbex/__main__.py
6
6
  symbex/cli.py
@@ -44,3 +44,30 @@ def test_output(extra_args, expected, expected_error):
44
44
  else:
45
45
  assert result.exit_code == 0
46
46
  assert result.output == expected
47
+
48
+
49
+ def test_output_class_with_methods():
50
+ runner = CliRunner()
51
+ with runner.isolated_filesystem():
52
+ open("symbex.py", "w").write(
53
+ "class Foo:\n"
54
+ " def bar(self):\n"
55
+ " pass\n"
56
+ " def baz(self):\n"
57
+ " pass\n"
58
+ )
59
+ result = runner.invoke(
60
+ cli,
61
+ ["*", "*.*", "--docs", "--imports", "-n"],
62
+ catch_exceptions=False,
63
+ )
64
+ assert result.exit_code == 0
65
+ assert result.output == (
66
+ "# from symbex import Foo\n"
67
+ "class Foo:\n"
68
+ "\n"
69
+ " def bar(self):\n"
70
+ "\n"
71
+ " def baz(self):\n"
72
+ "\n"
73
+ )
symbex-1.4.1/setup.py DELETED
@@ -1,37 +0,0 @@
1
- from setuptools import setup
2
- import os
3
-
4
- VERSION = "1.4.1"
5
-
6
-
7
- def get_long_description():
8
- with open(
9
- os.path.join(os.path.dirname(os.path.abspath(__file__)), "README.md"),
10
- encoding="utf8",
11
- ) as fp:
12
- return fp.read()
13
-
14
-
15
- setup(
16
- name="symbex",
17
- description="Find the Python code for specified symbols",
18
- long_description=get_long_description(),
19
- long_description_content_type="text/markdown",
20
- author="Simon Willison",
21
- url="https://github.com/simonw/symbex",
22
- project_urls={
23
- "Issues": "https://github.com/simonw/symbex/issues",
24
- "CI": "https://github.com/simonw/symbex/actions",
25
- "Changelog": "https://github.com/simonw/symbex/releases",
26
- },
27
- license="Apache License, Version 2.0",
28
- version=VERSION,
29
- packages=["symbex"],
30
- entry_points="""
31
- [console_scripts]
32
- symbex=symbex.cli:cli
33
- """,
34
- install_requires=["click"],
35
- extras_require={"test": ["pytest", "pytest-icdiff", "cogapp", "PyYAML", "ruff"]},
36
- python_requires=">=3.8",
37
- )
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