Skip to content
This repository has been archived by the owner on Aug 27, 2023. It is now read-only.

pypi.disallow_fallback doesn't work #327

Open
pulecp opened this issue Nov 4, 2022 · 2 comments
Open

pypi.disallow_fallback doesn't work #327

pulecp opened this issue Nov 4, 2022 · 2 comments

Comments

@pulecp
Copy link

pulecp commented Nov 4, 2022

Hello,

I would need to help with configuring pypi.disallow_fallback. It seems like any format doesn't work for me:

pypi.disallow_fallback = package1 package2
pypi.disallow_fallback =
    package1
    package2
pypi.disallow_fallback = (package1, package2)
pypi.disallow_fallback = [package1, package2]
pypi.disallow_fallback = package1, package2

I still see in logs that Pypicloud tried to search a package in an upstream even when it shouldn't look for it because it's private package:

2022-11-04 14:17:22	WARNING 2022-11-04 14:17:22,547 [pypicloud.locator] Error fetching 'package1' from upstream: 404 Client Error: Not Found for url: https://pypi.org/pypi/package1/json

Here is a part of configuration I'm using. If you need more or whole config, let me know.

pypi.always_show_upstream = true
pypi.cache_update = everyone
pypi.fallback = cache
pypi.disallow_fallback =

I'm running the newest version of Pypicloud from docker hub stevearc/pypicloud:1.3.11-alpine.

I have feeling that this option doesn't work at all.

Note: I already asked the same question in an old issue where someone had similar issue with formatting - link.

Thanks you very much for help! If you need more info, testing, just let me know.

@stevearc
Copy link
Owner

stevearc commented Nov 9, 2022

The first two formats should both work. If not, it's possible there's a bug in the logic somewhere. As per #325, I won't be working on this but since it would fall under the category of bugfix I would happily review a PR!

pulecp pushed a commit to pulecp/pypicloud that referenced this issue Nov 9, 2022
The fuction "request.locator.get_releases" looking for releases in an upstream
was called regardless of permissions that were set on a given package. Looking
for releases of packages in the upstream that were disallowed by the
"pypi.disallow_fallback" option exposed the names of disallowed packages to the
upstream. This is unsolicited behavior.

This change also fixes these warnings that were logged for all disallowed
packages:

WARNING [pypicloud.locator] Error fetching 'package1' from upstream: 404 Client Error: Not Found for url: https://pypi.org/pypi/package1/json

Fixed issue stevearc#327
@pulecp
Copy link
Author

pulecp commented Nov 9, 2022

The first two formats should both work. If not, it's possible there's a bug in the logic somewhere. As per #325, I won't be working on this but since it would fall under the category of bugfix I would happily review a PR!

You are right. Both formats are working.

There is just a wrong ordering when Pypicloud searches for releases in an upstream even when the package is listed in the pypi.disallow_fallback option. See my PR #328 with a fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants