Skip to content

Failing to export #112

@cmabastar

Description

@cmabastar
  • [/] 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:
  • Poetry version:
  • Link of a Gist with the contents of your pyproject.toml file:

Issue

I have a CI/CD that use serverless and usePoetry: True, just 3 days ago it was working. But right now it's failing.

Error:
Error: `poetry export --without-hashes -f requirements.txt -o requirements.txt --with-credentials` Exited with code 1
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/serverless-python-requirements/node_modules/child-process-ext/spawn.js:38:8)
    at ChildProcess.emit (node:events:513:28)
    at ChildProcess.emit (node:domain:489:12)
    at maybeClose (node:internal/child_process:1093:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)

poetry -vvv export --without-hashes -f requirements.txt -o requirements.txt --with-credentials

Here's the -vvv Result


Project environment contains an empty path in sys_path, ignoring.
Source (poetry-locked): 1 packages found for fastapi 0.75.2
Source (poetry-locked): 1 packages found for sqlalchemy >=1.4.23,<2.0.0
Source (poetry-locked): 1 packages found for uvicorn >=0.15.0,<0.16.0
Source (poetry-locked): 1 packages found for fastapi-jwt-auth >=0.5.0,<0.6.0
Source (poetry-locked): 1 packages found for python-jose >=3.3.0,<4.0.0
Source (poetry-locked): 1 packages found for passlib >=1.7.4,<2.0.0
Source (poetry-locked): 1 packages found for pydantic >=1.8.2,<2.0.0
Source (poetry-locked): 1 packages found for alembic >=1.7.1,<2.0.0
Source (poetry-locked): 1 packages found for itsdangerous >=2.0.1,<3.0.0
Source (poetry-locked): 1 packages found for pusher >=3.0.0,<4.0.0
Source (poetry-locked): 1 packages found for pendulum >=2.1.2,<3.0.0
Source (poetry-locked): 1 packages found for httpx >=0.19.0,<0.20.0
Source (poetry-locked): 1 packages found for slowapi >=0.1.5,<0.2.0
Source (poetry-locked): 1 packages found for mangum >=0.12.2,<0.13.0
Source (poetry-locked): 1 packages found for psycopg2-binary 2.9.1
Source (poetry-locked): 1 packages found for postmarker >=0.18.2,<0.19.0
Source (poetry-locked): 1 packages found for sentry-sdk >=1.3.1,<2.0.0
Source (poetry-locked): 1 packages found for dramatiq >=1.11.0,<2.0.0
Source (poetry-locked): 1 packages found for periodiq >=0.12.1,<0.13.0
Source (poetry-locked): 1 packages found for sqlalchemy-utils >=0.37.8,<0.38.0
Source (poetry-locked): 1 packages found for pytest-mock >=3.6.1,<4.0.0
Source (poetry-locked): 1 packages found for flask >=2.0.1,<3.0.0
Source (poetry-locked): 1 packages found for flask-caching >=1.10.1,<2.0.0
Source (poetry-locked): 1 packages found for requests-aws 0.1.8
Source (poetry-locked): 1 packages found for stripe >=2.63.0,<3.0.0
Source (poetry-locked): 1 packages found for google-auth >=2.3.3,<3.0.0
Source (poetry-locked): 1 packages found for sendgrid >=6.9.4,<7.0.0
Source (poetry-locked): 1 packages found for pyyaml >=6.0,<7.0
Source (poetry-locked): 1 packages found for ua-parser >=0.10.0,<0.11.0
Source (poetry-locked): 1 packages found for user-agents >=2.2.0,<3.0.0
Source (poetry-locked): 1 packages found for cloudpathlib >=0.9.0,<0.10.0

  Stack trace:

  14  ~/.pyenv/versions/3.10.3/envs/vision-3.10/lib/python3.10/site-packages/cleo/application.py:329 in run
       327│
       328│             try:
     → 329│                 exit_code = self._run(io)
       330│             except Exception as e:
       331│                 if not self._catch_exceptions:

  13  ~/.pyenv/versions/3.10.3/envs/vision-3.10/lib/python3.10/site-packages/poetry/console/application.py:185 in _run
       183│         self._load_plugins(io)
       184│
     → 185│         exit_code: int = super()._run(io)
       186│         return exit_code
       187│

  12  ~/.pyenv/versions/3.10.3/envs/vision-3.10/lib/python3.10/site-packages/cleo/application.py:423 in _run
       421│             io.input.set_stream(stream)
       422│
     → 423│         exit_code = self._run_command(command, io)
       424│         self._running_command = None
       425│

  11  ~/.pyenv/versions/3.10.3/envs/vision-3.10/lib/python3.10/site-packages/cleo/application.py:465 in _run_command
       463│
       464│         if error is not None:
     → 465│             raise error
       466│
       467│         return event.exit_code

  10  ~/.pyenv/versions/3.10.3/envs/vision-3.10/lib/python3.10/site-packages/cleo/application.py:449 in _run_command
       447│
       448│             if event.command_should_run():
     → 449│                 exit_code = command.run(io)
       450│             else:
       451│                 exit_code = ConsoleCommandEvent.RETURN_CODE_DISABLED

   9  ~/.pyenv/versions/3.10.3/envs/vision-3.10/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:

   8  ~/.pyenv/versions/3.10.3/envs/vision-3.10/lib/python3.10/site-packages/cleo/commands/command.py:83 in execute
        81│
        82│         try:
     →  83│             return self.handle()
        84│         except KeyboardInterrupt:
        85│             return 1

   7  ~/.pyenv/versions/3.10.3/envs/vision-3.10/lib/python3.10/site-packages/poetry_plugin_export/command.py:91 in handle
        89│         exporter.with_credentials(self.option("with-credentials"))
        90│         exporter.with_urls(not self.option("without-urls"))
     →  91│         exporter.export(fmt, self.poetry.file.parent, output or self.io)
        92│

   6  ~/.pyenv/versions/3.10.3/envs/vision-3.10/lib/python3.10/site-packages/poetry_plugin_export/exporter.py:72 in export
        70│             raise ValueError(f"Invalid export format: {fmt}")
        71│
     →  72│         getattr(self, self.EXPORT_METHODS[fmt])(cwd, output)
        73│
        74│     def _export_requirements_txt(self, cwd: Path, output: IO | str) -> None:

   5  ~/.pyenv/versions/3.10.3/envs/vision-3.10/lib/python3.10/site-packages/poetry_plugin_export/exporter.py:85 in _export_requirements_txt
        83│         )
        84│
     →  85│         for dependency_package in get_project_dependency_packages(
        86│             self._poetry.locker,
        87│             project_requires=root.all_requires,

   4  ~/.pyenv/versions/3.10.3/envs/vision-3.10/lib/python3.10/site-packages/poetry_plugin_export/walker.py:95 in get_project_dependency_packages
        93│         selected.append(dependency)
        94│
     →  95│     for package, dependency in get_project_dependencies(
        96│         project_requires=selected,
        97│         locked_packages=repository.packages,

   3  ~/.pyenv/versions/3.10.3/envs/vision-3.10/lib/python3.10/site-packages/poetry_plugin_export/walker.py:121 in get_project_dependencies
       119│         )
       120│
     → 121│     nested_dependencies = walk_dependencies(
       122│         dependencies=project_requires,
       123│         packages_by_name=packages_by_name,

   2  ~/.pyenv/versions/3.10.3/envs/vision-3.10/lib/python3.10/site-packages/poetry_plugin_export/walker.py:138 in walk_dependencies
       136│     while dependencies:
       137│         requirement = dependencies.pop(0)
     → 138│         if (requirement, requirement.marker) in visited:
       139│             continue
       140│         visited.add((requirement, requirement.marker))

   1  ~/.pyenv/versions/3.10.3/envs/vision-3.10/lib/python3.10/site-packages/poetry/core/version/markers.py:591 in __hash__
       589│         h = hash("multi")
       590│         for m in self._markers:
     → 591│             h |= hash(m)
       592│
       593│         return h

  TypeError

  unhashable type: 'UnionConstraint'

  at ~/.pyenv/versions/3.10.3/envs/vision-3.10/lib/python3.10/site-packages/poetry/core/version/markers.py:357 in __hash__
      353│
      354│         return self._name == other.name and self._constraint == other.constraint
      355│
      356│     def __hash__(self) -> int:
    → 357│         return hash((self._name, self._constraint))
      358│
      359│     def __str__(self) -> str:
      360│         return f'{self._name} {self._operator} "{self._value}"'
      361│

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions