RDFLib / pySHACL

A Python validator for SHACL
Apache License 2.0
241 stars 63 forks source link

Can the prettytable dependency be upgraded to major version 3? #206

Closed KonradHoeffner closed 8 months ago

KonradHoeffner commented 9 months ago

I'm currently using pySHACL on Arch Linux where the preferred mechanism is to install python packages published as python-xyz for the pacman package manager. The problem is that when installing local/python-pyshacl, a non-declared depdency on prettytable<3.0.0,>=2.2.1 prevents pySHACL from running. One can install python-prettytable but that currently is on version 3.7.?.

I know that there is the workaround of using pip and venv and that this it not the fault of pySHACL but a problem with the recommended Arch Linux python installation method and the outdated python-pyshacl package but if the prettytable dependency can be savely upgraded to major version 3 it would make life easier for Arch Linux users while not hurting the others.

P.S.: Here is the error message when one installs it on Arch Linux via pip:

$ pip install --global pyshacl
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try 'pacman -S
    python-xyz', where xyz is the package you are trying to
    install.

    If you wish to install a non-Arch-packaged Python package,
    create a virtual environment using 'python -m venv path/to/venv'.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip.

    If you wish to install a non-Arch packaged Python application,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. Make sure you have python-pipx
    installed via pacman.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
ashleysommer commented 8 months ago

Thanks for bringing this up. The prettytable feature was added by an external contributor, and I didn't realize it was not using the latest version. I'll have a look to see if we can update the implementation to use the latest version.