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

Fix regression where package.source_reference is unset #2460

Conversation

dan-hipschman
Copy link
Contributor

Change

This fixes an issue that looks like it's a regression on the develop branch.

The problem occurs with packages from private repos:

# Assume private repo called pypi-local exists.
poetry add private-package
Creating virtualenv test1-b4L2acJf-py3.8 in /root/.cache/pypoetry/virtualenvs
Using version ^3.1.6 for private-package

Updating dependencies
Resolving dependencies... (11.5s)

Writing lock file


Package operations: 25 installs, 0 updates, 0 removals

  - Installing blahblah...
    [snip irrelevant text...]
  - Installing private-package (3.1.6)

  ValueError

  Repository "" does not exist.

  at /poetry/poetry/repositories/pool.py:40 in repository
       36|     def repository(self, name):  # type: (str) -> Repository
       37|         if name in self._lookup:
       38|             return self._repositories[self._lookup[name]]
       39|
    >  40|         raise ValueError('Repository "{}" does not exist.'.format(name))
       41|
       42|     def add_repository(
       43|         self, repository, default=False, secondary=False
       44|     ):  # type: (Repository, bool, bool) -> Pool

It's caused by source_reference not being set in the lock file.

In lockfile on master:

[package.source]
reference = "pypi-local"
url = "https://xyz.jfrog.io/xyz/api/pypi/pip/simple"

In lockfile on develop:

[package.source]
reference = ""
url = "https://xyz.jfrog.io/xyz/api/pypi/pip/simple"

It was removed in this change. This PR just adds it back with a test.

Pull Request Check List

Resolves: I didn't file an issue for this because it's only on the develop branch, not master.

  • Added tests for changed code.
  • Updated documentation for changed code. (bug fix)

@finswimmer finswimmer requested a review from a team May 28, 2020 18:12
@dan-hipschman
Copy link
Contributor Author

It looks like the bug this PR addresses was fixed by #2484. I'll close this PR.

Copy link

github-actions bot commented Mar 1, 2024

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant