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

Regenerate some lockfiles with Poetry 1.5 #7862

Merged

Conversation

deivid-rodriguez
Copy link
Contributor

Otherwise some specs fail depending on order:

[dependabot-core-dev] ~/python $ rspec spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb:145
Run options: include {:locations=>{"./spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb"=>[145]}}

Randomized with seed 52409
F

Failures:

  1) Dependabot::Python::FileParser::PyprojectFilesParser parse poetry files with a lockfile with a path dependency excludes the path dependency
     Failure/Error: dep.name if dep.production?

     RuntimeError:
       Unsupported package_manager pip
     # /home/dependabot/common/lib/dependabot/dependency.rb:15:in `production_check_for_package_manager'
     # /home/dependabot/common/lib/dependabot/dependency.rb:97:in `production?'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:199:in `block (2 levels) in parse_production_dependency_names'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:198:in `each'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:198:in `filter_map'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:198:in `rescue in block in parse_production_dependency_names'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:188:in `block in parse_production_dependency_names'
     # /home/dependabot/common/lib/dependabot/shared_helpers.rb:55:in `block in in_a_temporary_directory'
     # /home/dependabot/common/lib/dependabot/shared_helpers.rb:55:in `chdir'
     # /home/dependabot/common/lib/dependabot/shared_helpers.rb:55:in `in_a_temporary_directory'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:184:in `parse_production_dependency_names'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:180:in `production_dependency_names'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:171:in `block in lockfile_dependencies'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:159:in `each'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:159:in `lockfile_dependencies'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:30:in `dependency_set'
     # ./spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb:24:in `block (3 levels) in <top (required)>'
     # ./spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb:143:in `block (5 levels) in <top (required)>'
     # ./spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb:146:in `block (5 levels) in <top (required)>'
     # ./spec/spec_helper.rb:24:in `block (2 levels) in <top (required)>'
     # /home/dependabot/common/spec/spec_helper.rb:45:in `block (2 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # Dependabot::SharedHelpers::HelperSubprocessFailed:
     #   Path /home/dependabot/python/tmp/toml for toml does not exist
     #   Creating virtualenv pythonprojects-Ixb30aeJ-py3.11 in /home/dependabot/.cache/pypoetry/virtualenvs
     #
     #   Because no versions of pytest match !=3.7.4
     #    and pytest (3.7.4) depends on setuptools (*), every version of pytest requires setuptools (*).
     #   So, because no versions of setuptools match *
     #    and pythonprojects depends on pytest (*), version solving failed.
     #   ./lib/dependabot/python/helpers.rb:22:in `run_poetry_command'

Top 1 slowest examples (0.65481 seconds, 99.6% of total time):
  Dependabot::Python::FileParser::PyprojectFilesParser parse poetry files with a lockfile with a path dependency excludes the path dependency
    0.65481 seconds ./spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb:145

