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

[bug] conan1: conflict of node-semver==0.6.1 with semver #15210

Closed
Nekto89 opened this issue Dec 4, 2023 · 4 comments
Closed

[bug] conan1: conflict of node-semver==0.6.1 with semver #15210

Nekto89 opened this issue Dec 4, 2023 · 4 comments
Assignees

Comments

@Nekto89
Copy link
Contributor

Nekto89 commented Dec 4, 2023

Environment details

  • Operating System+version: Windows 11
  • Compiler+version: -
  • Conan version: 1.62.0
  • Python version: 3.9.1

Steps to reproduce

  1. pip install --upgrade "conan<2" semver
  2. conan --version

Expected output: 1.62.0

Logs

(conan_venv) C:\dev\conan_venv>pip list
Package    Version
---------- -------
pip        20.2.3
setuptools 49.2.1
WARNING: You are using pip version 20.2.3; however, version 23.3.1 is available.
You should consider upgrading via the 'c:\dev\conan_venv\scripts\python.exe -m pip install --upgrade pip' command.

(conan_venv) C:\dev\conan_venv>pip install --upgrade "conan<2" semver
Collecting conan<2
  Downloading conan-1.62.0.tar.gz (787 kB)
     |████████████████████████████████| 787 kB 2.2 MB/s
Collecting semver
  Downloading semver-3.0.2-py3-none-any.whl (17 kB)
Collecting requests<3.0.0,>=2.25
  Downloading requests-2.31.0-py3-none-any.whl (62 kB)
     |████████████████████████████████| 62 kB 529 kB/s
Collecting urllib3<1.27,>=1.26.6
  Downloading urllib3-1.26.18-py2.py3-none-any.whl (143 kB)
     |████████████████████████████████| 143 kB ...
Collecting colorama<0.5.0,>=0.3.3
  Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting PyYAML<6.1,>=3.11
  Downloading PyYAML-6.0.1-cp39-cp39-win_amd64.whl (152 kB)
     |████████████████████████████████| 152 kB ...
Collecting patch-ng<1.18,>=1.17.4
  Using cached patch-ng-1.17.4.tar.gz (17 kB)
Collecting fasteners>=0.14.1
  Downloading fasteners-0.19-py3-none-any.whl (18 kB)
Collecting six<=1.16.0,>=1.10.0
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting node-semver==0.6.1
  Using cached node_semver-0.6.1-py3-none-any.whl (10 kB)
Collecting pygments<3.0,>=2.0
  Downloading pygments-2.17.2-py3-none-any.whl (1.2 MB)
     |████████████████████████████████| 1.2 MB ...
Collecting tqdm<5,>=4.28.1
  Downloading tqdm-4.66.1-py3-none-any.whl (78 kB)
     |████████████████████████████████| 78 kB 3.3 MB/s
Collecting python-dateutil<3,>=2.7.0
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting bottle<0.13,>=0.12.8
  Downloading bottle-0.12.25-py3-none-any.whl (90 kB)
     |████████████████████████████████| 90 kB 5.8 MB/s
Collecting pluginbase>=0.5
  Using cached pluginbase-1.0.1.tar.gz (43 kB)
Collecting PyJWT<3.0.0,>=2.4.0
  Downloading PyJWT-2.8.0-py3-none-any.whl (22 kB)
Collecting Jinja2<4.0.0,>=3.0
  Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting charset-normalizer<4,>=2
  Downloading charset_normalizer-3.3.2-cp39-cp39-win_amd64.whl (100 kB)
     |████████████████████████████████| 100 kB 6.8 MB/s
Collecting idna<4,>=2.5
  Downloading idna-3.6-py3-none-any.whl (61 kB)
     |████████████████████████████████| 61 kB 55 kB/s
Collecting certifi>=2017.4.17
  Downloading certifi-2023.11.17-py3-none-any.whl (162 kB)
     |████████████████████████████████| 162 kB 6.4 MB/s
Collecting MarkupSafe>=2.0
  Downloading MarkupSafe-2.1.3-cp39-cp39-win_amd64.whl (17 kB)
