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

PackageInfo: Invalid constraint sys-platform (=="win32") when installing kivy #3629

Closed
3 tasks done
pwoolvett opened this issue Feb 1, 2021 · 11 comments
Closed
3 tasks done
Labels
kind/bug Something isn't working as expected

Comments

@pwoolvett
Copy link
Contributor

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: elementary5 (x64), jetpack32 (armv8)
  • Python version: 3.6.9, 3.9
  • Poetry version: 1.1.4

Issue

Im having some trouble with poetry+kivy(2.2.0, from wheels and github) for linux (elementary on x64, jetpack on armv8, same issue):

  • when I run poetry add kivy, I get warnings because of "invalid constraints"
  • logs are not correctly parsed: the console shows the raw <debug>PackageInfo:</debug>
  • the resulting poetry.lock contains the "problematic" sub-deps
  • package gets correctly installed. Furthermore, poetry export generates a pip -r installable file, at least for linux...
The constraints from poetry output
PackageInfo: Invalid constraint (sys-platform (=="win32") ; extra == 'angle') found in kivy-2.0.0 dependencies, skipping
<debug>PackageInfo:</debug> Invalid constraint (sys-platform (=="win32") ; extra == 'angle') found in kivy-2.0.0 dependencies, skipping
PackageInfo: Invalid constraint (sys-platform (=="win32") ; extra == 'glew') found in kivy-2.0.0 dependencies, skipping
<debug>PackageInfo:</debug> Invalid constraint (sys-platform (=="win32") ; extra == 'glew') found in kivy-2.0.0 dependencies, skipping
PackageInfo: Invalid constraint (sys-platform (=="win32") ; extra == 'gstreamer') found in kivy-2.0.0 dependencies, skipping
<debug>PackageInfo:</debug> Invalid constraint (sys-platform (=="win32") ; extra == 'gstreamer') found in kivy-2.0.0 dependencies, skipping
PackageInfo: Invalid constraint (sys-platform (=="win32") ; extra == 'sdl2') found in kivy-2.0.0 dependencies, skipping

Thats the only thing (python 3.9 or python3.6.9, Poetry version 1.1.4):

snippet to reproduce
poetry new --name kk kk
cd kk
poetry add -vvv kivy[base]
poetry export --without-hashes -o req.txt

pyproject.toml

resulting file contents :

