What about a warning in the docs to check if mr.bob is already installed or available in PATH to avoid problems?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- cli, documentation
Hướng nghiên cứu
Start with the installation documentation and the subprocess call in plonecli/cli.py around line 72, then compare it with the version check around line 43. Document that mr.bob must be installed and available in PATH, and explain that conflicting installations can produce unintended results or a missing-command error.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
- Plone CLI version:
plonecli : 1.1
bobtemplates.plone: 4.0.4 - Python version: 2.7.16
- Operating System: Ubuntu 18.04
Description
Don't know if this is exactly a "bug", since I don't know if this problem can happen in another setups. I'm trying to know if it's possible to have some kind of documentation to avoid the problem I had (and forget me if it's out of the scope of the project, at least will be indexed by search engines and more people with similar problems will benefit).
In the past, to avoid dependency conflicts with python packages in my system python, I used to install a new python in my machine and all development utilities (like flake8, mr.bob and such) were pip installed there. Then, I added this python bin folder to PATH, so the utilities would be available.
It's a bit overkill but it worked and avoided dependency conflicts.
Nowadays, I try to use pipsi to acomplish this feature of installing python utilities, and installed plonecli this way. So far, so good.
I started creating my templates but having lots of problems: what was supposed to be created based on what was in the source code in github wasn't being created in my machine. I ran plonecli --versions and it was with correct versions:
plonecli : 1.1
bobtemplates.plone: 4.0.4
I've decided to dig a little in the source code and realized that, since plonecli uses mr.bob as a subprocess call, it was using that mr.bob installation, which had a bobtemplates.plone 3.5.x installed. plonecli --versions was checking the installed bobtemplates.plone in plonecli pipsi virtualenv instead of the bobtemplates.plone used in the mr.bob used in the subprocess call.
So, I removed the old installation of mr.bob. Then, I got the traceback:
Traceback (most recent call last):
File "/home/user/.local/bin/plonecli", line 11, in <module>
sys.exit(cli())
File "/home/user/.local/venvs/plonecli/local/lib/python2.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/.local/venvs/plonecli/local/lib/python2.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/user/.local/venvs/plonecli/local/lib/python2.7/site-packages/click/core.py", line 1163, in invoke
rv.append(sub_ctx.command.invoke(sub_ctx))
File "/home/user/.local/venvs/plonecli/local/lib/python2.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/user/.local/venvs/plonecli/local/lib/python2.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/user/.local/venvs/plonecli/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/user/.local/venvs/plonecli/local/lib/python2.7/site-packages/plonecli/cli.py", line 72, in create
subprocess.call(['mrbob', bobtemplate, '-O', name])
File "/usr/lib/python2.7/subprocess.py", line 172, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
But it is the intended behavior, since I'm using pipsi instead of installing like it's said in the docs and I need to do export PATH=$PATH:$HOME/.local/venvs/plonecli/bin before calling plonecli. This doesn't happen when doing the pip installation in the docs because mr.bob would be in the PATH.
But nevertheless I was thinking if a warning "check for mr.bob installation in your installation, since plonecli does a shell mr.bob call using subprocess and if you have it somewhere in your PATH you may have unintended results" would be overkill.
To use an older versions of plonecli and mrbob, I used pipenv (pipenv install --skip-lock -r requirements.txt) and a requirements.txt with plonecli==0.2.0 (https://github.com/plone/plonecli/blob/0.2.0/setup.py#L28) and bobtemplates.plone==3.4.2 (https://github.com/plone/bobtemplates.plone/blob/master/CHANGES.rst#342-2018-08-13).
- Ngôn ngữ chính
- Python
- Star
- 20
- Fork
- 12
- Merge trung bình
- 11 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của plone/plonecli
-
01 type: bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
uvx plonecli --helpCó thể đã có người làm @Anu13lol đã nhận 161 ngày trước. Đang mở01 type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 58/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
Add a migrate package commandĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
01 type: bug 21 status: confirmed
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Tất cả issue của plone/plonecli
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
conda-forge/conda-forge-bot#7025 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore(ci): publish.yml's release-job comment counts the hand-created Releases as all of themĐang mởarea:ci
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
catincloud-labs/dagster-dex#149 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
home-assistant/core#188424 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Review backlog (docs-currency): README 'CI run' link lands on a run whose overall badge is cancelledĐang mởagent/reviewer needs-kind needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
projectbluefin/utah#880 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
LSan reports obj_gen leak on post-parse usage() exits (aarch64)Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
redis/memtier_benchmark#850 ·
Maintainer thường phản hồi trong vòng 1 ngày