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

cfn-lint fails to install because of jsonschema #2790

Closed
shadycuz opened this issue Jul 6, 2023 · 8 comments
Closed

cfn-lint fails to install because of jsonschema #2790

shadycuz opened this issue Jul 6, 2023 · 8 comments

Comments

@shadycuz
Copy link

shadycuz commented Jul 6, 2023

CloudFormation Lint Version

0.72.2 and 0.77.2

What operating system are you using?

Alpine

Describe the bug

When installing cfn-lint the install now fails (used to pass). This failure is because jsonschema requires rpds-py and rpds-py requires a rust toolchain.

Collecting jsonschema-specifications>=2023.03.6 (from jsonschema<5,>=3.0->cfn-lint==0.77.2)
  Downloading jsonschema_specifications-2023.6.1-py3-none-any.whl (17 kB)
Collecting referencing>=0.28.4 (from jsonschema<5,>=3.0->cfn-lint==0.77.2)
  Downloading referencing-0.29.1-py3-none-any.whl (25 kB)
Collecting rpds-py>=0.7.1 (from jsonschema<5,>=3.0->cfn-lint==0.77.2)
  Downloading rpds_py-0.8.4.tar.gz (15 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Checking for Rust toolchain....
      
      Cargo, the Rust package manager, is not installed or is not on PATH.
      This package requires Rust and Cargo to compile extensions. Install it through
      the system's package manager or via https://rustup.rs/
      
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Expected behavior

Install cfn-lint with out a rust tool chain =)

I think we should figure out which version of jsonschema added the need for rpds-py and pin the version before that. Or we open an issue with them and ask them to pin a version of rpds-py that doesn't require a rust toolchain.

Reproduction template

pip install cfn-lint==0.77.2

@rene84
Copy link

rene84 commented Jul 6, 2023

We are running into this as well. Are you aware of a workaround? Install the rust toolchain?

@shadycuz
Copy link
Author

shadycuz commented Jul 6, 2023

@rene84 The fix is to install the previous release of jsonschema like this:

pip install jsonschema==4.17.3
pip install cfn-lint

I'm not sure if it can be done one a single line or not.

@shadycuz
Copy link
Author

shadycuz commented Jul 6, 2023

Okay so jsonschema version 4.18.0 has added rpds-py and it requires a rust toolchain. They are also closing any issue that brings it up, see python-jsonschema/jsonschema#1114

I would recommend that cfn-lint change its dependency specification so 4.17.3 is the max version of jsonschema until this gets figured out. For more details on when its fixed see crate-py/rpds#6

@Julian
Copy link

Julian commented Jul 6, 2023

Just because I see this cross-linked...

Okay so jsonschema version 4.18.0 has added rpds-py and it requires a rust toolchain.

No, building from source requires Rust now, and if you're on a platform which has no wheels, you'll build from source, of which the just-released v0.8.6 of rpds now probably fixes things for alpine/musl. jsonschema does not have any install-time dependency.

They are also closing any issue that brings it up, see python-jsonschema/jsonschema#1114

This is a very strange way to phrase things for what it's worth.

@DJFliX
Copy link

DJFliX commented Jul 6, 2023

Single line works for me:
pip3 install jsonschema==4.17.3 cfn-lint

@shadycuz
Copy link
Author

shadycuz commented Jul 6, 2023

@Julian

I only pip install things. I dont know much about rust, musl or wheels.

If 4.17.3 works but 4.18.0 doesn't because rpds was added to it, and installing now fails. So...

Okay so jsonschema version 4.18.0 has added rpds-py and it requires a rust toolchain.

Might not be technically correct, but it is correct from a layman's perspective.

They are also closing any issue that brings it up, see python-jsonschema/jsonschema#1114

This is a very strange way to phrase things for what it's worth.

I mean... there isn't a single open issue that mentions 4.18.0 will break things but there are closed ones? Add python-jsonschema/jsonschema#1116 to the list.

@shadycuz
Copy link
Author

shadycuz commented Jul 6, 2023

This has now been fixed crate-py/rpds#6

My builds are working without the workaround.

@shadycuz shadycuz closed this as completed Jul 6, 2023
@Julian
Copy link

Julian commented Jul 6, 2023

It isn't correct for the majority of users, so I don't know what's "technical" about it.

And yes, I don't appreciate the silly phrasing which makes it sound like there's some sort of censorship or other nonsense -- you seem to personally think that keeping some tracking issue is helpful, and I don't -- both strategies are common in projects, and I would rather fix things in exactly the way it ultimately was fixed than explain or argue with you, but if you post weird sounding comments and link to them, I'll of course be tempted to say "uh, no".

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

4 participants