Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.

Commit

Permalink
Fix deprecation issues with pyproject file (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitsalis authored Nov 26, 2023
1 parent 014d21c commit 82c0a2b
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 19 deletions.
6 changes: 3 additions & 3 deletions pycg/formats/fasten.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ def add_range(begin, end):
end = (val, True)
add_range(begin, end)

res.append(
{"forge": "PyPI", "product": req.name, "constraints": constraints}
)
res.append({
"forge": "PyPI", "product": req.name, "constraints": constraints
})

return res

Expand Down
6 changes: 3 additions & 3 deletions pycg/machinery/key_err.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ def __init__(self):
self.key_errs = []

def add(self, filename, lineno, namespace, key):
self.key_errs.append(
{"filename": filename, "lineno": lineno, "namespace": namespace, "key": key}
)
self.key_errs.append({
"filename": filename, "lineno": lineno, "namespace": namespace, "key": key
})

def get(self):
return self.key_errs
6 changes: 3 additions & 3 deletions pycg/pycg.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ def extract_state(self):

state["scopes"] = {}
for key, scope in self.scope_manager.get_scopes().items():
state["scopes"][key] = set(
[x.get_ns() for (_, x) in scope.get_defs().items()]
)
state["scopes"][key] = set([
x.get_ns() for (_, x) in scope.get_defs().items()
])

state["classes"] = {}
for key, ch in self.class_manager.get_classes().items():
Expand Down
14 changes: 6 additions & 8 deletions pycg/tests/scopes_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,12 @@ def get_lineno(self):

self.assertEqual(
sorted(items["functions"]),
sorted(
[
"root.chld1",
"root.chld1.grndchld2",
"root.chld2",
"root.chld3.grndchld4",
]
),
sorted([
"root.chld1",
"root.chld1.grndchld2",
"root.chld2",
"root.chld3.grndchld4",
]),
)
self.assertEqual(sorted(items["classes"]), sorted(["root.chld3"]))

Expand Down
18 changes: 17 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
[project]
name = "PyCG"
version = "0.0.7"
version = "0.0.8"

description = "PyCG - Practical Python Call Graphs"
readme = "README.md"
requires-python = ">=3.4"

licence = {file = "LICENCE"}
authors = [{name = "Vitalis Salis", email = "[email protected]"}]


classifiers = [
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
]

[project.optional-dependencies]
dev = ["flake8>=6.0.0", "isort>=5.12.0", "black>=22.12.0", "mock"]

[project.urls]
"Homepage" = "https://github.com/vitsalis/PyCG"
"Bug Tracker" = "https://github.com/vitsalis/PyCG/issues"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.black]
line-length = 88
target_version = ['py38', 'py39', 'py310']
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get_long_desc():
def setup_package():
setup(
name="pycg",
version="0.0.7",
version="0.0.8",
description="Practical Python Call Graphs",
long_description=get_long_desc(),
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 82c0a2b

Please sign in to comment.