Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup errors #159

Open
jpadfield opened this issue Dec 16, 2022 · 2 comments
Open

Setup errors #159

jpadfield opened this issue Dec 16, 2022 · 2 comments

Comments

@jpadfield
Copy link

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)

@camdendotlol
Copy link

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.

@edsnowden
Copy link

edsnowden commented Feb 2, 2023

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants