Repository navigation
Closed as not planned
Labels
status/external-issueIssue is caused by external project (platform, dep, etc)Issue is caused by external project (platform, dep, etc)
Description
- Poetry version: Poetry (version 1.3.2)
- Python version: 3.10.9
- OS version and name: Arch Linux
- pyproject.toml: https://gist.github.com/alanorth/794c4fc8b1b81eb8d3034f7a7564b105
- 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 (
-vvvoption) and have included the output below.
Issue
I have a project that I've been using with poetry for a few years. Today when I tried to poetry update I received an error:
$ poetry update
Updating dependencies
Resolving dependencies... (1.6s)
'ProjectPackage' object has no attribute 'platform'On a hunch, I tried removing the environment, removing the artifact cache, and reinstalling the environment. This succeeds:
$ poetry env remove python
Deleted virtualenv: /home/aorth/.cache/pypoetry/virtualenvs/csv-metadata-quality-0rM9ayEp-py3.10
$ rm -rf ~/.cache/pypoetry/artifacts/*
$ poetry install
...
$ echo $?
0But still, poetry update fails:
$ poetry update -vvv
Using virtualenv: /home/aorth/.cache/pypoetry/virtualenvs/csv-metadata-quality-0rM9ayEp-py3.10
Updating dependencies
Resolving dependencies...
1: fact: csv-metadata-quality is 0.6.0
1: derived: csv-metadata-quality
[keyring.backend] Loading KWallet
[keyring.backend] Loading SecretService
[keyring.backend] Loading Windows
[keyring.backend] Loading chainer
[keyring.backend] Loading libsecret
[keyring.backend] Loading macOS
[urllib3.connectionpool] Starting new HTTPS connection (1): github.com:443
[urllib3.connectionpool] https://github.com:443 "GET /alanorth/country_converter.git/info/refs?service=git-upload-pack HTTP/1.1" 200 None
Cloning https://github.com/alanorth/country_converter.git at 'myanmar-region' to /home/aorth/.cache/pypoetry/virtualenvs/csv-metadata-quality-0rM9ayEp-py3.10/src/country_converter
[urllib3.connectionpool] Starting new HTTPS connection (1): github.com:443
[urllib3.connectionpool] https://github.com:443 "GET /alanorth/pycountry/info/refs?service=git-upload-pack HTTP/1.1" 200 None
Cloning https://github.com/alanorth/pycountry at 'iso-codes-4.12.0' to /home/aorth/.cache/pypoetry/virtualenvs/csv-metadata-quality-0rM9ayEp-py3.10/src/pycountry
1: Version solving took 1.560 seconds.
1: Tried 1 solutions.
Stack trace:
22 /usr/lib/python3.10/site-packages/cleo/application.py:327 in run
325│
326│ try:
→ 327│ exit_code = self._run(io)
328│ except BrokenPipeError:
329│ # If we are piped to another process, it may close early and send a
21 /usr/lib/python3.10/site-packages/poetry/console/application.py:190 in _run
188│ self._load_plugins(io)
189│
→ 190│ exit_code: int = super()._run(io)
191│ return exit_code
192│
20 /usr/lib/python3.10/site-packages/cleo/application.py:431 in _run
429│ io.input.interactive(interactive)
430│
→ 431│ exit_code = self._run_command(command, io)
432│ self._running_command = None
433│
19 /usr/lib/python3.10/site-packages/cleo/application.py:473 in _run_command
471│
472│ if error is not None:
→ 473│ raise error
474│
475│ return terminate_event.exit_code
18 /usr/lib/python3.10/site-packages/cleo/application.py:457 in _run_command
455│
456│ if command_event.command_should_run():
→ 457│ exit_code = command.run(io)
458│ else:
459│ exit_code = ConsoleCommandEvent.RETURN_CODE_DISABLED
17 /usr/lib/python3.10/site-packages/cleo/commands/base_command.py:119 in run
117│ io.input.validate()
118│
→ 119│ status_code = self.execute(io)
120│
121│ if status_code is None:
16 /usr/lib/python3.10/site-packages/cleo/commands/command.py:62 in execute
60│
61│ try:
→ 62│ return self.handle()
63│ except KeyboardInterrupt:
64│ return 1
15 /usr/lib/python3.10/site-packages/poetry/console/commands/update.py:54 in handle
52│ self.installer.update(True)
53│
→ 54│ return self.installer.run()
55│
14 /usr/lib/python3.10/site-packages/poetry/installation/installer.py:114 in run
112│ self._execute_operations = False
113│
→ 114│ return self._do_install()
115│
116│ def dry_run(self, dry_run: bool = True) -> Installer:
13 /usr/lib/python3.10/site-packages/poetry/installation/installer.py:253 in _do_install
251│ source_root=self._env.path.joinpath("src")
252│ ):
→ 253│ ops = solver.solve(use_latest=self._whitelist).calculate_operations()
254│ else:
255│ self._io.write_line("Installing dependencies from lock file")
12 /usr/lib/python3.10/site-packages/poetry/puzzle/solver.py:74 in solve
72│ with self._progress(), self._provider.use_latest_for(use_latest or []):
73│ start = time.time()
→ 74│ packages, depths = self._solve()
75│ end = time.time()
76│
11 /usr/lib/python3.10/site-packages/poetry/puzzle/solver.py:157 in _solve
155│
156│ try:
→ 157│ result = resolve_version(self._package, self._provider)
158│
159│ packages = result.packages
10 /usr/lib/python3.10/site-packages/poetry/mixology/__init__.py:18 in resolve_version
16│ solver = VersionSolver(root, provider)
17│
→ 18│ return solver.solve()
19│
9 /usr/lib/python3.10/site-packages/poetry/mixology/version_solver.py:112 in solve
110│ while next is not None:
111│ self._propagate(next)
→ 112│ next = self._choose_package_version()
113│
114│ return self._result()
8 /usr/lib/python3.10/site-packages/poetry/mixology/version_solver.py:428 in _choose_package_version
426│ package = locked
427│
→ 428│ package = self._provider.complete_package(package)
429│
430│ conflict = False
7 /usr/lib/python3.10/site-packages/poetry/puzzle/provider.py:653 in complete_package
651│ if locked is not None and locked.package.is_same_package_as(dep):
652│ continue
→ 653│ self.search_for_direct_origin_dependency(dep)
654│
655│ dependencies = self._get_dependencies_with_overrides(
6 /usr/lib/python3.10/site-packages/poetry/puzzle/provider.py:270 in search_for_direct_origin_dependency
268│ elif dependency.is_vcs():
269│ dependency = cast("VCSDependency", dependency)
→ 270│ package = self._search_for_vcs(dependency)
271│
272│ elif dependency.is_file():
5 /usr/lib/python3.10/site-packages/poetry/puzzle/provider.py:352 in _search_for_vcs
350│ and get the information we need by checking out the specified reference.
351│ """
→ 352│ package = self.get_package_from_vcs(
353│ dependency.vcs,
354│ dependency.source,
4 /usr/lib/python3.10/site-packages/poetry/puzzle/provider.py:382 in get_package_from_vcs
380│ raise ValueError(f"Unsupported VCS dependency {vcs}")
381│
→ 382│ return _get_package_from_git(
383│ url=url,
384│ branch=branch,
3 /usr/lib/python3.10/site-packages/poetry/puzzle/provider.py:124 in _get_package_from_git
122│ path = path.joinpath(subdirectory)
123│
→ 124│ package = Provider.get_package_from_directory(path)
125│ package._source_type = "git"
126│ package._source_url = url
2 /usr/lib/python3.10/site-packages/poetry/puzzle/provider.py:435 in get_package_from_directory
433│ @classmethod
434│ def get_package_from_directory(cls, directory: Path) -> Package:
→ 435│ return PackageInfo.from_directory(path=directory).to_package(root_dir=directory)
436│
437│ def _search_for_url(self, dependency: URLDependency) -> Package:
1 /usr/lib/python3.10/site-packages/poetry/inspection/info.py:488 in from_directory
486│ info: PackageInfo | None
487│ if project_package:
→ 488│ info = cls.from_package(project_package)
489│ else:
490│ info = cls.from_metadata(path)
AttributeError
'ProjectPackage' object has no attribute 'platform'
at /usr/lib/python3.10/site-packages/poetry/inspection/info.py:456 in from_package
452│ return cls(
453│ name=package.name,
454│ version=str(package.version),
455│ summary=package.description,
→ 456│ platform=package.platform,
457│ requires_dist=list(requires),
458│ requires_python=package.python_versions,
459│ files=package.files,
460│ yanked=package.yanked_reason if package.yanked else False,Reacted by Daniel de Souza
Metadata
Metadata
Assignees
Labels
status/external-issueIssue is caused by external project (platform, dep, etc)Issue is caused by external project (platform, dep, etc)
Activity
dimbleby commentedon Feb 7, 2023
poetry-core 1.5.0 removed the
platformfield from theProjectPackage- python-poetry/poetry-core#548However since poetry 1.3.2 pins its requirement to
poetry-core==1.4.0that shouldn't be a problem.So it seems like you have somehow managed to install incompatible versions of poetry and poetry-core
alanorth commentedon Feb 7, 2023
Oh interesting! Could be an issue in Arch Linux packaging?
Update: yes, someone already filed a bug for this three days ago: https://bugs.archlinux.org/task/77375
dimbleby commentedon Feb 7, 2023
you forgot to close this issue!
github-actions commentedon Feb 29, 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.