Finished in 0.6576 seconds (files took 3.02 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb:145 # Dependabot::Python::FileParser::PyprojectFilesParser parse poetry files with a lockfile with a path dependency excludes the path dependency

Otherwise some specs fail depending on order:

```
[dependabot-core-dev] ~/python $ rspec spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb:145
Run options: include {:locations=>{"./spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb"=>[145]}}

Randomized with seed 52409
F

Failures:

  1) Dependabot::Python::FileParser::PyprojectFilesParser parse poetry files with a lockfile with a path dependency excludes the path dependency
     Failure/Error: dep.name if dep.production?

     RuntimeError:
       Unsupported package_manager pip
     # /home/dependabot/common/lib/dependabot/dependency.rb:15:in `production_check_for_package_manager'
     # /home/dependabot/common/lib/dependabot/dependency.rb:97:in `production?'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:199:in `block (2 levels) in parse_production_dependency_names'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:198:in `each'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:198:in `filter_map'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:198:in `rescue in block in parse_production_dependency_names'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:188:in `block in parse_production_dependency_names'
     # /home/dependabot/common/lib/dependabot/shared_helpers.rb:55:in `block in in_a_temporary_directory'
     # /home/dependabot/common/lib/dependabot/shared_helpers.rb:55:in `chdir'
     # /home/dependabot/common/lib/dependabot/shared_helpers.rb:55:in `in_a_temporary_directory'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:184:in `parse_production_dependency_names'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:180:in `production_dependency_names'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:171:in `block in lockfile_dependencies'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:159:in `each'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:159:in `lockfile_dependencies'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:30:in `dependency_set'
     # ./spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb:24:in `block (3 levels) in <top (required)>'
     # ./spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb:143:in `block (5 levels) in <top (required)>'
     # ./spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb:146:in `block (5 levels) in <top (required)>'
     # ./spec/spec_helper.rb:24:in `block (2 levels) in <top (required)>'
     # /home/dependabot/common/spec/spec_helper.rb:45:in `block (2 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # Dependabot::SharedHelpers::HelperSubprocessFailed:
     #   Path /home/dependabot/python/tmp/toml for toml does not exist
     #   Creating virtualenv pythonprojects-Ixb30aeJ-py3.11 in /home/dependabot/.cache/pypoetry/virtualenvs
     #
     #   Because no versions of pytest match !=3.7.4
     #    and pytest (3.7.4) depends on setuptools (*), every version of pytest requires setuptools (*).
     #   So, because no versions of setuptools match *
     #    and pythonprojects depends on pytest (*), version solving failed.
     #   ./lib/dependabot/python/helpers.rb:22:in `run_poetry_command'

Top 1 slowest examples (0.65481 seconds, 99.6% of total time):
  Dependabot::Python::FileParser::PyprojectFilesParser parse poetry files with a lockfile with a path dependency excludes the path dependency
    0.65481 seconds ./spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb:145

Finished in 0.6576 seconds (files took 3.02 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb:145 # Dependabot::Python::FileParser::PyprojectFilesParser parse poetry files with a lockfile with a path dependency excludes the path dependency

```
@jeffwidman jeffwidman merged commit fe7e6aa into main Aug 21, 2023
79 checks passed
@jeffwidman jeffwidman deleted the deivid-rodriguez/regenerate-some-lockfiles-with-poetry-15 branch August 21, 2023 21:47
@jeffwidman
Copy link
Member

Merging as this has passed our python slow CI, so might as well merge before it gets outdated.

@jeffwidman
Copy link
Member

jeffwidman commented Aug 21, 2023

Also, @deivid-rodriguez do you recall what command you used to regenerate them? I generally like to document that in the commit/PR for future reference.

@deivid-rodriguez
Copy link
Contributor Author

deivid-rodriguez commented Aug 22, 2023

Hei!

Actually what I did was to copy the related files to tmp, then change the pytest = "*" line to pytest = "3.7.4" so that the top level dependency is not changed, and then run pyenv exec poetry lock.

However, I just found about pyenv exec poetry lock --no-update. That's the right way if we ever need to do this in the future since that just regenerates the format as opposed to also updating dependencies.

brettfo pushed a commit to brettfo/dependabot-core that referenced this pull request Oct 11, 2023
Otherwise some specs fail depending on order:

```
[dependabot-core-dev] ~/python $ rspec spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb:145
Run options: include {:locations=>{"./spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb"=>[145]}}

Randomized with seed 52409
F

Failures:

  1) Dependabot::Python::FileParser::PyprojectFilesParser parse poetry files with a lockfile with a path dependency excludes the path dependency
     Failure/Error: dep.name if dep.production?

     RuntimeError:
       Unsupported package_manager pip
     # /home/dependabot/common/lib/dependabot/dependency.rb:15:in `production_check_for_package_manager'
     # /home/dependabot/common/lib/dependabot/dependency.rb:97:in `production?'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:199:in `block (2 levels) in parse_production_dependency_names'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:198:in `each'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:198:in `filter_map'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:198:in `rescue in block in parse_production_dependency_names'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:188:in `block in parse_production_dependency_names'
     # /home/dependabot/common/lib/dependabot/shared_helpers.rb:55:in `block in in_a_temporary_directory'
     # /home/dependabot/common/lib/dependabot/shared_helpers.rb:55:in `chdir'
     # /home/dependabot/common/lib/dependabot/shared_helpers.rb:55:in `in_a_temporary_directory'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:184:in `parse_production_dependency_names'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:180:in `production_dependency_names'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:171:in `block in lockfile_dependencies'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:159:in `each'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:159:in `lockfile_dependencies'
     # ./lib/dependabot/python/file_parser/pyproject_files_parser.rb:30:in `dependency_set'
     # ./spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb:24:in `block (3 levels) in <top (required)>'
     # ./spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb:143:in `block (5 levels) in <top (required)>'
     # ./spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb:146:in `block (5 levels) in <top (required)>'
     # ./spec/spec_helper.rb:24:in `block (2 levels) in <top (required)>'
     # /home/dependabot/common/spec/spec_helper.rb:45:in `block (2 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # Dependabot::SharedHelpers::HelperSubprocessFailed:
     #   Path /home/dependabot/python/tmp/toml for toml does not exist
     #   Creating virtualenv pythonprojects-Ixb30aeJ-py3.11 in /home/dependabot/.cache/pypoetry/virtualenvs
     #
     #   Because no versions of pytest match !=3.7.4
     #    and pytest (3.7.4) depends on setuptools (*), every version of pytest requires setuptools (*).
     #   So, because no versions of setuptools match *
     #    and pythonprojects depends on pytest (*), version solving failed.
     #   ./lib/dependabot/python/helpers.rb:22:in `run_poetry_command'

Top 1 slowest examples (0.65481 seconds, 99.6% of total time):
  Dependabot::Python::FileParser::PyprojectFilesParser parse poetry files with a lockfile with a path dependency excludes the path dependency
    0.65481 seconds ./spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb:145

Finished in 0.6576 seconds (files took 3.02 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/dependabot/python/file_parser/pyproject_files_parser_spec.rb:145 # Dependabot::Python::FileParser::PyprojectFilesParser parse poetry files with a lockfile with a path dependency excludes the path dependency

```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: python:poetry Python packages via poetry L: python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants