Giter Site home page Giter Site logo

ronaldoussoren / altgraph Goto Github PK

View Code? Open in Web Editor NEW
20.0 20.0 7.0 589 KB

altgraph is a fork of graphlib: a graph (network) package for constructing graphs, BFS and DFS traversals, topological sort, shortest paths, etc. with graphviz output. altgraph includes some additional usage of Python 2.3+ features and enhancements related to modulegraph and macholib.

Home Page: https://altgraph.readthedocs.io/en/latest/

License: Other

Python 100.00%
graph python

altgraph's People

Contributors

etrepum avatar hugovk avatar pombredanne avatar ronaldoussoren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

altgraph's Issues

Minor v0.17.4 issues

A few minor problems I noticed when looking at fc154b5:

  • The commit removes u prefixes, presumably breaking Python 2 support - that's kinda to be expected, but the classifiers in setup.cfg still claim Python 2 support (might also want to remove 3.4-3.7 while at it?)
  • The release seems to be missing from the release history

Get rid of setuptools as a runtime dependency

pkg_resources is provided by setuptools:

__version__ = pkg_resources.require("altgraph")[0].version

The stdlib’s replacement for this line would be

from importlib.metadata import version

 __version__ = version("altgraph")

If you want to be compatible with Python <3.8, you could do:

try:
    from importlib.metadata import version
except ImportError:  # Python <3.8
    from importlib_metadata import version

 __version__ = version("altgraph")

which would use this conditional dependency: importlib-metadata; python_version < '3.8'

You could also just do #12 instead. Flit sources the metadata version from a version string in __init__.py so this would just become __version__ = '0.17.4'

Wrong README filename

Original report by Anonymous.


setup.cfg contain:
long_description_file = ReadMe.txt doc/changelog.rst

But
$ ls
altgraph altgraph_tests doc PKG-INFO setup.cfg
altgraph.egg-info distribute_setup.py MANIFEST.in README.txt setup.py

ReadMe.txt != README.txt

Use GitHub Actions for CI

  • At least add automatic testing for the tip of the tree, consider adding testing of PRs as well.

  • Investigate automatic releases to PyPI for tagged releases.

Py2app 0.14 doesn't work with wxPython

Original report by Hamish McIntyre-Bhatty (Bitbucket: hamishmb, GitHub: hamishmb).


Hi,

Python version: 2.7.14
Py2app version: 0.14
macOS version: 10.13 and 10.9

I was having serious trouble today trying to package a new version of one of my programs, and then realised py2app had been updated since I last packaged for macOS. The wxPython wx.App object wasn't being created properly, and I would get an undefined global variable error every time I tried to access it.

Downgrading to v 0.13 fixed the issue, so I'll package with that for now.

Do you need any more information?

Hamish

0.7.1 cannot be installed from release tarball

Original report by Joshua Root (Bitbucket: jmroot, GitHub: jmroot).


% python2.6 setup.py
Traceback (most recent call last):
  File "setup.py", line 31, in <module>
    LONG_DESCRIPTION += open('doc/changelog.rst', 'rU').read()
IOError: [Errno 2] No such file or directory: 'doc/changelog.rst'

Installing from hg works, but the doc directory is not included in the tarball on pypi.

Switch from setuptools to flit

altgraph currently uses setuptools, use flit instead.

Doing this is easy enough, but requires dropping python 2 support and I don't know when I'll do that.

Version 0.14 complies apps that fail to open on MacOS 10.10.5

Original report by Kris Kringle (Bitbucket: kriskringle101, ).


Using py2app 0.14 installed through pip 9.0.1 python 3.6.3 MacOSX 10.10.5

For simplicity sake I am using the tkinter hello world example:

#hello.py
import tkinter
from tkinter.constants import *

tk = tkinter.Tk()
frame = tkinter.Frame(tk, relief=RIDGE, borderwidth=2)
frame.pack(fill=BOTH,expand=1)
label = tkinter.Label(frame, text="Hello, World")
label.pack(fill=X, expand=1)
button = tkinter.Button(frame,text="Exit",command=tk.destroy)
button.pack(side=BOTTOM)
tk.mainloop()

I run py2applet --make-setup hello.py which makes a setup file

"""
This is a setup.py script generated by py2applet

Usage:
python setup.py py2app
"""

from setuptools import setup

APP = ['hello.py']
DATA_FILES = []
OPTIONS = {}

setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)

I then run python setup.py py2app -A to develop in Alias mode and it makes the build and dist folders.

Now, no matter how I try to open the application (double click or via terminal) it fails with a hello Error and gives two options. Open Console or Terminate

Looking at console, there is only one line that pops up from the error.

It reads, hello: hello Error.