[tool.poetry]
name = "kk"
version = "0.1.0"
description = ""
authors = ["Author <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.9"
Kivy = {extras = ["base"], version = "^2.0.0"}

[tool.poetry.dev-dependencies]
pytest = "^5.2"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

The problem seems to happen at poetry.inspection.info:

PackageInfo.from_metadata creates the pkginfo.Wheel(directory.as_posix()) ok, but the metadata contains unparsable stuff (attached in the log snippet above)

Additional INFO:

The wheel contains this as METADATA:
...
Provides-Extra: angle
Requires-Dist: kivy-deps.angle (~=0.3.0) ; extra == 'angle'
Requires-Dist: sys-platform (=="win32") ; extra == 'angle'
...
Provides-Extra: glew
Requires-Dist: kivy-deps.glew (~=0.3.0) ; extra == 'glew'
Requires-Dist: sys-platform (=="win32") ; extra == 'glew'
Provides-Extra: gstreamer
Requires-Dist: kivy-deps.gstreamer (~=0.3.1) ; extra == 'gstreamer'
Requires-Dist: sys-platform (=="win32") ; extra == 'gstreamer'
...
Provides-Extra: sdl2
Requires-Dist: kivy-deps.sdl2 (~=0.3.1) ; extra == 'sdl2'
Requires-Dist: sys-platform (=="win32") ; extra == 'sdl2'
...

These lines from the wheel/dist.info look weird:

Requires-Dist: sys-platform (=="win32") ; extra == 'sdl2'

Specially, poetry does this

dependency = dependency_from_pep_508(req, relative_to=root_dir)
:

poetry code
# poetry.inspection.info:PackageInfo
...
class PackageInfo:
    ...
    def to_package(...)
        ...
        for req in self.requires_dist or []:
            try:
                # Attempt to parse the PEP-508 requirement string
                dependency = dependency_from_pep_508(req, relative_to=root_dir)
            except InvalidMarker:
                # Invalid marker, We strip the markers hoping for the best
                req = req.split(";")[0] #############################################   <- THIS
                dependency = dependency_from_pep_508(req, relative_to=root_dir)
            except ValueError:
                # Likely unable to parse constraint so we skip it
                self._log(
                    "Invalid constraint ({}) found in {}-{} dependencies, "
                    "skipping".format(req, package.name, package.version),
                    level="warning",
                )
                continue
@pwoolvett pwoolvett added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Feb 1, 2021
@pwoolvett pwoolvett changed the title Kivy conflictin resolution Kivy conflicting resolution Feb 1, 2021
@pwoolvett pwoolvett changed the title Kivy conflicting resolution PackageInfo: Invalid constraint sys-platform (=="win32") when installing kivy Feb 2, 2021
@pwoolvett
Copy link
Contributor Author

OK I've narrowed it down. The offending file (at lest for path installs, see below) seems to be kivy'ssetup.cfg. specifically, in section [options.extras_require], there are four "inline extras":

...
[options.extras_require]
tuio = oscpy
...
full =
    pillow
    docutils
...
gstreamer = kivy_deps.gstreamer~=0.3.1; sys_platform == "win32"
angle = kivy_deps.angle~=0.3.0; sys_platform == "win32"
sdl2 = kivy_deps.sdl2~=0.3.1; sys_platform == "win32"
glew = kivy_deps.glew~=0.3.0; sys_platform == "win32"

[flake8]
...
  • Comparing those with all the other in the same section, all the rest (which do not generate the issue) are split by newlines
  • The issue is solved by changing the format to "newline", eg to this:
gstreamer =
    kivy_deps.gstreamer~=0.3.1; sys_platform == "win32"
angle =
    kivy_deps.angle~=0.3.0; sys_platform == "win32"
sdl2 =
    kivy_deps.sdl2~=0.3.1; sys_platform == "win32"
glew =
    kivy_deps.glew~=0.3.0; sys_platform == "win32"

After reading the docs, I'm still not sure as to whether this is a poetry issue parsing said file, or the file itself is the one with problems

@pwoolvett
Copy link
Contributor Author

I've done the following:

  1. Modify setup.cfg with the "newline format" PackageInfo: Invalid constraint sys-platform (=="win32") when installing kivy #3629 (comment)
  2. using pip 20.2.4, run pip wheel . where the repo is located

By doing this:

  1. The generated metadata file inside the wheel (./Kivy.whl/Kivy-version.dist-info/METADATA) now contains cleaner lines:

       diff --git a/./m1 b/./m2
    index dc7f1ef..fd89685 100644
    --- a/./m1
    +++ b/./m2
    @@ -47,8 +47,7 @@ Requires-Dist: kivy-deps.sdl2 (~=0.3.1) ; sys_platform == "win32"
     Requires-Dist: kivy-deps.glew (~=0.3.0) ; sys_platform == "win32"
     Requires-Dist: pypiwin32 ; sys_platform == "win32"
     Provides-Extra: angle
    -Requires-Dist: kivy-deps.angle (~=0.3.0) ; extra == 'angle'
    -Requires-Dist: sys-platform (=="win32") ; extra == 'angle'
    +Requires-Dist: kivy-deps.angle (~=0.3.0) ; (sys_platform == "win32") and extra == 'angle'
     Provides-Extra: base
     Requires-Dist: pillow ; extra == 'base'
     Requires-Dist: docutils ; extra == 'base'
    @@ -83,17 +82,14 @@ Requires-Dist: kivy-deps.sdl2 (~=0.3.1) ; (sys_platform == "win32") and extra ==
     Requires-Dist: kivy-deps.glew (~=0.3.0) ; (sys_platform == "win32") and extra == 'full'
     Requires-Dist: pypiwin32 ; (sys_platform == "win32") and extra == 'full'
     Provides-Extra: glew
    -Requires-Dist: kivy-deps.glew (~=0.3.0) ; extra == 'glew'
    -Requires-Dist: sys-platform (=="win32") ; extra == 'glew'
    +Requires-Dist: kivy-deps.glew (~=0.3.0) ; (sys_platform == "win32") and extra == 'glew'
     Provides-Extra: gstreamer
    -Requires-Dist: kivy-deps.gstreamer (~=0.3.1) ; extra == 'gstreamer'
    -Requires-Dist: sys-platform (=="win32") ; extra == 'gstreamer'
    +Requires-Dist: kivy-deps.gstreamer (~=0.3.1) ; (sys_platform == "win32") and extra == 'gstreamer'
     Provides-Extra: media
     Requires-Dist: ffpyplayer ; (sys_platform == "linux" or sys_platform == "darwin") and extra == 'media'
     Requires-Dist: kivy-deps.gstreamer (~=0.3.1) ; (sys_platform == "win32") and extra == 'media'
     Provides-Extra: sdl2
    -Requires-Dist: kivy-deps.sdl2 (~=0.3.1) ; extra == 'sdl2'
    -Requires-Dist: sys-platform (=="win32") ; extra == 'sdl2'
    +Requires-Dist: kivy-deps.sdl2 (~=0.3.1) ; (sys_platform == "win32") and extra == 'sdl2'
     Provides-Extra: tuio
     Requires-Dist: oscpy ; extra == 'tuio'
    
  2. installing this wheel or directly from the directory with modifications solves all issues

So, I guess its an issue with Kivy's setup.cfg...

I guess things like these are the motivation for warning instead of raising? I would still prefer a raise and have to manually opt-in to ignoring, either via cli or env var.

Would you accept a pr for something like that?

@sinoroc
Copy link

sinoroc commented Feb 2, 2021

@pwoolvett
Copy link
Contributor Author

Isn't it a setuptools issue, then?
https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html

I really cant make my mind just by reading the specs. Its not a poetry issue, though... except for the fact that it did not raise!

(kivy/kivy#7362 (comment))
🤷

@pwoolvett
Copy link
Contributor Author

Would the maintainers care about the raise vs log, with an opt-in feature?
If not, I should close this, as the rest is definitively not a poetry issue

@Antyos
Copy link

Antyos commented Aug 12, 2021

I'm also having this issue when adding Kivy 2.0 via Poetry. As this appears to be an issue with Kivy, does a new issue need to be opened in their repo, or have changes already been made that should fix this issue?

@pwoolvett
Copy link
Contributor Author

The kivy code had a misinterpretation from the (interpretable) setuptools documentation at the time.

The setuptools documentation has been fixed and merged. See pypa/setuptools#2561
The kivy configuration files have been fixed and merged (master), but marked for milestone 32 (2.1) . See kivy/kivy#7362

According to this, The issue should still be happening. However, I tried to reproduce the issue in docker yesterday (both x86 and arm) but couldn't, so maybe it has been fixed elsewhere?

The following allows to install kivy via poetry, in both scenarios:
# Dockerfile
FROM python:3.6.9

RUN pip install --user poetry

# uncomment to allow kivy compilation when no wheels are available
# RUN apt-get update && apt-get install libgl1-mesa-dev

ENV PATH="/root/.local/bin:${PATH}"
ENTRYPOINT ["bash"]
# command on host
docker build -t tmp . && docker run --rm -it tmp

And on the container:

root@9be665d8bc5d:/# python --version
Python 3.6.9
root@9be665d8bc5d:/# pip --version
pip 19.3.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)
root@9be665d8bc5d:/# poetry --version
Poetry version 1.1.7
root@9be665d8bc5d:/kk# python -c "import poetry.core as c;print(c.__version__)"
1.0.3
root@9be665d8bc5d:/# poetry new --name kk kk
Created package kk in kk
root@9be665d8bc5d:/# cd kk
root@9be665d8bc5d:/kk# poetry add -vvv kivy[base]
Creating virtualenv kk-x3E5Giiz-py3.6 in /root/.cache/pypoetry/virtualenvs
Using virtualenv: /root/.cache/pypoetry/virtualenvs/kk-x3E5Giiz-py3.6
PyPI: 25 packages found for kivy *
Using version ^2.0.0 for Kivy

Updating dependencies
Resolving dependencies...
   1: fact: kk is 0.1.0
   1: derived: kk
   1: fact: kk depends on Kivy (^2.0.0)
(...)
PackageInfo: Invalid constraint (sys-platform (=="win32") ; extra == 'angle') found in kivy-2.0.0 dependencies, skipping
<debug>PackageInfo:</debug> Invalid constraint (sys-platform (=="win32") ; extra == 'angle') found in kivy-2.0.0 dependencies, skipping
PackageInfo: Invalid constraint (sys-platform (=="win32") ; extra == 'glew') found in kivy-2.0.0 dependencies, skipping
<debug>PackageInfo:</debug> Invalid constraint (sys-platform (=="win32") ; extra == 'glew') found in kivy-2.0.0 dependencies, skipping
PackageInfo: Invalid constraint (sys-platform (=="win32") ; extra == 'gstreamer') found in kivy-2.0.0 dependencies, skipping
<debug>PackageInfo:</debug> Invalid constraint (sys-platform (=="win32") ; extra == 'gstreamer') found in kivy-2.0.0 dependencies, skipping
PackageInfo: Invalid constraint (sys-platform (=="win32") ; extra == 'sdl2') found in kivy-2.0.0 dependencies, skipping
<debug>PackageInfo:</debug> Invalid constraint (sys-platform (=="win32") ; extra == 'sdl2') found in kivy-2.0.0 dependencies, (...)
   0: Duplicate dependencies for kivy-deps.angle
   0: Merging requirements for kivy-deps.angle (>=0.3.0,<0.4.0)
   0: Duplicate dependencies for kivy-deps.sdl2
   0: Merging requirements for kivy-deps.sdl2 (>=0.3.1,<0.4.0)
   0: Duplicate dependencies for kivy-deps.glew
   0: Merging requirements for kivy-deps.glew (>=0.3.0,<0.4.0)
   0: Duplicate dependencies for pypiwin32
   0: Merging requirements for pypiwin32
   1: fact: kivy (2.0.0) depends on kivy (2.0.0)
   1: fact: kivy (2.0.0) depends on Kivy-Garden (>=0.1.4)
   1: fact: kivy (2.0.0) depends on docutils (*)
   1: fact: kivy (2.0.0) depends on pygments (*)
   1: fact: kivy (2.0.0) depends on kivy-deps.angle (>=0.3.0,<0.4.0)
   1: fact: kivy (2.0.0) depends on kivy-deps.sdl2 (>=0.3.1,<0.4.0)
   1: fact: kivy (2.0.0) depends on kivy-deps.glew (>=0.3.0,<0.4.0)
   1: fact: kivy (2.0.0) depends on pypiwin32 (*)
   1: fact: kivy (2.0.0) depends on pillow (*)
   1: selecting kivy[base] (2.0.0)
   1: derived: pillow
   1: derived: pypiwin32
   1: derived: kivy-deps.glew (>=0.3.0,<0.4.0)
   1: derived: kivy-deps.sdl2 (>=0.3.1,<0.4.0)
   1: derived: kivy-deps.angle (>=0.3.0,<0.4.0)
   1: derived: pygments
   1: derived: docutils
   1: derived: Kivy-Garden (>=0.1.4)
   1: derived: kivy (==2.0.0)
PyPI: 79 packages found for pillow *
PyPI: 3 packages found for pypiwin32 *
PyPI: 1 packages found for kivy-deps.glew >=0.3.0,<0.4.0
PyPI: 1 packages found for kivy-deps.sdl2 >=0.3.1,<0.4.0
PyPI: 1 packages found for kivy-deps.angle >=0.3.0,<0.4.0
PyPI: 47 packages found for pygments *
PyPI: 23 packages found for docutils *
PyPI: 1 packages found for kivy-garden >=0.1.4
PyPI: Getting info for kivy-garden (0.1.4) from PyPI
PyPI: No dependencies found, downloading archives
PyPI: Downloading sdist: kivy-garden-0.1.4.tar.gz
   1: fact: kivy-garden (0.1.4) depends on requests (*)
   1: selecting kivy-garden (0.1.4)
   1: derived: requests
PyPI: No release information found for requests-0.0.1, skipping
PyPI: No release information found for requests-0.12.01, skipping
PyPI: No release information found for requests-2.15.0, skipping
PyPI: 140 packages found for requests *
PyPI: 1 packages found for kivy 2.0.0
PackageInfo: Invalid constraint (sys-platform (=="win32") ; extra == 'angle') found in kivy-2.0.0 dependencies, skipping
<debug>PackageInfo:</debug> Invalid constraint (sys-platform (=="win32") ; extra == 'angle') found in kivy-2.0.0 dependencies, skipping
PackageInfo: Invalid constraint (sys-platform (=="win32") ; extra == 'glew') found in kivy-2.0.0 dependencies, skipping
<debug>PackageInfo:</debug> Invalid constraint (sys-platform (=="win32") ; extra == 'glew') found in kivy-2.0.0 dependencies, skipping
PackageInfo: Invalid constraint (sys-platform (=="win32") ; extra == 'gstreamer') found in kivy-2.0.0 dependencies, skipping
<debug>PackageInfo:</debug> Invalid constraint (sys-platform (=="win32") ; extra == 'gstreamer') found in kivy-2.0.0 dependencies, skipping
PackageInfo: Invalid constraint (sys-platform (=="win32") ; extra == 'sdl2') found in kivy-2.0.0 dependencies, skipping
<debug>PackageInfo:</debug> Invalid constraint (sys-platform (=="win32") ; extra == 'sdl2') found in kivy-2.0.0 dependencies, skipping
   1: fact: kivy (2.0.0) depends on Kivy-Garden (>=0.1.4)
   1: fact: kivy (2.0.0) depends on docutils (*)
   1: fact: kivy (2.0.0) depends on pygments (*)
   1: fact: kivy (2.0.0) depends on kivy-deps.angle (>=0.3.0,<0.4.0)
   1: fact: kivy (2.0.0) depends on kivy-deps.sdl2 (>=0.3.1,<0.4.0)
   1: fact: kivy (2.0.0) depends on kivy-deps.glew (>=0.3.0,<0.4.0)
   1: fact: kivy (2.0.0) depends on pypiwin32 (*)
   1: selecting kivy (2.0.0)
PyPI: Getting info for pytest (5.4.3) from PyPI
   1: fact: pytest (5.4.3) depends on py (>=1.5.0)
   1: fact: pytest (5.4.3) depends on packaging (*)
   1: fact: pytest (5.4.3) depends on attrs (>=17.4.0)
   1: fact: pytest (5.4.3) depends on more-itertools (>=4.0.0)
   1: fact: pytest (5.4.3) depends on pluggy (>=0.12,<1.0)
   1: fact: pytest (5.4.3) depends on wcwidth (*)
   1: fact: pytest (5.4.3) depends on importlib-metadata (>=0.12)
   1: fact: pytest (5.4.3) depends on atomicwrites (>=1.0)
   1: fact: pytest (5.4.3) depends on colorama (*)
   1: selecting pytest (5.4.3)
   1: derived: colorama
   1: derived: atomicwrites (>=1.0)
   1: derived: importlib-metadata (>=0.12)
   1: derived: wcwidth
   1: derived: pluggy (>=0.12,<1.0)
   1: derived: more-itertools (>=4.0.0)
   1: derived: attrs (>=17.4.0)
   1: derived: packaging
   1: derived: py (>=1.5.0)
PyPI: 42 packages found for colorama *
PyPI: 7 packages found for atomicwrites >=1.0
PyPI: 60 packages found for importlib-metadata >=0.12
PyPI: 17 packages found for wcwidth *
PyPI: 3 packages found for pluggy >=0.12,<1.0
PyPI: 21 packages found for more-itertools >=4.0.0
PyPI: 11 packages found for attrs >=17.4.0
PyPI: 36 packages found for packaging *
PyPI: No release information found for py-0.8.0-alpha2, skipping
PyPI: No release information found for py-0.9.0, skipping
PyPI: No release information found for py-1.4.32.dev1, skipping
PyPI: 11 packages found for py >=1.5.0
PyPI: Getting info for pluggy (0.13.1) from PyPI
   1: fact: pluggy (0.13.1) depends on importlib-metadata (>=0.12)
   1: selecting pluggy (0.13.1)
PyPI: Getting info for attrs (21.2.0) from PyPI
   1: selecting attrs (21.2.0)
PyPI: Getting info for py (1.10.0) from PyPI
PyPI: No dependencies found, downloading archives
PyPI: Downloading wheel: py-1.10.0-py2.py3-none-any.whl
   1: selecting py (1.10.0)
PyPI: Getting info for wcwidth (0.2.5) from PyPI
   1: selecting wcwidth (0.2.5)
PyPI: Getting info for more-itertools (8.8.0) from PyPI
PyPI: No dependencies found, downloading archives
PyPI: Downloading wheel: more_itertools-8.8.0-py3-none-any.whl
   1: selecting more-itertools (8.8.0)
PyPI: Getting info for docutils (0.17.1) from PyPI
PyPI: No dependencies found, downloading archives
PyPI: Downloading wheel: docutils-0.17.1-py2.py3-none-any.whl
   1: selecting docutils (0.17.1)
PyPI: Getting info for packaging (21.0) from PyPI
   1: fact: packaging (21.0) depends on pyparsing (>=2.0.2)
   1: selecting packaging (21.0)
   1: derived: pyparsing (>=2.0.2)
PyPI: No release information found for pyparsing-1.1.2, skipping
PyPI: No release information found for pyparsing-1.2, skipping
PyPI: No release information found for pyparsing-1.3.3, skipping
PyPI: 30 packages found for pyparsing >=2.0.2
PyPI: Getting info for pyparsing (2.4.7) from PyPI
PyPI: No dependencies found, downloading archives
PyPI: Downloading wheel: pyparsing-2.4.7-py2.py3-none-any.whl
   1: selecting pyparsing (2.4.7)
PyPI: Getting info for pygments (2.9.0) from PyPI
PyPI: No dependencies found, downloading archives
PyPI: Downloading wheel: Pygments-2.9.0-py3-none-any.whl
   1: selecting pygments (2.9.0)
PyPI: Getting info for requests (2.26.0) from PyPI
   1: fact: requests (2.26.0) depends on urllib3 (>=1.21.1,<1.27)
   1: fact: requests (2.26.0) depends on certifi (>=2017.4.17)
   1: fact: requests (2.26.0) depends on charset-normalizer (>=2.0.0,<2.1.0)
   1: fact: requests (2.26.0) depends on idna (>=2.5,<4)
   1: selecting requests (2.26.0)
   1: derived: idna (>=2.5,<4)
   1: derived: charset-normalizer (>=2.0.0,<2.1.0)
   1: derived: certifi (>=2017.4.17)
   1: derived: urllib3 (>=1.21.1,<1.27)
PyPI: No release information found for idna-0.1, skipping
PyPI: 9 packages found for idna >=2.5,<4
PyPI: 5 packages found for charset-normalizer >=2.0.0,<2.1.0
PyPI: No release information found for certifi-0, skipping
PyPI: 21 packages found for certifi >=2017.4.17
PyPI: No release information found for urllib3-0.3, skipping
PyPI: No release information found for urllib3-0.3.1, skipping
PyPI: No release information found for urllib3-0.4.0, skipping
PyPI: No release information found for urllib3-0.4.1, skipping
PyPI: 26 packages found for urllib3 >=1.21.1,<1.27
PyPI: Getting info for certifi (2021.5.30) from PyPI
PyPI: No dependencies found, downloading archives
PyPI: Downloading wheel: certifi-2021.5.30-py2.py3-none-any.whl
   1: selecting certifi (2021.5.30)
PyPI: Getting info for urllib3 (1.26.6) from PyPI
   1: selecting urllib3 (1.26.6)
PyPI: Getting info for kivy-deps.glew (0.3.0) from PyPI
PyPI: No dependencies found, downloading archives
PyPI: Downloading wheel: kivy_deps.glew-0.3.0-cp36-cp36m-win32.whl
   1: selecting kivy-deps.glew (0.3.0)
PyPI: Getting info for kivy-deps.sdl2 (0.3.1) from PyPI
PyPI: No dependencies found, downloading archives
PyPI: Downloading wheel: kivy_deps.sdl2-0.3.1-cp36-cp36m-win32.whl
   1: selecting kivy-deps.sdl2 (0.3.1)
PyPI: Getting info for kivy-deps.angle (0.3.0) from PyPI
PyPI: No dependencies found, downloading archives
PyPI: Downloading wheel: kivy_deps.angle-0.3.0-cp36-cp36m-win32.whl
   1: selecting kivy-deps.angle (0.3.0)
PyPI: Getting info for pypiwin32 (223) from PyPI
   1: fact: pypiwin32 (223) depends on pywin32 (>=223)
   1: selecting pypiwin32 (223)
   1: derived: pywin32 (>=223)
PyPI: No release information found for pywin32-210, skipping
PyPI: No release information found for pywin32-214, skipping
PyPI: 8 packages found for pywin32 >=223
PyPI: Getting info for pywin32 (301) from PyPI
PyPI: No dependencies found, downloading archives
PyPI: Downloading wheel: pywin32-301-cp35-cp35m-win32.whl
   1: selecting pywin32 (301)
PyPI: Getting info for charset-normalizer (2.0.4) from PyPI
   1: selecting charset-normalizer (2.0.4)
PyPI: Getting info for atomicwrites (1.4.0) from PyPI
PyPI: No dependencies found, downloading archives
PyPI: Downloading wheel: atomicwrites-1.4.0-py2.py3-none-any.whl
   1: selecting atomicwrites (1.4.0)
PyPI: Getting info for idna (3.2) from PyPI
PyPI: No dependencies found, downloading archives
PyPI: Downloading wheel: idna-3.2-py3-none-any.whl
   1: selecting idna (3.2)
PyPI: Getting info for colorama (0.4.4) from PyPI
PyPI: No dependencies found, downloading archives
PyPI: Downloading wheel: colorama-0.4.4-py2.py3-none-any.whl
   1: selecting colorama (0.4.4)
PyPI: Getting info for importlib-metadata (4.6.3) from PyPI
   1: fact: importlib-metadata (4.6.3) depends on zipp (>=0.5)
   1: fact: importlib-metadata (4.6.3) depends on typing-extensions (>=3.6.4)
   1: selecting importlib-metadata (4.6.3)
   1: derived: typing-extensions (>=3.6.4)
   1: derived: zipp (>=0.5)
PyPI: 8 packages found for typing-extensions >=3.6.4
PyPI: 23 packages found for zipp >=0.5
PyPI: Getting info for zipp (3.5.0) from PyPI
   1: selecting zipp (3.5.0)
PyPI: Getting info for typing-extensions (3.10.0.0) from PyPI
   1: selecting typing-extensions (3.10.0.0)
PyPI: Getting info for pillow (8.3.1) from PyPI
PyPI: No dependencies found, downloading archives
PyPI: Downloading sdist: Pillow-8.3.1.tar.gz
   1: selecting pillow (8.3.1)
   1: Version solving took 78.712 seconds.
   1: Tried 1 solutions.

Writing lock file

Finding the necessary packages for the current system

Package operations: 21 installs, 0 updates, 0 removals
(...)
  • Installing kivy (2.0.0)
(...)
root@9be665d8bc5d:/kk# poetry export --without-hashes -o req.txt
root@9be665d8bc5d:/kk# poetry shell
Spawning shell within /root/.cache/pypoetry/virtualenvs/kk-x3E5Giiz-py3.6
root@9be665d8bc5d:/kk# . /root/.cache/pypoetry/virtualenvs/kk-x3E5Giiz-py3.6/bin/activate
(kk-x3E5Giiz-py3.6) root@9be665d8bc5d:/kk# python
Python 3.6.9 (default, Nov 23 2019, 06:41:34) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import kivy
[WARNING] [Config      ] Older configuration version detected (0 instead of 21)
[WARNING] [Config      ] Upgrading configuration in progress.
[INFO   ] [Logger      ] Record log in /root/.kivy/logs/kivy_21-08-13_0.txt
[INFO   ] [Kivy        ] v2.0.0
[INFO   ] [Kivy        ] Installed at "/root/.cache/pypoetry/virtualenvs/kk-x3E5Giiz-py3.6/lib/python3.6/site-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.6.9 (default, Nov 23 2019, 06:41:34) 
[GCC 8.3.0]
[INFO   ] [Python      ] Interpreter at "/root/.cache/pypoetry/virtualenvs/kk-x3E5Giiz-py3.6/bin/python"

@Antyos
Copy link

Antyos commented Aug 17, 2021

Given that this issue seems like it will be fixed in the next release, I'll hold off further troubleshooting until Kivy 2.1 is released.

Though, for what it's worth, here's some system info / logs:

System Info

  • OS Version: Windows 10, 20H2
  • Python Version: 3.9.6
  • Poetry Version: 1.1.7

Logs

Creating a new Poetry project with Kivy

New Project

PS C:\Users\Andrew\Code> poetry new kivy-test
Created package kivy_test in kivy-test
PS C:\Users\Andrew\Code> cd kivy-test

Adding Kivy

PS C:\Users\Andrew\Code\kivy-test> poetry add kivy
Creating virtualenv kivy-test in C:\Users\Andrew\Code\kivy-test\.venv
Using version ^2.0.0 for Kivy

Updating dependencies
Resolving dependencies...
PackageInfo: Invalid constraint (sys-platform (=="win32") ; extra == 'angle') found in kivy-2.0.0 dependencies, skipping
<debug>PackageInfo:</debug> Invalid constraint (sys-platform (=="win32") ; extra == 'angle') found in kivy-2.0.0 dependencies, skipping
PackageInfo: Invalid constraint (sys-platform (=="win32") ; extra == 'glew') found in kivy-2.0.0 dependencies, skipping
<debug>PackageInfo:</debug> Invalid constraint (sys-platform (=="win32") ; extra == 'glew') found in kivy-2.0.0 dependencies, skipping
PackageInfo: Invalid constraint (sys-platform (=="win32") ; extra == 'gstreamer') found in kivy-2.0.0 dependencies, skipping
<debug>PackageInfo:</debug> Invalid constraint (sys-platform (=="win32") ; extra == 'gstreamer') found in kivy-2.0.0 dependencies, skipping
PackageInfo: Invalid constraint (sys-platform (=="win32") ; extra == 'sdl2') found in kivy-2.0.0 dependencies, skipping
<debug>PackageInfo:</debug> Invalid constraint (sys-platform (=="win32") ; extra == 'sdl2') found in kivy-2.0.0 dependencies, skipping

Writing lock file

Package operations: 24 installs, 0 updates, 0 removals

  • Installing certifi (2021.5.30)
  • Installing charset-normalizer (2.0.4)
  • Installing idna (3.2)
  • Installing urllib3 (1.26.6)
  • Installing pyparsing (2.4.7)
  • Installing pywin32 (301)
  • Installing requests (2.26.0)
  • Installing atomicwrites (1.4.0)
  • Installing attrs (21.2.0)
  • Installing colorama (0.4.4)
  • Installing kivy-deps.glew (0.3.0)
  • Installing kivy-deps.sdl2 (0.3.1)
  • Installing kivy-deps.angle (0.3.0)
  • Installing docutils (0.17.1)
  • Installing more-itertools (8.8.0)
  • Installing packaging (21.0)
  • Installing pluggy (0.13.1)
  • Installing wcwidth (0.2.5)
  • Installing kivy-garden (0.1.4)
  • Installing pypiwin32 (223)
  • Installing py (1.10.0)
  • Installing pygments (2.10.0)
  • Installing kivy (2.0.0)
  • Installing pytest (5.4.3)

Adding another library (ex. Numpy)

PS C:\Users\Andrew\Code\kivy-test> poetry add numpy
Using version ^1.21.2 for numpy

Updating dependencies
Resolving dependencies...
PackageInfo: Invalid constraint (sys-platform (=="win32") ; extra == 'angle') found in kivy-2.0.0 dependencies, skipping
PackageInfo: Invalid constraint (sys-platform (=="win32") ; extra == 'glew') found in kivy-2.0.0 dependencies, skipping
PackageInfo: Invalid constraint (sys-platform (=="win32") ; extra == 'gstreamer') found in kivy-2.0.0 dependencies, skipping
PackageInfo: Invalid constraint (sys-platform (=="win32") ; extra == 'sdl2') found in kivy-2.0.0 dependencies, skipping

Writing lock file

Package operations: 1 install, 0 updates, 0 removals

  • Installing numpy (1.21.2)

Pyproject.toml

[tool.poetry]
name = "kivy-test"
version = "0.1.0"
description = ""
authors = ["Andrew Glick <[email protected]>"]

[tool.poetry.dependencies]
python = "~3.9"
Kivy = "^2.0.0"
numpy = "^1.21.2"

[tool.poetry.dev-dependencies]
pytest = "^5.2"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

@desophos
Copy link

desophos commented Mar 19, 2022

I had these "Invalid constraint" messages with Kivy 2.0, but updating to Kivy 2.1 fixed this issue for me.

System Info

  • OS Version: Windows 10, 21H2
  • Python Version: 3.9.9
  • Poetry Version: 1.2.0a2
  • Kivy Version: 2.1.0

@Antyos
Copy link

Antyos commented Mar 19, 2022

I had these "Invalid constraint" messages with Kivy 2.0, but updating to Kivy 2.1 fixed this issue for me.

Now that kivy/kivy#7362 has been merged in a full release with Kivy 2.1, I believe we can close this issue.

@mkniewallner mkniewallner removed the status/triage This issue needs to be triaged label Jun 11, 2022
Copy link

github-actions bot commented Mar 1, 2024

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 Mar 1, 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
Projects
None yet
Development

No branches or pull requests

5 participants