presentation-validator icon indicating copy to clipboard operation
presentation-validator copied to clipboard

Setup errors

Open jpadfield opened this issue 3 years ago • 2 comments

Hi,

I needed to add an extra line to the setup.py file to get the install process to work:

So changing:

 setup(
     name='iiif-presentation-validator',
     version='0.0.3',

To:

setup(
    py_modules=[],
    name='iiif-presentation-validator',
    version='0.0.3',

I also needed to run the setup script as sudo - without creating a new environment or a local installation.

It might be good to update the README file if this is a more wide spread issue.

(Installed on Ubuntu 20.04)

jpadfield avatar Dec 16 '22 10:12 jpadfield

Also running into the first part of this issue on macOS Ventura.

This is the error when attempting to run the setup script:

error: Multiple top-level packages discovered in a flat-layout: ['schema', 'fixtures'].

To avoid accidental inclusion of unwanted files or directories,
setuptools will not proceed with this build.

If you are trying to create a single distribution with multiple packages
on purpose, you should not rely on automatic discovery.
Instead, consider the following options:

1. set up custom discovery (`find` directive with `include` or `exclude`)
2. use a `src-layout`
3. explicitly set `py_modules` or `packages` with a list of names

To find more information, look for "package discovery" on setuptools docs.

Adding the py_modules=[] line from above fixed it. (Thanks!)

I did not get the sudo issue though.

camdendotlol avatar Jan 12 '23 16:01 camdendotlol

I had no luck with the instructions in the README.md. I had more success with the Docker container, which I built and ran as follows (as root):

cd presentation-validator-main
docker build -t presentation-validator .
docker run --network=host -d presentation-validator

I was also then able to use the commands in the Dockerfile to run the validator outside Docker:

virtualenv --python=python3.9 venv
. venv/bin/activate
cd presentation-validator-main
pip install --trusted-host pypi.python.org -r requirements.txt
python iiif-presentation-validator.py --hostname 0.0.0.0

Also note that if you're validating a local HTTPS site with an invalid certificate, you will need to alter iiif-presentation-validator.py to disable SSL certificate verification:

        import ssl

        ...

        ctx = ssl.create_default_context()
        ctx.check_hostname = False
        ctx.verify_mode = ssl.CERT_NONE

        try:
            wh = urlopen(req, context=ctx)

edsnowden avatar Feb 02 '23 10:02 edsnowden