That is it. I have tried adding the 'argv_emulation': True to the setup.py OPTIONS No change. I have tried it in deployment mode. No change. Also, whatever I name the program is the name of the error. If I were to name the program test, it would fail with test Error

What am I missing to get this going?

Graph._bfs_subgraph and back_bfs_subgraph return subgraphs with reversed edges

Original report by pombredanne NA (Bitbucket: pombredanne, GitHub: pombredanne).


If I call back_bfs_subgraph on a graph: A -> B -> C starting from C, the returned graph will be A <-- B <-- C .
I would have expected no edge reversal and to get A -> B -> C

#!python

>>>import altgraph
>>> graph = altgraph.Graph.Graph()
>>> graph.add_node('A')
>>> graph.add_node('B')
>>> graph.add_node('C')
>>> graph.add_edge('A', 'B')
>>> graph.add_edge('B', 'C')
>>> ls = graph.forw_topo_sort()
>>> print(ls)
(True, ['A', 'B', 'C'])
>>> subgraph = graph.back_bfs_subgraph('C')
>>> ls = subgraph.forw_topo_sort()
>>> print(ls)
(True, ['C', 'B', 'A'])

Python 3.12: AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?

Hello,

Trying to use pyinstaller on windows 11 and python 3.12.
Got next exception:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\valeriyi\AppData\Local\pypoetry\Cache\virtualenvs\pg-device-config-server-SeUiqVb2-py3.12\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
  File "C:\Users\valeriyi\AppData\Local\pypoetry\Cache\virtualenvs\pg-device-config-server-SeUiqVb2-py3.12\Lib\site-packages\PyInstaller\__main__.py", line 228, in _console_script_run
    run()
  File "C:\Users\valeriyi\AppData\Local\pypoetry\Cache\virtualenvs\pg-device-config-server-SeUiqVb2-py3.12\Lib\site-packages\PyInstaller\__main__.py", line 170, in run
    parser = generate_parser()
             ^^^^^^^^^^^^^^^^^
  File "C:\Users\valeriyi\AppData\Local\pypoetry\Cache\virtualenvs\pg-device-config-server-SeUiqVb2-py3.12\Lib\site-packages\PyInstaller\__main__.py", line 136, in generate_parser
    import PyInstaller.building.build_main
  File "C:\Users\valeriyi\AppData\Local\pypoetry\Cache\virtualenvs\pg-device-config-server-SeUiqVb2-py3.12\Lib\site-packages\PyInstaller\building\build_main.py", line 28, in <module>
    from PyInstaller.building.api import COLLECT, EXE, MERGE, PYZ
  File "C:\Users\valeriyi\AppData\Local\pypoetry\Cache\virtualenvs\pg-device-config-server-SeUiqVb2-py3.12\Lib\site-packages\PyInstaller\building\api.py", line 32, in <module>
    from PyInstaller.building.splash import Splash  # argument type validation in EXE
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\valeriyi\AppData\Local\pypoetry\Cache\virtualenvs\pg-device-config-server-SeUiqVb2-py3.12\Lib\site-packages\PyInstaller\building\splash.py", line 23, in <module>
    from PyInstaller.depend import bindepend
  File "C:\Users\valeriyi\AppData\Local\pypoetry\Cache\virtualenvs\pg-device-config-server-SeUiqVb2-py3.12\Lib\site-packages\PyInstaller\depend\bindepend.py", line 25, in <module>
    from PyInstaller.depend import dylib, utils
  File "C:\Users\valeriyi\AppData\Local\pypoetry\Cache\virtualenvs\pg-device-config-server-SeUiqVb2-py3.12\Lib\site-packages\PyInstaller\depend\utils.py", line 31, in <module>
    from PyInstaller.lib.modulegraph import modulegraph
  File "C:\Users\valeriyi\AppData\Local\pypoetry\Cache\virtualenvs\pg-device-config-server-SeUiqVb2-py3.12\Lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 34, in <module>
    from altgraph.ObjectGraph import ObjectGraph
  File "C:\Users\valeriyi\AppData\Local\pypoetry\Cache\virtualenvs\pg-device-config-server-SeUiqVb2-py3.12\Lib\site-packages\altgraph\__init__.py", line 142, in <module>
    import pkg_resources
  File "C:\Users\valeriyi\AppData\Local\pypoetry\Cache\virtualenvs\pg-device-config-server-SeUiqVb2-py3.12\Lib\site-packages\pkg_resources\__init__.py", line 2158, in <module>
    register_finder(pkgutil.ImpImporter, find_on_path)
                    ^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?

The root cause is from here:

importlib.abc.Finder, pkgutil.ImpImporter, and pkgutil.ImpLoader have been removed. (Contributed by Barry Warsaw in gh-98040.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.