Skip to content

Commit

Permalink
py-dot: updated to 2.0.0
Browse files Browse the repository at this point in the history
2.0.0 (2023-12-30)
------------------

Changed:
- Broken parsing caused by `pyparsing` updates fixed.
  With this, the pydot project rises from the dead.
- (Internal) CI revived by @ferdnyc.
  Modernized and clarified the development process.
  Testing is done against multiple Python versions.
- Reorganized package/module structure.
  The `pydot` package is installed as a directory now instead of as
  two modules:

      Before (pydot 0.x, 1.x)    After (pydot 2.x)

      site-packages/             site-packages/
      |-- pydot.py               `-- pydot/
      `-- dot_parser.py              |-- __init__.py
                                     |-- core.py
                                     |-- dot_parser.py
                                     `-- exceptions.py

  This is mostly an internal change that should go unnoticed by most
  users, especially those upgrading through `pip` or a software
  distribution. `import pydot` should work as it did before.
  Special cases:
  - `import dot_parser` no longer works. Change it to
    `from pydot import dot_parser` or see if you can use the wrappers
    `pydot.graph_from_dot_data()` or `pydot.graph_from_dot_file()`.

    **USER FEEDBACK REQUESTED**
    We assume pydot users do not often directly `import dot_parser`.
    If you do, please report your reasons, so that we can consider
    making it available again before the final release of pydot 2.0:
    pydot/pydot#230

  - If you use pydot from a (cloned) pydot source tree:
    - The pydot source modules moved from the top directory to
      subdirectory `src/pydot/`.
    - When using a `PYTHONPATH` environment variable: Append `/src`,
      e.g. `PYTHONPATH=~/Development/pydot/src`. If you need to switch
      between pydot 1.x and pydot 2.x, add both, e.g.
      `PYTHONPATH=~/Development/pydot/src:~/Development/pydot`
    - When using an editable install (development mode): Re-run
      `pip install -e .` from the top directory of the source tree to
      update the links.
  - For users of the test suite:
    - The test suite no longer refuses to run from the top of the
      source tree.
    - This makes the test suite option `--no-check` redundant. It has
      no effect except for printing a deprecation warning. It will be
      removed in a future major release (pydot 3 or higher), then
      leading to an error.
- Reorganized exception hierarchy:
  - New base class `PydotException`, derived from Python's `Exception`.
  - Pydot's `Error` exception class is now derived from `PydotException`
    instead of from Python's built-in `Exception` directly. Existing
    handlers should not be affected.
  - Exception class `InvocationException` was removed. It has not been
    raised by pydot since 2016 (v1.2.0).

- API (minor): Renamed the first parameter of the parser functions
  listed below from `str` to `s`. These functions primarily exist for
  internal use and would normally be called using positional arguments,
  so few users should be affected.
      push_top_graph_stmt(s, loc, toks)
      push_graph_stmt(s, loc, toks)
      push_subgraph_stmt(s, loc, toks)
      push_default_stmt(s, loc, toks)
      push_attr_list(s, loc, toks)
      push_edge_stmt(s, loc, toks)

Deprecated:
- Test suite option `--no-check`. See "Reorganized package/module
  structure" above.

Removed:
- Drop support for Python 2 and Python < 3.7.
  **USER FEEDBACK REQUESTED**
  ~~We are considering if pydot 2.0 should drop support for Python 3.5
  and 3.6 as well. If this would affect you, please leave a comment in
  pydot/pydot#268
  EDIT: This was decided to be done, with a lot of time passed since this entry.
  • Loading branch information
adam committed Feb 6, 2024
1 parent f5d5e6a commit 569d10d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 22 deletions.
17 changes: 11 additions & 6 deletions graphics/py-dot/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# $NetBSD: Makefile,v 1.13 2022/07/20 22:16:56 wiz Exp $
# $NetBSD: Makefile,v 1.14 2024/02/06 21:40:08 adam Exp $

DISTNAME= pydot-1.4.2
DISTNAME= pydot-2.0.0
PKGNAME= ${PYPKGPREFIX}-${DISTNAME:S/py//}
PKGREVISION= 1
CATEGORIES= graphics python
MASTER_SITES= ${MASTER_SITE_PYPI:=p/pydot/}

Expand All @@ -11,12 +10,18 @@ HOMEPAGE= https://github.com/erocarrera/pydot
COMMENT= Python interface to Graphviz's Dot language
LICENSE= mit

TOOL_DEPENDS+= ${PYPKGPREFIX}-setuptools-[0-9]*:../../devel/py-setuptools
TOOL_DEPENDS+= ${PYPKGPREFIX}-wheel-[0-9]*:../../devel/py-wheel
DEPENDS+= graphviz-[0-9]*:../../graphics/graphviz
DEPENDS+= ${PYPKGPREFIX}-pyparsing-[0-9]*:../../devel/py-pyparsing
DEPENDS+= ${PYPKGPREFIX}-pyparsing>=3:../../devel/py-pyparsing
TEST_DEPENDS+= ${PYPKGPREFIX}-chardet-[0-9]*:../../converters/py-chardet

USE_LANGUAGES= # none

PYTHON_VERSIONS_INCOMPATIBLE= 27

USE_LANGUAGES= # none
do-test:
cd ${WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHONBIN} test/pydot_unittest.py

.include "../../lang/python/egg.mk"
.include "../../lang/python/wheel.mk"
.include "../../mk/bsd.pkg.mk"
30 changes: 18 additions & 12 deletions graphics/py-dot/PLIST
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
@comment $NetBSD: PLIST,v 1.3 2017/07/14 15:33:19 adam Exp $
${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
${PYSITELIB}/${EGG_INFODIR}/requires.txt
${PYSITELIB}/${EGG_INFODIR}/top_level.txt
${PYSITELIB}/dot_parser.py
${PYSITELIB}/dot_parser.pyc
${PYSITELIB}/dot_parser.pyo
${PYSITELIB}/pydot.py
${PYSITELIB}/pydot.pyc
${PYSITELIB}/pydot.pyo
@comment $NetBSD: PLIST,v 1.4 2024/02/06 21:40:08 adam Exp $
${PYSITELIB}/${WHEEL_INFODIR}/LICENSE
${PYSITELIB}/${WHEEL_INFODIR}/METADATA
${PYSITELIB}/${WHEEL_INFODIR}/RECORD
${PYSITELIB}/${WHEEL_INFODIR}/WHEEL
${PYSITELIB}/${WHEEL_INFODIR}/top_level.txt
${PYSITELIB}/pydot/__init__.py
${PYSITELIB}/pydot/__init__.pyc
${PYSITELIB}/pydot/__init__.pyo
${PYSITELIB}/pydot/core.py
${PYSITELIB}/pydot/core.pyc
${PYSITELIB}/pydot/core.pyo
${PYSITELIB}/pydot/dot_parser.py
${PYSITELIB}/pydot/dot_parser.pyc
${PYSITELIB}/pydot/dot_parser.pyo
${PYSITELIB}/pydot/exceptions.py
${PYSITELIB}/pydot/exceptions.pyc
${PYSITELIB}/pydot/exceptions.pyo
8 changes: 4 additions & 4 deletions graphics/py-dot/distinfo
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$NetBSD: distinfo,v 1.9 2021/10/26 10:46:45 nia Exp $
$NetBSD: distinfo,v 1.10 2024/02/06 21:40:08 adam Exp $

BLAKE2s (pydot-1.4.2.tar.gz) = fe8cb3414e115da64b1333bd30b603c063636b03fc7282ae2a7b0b960bb9393d
SHA512 (pydot-1.4.2.tar.gz) = 1027833dd0adff475082db87675cb0f0f045d2a2a32d6020c3cfb9460e859d107fd89b2f0857d1ec431aa034c077fbf0d21b305be0d788f371142bca38c515ed
Size (pydot-1.4.2.tar.gz) = 137681 bytes
BLAKE2s (pydot-2.0.0.tar.gz) = eaafa42346b7af71b5aa6c9195969b640f40dfaac74471b64837c66216db7c3e
SHA512 (pydot-2.0.0.tar.gz) = 5d0c1f88838784184078b911c138b9b2f3588bb970e0247df5a8b17bb778b927e881c3d29efc3cbedf20c22ca2534bb65f1cc5265adcdf04e1c4d24ad0ae372a
Size (pydot-2.0.0.tar.gz) = 152022 bytes

0 comments on commit 569d10d

Please sign in to comment.