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

Unable to install jsonschema >= 4.18.0 #8455

Closed
4 tasks done
jsolbrig opened this issue Sep 20, 2023 · 9 comments
Closed
4 tasks done

Unable to install jsonschema >= 4.18.0 #8455

jsolbrig opened this issue Sep 20, 2023 · 9 comments
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@jsolbrig
Copy link

  • Poetry version: 1.6.1
  • Python version: 3.10.12
  • OS version and name: CentOS 7
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

I have a package that currently uses setuptools but have been working on migrating to poetry. I would prefer to keep building and installing via pip but have run into an issue that occurs only when using pip install and not when using poetry install.

Due to new features made available in jsonschema 4.18, my package has a dependency on jsonschema >= 4.18.0. It appears that I am unable to use poetry via pip for my project at the moment because poetry needs to be installed into the same environment that the package will be installed into and the version restrictions conflict with one another.

When I attempt to install my project using poetry by calling pip install . I get the following error:

  ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
  poetry 1.6.1 requires jsonschema<4.18.0,>=4.10.0, which is not installed.

I see that this version requirement was added due to #8160 in PR #8161 due to missing MUSL wheels but this is blocking me from using poetry for my project.

  • Is there a workaround for this issue that allows me to use pip install for a project whose version requirements conflict with Poetry's?
  • Is there a plan to allow jsonschema >= 4.18.0 in the future?
  • Has anyone reached out to jsonschema regarding the missing wheels? I would do it, but I don't feel that I know enough about the problem to accurately describe it.
@jsolbrig jsolbrig added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 20, 2023
@dimbleby
Copy link
Contributor

poetry needs to be installed into the same environment that the package will be installed into

the exact opposite is true, don't do that

@jsolbrig
Copy link
Author

Okay, maybe I'm misunderstanding something. If I'm using conda environments, where in my workflow should I be installing poetry?

@jsolbrig
Copy link
Author

@dimbleby Sorry, I should have RTFM. If I'm understanding correctly, poetry should be seen as a prerequisite for my package that needs to be made available globally. It's not intended to be installed into the same environment as my package.

So, that adds some additional setup for developers to follow before they can start developing, right?

@dimbleby
Copy link
Contributor

if you want your contributors to run poetry, then you will need to tell them to install poetry

end users need never know

@jsolbrig
Copy link
Author

@dimbleby My use case is that I'm using pyproject.toml to define my package. I have the following in my pyproject.toml:

[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
build-backend = "poetry_dynamic_versioning.backend"

When I attempt to build using pip install . I get:

  ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
  poetry 1.6.1 requires jsonschema<4.18.0,>=4.10.0, which is not installed.

Shouldn't I be able to call pip install . without even having poetry installed given what I have above?

@chadhutchins182
Copy link

@dimbleby My use case is that I'm using pyproject.toml to define my package. I have the following in my pyproject.toml:

[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
build-backend = "poetry_dynamic_versioning.backend"

When I attempt to build using pip install . I get:

  ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
  poetry 1.6.1 requires jsonschema<4.18.0,>=4.10.0, which is not installed.

Shouldn't I be able to call pip install . without even having poetry installed given what I have above?

Use poetry install https://python-poetry.org/docs/cli/#install

@dimbleby
Copy link
Contributor

I do not reproduce:

$ cat pyproject.toml
[tool.poetry]
name = "bar"
version = "0.1.0"
description = ""
authors = ["Anon"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"
jsonschema = "^4.19.1"

[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
build-backend = "poetry_dynamic_versioning.backend"

$ pip install .
Processing /home/dch/bar
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting jsonschema<5.0.0,>=4.19.1 (from bar==0.1.0)
  Obtaining dependency information for jsonschema<5.0.0,>=4.19.1 from https://files.pythonhosted.org/packages/0f/bf/a84bc75f069f4f156e1c0d9892fb7325945106c6ecaad9f29d24360872af/jsonschema-4.19.1-py3-none-any.whl.metadata
  Downloading jsonschema-4.19.1-py3-none-any.whl.metadata (7.9 kB)
Collecting attrs>=22.2.0 (from jsonschema<5.0.0,>=4.19.1->bar==0.1.0)
  Downloading attrs-23.1.0-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.2/61.2 kB 1.1 MB/s eta 0:00:00
Collecting jsonschema-specifications>=2023.03.6 (from jsonschema<5.0.0,>=4.19.1->bar==0.1.0)
  Obtaining dependency information for jsonschema-specifications>=2023.03.6 from https://files.pythonhosted.org/packages/1c/24/83349ac2189cc2435e84da3f69ba3c97314d3c0622628e55171c6798ed80/jsonschema_specifications-2023.7.1-py3-none-any.whl.metadata
  Downloading jsonschema_specifications-2023.7.1-py3-none-any.whl.metadata (2.8 kB)
Collecting referencing>=0.28.4 (from jsonschema<5.0.0,>=4.19.1->bar==0.1.0)
  Obtaining dependency information for referencing>=0.28.4 from https://files.pythonhosted.org/packages/be/8e/56d6f1e2d591f4d6cbcba446cac4a1b0dc4f584537e2071d9bcee8eeab6b/referencing-0.30.2-py3-none-any.whl.metadata
  Downloading referencing-0.30.2-py3-none-any.whl.metadata (2.6 kB)
Collecting rpds-py>=0.7.1 (from jsonschema<5.0.0,>=4.19.1->bar==0.1.0)
  Obtaining dependency information for rpds-py>=0.7.1 from https://files.pythonhosted.org/packages/2e/b5/bb6d90878ef8df7df279af68379266285eff135dfa7fe9985e19e10b1a43/rpds_py-0.10.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
  Downloading rpds_py-0.10.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.7 kB)
Downloading jsonschema-4.19.1-py3-none-any.whl (83 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 83.3/83.3 kB 4.3 MB/s eta 0:00:00
Downloading jsonschema_specifications-2023.7.1-py3-none-any.whl (17 kB)
Downloading referencing-0.30.2-py3-none-any.whl (25 kB)
Downloading rpds_py-0.10.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 13.4 MB/s eta 0:00:00
Building wheels for collected packages: bar
  Building wheel for bar (pyproject.toml) ... done
  Created wheel for bar: filename=bar-0.1.0-py3-none-any.whl size=997 sha256=3763b8a60b7b10402b2bf9966719254e256dd8896c14cdfcdfb201165a761cf0
  Stored in directory: /tmp/pip-ephem-wheel-cache-ma6hbjl7/wheels/b9/6e/82/2d5371bcb3dd198b609e0b3ba270da2dea4150711706037498
Successfully built bar
Installing collected packages: rpds-py, attrs, referencing, jsonschema-specifications, jsonschema, bar
Successfully installed attrs-23.1.0 bar-0.1.0 jsonschema-4.19.1 jsonschema-specifications-2023.7.1 referencing-0.30.2 rpds-py-0.10.3

@jsolbrig
Copy link
Author

jsolbrig commented Sep 20, 2023

@dimbleby @chadhutchins182 I'm not sure what my problem was. It is working as @dimbleby shows above now. The dynamic versioning still isn't working for me, but that's a separate problem.

I have no idea why it was erroring before but is working now...

Edit: Actually, I know why this was erroring. I had installed poetry directly into my environment while trying to figure out why poetry-dynamic-versioning wasn't working correctly. That created the conflict. If I just leave management of poetry-core to pip, pip handles it cleanly.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

3 participants