Using legacy 'setup.py install' for conan, since package 'wheel' is not installed.
Using legacy 'setup.py install' for patch-ng, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pluginbase, since package 'wheel' is not installed.
Installing collected packages: urllib3, charset-normalizer, idna, certifi, requests, colorama, PyYAML, patch-ng, fasteners, six, node-semver, pygments, tqdm, python-dateutil, bottle, pluginbase, PyJWT, MarkupSafe, Jinja2, conan, semver
    Running setup.py install for patch-ng ... done
    Running setup.py install for pluginbase ... done
    Running setup.py install for conan ... done
Successfully installed Jinja2-3.1.2 MarkupSafe-2.1.3 PyJWT-2.8.0 PyYAML-6.0.1 bottle-0.12.25 certifi-2023.11.17 charset-normalizer-3.3.2 colorama-0.4.6 conan-1.62.0 fasteners-0.19 idna-3.6 node-semver-0.6.1 patch-ng-1.17.4 pluginbase-1.0.1 pygments-2.17.2 python-dateutil-2.8.2 requests-2.31.0 semver-3.0.2 six-1.16.0 tqdm-4.66.1 urllib3-1.26.18
WARNING: You are using pip version 20.2.3; however, version 23.3.1 is available.
You should consider upgrading via the 'c:\dev\conan_venv\scripts\python.exe -m pip install --upgrade pip' command.

(conan_venv) C:\dev\conan_venv>conan --version
Traceback (most recent call last):
  File "C:\dev\conan_venv\Scripts\conan-script.py", line 33, in <module>
    sys.exit(load_entry_point('conan==1.62.0', 'console_scripts', 'conan')())
  File "C:\dev\conan_venv\Scripts\conan-script.py", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "C:\Soft\Python39\lib\importlib\metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "C:\Soft\Python39\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "c:\dev\conan_venv\lib\site-packages\conans\__init__.py", line 4, in <module>
    from conans.client.build.msbuild import MSBuild
  File "c:\dev\conan_venv\lib\site-packages\conans\client\build\msbuild.py", line 15, in <module>
    from conans.tools import vcvars_command as tools_vcvars_command
  File "c:\dev\conan_venv\lib\site-packages\conans\tools.py", line 31, in <module>
    from conans.client.tools.version import Version
  File "c:\dev\conan_venv\lib\site-packages\conans\client\tools\version.py", line 5, in <module>
    from semver import SemVer
ImportError: cannot import name 'SemVer' from 'semver' (c:\dev\conan_venv\lib\site-packages\semver\__init__.py)
@memsharded memsharded self-assigned this Dec 4, 2023
@memsharded
Copy link
Member

Hi @Nekto89

Thanks for your report.

It seems this is a conflict of names between node-semver and semver Python packages, that are not jointly compatible, as they use the same api.
I am afraid there is very little we can do about this, Conan 1.X needs node-semver to operate, this cannot be changed, so installing any other package that conflicts with node-semver in the same python environment, is not possible, this is not a Conan limitation we can fix, but something happening in the underlying Python installation. In the same way if you install another Python dependency that predates over the requests imports, Conan will break too.

Conan 2.0 solve this problem, it has removed node-semver as dependency completely.

@Nekto89
Copy link
Contributor Author

Nekto89 commented Dec 4, 2023

@memsharded can version of node-semver be bumped in conan1? Or is it too much work and risky? If I understood correctly, "node-semver" has fixed this conflict through rename in 0.9.0 podhmo/python-node-semver#45

@memsharded
Copy link
Member

@memsharded can version of node-semver be bumped in conan1? Or is it too much work and risky? If I understood correctly, "node-semver" has fixed this conflict through rename in 0.9.0 podhmo/python-node-semver#45

Yes, it is pinned to that specific 0.6.1 version, because node-semver changed behavior later that would be considered breaking for Conan users (this was also one of the reasons we decided to implement our own functionality in 2.0, to not depend on something external in something as core as this)

@memsharded
Copy link
Member

I am closing this, as this cannot be changed in Conan 1 because it would be breaking behavior, and has already been fixed in Conan 2, thanks for the feedback

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

2 participants