Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: habnabit/tahoe-depgraph
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: tahoe-lafs/tahoe-depgraph
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 5 commits
  • 2 files changed
  • 3 contributors

Commits on Sep 13, 2019

  1. Copy the full SHA
    842f8e8 View commit details
  2. Clean up newlines

    exarkun committed Sep 13, 2019
    Copy the full SHA
    c8a3bcc View commit details

Commits on Apr 13, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8495b4f View commit details

Commits on Jul 3, 2020

  1. Copy the full SHA
    c3a12ec View commit details

Commits on Jul 8, 2020

  1. Merge pull request #1 from tahoe-lafs/new-ported-modules-location

    Support Python 3, and work with new module-based port listing.
    itamarst authored Jul 8, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    72bdfd9 View commit details
Showing with 15 additions and 8 deletions.
  1. +1 −1 README.rst
  2. +14 −7 tahoe-depgraph.py
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ tahoe-depgraph
==============

`View the generated graph on github pages.
<https://habnabit.github.io/tahoe-depgraph/>`_
<https://tahoe-lafs.github.io/tahoe-depgraph/>`_

A little thing based on `Toby Dickenson's py2depgraph
<http://www.tarind.com/py2depgraph.py>`_ for determining the dependency tree of
21 changes: 14 additions & 7 deletions tahoe-depgraph.py
Original file line number Diff line number Diff line change
@@ -60,7 +60,8 @@ def import_module(self, partnam, fqname, parent):
self._depgraph[last_caller.__name__].add(fqname)
return r

def load_module(self, fqname, fp, pathname, (suffix, mode, type)):
def load_module(self, fqname, fp, pathname, additional_info):
(suffix, mode, type) = additional_info
r = modulefinder.ModuleFinder.load_module(
self, fqname, fp, pathname, (suffix, mode, type))
if r is not None:
@@ -71,7 +72,7 @@ def as_json(self):
return {
'depgraph': {
name: dict.fromkeys(deps, 1)
for name, deps in self._depgraph.iteritems()},
for name, deps in self._depgraph.items()},
'types': self._types,
}

@@ -101,19 +102,25 @@ def main(target):
filepath = path
moduleNames.append(reflect.filenameToModuleName(filepath))

with tempfile.NamedTemporaryFile() as tmpfile:
with tempfile.NamedTemporaryFile("w") as tmpfile:
for moduleName in moduleNames:
tmpfile.write('import %s\n' % moduleName)
tmpfile.flush()
mf.run_script(tmpfile.name)

with open('tahoe-deps.json', 'wb') as outfile:
with open('tahoe-deps.json', 'w') as outfile:
json_dump(mf.as_json(), outfile)
outfile.write('\n')

# no port status yet
port_status = {}
with open('tahoe-ported.json', 'wb') as outfile:
ported_modules_path = os.path.join(target, "src", "allmydata", "util", "_python3.py")
with open(ported_modules_path) as f:
ported_modules = {}
exec(f.read(), ported_modules, ported_modules)
port_status = dict.fromkeys(
ported_modules["PORTED_MODULES"] + ported_modules["PORTED_TEST_MODULES"],
"ported"
)
with open('tahoe-ported.json', 'w') as outfile:
json_dump(port_status, outfile)
outfile.write('\n')