release 0.5.5 breaks requirementslib
还没有人认领这个 Issue。
评估
调研方向
通过 requirementslib testsuite 或 isort 重现该故障,从 test_isort.py:2685 以及 isort/finders.py:199-332 中的 PipfileFinder 路径开始。跟踪 requirementslib 如何访问 pipfile.get("packages", {}),并检查 tomlkit 中对应的行为;当报告的测试不再引发 AttributeError 时即表示完成。
由索引模型根据 Issue 内容生成。
描述
This is exposed by the requirementslib testsuite or in isort:
[ 146s] _____________________________ test_pipfile_finder ______________________________
[ 146s]
[ 146s] tmpdir = local('/tmp/pytest-of-abuild/pytest-0/test_pipfile_finder0')
[ 146s]
[ 146s] def test_pipfile_finder(tmpdir):
[ 146s] pipfile = tmpdir.join('Pipfile')
[ 146s] pipfile.write(PIPFILE)
[ 146s] si = SortImports(file_contents="")
[ 146s] finder = finders.PipfileFinder(
[ 146s] config=si.config,
[ 146s] sections=si.sections,
[ 146s] > path=str(tmpdir)
[ 146s] )
[ 146s]
[ 146s] /home/abuild/rpmbuild/BUILD/isort-4.3.21/test_isort.py:2685:
[ 146s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[ 146s] /home/abuild/rpmbuild/BUILD/isort-4.3.21/isort/finders.py:199: in __init__
[ 146s] self.names = self._load_names()
[ 146s] /home/abuild/rpmbuild/BUILD/isort-4.3.21/isort/finders.py:221: in _load_names
[ 146s] for name in self._get_names(path):
[ 146s] /home/abuild/rpmbuild/BUILD/isort-4.3.21/isort/finders.py:332: in _get_names
[ 146s] for req in project.packages:
[ 146s] /usr/lib/python2.7/site-packages/requirementslib/models/pipfile.py:240: in __getattr__
[ 146s] return super(Pipfile, self).__getattribute__(k, *args, **kwargs)
[ 146s] /usr/lib/python2.7/site-packages/requirementslib/models/pipfile.py:326: in packages
[ 146s] return self.requirements
[ 146s] /usr/lib/python2.7/site-packages/requirementslib/models/pipfile.py:240: in __getattr__
[ 146s] return super(Pipfile, self).__getattribute__(k, *args, **kwargs)
[ 146s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[ 146s]
[ 146s] self = Pipfile(path=PosixPath('/tmp/pytest-of-abuild/pytest-0/test_pipfile_finder0/Pi...e=None, _pyproject={}, build_system={}, _requirements=[], _dev_requirements=[])
[ 146s]
[ 146s] @property
[ 146s] def requirements(self):
[ 146s] # type: () -> List[Requirement]
[ 146s] if not self._requirements:
[ 146s] > packages = tomlkit_value_to_python(self.pipfile.get("packages", {}))
[ 146s] E AttributeError: 'NoneType' object has no attribute 'get'
[ 146s]
[ 146s] /usr/lib/python2.7/site-packages/requirementslib/models/pipfile.py:344: AttributeError
The logic in requirementslib actually looks okayish so I suppose it is an issue inside tomlkit.
- 主要语言
- Python
- 星标
- 850
- 派生
- 163
- 平均合并
- 13 分钟
- 30 天内合并 PR
- 2
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
python-poetry/tomlkit 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
python-poetry/tomlkit#546 · 2 条评论 ·
-
难度 3/5 1-2 天 新手友好度 68/100
python-poetry/tomlkit#603 ·
-
难度 3/5 1-2 天 新手友好度 52/100
python-poetry/tomlkit#580 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 72/100
python-poetry/tomlkit#577 ·
-
难度 5/5 一周以上 新手友好度 20/100
python-poetry/tomlkit#574 · 5 条评论 ·
查看 python-poetry/tomlkit 的全部 Issue
相似的 Issue
-
area: harness bug status: needs-triage
难度 2/5 1-3 小时 新手友好度 75/100
Human-Agent-Society/reef#625 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 1/5 1 小时以内 新手友好度 80/100
learningequality/kolibri#15351 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
Name consistency 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
eellak/triplestore#65 · 1 条评论 ·